text: (window.webpackJsonpdash_bio=window.webpackJsonpdash_bio||[]).push([[3],{141:function(e,t,r){(function(t,r,n){var i;i=function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var a=function(e){return e&&e.Math==Math&&e},o=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof e&&e)||Function("return this")(),s=function(e){try{return!!e()}catch(e){return!0}},c=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),h={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,l={f:u&&!h.call({1:2},1)?function(e){var t=u(this,e);return!!t&&t.enumerable}:h},f=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},p={}.toString,d=function(e){return p.call(e).slice(8,-1)},g="".split,v=s((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==d(e)?g.call(e,""):Object(e)}:Object,m=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},y=function(e){return v(m(e))},b=function(e){return"object"==typeof e?null!==e:"function"==typeof e},w=function(e,t){if(!b(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!b(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!b(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!b(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},x={}.hasOwnProperty,k=function(e,t){return x.call(e,t)},S=o.document,_=b(S)&&b(S.createElement),C=function(e){return _?S.createElement(e):{}},A=!c&&!s((function(){return 7!=Object.defineProperty(C("div"),"a",{get:function(){return 7}}).a})),E=Object.getOwnPropertyDescriptor,R={f:c?E:function(e,t){if(e=y(e),t=w(t,!0),A)try{return E(e,t)}catch(e){}if(k(e,t))return f(!l.f.call(e,t),e[t])}},T=function(e){if(!b(e))throw TypeError(String(e)+" is not an object");return e},I=Object.defineProperty,L={f:c?I:function(e,t,r){if(T(e),t=w(t,!0),T(r),A)try{return I(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},M=c?function(e,t,r){return L.f(e,t,f(1,r))}:function(e,t,r){return e[t]=r,e},P=function(e,t){try{M(o,e,t)}catch(r){o[e]=t}return t},O=o["__core-js_shared__"]||P("__core-js_shared__",{}),F=Function.toString;"function"!=typeof O.inspectSource&&(O.inspectSource=function(e){return F.call(e)});var N,D,B,z=O.inspectSource,U=o.WeakMap,H="function"==typeof U&&/native code/.test(z(U)),$=i((function(e){(e.exports=function(e,t){return O[e]||(O[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),j=0,q=Math.random(),G=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++j+q).toString(36)},V=$("keys"),W=function(e){return V[e]||(V[e]=G(e))},Z={},Y=o.WeakMap;if(H){var X=new Y,K=X.get,Q=X.has,J=X.set;N=function(e,t){return J.call(X,e,t),t},D=function(e){return K.call(X,e)||{}},B=function(e){return Q.call(X,e)}}else{var ee=W("state");Z[ee]=!0,N=function(e,t){return M(e,ee,t),t},D=function(e){return k(e,ee)?e[ee]:{}},B=function(e){return k(e,ee)}}var te,re,ne={set:N,get:D,has:B,enforce:function(e){return B(e)?D(e):N(e,{})},getterFor:function(e){return function(t){var r;if(!b(t)||(r=D(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}},ie=i((function(e){var t=ne.get,r=ne.enforce,n=String(String).split("String");(e.exports=function(e,t,i,a){var s=!!a&&!!a.unsafe,c=!!a&&!!a.enumerable,h=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof t||k(i,"name")||M(i,"name",t),r(i).source=n.join("string"==typeof t?t:"")),e!==o?(s?!h&&e[t]&&(c=!0):delete e[t],c?e[t]=i:M(e,t,i)):c?e[t]=i:P(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||z(this)}))})),ae=o,oe=function(e){return"function"==typeof e?e:void 0},se=function(e,t){return arguments.length<2?oe(ae[e])||oe(o[e]):ae[e]&&ae[e][t]||o[e]&&o[e][t]},ce=Math.ceil,he=Math.floor,ue=function(e){return isNaN(e=+e)?0:(e>0?he:ce)(e)},le=Math.min,fe=function(e){return e>0?le(ue(e),9007199254740991):0},pe=Math.max,de=Math.min,ge=function(e,t){var r=ue(e);return r<0?pe(r+t,0):de(r,t)},ve=function(e){return function(t,r,n){var i,a=y(t),o=fe(a.length),s=ge(n,o);if(e&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((e||s in a)&&a[s]===r)return e||s||0;return!e&&-1}},me={includes:ve(!0),indexOf:ve(!1)},ye=me.indexOf,be=function(e,t){var r,n=y(e),i=0,a=[];for(r in n)!k(Z,r)&&k(n,r)&&a.push(r);for(;t.length>i;)k(n,r=t[i++])&&(~ye(a,r)||a.push(r));return a},we=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xe=we.concat("length","prototype"),ke={f:Object.getOwnPropertyNames||function(e){return be(e,xe)}},Se={f:Object.getOwnPropertySymbols},_e=se("Reflect","ownKeys")||function(e){var t=ke.f(T(e)),r=Se.f;return r?t.concat(r(e)):t},Ce=function(e,t){for(var r=_e(t),n=L.f,i=R.f,a=0;a<r.length;a++){var o=r[a];k(e,o)||n(e,o,i(t,o))}},Ae=/#|\.prototype\./,Ee=function(e,t){var r=Te[Re(e)];return r==Le||r!=Ie&&("function"==typeof t?s(t):!!t)},Re=Ee.normalize=function(e){return String(e).replace(Ae,".").toLowerCase()},Te=Ee.data={},Ie=Ee.NATIVE="N",Le=Ee.POLYFILL="P",Me=Ee,Pe=R.f,Oe=function(e,t){var r,n,i,a,s,c=e.target,h=e.global,u=e.stat;if(r=h?o:u?o[c]||P(c,{}):(o[c]||{}).prototype)for(n in t){if(a=t[n],i=e.noTargetGet?(s=Pe(r,n))&&s.value:r[n],!Me(h?n:c+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;Ce(a,i)}(e.sham||i&&i.sham)&&M(a,"sham",!0),ie(r,n,a,e)}},Fe=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Ne=function(e,t,r){if(Fe(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},De=function(e){return Object(m(e))},Be=Array.isArray||function(e){return"Array"==d(e)},ze=!!Object.getOwnPropertySymbols&&!s((function(){return!String(Symbol())})),Ue=ze&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,He=$("wks"),$e=o.Symbol,je=Ue?$e:$e&&$e.withoutSetter||G,qe=function(e){return k(He,e)||(ze&&k($e,e)?He[e]=$e[e]:He[e]=je("Symbol."+e)),He[e]},Ge=qe("species"),Ve=function(e,t){var r;return Be(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!Be(r.prototype)?b(r)&&null===(r=r[Ge])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)},We=[].push,Ze=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,a=6==e,o=5==e||a;return function(s,c,h,u){for(var l,f,p=De(s),d=v(p),g=Ne(c,h,3),m=fe(d.length),y=0,b=u||Ve,w=t?b(s,m):r?b(s,0):void 0;m>y;y++)if((o||y in d)&&(f=g(l=d[y],y,p),e))if(t)w[y]=f;else if(f)switch(e){case 3:return!0;case 5:return l;case 6:return y;case 2:We.call(w,l)}else if(i)return!1;return a?-1:n||i?i:w}},Ye={forEach:Ze(0),map:Ze(1),filter:Ze(2),some:Ze(3),every:Ze(4),find:Ze(5),findIndex:Ze(6)},Xe=se("navigator","userAgent")||"",Ke=o.process,Qe=Ke&&Ke.versions,Je=Qe&&Qe.v8;Je?re=(te=Je.split("."))[0]+te[1]:Xe&&(!(te=Xe.match(/Edge\/(\d+)/))||te[1]>=74)&&(te=Xe.match(/Chrome\/(\d+)/))&&(re=te[1]);var et=re&&+re,tt=qe("species"),rt=function(e){return et>=51||!s((function(){var t=[];return(t.constructor={})[tt]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},nt=Object.defineProperty,it={},at=function(e){throw e},ot=function(e,t){if(k(it,e))return it[e];t||(t={});var r=[][e],n=!!k(t,"ACCESSORS")&&t.ACCESSORS,i=k(t,0)?t[0]:at,a=k(t,1)?t[1]:void 0;return it[e]=!!r&&!s((function(){if(n&&!c)return!0;var e={length:-1};n?nt(e,1,{enumerable:!0,get:at}):e[1]=1,r.call(e,i,a)}))},st=Ye.filter,ct=rt("filter"),ht=ot("filter");Oe({target:"Array",proto:!0,forced:!ct||!ht},{filter:function(e){return st(this,e,arguments.length>1?arguments[1]:void 0)}});var ut=function(e,t){var r=[][e];return!!r&&s((function(){r.call(null,t||function(){throw 1},1)}))},lt=Ye.forEach,ft=ut("forEach"),pt=ot("forEach"),dt=ft&&pt?[].forEach:function(e){return lt(this,e,arguments.length>1?arguments[1]:void 0)};Oe({target:"Array",proto:!0,forced:[].forEach!=dt},{forEach:dt});var gt=me.indexOf,vt=[].indexOf,mt=!!vt&&1/[1].indexOf(1,-0)<0,yt=ut("indexOf"),bt=ot("indexOf",{ACCESSORS:!0,1:0});Oe({target:"Array",proto:!0,forced:mt||!yt||!bt},{indexOf:function(e){return mt?vt.apply(this,arguments)||0:gt(this,e,arguments.length>1?arguments[1]:void 0)}});var wt=Math.min,xt=[].lastIndexOf,kt=!!xt&&1/[1].lastIndexOf(1,-0)<0,St=ut("lastIndexOf"),_t=ot("indexOf",{ACCESSORS:!0,1:0}),Ct=!kt&&St&&_t?xt:function(e){if(kt)return xt.apply(this,arguments)||0;var t=y(this),r=fe(t.length),n=r-1;for(arguments.length>1&&(n=wt(n,ue(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1};Oe({target:"Array",proto:!0,forced:Ct!==[].lastIndexOf},{lastIndexOf:Ct});var At,Et=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return T(r),function(e){if(!b(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),Rt=function(e,t,r){var n,i;return Et&&"function"==typeof(n=t.constructor)&&n!==r&&b(i=n.prototype)&&i!==r.prototype&&Et(e,i),e},Tt=Object.keys||function(e){return be(e,we)},It=c?Object.defineProperties:function(e,t){T(e);for(var r,n=Tt(t),i=n.length,a=0;i>a;)L.f(e,r=n[a++],t[r]);return e},Lt=se("document","documentElement"),Mt=W("IE_PROTO"),Pt=function(){},Ot=function(e){return"<script>"+e+"<\/script>"},Ft=function(){try{At=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;Ft=At?function(e){e.write(Ot("")),e.close();var t=e.parentWindow.Object;return e=null,t}(At):((t=C("iframe")).style.display="none",Lt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Ot("document.F=Object")),e.close(),e.F);for(var r=we.length;r--;)delete Ft.prototype[we[r]];return Ft()};Z[Mt]=!0;var Nt=Object.create||function(e,t){var r;return null!==e?(Pt.prototype=T(e),r=new Pt,Pt.prototype=null,r[Mt]=e):r=Ft(),void 0===t?r:It(r,t)},Dt="\t\n\v\f\r                　\u2028\u2029\ufeff",Bt="["+Dt+"]",zt=RegExp("^"+Bt+Bt+"*"),Ut=RegExp(Bt+Bt+"*$"),Ht=function(e){return function(t){var r=String(m(t));return 1&e&&(r=r.replace(zt,"")),2&e&&(r=r.replace(Ut,"")),r}},$t={start:Ht(1),end:Ht(2),trim:Ht(3)},jt=ke.f,qt=R.f,Gt=L.f,Vt=$t.trim,Wt=o.Number,Zt=Wt.prototype,Yt="Number"==d(Nt(Zt)),Xt=function(e){var t,r,n,i,a,o,s,c,h=w(e,!1);if("string"==typeof h&&h.length>2)if(43===(t=(h=Vt(h)).charCodeAt(0))||45===t){if(88===(r=h.charCodeAt(2))||120===r)return NaN}else if(48===t){switch(h.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+h}for(o=(a=h.slice(2)).length,s=0;s<o;s++)if((c=a.charCodeAt(s))<48||c>i)return NaN;return parseInt(a,n)}return+h};if(Me("Number",!Wt(" 0o1")||!Wt("0b1")||Wt("+0x1"))){for(var Kt,Qt=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof Qt&&(Yt?s((function(){Zt.valueOf.call(r)})):"Number"!=d(r))?Rt(new Wt(Xt(t)),r,Qt):Xt(t)},Jt=c?jt(Wt):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),er=0;Jt.length>er;er++)k(Wt,Kt=Jt[er])&&!k(Qt,Kt)&&Gt(Qt,Kt,qt(Wt,Kt));Qt.prototype=Zt,Zt.constructor=Qt,ie(o,"Number",Qt)}Oe({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991});var tr=function(){var e=T(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function rr(e,t){return RegExp(e,t)}var nr={UNSUPPORTED_Y:s((function(){var e=rr("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:s((function(){var e=rr("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},ir=RegExp.prototype.exec,ar=String.prototype.replace,or=ir,sr=function(){var e=/a/,t=/b*/g;return ir.call(e,"a"),ir.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),cr=nr.UNSUPPORTED_Y||nr.BROKEN_CARET,hr=void 0!==/()??/.exec("")[1];(sr||hr||cr)&&(or=function(e){var t,r,n,i,a=this,o=cr&&a.sticky,s=tr.call(a),c=a.source,h=0,u=e;return o&&(-1===(s=s.replace("y","")).indexOf("g")&&(s+="g"),u=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(c="(?: "+c+")",u=" "+u,h++),r=new RegExp("^(?:"+c+")",s)),hr&&(r=new RegExp("^"+c+"$(?!\\s)",s)),sr&&(t=a.lastIndex),n=ir.call(o?r:a,u),o?n?(n.input=n.input.slice(h),n[0]=n[0].slice(h),n.index=a.lastIndex,a.lastIndex+=n[0].length):a.lastIndex=0:sr&&n&&(a.lastIndex=a.global?n.index+n[0].length:t),hr&&n&&n.length>1&&ar.call(n[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)})),n});var ur=or;Oe({target:"RegExp",proto:!0,forced:/./.exec!==ur},{exec:ur});var lr,fr=qe("match"),pr=function(e){var t;return b(e)&&(void 0!==(t=e[fr])?!!t:"RegExp"==d(e))},dr=function(e){if(pr(e))throw TypeError("The method doesn't accept regular expressions");return e},gr=qe("match"),vr=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[gr]=!1,"/./"[e](t)}catch(e){}}return!1},mr=R.f,yr="".endsWith,br=Math.min,wr=vr("endsWith"),xr=!(wr||(lr=mr(String.prototype,"endsWith"),!lr||lr.writable));Oe({target:"String",proto:!0,forced:!xr&&!wr},{endsWith:function(e){var t=String(m(this));dr(e);var r=arguments.length>1?arguments[1]:void 0,n=fe(t.length),i=void 0===r?n:br(fe(r),n),a=String(e);return yr?yr.call(t,a,i):t.slice(i-a.length,i)===a}});var kr=qe("species"),Sr=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),_r="$0"==="a".replace(/./,"$0"),Cr=qe("replace"),Ar=!!/./[Cr]&&""===/./[Cr]("a","$0"),Er=!s((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),Rr=function(e,t,r,n){var i=qe(e),a=!s((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),o=a&&!s((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[kr]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!a||!o||"replace"===e&&(!Sr||!_r||Ar)||"split"===e&&!Er){var c=/./[i],h=r(i,""[e],(function(e,t,r,n,i){return t.exec===ur?a&&!i?{done:!0,value:c.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:_r,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Ar}),u=h[0],l=h[1];ie(String.prototype,e,u),ie(RegExp.prototype,i,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}n&&M(RegExp.prototype[i],"sham",!0)},Tr=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Ir=function(e,t){var r=e.exec;if("function"==typeof r){var n=r.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==d(e))throw TypeError("RegExp#exec called on incompatible receiver");return ur.call(e,t)};Rr("search",1,(function(e,t,r){return[function(t){var r=m(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var i=T(e),a=String(this),o=i.lastIndex;Tr(o,0)||(i.lastIndex=0);var s=Ir(i,a);return Tr(i.lastIndex,o)||(i.lastIndex=o),null===s?-1:s.index}]}));var Lr=qe("species"),Mr=function(e,t){var r,n=T(e).constructor;return void 0===n||null==(r=T(n)[Lr])?t:Fe(r)},Pr=function(e){return function(t,r){var n,i,a=String(m(t)),o=ue(r),s=a.length;return o<0||o>=s?e?"":void 0:(n=a.charCodeAt(o))<55296||n>56319||o+1===s||(i=a.charCodeAt(o+1))<56320||i>57343?e?a.charAt(o):n:e?a.slice(o,o+2):i-56320+(n-55296<<10)+65536}},Or={codeAt:Pr(!1),charAt:Pr(!0)},Fr=Or.charAt,Nr=function(e,t,r){return t+(r?Fr(e,t).length:1)},Dr=[].push,Br=Math.min,zr=!s((function(){return!RegExp(4294967295,"y")}));Rr("split",2,(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=String(m(this)),i=void 0===r?4294967295:r>>>0;if(0===i)return[];if(void 0===e)return[n];if(!pr(e))return t.call(n,e,i);for(var a,o,s,c=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,l=new RegExp(e.source,h+"g");(a=ur.call(l,n))&&!((o=l.lastIndex)>u&&(c.push(n.slice(u,a.index)),a.length>1&&a.index<n.length&&Dr.apply(c,a.slice(1)),s=a[0].length,u=o,c.length>=i));)l.lastIndex===a.index&&l.lastIndex++;return u===n.length?!s&&l.test("")||c.push(""):c.push(n.slice(u)),c.length>i?c.slice(0,i):c}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t,[function(t,r){var i=m(this),a=null==t?void 0:t[e];return void 0!==a?a.call(t,i,r):n.call(String(i),t,r)},function(e,i){var a=r(n,e,this,i,n!==t);if(a.done)return a.value;var o=T(e),s=String(this),c=Mr(o,RegExp),h=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(zr?"y":"g"),l=new c(zr?o:"^(?:"+o.source+")",u),f=void 0===i?4294967295:i>>>0;if(0===f)return[];if(0===s.length)return null===Ir(l,s)?[s]:[];for(var p=0,d=0,g=[];d<s.length;){l.lastIndex=zr?d:0;var v,m=Ir(l,zr?s:s.slice(d));if(null===m||(v=Br(fe(l.lastIndex+(zr?0:d)),s.length))===p)d=Nr(s,d,h);else{if(g.push(s.slice(p,d)),g.length===f)return g;for(var y=1;y<=m.length-1;y++)if(g.push(m[y]),g.length===f)return g;d=p=v}}return g.push(s.slice(p)),g}]}),!zr);var Ur={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var Hr in Ur){var $r=o[Hr],jr=$r&&$r.prototype;if(jr&&jr.forEach!==dt)try{M(jr,"forEach",dt)}catch(e){jr.forEach=dt}}function qr(e){return(qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gr(e,t,r,n,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function Vr(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){Gr(a,n,i,o,s,"next",e)}function s(e){Gr(a,n,i,o,s,"throw",e)}o(void 0)}))}}function Wr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Yr(e,t,r){return t&&Zr(e.prototype,t),r&&Zr(e,r),e}function Xr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qr(e,t)}function Kr(e){return(Kr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qr(e,t){return(Qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function en(e,t,r){return(en=Jr()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Qr(i,r.prototype),i}).apply(null,arguments)}function tn(e){var t="function"==typeof Map?new Map:void 0;return(tn=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return en(e,arguments,Kr(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Qr(n,e)})(e)}function rn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function nn(e){var t=Jr();return function(){var r,n=Kr(e);if(t){var i=Kr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rn(this,r)}}function an(e,t){return sn(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return r}}(e,t)||hn(e,t)||ln()}function on(e){return function(e){if(Array.isArray(e))return un(e)}(e)||cn(e)||hn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sn(e){if(Array.isArray(e))return e}function cn(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function hn(e,t){if(e){if("string"==typeof e)return un(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?un(e,t):void 0}}function un(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ln(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fn(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=hn(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}i((function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var i=t&&t.prototype instanceof u?t:u,a=Object.create(i.prototype),o=new k(n||[]);return a._invoke=function(e,t,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=b(o,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var h={};function u(){}function l(){}function f(){}var p={};p[i]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(S([])));g&&g!==t&&r.call(g,i)&&(p=g);var v=f.prototype=u.prototype=Object.create(p);function m(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function y(e){var t;this._invoke=function(n,i){function a(){return new Promise((function(t,a){!function t(n,i,a,o){var s=c(e[n],e,i);if("throw"!==s.type){var h=s.arg,u=h.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,a,o)}),(function(e){t("throw",e,a,o)})):Promise.resolve(u).then((function(e){h.value=e,a(h)}),(function(e){return t("throw",e,a,o)}))}o(s.arg)}(n,i,t,a)}))}return t=t?t.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:_}}function _(){return{value:void 0,done:!0}}return l.prototype=v.constructor=f,f.constructor=l,f[o]=l.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},m(y.prototype),y.prototype[a]=function(){return this},e.AsyncIterator=y,e.async=function(t,r,n,i){var a=new y(s(t,r,n,i));return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(v),v[o]="Generator",v[i]=function(){return this},v.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return o.type="throw",o.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;x(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));var pn=ke.f,dn={}.toString,gn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],vn={f:function(e){return gn&&"[object Window]"==dn.call(e)?function(e){try{return pn(e)}catch(e){return gn.slice()}}(e):pn(y(e))}},mn={f:qe},yn=L.f,bn=function(e){var t=ae.Symbol||(ae.Symbol={});k(t,e)||yn(t,e,{value:mn.f(e)})},wn=L.f,xn=qe("toStringTag"),kn=function(e,t,r){e&&!k(e=r?e:e.prototype,xn)&&wn(e,xn,{configurable:!0,value:t})},Sn=Ye.forEach,_n=W("hidden"),Cn=qe("toPrimitive"),An=ne.set,En=ne.getterFor("Symbol"),Rn=Object.prototype,Tn=o.Symbol,In=se("JSON","stringify"),Ln=R.f,Mn=L.f,Pn=vn.f,On=l.f,Fn=$("symbols"),Nn=$("op-symbols"),Dn=$("string-to-symbol-registry"),Bn=$("symbol-to-string-registry"),zn=$("wks"),Un=o.QObject,Hn=!Un||!Un.prototype||!Un.prototype.findChild,$n=c&&s((function(){return 7!=Nt(Mn({},"a",{get:function(){return Mn(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Ln(Rn,t);n&&delete Rn[t],Mn(e,t,r),n&&e!==Rn&&Mn(Rn,t,n)}:Mn,jn=function(e,t){var r=Fn[e]=Nt(Tn.prototype);return An(r,{type:"Symbol",tag:e,description:t}),c||(r.description=t),r},qn=Ue?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Tn},Gn=function(e,t,r){e===Rn&&Gn(Nn,t,r),T(e);var n=w(t,!0);return T(r),k(Fn,n)?(r.enumerable?(k(e,_n)&&e[_n][n]&&(e[_n][n]=!1),r=Nt(r,{enumerable:f(0,!1)})):(k(e,_n)||Mn(e,_n,f(1,{})),e[_n][n]=!0),$n(e,n,r)):Mn(e,n,r)},Vn=function(e,t){T(e);var r=y(t),n=Tt(r).concat(Xn(r));return Sn(n,(function(t){c&&!Wn.call(r,t)||Gn(e,t,r[t])})),e},Wn=function(e){var t=w(e,!0),r=On.call(this,t);return!(this===Rn&&k(Fn,t)&&!k(Nn,t))&&(!(r||!k(this,t)||!k(Fn,t)||k(this,_n)&&this[_n][t])||r)},Zn=function(e,t){var r=y(e),n=w(t,!0);if(r!==Rn||!k(Fn,n)||k(Nn,n)){var i=Ln(r,n);return!i||!k(Fn,n)||k(r,_n)&&r[_n][n]||(i.enumerable=!0),i}},Yn=function(e){var t=Pn(y(e)),r=[];return Sn(t,(function(e){k(Fn,e)||k(Z,e)||r.push(e)})),r},Xn=function(e){var t=e===Rn,r=Pn(t?Nn:y(e)),n=[];return Sn(r,(function(e){!k(Fn,e)||t&&!k(Rn,e)||n.push(Fn[e])})),n};if(ze||(ie((Tn=function(){if(this instanceof Tn)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=G(e),r=function(e){this===Rn&&r.call(Nn,e),k(this,_n)&&k(this[_n],t)&&(this[_n][t]=!1),$n(this,t,f(1,e))};return c&&Hn&&$n(Rn,t,{configurable:!0,set:r}),jn(t,e)}).prototype,"toString",(function(){return En(this).tag})),ie(Tn,"withoutSetter",(function(e){return jn(G(e),e)})),l.f=Wn,L.f=Gn,R.f=Zn,ke.f=vn.f=Yn,Se.f=Xn,mn.f=function(e){return jn(qe(e),e)},c&&(Mn(Tn.prototype,"description",{configurable:!0,get:function(){return En(this).description}}),ie(Rn,"propertyIsEnumerable",Wn,{unsafe:!0}))),Oe({global:!0,wrap:!0,forced:!ze,sham:!ze},{Symbol:Tn}),Sn(Tt(zn),(function(e){bn(e)})),Oe({target:"Symbol",stat:!0,forced:!ze},{for:function(e){var t=String(e);if(k(Dn,t))return Dn[t];var r=Tn(t);return Dn[t]=r,Bn[r]=t,r},keyFor:function(e){if(!qn(e))throw TypeError(e+" is not a symbol");if(k(Bn,e))return Bn[e]},useSetter:function(){Hn=!0},useSimple:function(){Hn=!1}}),Oe({target:"Object",stat:!0,forced:!ze,sham:!c},{create:function(e,t){return void 0===t?Nt(e):Vn(Nt(e),t)},defineProperty:Gn,defineProperties:Vn,getOwnPropertyDescriptor:Zn}),Oe({target:"Object",stat:!0,forced:!ze},{getOwnPropertyNames:Yn,getOwnPropertySymbols:Xn}),Oe({target:"Object",stat:!0,forced:s((function(){Se.f(1)}))},{getOwnPropertySymbols:function(e){return Se.f(De(e))}}),In){var Kn=!ze||s((function(){var e=Tn();return"[null]"!=In([e])||"{}"!=In({a:e})||"{}"!=In(Object(e))}));Oe({target:"JSON",stat:!0,forced:Kn},{stringify:function(e,t,r){for(var n,i=[e],a=1;arguments.length>a;)i.push(arguments[a++]);if(n=t,(b(t)||void 0!==e)&&!qn(e))return Be(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!qn(t))return t}),i[1]=t,In.apply(null,i)}})}Tn.prototype[Cn]||M(Tn.prototype,Cn,Tn.prototype.valueOf),kn(Tn,"Symbol"),Z[_n]=!0;var Qn=L.f,Jn=o.Symbol;if(c&&"function"==typeof Jn&&(!("description"in Jn.prototype)||void 0!==Jn().description)){var ei={},ti=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof ti?new Jn(e):void 0===e?Jn():Jn(e);return""===e&&(ei[t]=!0),t};Ce(ti,Jn);var ri=ti.prototype=Jn.prototype;ri.constructor=ti;var ni=ri.toString,ii="Symbol(test)"==String(Jn("test")),ai=/^Symbol\((.*)\)[^)]+$/;Qn(ri,"description",{configurable:!0,get:function(){var e=b(this)?this.valueOf():this,t=ni.call(e);if(k(ei,e))return"";var r=ii?t.slice(7,-1):t.replace(ai,"$1");return""===r?void 0:r}}),Oe({global:!0,forced:!0},{Symbol:ti})}bn("iterator");var oi=function(e,t,r){var n=w(t);n in e?L.f(e,n,f(0,r)):e[n]=r},si=qe("isConcatSpreadable"),ci=et>=51||!s((function(){var e=[];return e[si]=!1,e.concat()[0]!==e})),hi=rt("concat"),ui=function(e){if(!b(e))return!1;var t=e[si];return void 0!==t?!!t:Be(e)};Oe({target:"Array",proto:!0,forced:!ci||!hi},{concat:function(e){var t,r,n,i,a,o=De(this),s=Ve(o,0),c=0;for(t=-1,n=arguments.length;t<n;t++)if(a=-1===t?o:arguments[t],ui(a)){if(c+(i=fe(a.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<i;r++,c++)r in a&&oi(s,c,a[r])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");oi(s,c++,a)}return s.length=c,s}});var li=qe("unscopables"),fi=Array.prototype;null==fi[li]&&L.f(fi,li,{configurable:!0,value:Nt(null)});var pi=function(e){fi[li][e]=!0},di=Ye.find,gi=!0,vi=ot("find");"find"in[]&&Array(1).find((function(){gi=!1})),Oe({target:"Array",proto:!0,forced:gi||!vi},{find:function(e){return di(this,e,arguments.length>1?arguments[1]:void 0)}}),pi("find");var mi,yi,bi,wi={},xi=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ki=W("IE_PROTO"),Si=Object.prototype,_i=xi?Object.getPrototypeOf:function(e){return e=De(e),k(e,ki)?e[ki]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Si:null},Ci=qe("iterator"),Ai=!1;[].keys&&("next"in(bi=[].keys())?(yi=_i(_i(bi)))!==Object.prototype&&(mi=yi):Ai=!0),null==mi&&(mi={}),k(mi,Ci)||M(mi,Ci,(function(){return this}));var Ei={IteratorPrototype:mi,BUGGY_SAFARI_ITERATORS:Ai},Ri=Ei.IteratorPrototype,Ti=function(){return this},Ii=function(e,t,r){var n=t+" Iterator";return e.prototype=Nt(Ri,{next:f(1,r)}),kn(e,n,!1),wi[n]=Ti,e},Li=Ei.IteratorPrototype,Mi=Ei.BUGGY_SAFARI_ITERATORS,Pi=qe("iterator"),Oi=function(){return this},Fi=function(e,t,r,n,i,a,o){Ii(r,t,n);var s,c,h,u=function(e){if(e===i&&g)return g;if(!Mi&&e in p)return p[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,p=e.prototype,d=p[Pi]||p["@@iterator"]||i&&p[i],g=!Mi&&d||u(i),v="Array"==t&&p.entries||d;if(v&&(s=_i(v.call(new e)),Li!==Object.prototype&&s.next&&(_i(s)!==Li&&(Et?Et(s,Li):"function"!=typeof s[Pi]&&M(s,Pi,Oi)),kn(s,l,!0))),"values"==i&&d&&"values"!==d.name&&(f=!0,g=function(){return d.call(this)}),p[Pi]!==g&&M(p,Pi,g),wi[t]=g,i)if(c={values:u("values"),keys:a?g:u("keys"),entries:u("entries")},o)for(h in c)!Mi&&!f&&h in p||ie(p,h,c[h]);else Oe({target:t,proto:!0,forced:Mi||f},c);return c},Ni=ne.set,Di=ne.getterFor("Array Iterator"),Bi=Fi(Array,"Array",(function(e,t){Ni(this,{type:"Array Iterator",target:y(e),index:0,kind:t})}),(function(){var e=Di(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");wi.Arguments=wi.Array,pi("keys"),pi("values"),pi("entries");var zi=[].join,Ui=v!=Object,Hi=ut("join",",");Oe({target:"Array",proto:!0,forced:Ui||!Hi},{join:function(e){return zi.call(y(this),void 0===e?",":e)}});var $i=Ye.map,ji=rt("map"),qi=ot("map");Oe({target:"Array",proto:!0,forced:!ji||!qi},{map:function(e){return $i(this,e,arguments.length>1?arguments[1]:void 0)}});var Gi=rt("slice"),Vi=ot("slice",{ACCESSORS:!0,0:0,1:2}),Wi=qe("species"),Zi=[].slice,Yi=Math.max;Oe({target:"Array",proto:!0,forced:!Gi||!Vi},{slice:function(e,t){var r,n,i,a=y(this),o=fe(a.length),s=ge(e,o),c=ge(void 0===t?o:t,o);if(Be(a)&&("function"!=typeof(r=a.constructor)||r!==Array&&!Be(r.prototype)?b(r)&&null===(r=r[Wi])&&(r=void 0):r=void 0,r===Array||void 0===r))return Zi.call(a,s,c);for(n=new(void 0===r?Array:r)(Yi(c-s,0)),i=0;s<c;s++,i++)s in a&&oi(n,i,a[s]);return n.length=i,n}});var Xi=rt("splice"),Ki=ot("splice",{ACCESSORS:!0,0:0,1:2}),Qi=Math.max,Ji=Math.min;Oe({target:"Array",proto:!0,forced:!Xi||!Ki},{splice:function(e,t){var r,n,i,a,o,s,c=De(this),h=fe(c.length),u=ge(e,h),l=arguments.length;if(0===l?r=n=0:1===l?(r=0,n=h-u):(r=l-2,n=Ji(Qi(ue(t),0),h-u)),h+r-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(i=Ve(c,n),a=0;a<n;a++)(o=u+a)in c&&oi(i,a,c[o]);if(i.length=n,r<n){for(a=u;a<h-n;a++)s=a+r,(o=a+n)in c?c[s]=c[o]:delete c[s];for(a=h;a>h-n+r;a--)delete c[a-1]}else if(r>n)for(a=h-n;a>u;a--)s=a+r-1,(o=a+n-1)in c?c[s]=c[o]:delete c[s];for(a=0;a<r;a++)c[a+u]=arguments[a+2];return c.length=h-n+r,i}});var ea=L.f,ta=Function.prototype,ra=ta.toString,na=/^\s*function ([^ (]*)/;!c||"name"in ta||ea(ta,"name",{configurable:!0,get:function(){try{return ra.call(this).match(na)[1]}catch(e){return""}}});var ia=s((function(){_i(1)}));Oe({target:"Object",stat:!0,forced:ia,sham:!xi},{getPrototypeOf:function(e){return _i(De(e))}});var aa={};aa[qe("toStringTag")]="z";var oa="[object z]"===String(aa),sa=qe("toStringTag"),ca="Arguments"==d(function(){return arguments}()),ha=oa?d:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),sa))?r:ca?d(t):"Object"==(n=d(t))&&"function"==typeof t.callee?"Arguments":n},ua=oa?{}.toString:function(){return"[object "+ha(this)+"]"};oa||ie(Object.prototype,"toString",ua,{unsafe:!0});var la=qe("species"),fa=function(e){var t=se(e),r=L.f;c&&t&&!t[la]&&r(t,la,{configurable:!0,get:function(){return this}})},pa=L.f,da=ke.f,ga=ne.set,va=qe("match"),ma=o.RegExp,ya=ma.prototype,ba=/a/g,wa=/a/g,xa=new ma(ba)!==ba,ka=nr.UNSUPPORTED_Y;if(c&&Me("RegExp",!xa||ka||s((function(){return wa[va]=!1,ma(ba)!=ba||ma(wa)==wa||"/a/i"!=ma(ba,"i")})))){for(var Sa=function(e,t){var r,n=this instanceof Sa,i=pr(e),a=void 0===t;if(!n&&i&&e.constructor===Sa&&a)return e;xa?i&&!a&&(e=e.source):e instanceof Sa&&(a&&(t=tr.call(e)),e=e.source),ka&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var o=Rt(xa?new ma(e,t):ma(e,t),n?this:ya,Sa);return ka&&r&&ga(o,{sticky:r}),o},_a=function(e){e in Sa||pa(Sa,e,{configurable:!0,get:function(){return ma[e]},set:function(t){ma[e]=t}})},Ca=da(ma),Aa=0;Ca.length>Aa;)_a(Ca[Aa++]);ya.constructor=Sa,Sa.prototype=ya,ie(o,"RegExp",Sa)}fa("RegExp");var Ea=RegExp.prototype,Ra=Ea.toString,Ta=s((function(){return"/a/b"!=Ra.call({source:"a",flags:"b"})})),Ia="toString"!=Ra.name;(Ta||Ia)&&ie(RegExp.prototype,"toString",(function(){var e=T(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in Ea)?tr.call(e):r)}),{unsafe:!0});var La=Or.charAt,Ma=ne.set,Pa=ne.getterFor("String Iterator");Fi(String,"String",(function(e){Ma(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Pa(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=La(r,n),t.index+=e.length,{value:e,done:!1})})),Rr("match",1,(function(e,t,r){return[function(t){var r=m(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var i=T(e),a=String(this);if(!i.global)return Ir(i,a);var o=i.unicode;i.lastIndex=0;for(var s,c=[],h=0;null!==(s=Ir(i,a));){var u=String(s[0]);c[h]=u,""===u&&(i.lastIndex=Nr(a,fe(i.lastIndex),o)),h++}return 0===h?null:c}]}));var Oa=Math.max,Fa=Math.min,Na=Math.floor,Da=/\$([$&'`]|\d\d?|<[^>]*>)/g,Ba=/\$([$&'`]|\d\d?)/g;Rr("replace",2,(function(e,t,r,n){var i=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,a=n.REPLACE_KEEPS_$0,o=i?"$":"$0";return[function(r,n){var i=m(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,i,n):t.call(String(i),r,n)},function(e,n){if(!i&&a||"string"==typeof n&&-1===n.indexOf(o)){var c=r(t,e,this,n);if(c.done)return c.value}var h=T(e),u=String(this),l="function"==typeof n;l||(n=String(n));var f=h.global;if(f){var p=h.unicode;h.lastIndex=0}for(var d=[];;){var g=Ir(h,u);if(null===g)break;if(d.push(g),!f)break;""===String(g[0])&&(h.lastIndex=Nr(u,fe(h.lastIndex),p))}for(var v,m="",y=0,b=0;b<d.length;b++){g=d[b];for(var w=String(g[0]),x=Oa(Fa(ue(g.index),u.length),0),k=[],S=1;S<g.length;S++)k.push(void 0===(v=g[S])?v:String(v));var _=g.groups;if(l){var C=[w].concat(k,x,u);void 0!==_&&C.push(_);var A=String(n.apply(void 0,C))}else A=s(w,u,x,k,_,n);x>=y&&(m+=u.slice(y,x)+A,y=x+w.length)}return m+u.slice(y)}];function s(e,r,n,i,a,o){var s=n+e.length,c=i.length,h=Ba;return void 0!==a&&(a=De(a),h=Da),t.call(o,h,(function(t,o){var h;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(s);case"<":h=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return t;if(u>c){var l=Na(u/10);return 0===l?t:l<=c?void 0===i[l-1]?o.charAt(1):i[l-1]+o.charAt(1):t}h=i[u-1]}return void 0===h?"":h}))}}));var za=qe("iterator"),Ua=qe("toStringTag"),Ha=Bi.values;for(var $a in Ur){var ja=o[$a],qa=ja&&ja.prototype;if(qa){if(qa[za]!==Ha)try{M(qa,za,Ha)}catch(e){qa[za]=Ha}if(qa[Ua]||M(qa,Ua,$a),Ur[$a])for(var Ga in Bi)if(qa[Ga]!==Bi[Ga])try{M(qa,Ga,Bi[Ga])}catch(e){qa[Ga]=Bi[Ga]}}}
  /*!
  	 * jQuery JavaScript Library v3.3.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector
  	 * https://jquery.com/
  	 *
  	 * Includes Sizzle.js
  	 * https://sizzlejs.com/
  	 *
  	 * Copyright JS Foundation and other contributors
  	 * Released under the MIT license
  	 * https://jquery.org/license
  	 *
  	 * Date: 2018-01-20T17:24Z
  	 */var Va=[],Wa=window.document,Za=Object.getPrototypeOf,Ya=Va.slice,Xa=Va.concat,Ka=Va.push,Qa=Va.indexOf,Ja={},eo=Ja.toString,to=Ja.hasOwnProperty,ro=to.toString,no=ro.call(Object),io={},ao=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},oo=function(e){return null!=e&&e===e.window},so={type:!0,src:!0,noModule:!0};function co(e,t,r){var n,i=(t=t||Wa).createElement("script");if(i.text=e,r)for(n in so)r[n]&&(i[n]=r[n]);t.head.appendChild(i).parentNode.removeChild(i)}function ho(e){return null==e?e+"":"object"===qr(e)||"function"==typeof e?Ja[eo.call(e)]||"object":qr(e)}var uo="3.3.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector",lo=function e(t,r){return new e.fn.init(t,r)},fo=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function po(e){var t=!!e&&"length"in e&&e.length,r=ho(e);return!ao(e)&&!oo(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}lo.fn=lo.prototype={jquery:uo,constructor:lo,length:0,toArray:function(){return Ya.call(this)},get:function(e){return null==e?Ya.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=lo.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return lo.each(this,e)},map:function(e){return this.pushStack(lo.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return this.pushStack(Ya.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(e<0?t:0);return this.pushStack(r>=0&&r<t?[this[r]]:[])},end:function(){return this.prevObject||this.constructor()},push:Ka,sort:Va.sort,splice:Va.splice},lo.extend=lo.fn.extend=function(){var e,t,r,n,i,a,o=arguments[0]||{},s=1,c=arguments.length,h=!1;for("boolean"==typeof o&&(h=o,o=arguments[s]||{},s++),"object"===qr(o)||ao(o)||(o={}),s===c&&(o=this,s--);s<c;s++)if(null!=(e=arguments[s]))for(t in e)r=o[t],o!==(n=e[t])&&(h&&n&&(lo.isPlainObject(n)||(i=Array.isArray(n)))?(i?(i=!1,a=r&&Array.isArray(r)?r:[]):a=r&&lo.isPlainObject(r)?r:{},o[t]=lo.extend(h,a,n)):void 0!==n&&(o[t]=n));return o},lo.extend({expando:"jQuery"+(uo+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,r;return!(!e||"[object Object]"!==eo.call(e)||(t=Za(e))&&("function"!=typeof(r=to.call(t,"constructor")&&t.constructor)||ro.call(r)!==no))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){co(e)},each:function(e,t){var r,n=0;if(po(e))for(r=e.length;n<r&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e},trim:function(e){return null==e?"":(e+"").replace(fo,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(po(Object(e))?lo.merge(r,"string"==typeof e?[e]:e):Ka.call(r,e)),r},inArray:function(e,t,r){return null==t?-1:Qa.call(t,e,r)},merge:function(e,t){for(var r=+t.length,n=0,i=e.length;n<r;n++)e[i++]=t[n];return e.length=i,e},grep:function(e,t,r){for(var n=[],i=0,a=e.length,o=!r;i<a;i++)!t(e[i],i)!==o&&n.push(e[i]);return n},map:function(e,t,r){var n,i,a=0,o=[];if(po(e))for(n=e.length;a<n;a++)null!=(i=t(e[a],a,r))&&o.push(i);else for(a in e)null!=(i=t(e[a],a,r))&&o.push(i);return Xa.apply([],o)},guid:1,support:io}),"function"==typeof Symbol&&(lo.fn[Symbol.iterator]=Va[Symbol.iterator]),lo.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){Ja["[object "+t+"]"]=t.toLowerCase()}));var go=
  /*!
  	* Sizzle CSS Selector Engine v2.3.3
  	* https://sizzlejs.com/
  	*
  	* Copyright jQuery Foundation and other contributors
  	* Released under the MIT license
  	* http://jquery.org/license
  	*
  	* Date: 2016-08-08
  	*/
  function(e){var t,r,n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w="sizzle"+1*new Date,x=e.document,k=0,S=0,_=oe(),C=oe(),A=oe(),E=function(e,t){return e===t&&(l=!0),0},R={}.hasOwnProperty,T=[],I=T.pop,L=T.push,M=T.push,P=T.slice,O=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",N="[\\x20\\t\\r\\n\\f]",D="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",B="\\["+N+"*("+D+")(?:"+N+"*([*^$|!~]?=)"+N+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+D+"))|)"+N+"*\\]",z=":("+D+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+B+")*)|.*)\\)|)",U=new RegExp(N+"+","g"),H=new RegExp("^"+N+"+|((?:^|[^\\\\])(?:\\\\.)*)"+N+"+$","g"),$=new RegExp("^"+N+"*,"+N+"*"),j=new RegExp("^"+N+"*([>+~]|"+N+")"+N+"*"),q=new RegExp("="+N+"*([^\\]'\"]*?)"+N+"*\\]","g"),G=new RegExp(z),V=new RegExp("^"+D+"$"),W={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},Z=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,J=new RegExp("\\\\([\\da-f]{1,6}"+N+"?|("+N+")|.)","ig"),ee=function(e,t,r){var n="0x"+t-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ne=function(){f()},ie=ye((function(e){return!0===e.disabled&&("form"in e||"label"in e)}),{dir:"parentNode",next:"legend"});try{M.apply(T=P.call(x.childNodes),x.childNodes),T[x.childNodes.length].nodeType}catch(e){M={apply:T.length?function(e,t){L.apply(e,P.call(t))}:function(e,t){for(var r=e.length,n=0;e[r++]=t[n++];);e.length=r-1}}}function ae(e,t,n,i){var a,s,h,u,l,d,m,y=t&&t.ownerDocument,k=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==k&&9!==k&&11!==k)return n;if(!i&&((t?t.ownerDocument||t:x)!==p&&f(t),t=t||p,g)){if(11!==k&&(l=K.exec(e)))if(a=l[1]){if(9===k){if(!(h=t.getElementById(a)))return n;if(h.id===a)return n.push(h),n}else if(y&&(h=y.getElementById(a))&&b(t,h)&&h.id===a)return n.push(h),n}else{if(l[2])return M.apply(n,t.getElementsByTagName(e)),n;if((a=l[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(a)),n}if(r.qsa&&!A[e+" "]&&(!v||!v.test(e))){if(1!==k)y=t,m=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(te,re):t.setAttribute("id",u=w),s=(d=o(e)).length;s--;)d[s]="#"+u+" "+me(d[s]);m=d.join(","),y=Q.test(e)&&ge(t.parentNode)||t}if(m)try{return M.apply(n,y.querySelectorAll(m)),n}catch(e){}finally{u===w&&t.removeAttribute("id")}}}return c(e.replace(H,"$1"),t,n,i)}function oe(){var e=[];return function t(r,i){return e.push(r+" ")>n.cacheLength&&delete t[e.shift()],t[r+" "]=i}}function se(e){return e[w]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){for(var r=e.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=t}function ue(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function le(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function pe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function de(e){return se((function(t){return t=+t,se((function(r,n){for(var i,a=e([],r.length,t),o=a.length;o--;)r[i=a[o]]&&(r[i]=!(n[i]=r[i]))}))}))}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in r=ae.support={},a=ae.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},f=ae.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:x;return o!==p&&9===o.nodeType&&o.documentElement?(d=(p=o).documentElement,g=!a(p),x!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ne,!1):i.attachEvent&&i.attachEvent("onunload",ne)),r.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),r.getElementsByTagName=ce((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),r.getElementsByClassName=X.test(p.getElementsByClassName),r.getById=ce((function(e){return d.appendChild(e).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),r.getById?(n.filter.ID=function(e){var t=e.replace(J,ee);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var r=t.getElementById(e);return r?[r]:[]}}):(n.filter.ID=function(e){var t=e.replace(J,ee);return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return r&&r.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var r,n,i,a=t.getElementById(e);if(a){if((r=a.getAttributeNode("id"))&&r.value===e)return[a];for(i=t.getElementsByName(e),n=0;a=i[n++];)if((r=a.getAttributeNode("id"))&&r.value===e)return[a]}return[]}}),n.find.TAG=r.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):r.qsa?t.querySelectorAll(e):void 0}:function(e,t){var r,n=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;r=a[i++];)1===r.nodeType&&n.push(r);return n}return a},n.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},m=[],v=[],(r.qsa=X.test(p.querySelectorAll))&&(ce((function(e){d.appendChild(e).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+N+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+N+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+w+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||v.push(".#.+[+~]")})),ce((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+N+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(r.matchesSelector=X.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ce((function(e){r.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),m.push("!=",z)})),v=v.length&&new RegExp(v.join("|")),m=m.length&&new RegExp(m.join("|")),t=X.test(d.compareDocumentPosition),b=t||X.test(d.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},E=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!r.sortDetached&&t.compareDocumentPosition(e)===n?e===p||e.ownerDocument===x&&b(x,e)?-1:t===p||t.ownerDocument===x&&b(x,t)?1:u?O(u,e)-O(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var r,n=0,i=e.parentNode,a=t.parentNode,o=[e],s=[t];if(!i||!a)return e===p?-1:t===p?1:i?-1:a?1:u?O(u,e)-O(u,t):0;if(i===a)return ue(e,t);for(r=e;r=r.parentNode;)o.unshift(r);for(r=t;r=r.parentNode;)s.unshift(r);for(;o[n]===s[n];)n++;return n?ue(o[n],s[n]):o[n]===x?-1:s[n]===x?1:0},p):p},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&f(e),t=t.replace(q,"='$1']"),r.matchesSelector&&g&&!A[t+" "]&&(!m||!m.test(t))&&(!v||!v.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return ae(t,p,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!==p&&f(e),b(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!==p&&f(e);var i=n.attrHandle[t.toLowerCase()],a=i&&R.call(n.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==a?a:r.attributes||!g?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},ae.escape=function(e){return(e+"").replace(te,re)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,n=[],i=0,a=0;if(l=!r.detectDuplicates,u=!r.sortStable&&e.slice(0),e.sort(E),l){for(;t=e[a++];)t===e[a]&&(i=n.push(a));for(;i--;)e.splice(n[i],1)}return u=null,e},i=ae.getText=function(e){var t,r="",n=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=i(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[n++];)r+=i(t);return r},(n=ae.selectors={cacheLength:50,createPseudo:se,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(J,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(J,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return W.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&G.test(r)&&(t=o(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(J,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=_[e+" "];return t||(t=new RegExp("(^|"+N+")"+e+"("+N+"|$)"))&&_(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,r){return function(n){var i=ae.attr(n,e);return null==i?"!="===t:!t||(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.slice(-r.length)===r:"~="===t?(" "+i.replace(U," ")+" ").indexOf(r)>-1:"|="===t&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,r,n,i){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===i?function(e){return!!e.parentNode}:function(t,r,c){var h,u,l,f,p,d,g=a!==o?"nextSibling":"previousSibling",v=t.parentNode,m=s&&t.nodeName.toLowerCase(),y=!c&&!s,b=!1;if(v){if(a){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===m:1===f.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[o?v.firstChild:v.lastChild],o&&y){for(b=(p=(h=(u=(l=(f=v)[w]||(f[w]={}))[f.uniqueID]||(l[f.uniqueID]={}))[e]||[])[0]===k&&h[1])&&h[2],f=p&&v.childNodes[p];f=++p&&f&&f[g]||(b=p=0)||d.pop();)if(1===f.nodeType&&++b&&f===t){u[e]=[k,p,b];break}}else if(y&&(b=p=(h=(u=(l=(f=t)[w]||(f[w]={}))[f.uniqueID]||(l[f.uniqueID]={}))[e]||[])[0]===k&&h[1]),!1===b)for(;(f=++p&&f&&f[g]||(b=p=0)||d.pop())&&((s?f.nodeName.toLowerCase()!==m:1!==f.nodeType)||!++b||(y&&((u=(l=f[w]||(f[w]={}))[f.uniqueID]||(l[f.uniqueID]={}))[e]=[k,b]),f!==t)););return(b-=i)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,t){var r,i=n.pseudos[e]||n.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(r=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,r){for(var n,a=i(e,t),o=a.length;o--;)e[n=O(e,a[o])]=!(r[n]=a[o])})):function(e){return i(e,0,r)}):i}},pseudos:{not:se((function(e){var t=[],r=[],n=s(e.replace(H,"$1"));return n[w]?se((function(e,t,r,i){for(var a,o=n(e,null,i,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))})):function(e,i,a){return t[0]=e,n(t,null,a,r),t[0]=null,!r.pop()}})),has:se((function(e){return function(t){return ae(e,t).length>0}})),contains:se((function(e){return e=e.replace(J,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}})),lang:se((function(e){return V.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(J,ee).toLowerCase(),function(t){var r;do{if(r=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(r=r.toLowerCase())===e||0===r.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:de((function(){return[0]})),last:de((function(e,t){return[t-1]})),eq:de((function(e,t,r){return[r<0?r+t:r]})),even:de((function(e,t){for(var r=0;r<t;r+=2)e.push(r);return e})),odd:de((function(e,t){for(var r=1;r<t;r+=2)e.push(r);return e})),lt:de((function(e,t,r){for(var n=r<0?r+t:r;--n>=0;)e.push(n);return e})),gt:de((function(e,t,r){for(var n=r<0?r+t:r;++n<t;)e.push(n);return e}))}}).pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[t]=le(t);for(t in{submit:!0,reset:!0})n.pseudos[t]=fe(t);function ve(){}function me(e){for(var t=0,r=e.length,n="";t<r;t++)n+=e[t].value;return n}function ye(e,t,r){var n=t.dir,i=t.next,a=i||n,o=r&&"parentNode"===a,s=S++;return t.first?function(t,r,i){for(;t=t[n];)if(1===t.nodeType||o)return e(t,r,i);return!1}:function(t,r,c){var h,u,l,f=[k,s];if(c){for(;t=t[n];)if((1===t.nodeType||o)&&e(t,r,c))return!0}else for(;t=t[n];)if(1===t.nodeType||o)if(u=(l=t[w]||(t[w]={}))[t.uniqueID]||(l[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[n]||t;else{if((h=u[a])&&h[0]===k&&h[1]===s)return f[2]=h[2];if(u[a]=f,f[2]=e(t,r,c))return!0}return!1}}function be(e){return e.length>1?function(t,r,n){for(var i=e.length;i--;)if(!e[i](t,r,n))return!1;return!0}:e[0]}function we(e,t,r,n,i){for(var a,o=[],s=0,c=e.length,h=null!=t;s<c;s++)(a=e[s])&&(r&&!r(a,n,i)||(o.push(a),h&&t.push(s)));return o}function xe(e,t,r,n,i,a){return n&&!n[w]&&(n=xe(n)),i&&!i[w]&&(i=xe(i,a)),se((function(a,o,s,c){var h,u,l,f=[],p=[],d=o.length,g=a||function(e,t,r){for(var n=0,i=t.length;n<i;n++)ae(e,t[n],r);return r}(t||"*",s.nodeType?[s]:s,[]),v=!e||!a&&t?g:we(g,f,e,s,c),m=r?i||(a?e:d||n)?[]:o:v;if(r&&r(v,m,s,c),n)for(h=we(m,p),n(h,[],s,c),u=h.length;u--;)(l=h[u])&&(m[p[u]]=!(v[p[u]]=l));if(a){if(i||e){if(i){for(h=[],u=m.length;u--;)(l=m[u])&&h.push(v[u]=l);i(null,m=[],h,c)}for(u=m.length;u--;)(l=m[u])&&(h=i?O(a,l):f[u])>-1&&(a[h]=!(o[h]=l))}}else m=we(m===o?m.splice(d,m.length):m),i?i(null,o,m,c):M.apply(o,m)}))}function ke(e){for(var t,r,i,a=e.length,o=n.relative[e[0].type],s=o||n.relative[" "],c=o?1:0,u=ye((function(e){return e===t}),s,!0),l=ye((function(e){return O(t,e)>-1}),s,!0),f=[function(e,r,n){var i=!o&&(n||r!==h)||((t=r).nodeType?u(e,r,n):l(e,r,n));return t=null,i}];c<a;c++)if(r=n.relative[e[c].type])f=[ye(be(f),r)];else{if((r=n.filter[e[c].type].apply(null,e[c].matches))[w]){for(i=++c;i<a&&!n.relative[e[i].type];i++);return xe(c>1&&be(f),c>1&&me(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(H,"$1"),r,c<i&&ke(e.slice(c,i)),i<a&&ke(e=e.slice(i)),i<a&&me(e))}f.push(r)}return be(f)}return ve.prototype=n.filters=n.pseudos,n.setFilters=new ve,o=ae.tokenize=function(e,t){var r,i,a,o,s,c,h,u=C[e+" "];if(u)return t?0:u.slice(0);for(s=e,c=[],h=n.preFilter;s;){for(o in r&&!(i=$.exec(s))||(i&&(s=s.slice(i[0].length)||s),c.push(a=[])),r=!1,(i=j.exec(s))&&(r=i.shift(),a.push({value:r,type:i[0].replace(H," ")}),s=s.slice(r.length)),n.filter)!(i=W[o].exec(s))||h[o]&&!(i=h[o](i))||(r=i.shift(),a.push({value:r,type:o,matches:i}),s=s.slice(r.length));if(!r)break}return t?s.length:s?ae.error(e):C(e,c).slice(0)},s=ae.compile=function(e,t){var r,i=[],a=[],s=A[e+" "];if(!s){for(t||(t=o(e)),r=t.length;r--;)(s=ke(t[r]))[w]?i.push(s):a.push(s);(s=A(e,function(e,t){var r=t.length>0,i=e.length>0,a=function(a,o,s,c,u){var l,d,v,m=0,y="0",b=a&&[],w=[],x=h,S=a||i&&n.find.TAG("*",u),_=k+=null==x?1:Math.random()||.1,C=S.length;for(u&&(h=o===p||o||u);y!==C&&null!=(l=S[y]);y++){if(i&&l){for(d=0,o||l.ownerDocument===p||(f(l),s=!g);v=e[d++];)if(v(l,o||p,s)){c.push(l);break}u&&(k=_)}r&&((l=!v&&l)&&m--,a&&b.push(l))}if(m+=y,r&&y!==m){for(d=0;v=t[d++];)v(b,w,o,s);if(a){if(m>0)for(;y--;)b[y]||w[y]||(w[y]=I.call(c));w=we(w)}M.apply(c,w),u&&!a&&w.length>0&&m+t.length>1&&ae.uniqueSort(c)}return u&&(k=_,h=x),b};return r?se(a):a}(a,i))).selector=e}return s},c=ae.select=function(e,t,r,i){var a,c,h,u,l,f="function"==typeof e&&e,p=!i&&o(e=f.selector||e);if(r=r||[],1===p.length){if((c=p[0]=p[0].slice(0)).length>2&&"ID"===(h=c[0]).type&&9===t.nodeType&&g&&n.relative[c[1].type]){if(!(t=(n.find.ID(h.matches[0].replace(J,ee),t)||[])[0]))return r;f&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(a=W.needsContext.test(e)?0:c.length;a--&&(h=c[a],!n.relative[u=h.type]);)if((l=n.find[u])&&(i=l(h.matches[0].replace(J,ee),Q.test(c[0].type)&&ge(t.parentNode)||t))){if(c.splice(a,1),!(e=i.length&&me(c)))return M.apply(r,i),r;break}}return(f||s(e,p))(i,t,!g,r,!t||Q.test(e)&&ge(t.parentNode)||t),r},r.sortStable=w.split("").sort(E).join("")===w,r.detectDuplicates=!!l,f(),r.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),ce((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||he("type|href|height|width",(function(e,t,r){if(!r)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),r.attributes&&ce((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||he("value",(function(e,t,r){if(!r&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||he(F,(function(e,t,r){var n;if(!r)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null})),ae}(window);lo.find=go,(lo.expr=go.selectors)[":"]=lo.expr.pseudos,lo.uniqueSort=lo.unique=go.uniqueSort,lo.text=go.getText,lo.isXMLDoc=go.isXML,lo.contains=go.contains,lo.escapeSelector=go.escape;var vo=function(e,t,r){for(var n=[],i=void 0!==r;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&lo(e).is(r))break;n.push(e)}return n},mo=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r},yo=lo.expr.match.needsContext;function bo(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var wo=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function xo(e,t,r){return ao(t)?lo.grep(e,(function(e,n){return!!t.call(e,n,e)!==r})):t.nodeType?lo.grep(e,(function(e){return e===t!==r})):"string"!=typeof t?lo.grep(e,(function(e){return Qa.call(t,e)>-1!==r})):lo.filter(t,e,r)}lo.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?lo.find.matchesSelector(n,e)?[n]:[]:lo.find.matches(e,lo.grep(t,(function(e){return 1===e.nodeType})))},lo.fn.extend({find:function(e){var t,r,n=this.length,i=this;if("string"!=typeof e)return this.pushStack(lo(e).filter((function(){for(t=0;t<n;t++)if(lo.contains(i[t],this))return!0})));for(r=this.pushStack([]),t=0;t<n;t++)lo.find(e,i[t],r);return n>1?lo.uniqueSort(r):r},filter:function(e){return this.pushStack(xo(this,e||[],!1))},not:function(e){return this.pushStack(xo(this,e||[],!0))},is:function(e){return!!xo(this,"string"==typeof e&&yo.test(e)?lo(e):e||[],!1).length}});var ko,So=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(lo.fn.init=function(e,t,r){var n,i;if(!e)return this;if(r=r||ko,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:So.exec(e))||!n[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof lo?t[0]:t,lo.merge(this,lo.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:Wa,!0)),wo.test(n[1])&&lo.isPlainObject(t))for(n in t)ao(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(i=Wa.getElementById(n[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ao(e)?void 0!==r.ready?r.ready(e):e(lo):lo.makeArray(e,this)}).prototype=lo.fn,ko=lo(Wa);var _o=/^(?:parents|prev(?:Until|All))/,Co={children:!0,contents:!0,next:!0,prev:!0};function Ao(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}lo.fn.extend({has:function(e){var t=lo(e,this),r=t.length;return this.filter((function(){for(var e=0;e<r;e++)if(lo.contains(this,t[e]))return!0}))},closest:function(e,t){var r,n=0,i=this.length,a=[],o="string"!=typeof e&&lo(e);if(!yo.test(e))for(;n<i;n++)for(r=this[n];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(o?o.index(r)>-1:1===r.nodeType&&lo.find.matchesSelector(r,e))){a.push(r);break}return this.pushStack(a.length>1?lo.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?Qa.call(lo(e),this[0]):Qa.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(lo.uniqueSort(lo.merge(this.get(),lo(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),lo.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return vo(e,"parentNode")},parentsUntil:function(e,t,r){return vo(e,"parentNode",r)},next:function(e){return Ao(e,"nextSibling")},prev:function(e){return Ao(e,"previousSibling")},nextAll:function(e){return vo(e,"nextSibling")},prevAll:function(e){return vo(e,"previousSibling")},nextUntil:function(e,t,r){return vo(e,"nextSibling",r)},prevUntil:function(e,t,r){return vo(e,"previousSibling",r)},siblings:function(e){return mo((e.parentNode||{}).firstChild,e)},children:function(e){return mo(e.firstChild)},contents:function(e){return bo(e,"iframe")?e.contentDocument:(bo(e,"template")&&(e=e.content||e),lo.merge([],e.childNodes))}},(function(e,t){lo.fn[e]=function(r,n){var i=lo.map(this,t,r);return"Until"!==e.slice(-5)&&(n=r),n&&"string"==typeof n&&(i=lo.filter(n,i)),this.length>1&&(Co[e]||lo.uniqueSort(i),_o.test(e)&&i.reverse()),this.pushStack(i)}}));var Eo=/[^\x20\t\r\n\f]+/g;function Ro(e){return e}function To(e){throw e}function Io(e,t,r,n){var i;try{e&&ao(i=e.promise)?i.call(e).done(t).fail(r):e&&ao(i=e.then)?i.call(e,t,r):t.apply(void 0,[e].slice(n))}catch(e){r.apply(void 0,[e])}}lo.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return lo.each(e.match(Eo)||[],(function(e,r){t[r]=!0})),t}(e):lo.extend({},e);var t,r,n,i,a=[],o=[],s=-1,c=function(){for(i=i||e.once,n=t=!0;o.length;s=-1)for(r=o.shift();++s<a.length;)!1===a[s].apply(r[0],r[1])&&e.stopOnFalse&&(s=a.length,r=!1);e.memory||(r=!1),t=!1,i&&(a=r?[]:"")},h={add:function(){return a&&(r&&!t&&(s=a.length-1,o.push(r)),function t(r){lo.each(r,(function(r,n){ao(n)?e.unique&&h.has(n)||a.push(n):n&&n.length&&"string"!==ho(n)&&t(n)}))}(arguments),r&&!t&&c()),this},remove:function(){return lo.each(arguments,(function(e,t){for(var r;(r=lo.inArray(t,a,r))>-1;)a.splice(r,1),r<=s&&s--})),this},has:function(e){return e?lo.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=o=[],a=r="",this},disabled:function(){return!a},lock:function(){return i=o=[],r||t||(a=r=""),this},locked:function(){return!!i},fireWith:function(e,r){return i||(r=[e,(r=r||[]).slice?r.slice():r],o.push(r),t||c()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},lo.extend({Deferred:function(e){var t=[["notify","progress",lo.Callbacks("memory"),lo.Callbacks("memory"),2],["resolve","done",lo.Callbacks("once memory"),lo.Callbacks("once memory"),0,"resolved"],["reject","fail",lo.Callbacks("once memory"),lo.Callbacks("once memory"),1,"rejected"]],r="pending",n={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return n.then(null,e)},pipe:function(){var e=arguments;return lo.Deferred((function(r){lo.each(t,(function(t,n){var a=ao(e[n[4]])&&e[n[4]];i[n[1]]((function(){var e=a&&a.apply(this,arguments);e&&ao(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[n[0]+"With"](this,a?[e]:arguments)}))})),e=null})).promise()},then:function(e,r,n){var i=0;function a(e,t,r,n){return function(){var o=this,s=arguments,c=function(){var c,h;if(!(e<i)){if((c=r.apply(o,s))===t.promise())throw new TypeError("Thenable self-resolution");h=c&&("object"===qr(c)||"function"==typeof c)&&c.then,ao(h)?n?h.call(c,a(i,t,Ro,n),a(i,t,To,n)):(i++,h.call(c,a(i,t,Ro,n),a(i,t,To,n),a(i,t,Ro,t.notifyWith))):(r!==Ro&&(o=void 0,s=[c]),(n||t.resolveWith)(o,s))}},h=n?c:function(){try{c()}catch(n){lo.Deferred.exceptionHook&&lo.Deferred.exceptionHook(n,h.stackTrace),e+1>=i&&(r!==To&&(o=void 0,s=[n]),t.rejectWith(o,s))}};e?h():(lo.Deferred.getStackHook&&(h.stackTrace=lo.Deferred.getStackHook()),window.setTimeout(h))}}return lo.Deferred((function(i){t[0][3].add(a(0,i,ao(n)?n:Ro,i.notifyWith)),t[1][3].add(a(0,i,ao(e)?e:Ro)),t[2][3].add(a(0,i,ao(r)?r:To))})).promise()},promise:function(e){return null!=e?lo.extend(e,n):n}},i={};return lo.each(t,(function(e,a){var o=a[2],s=a[5];n[a[1]]=o.add,s&&o.add((function(){r=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),o.add(a[3].fire),i[a[0]]=function(){return i[a[0]+"With"](this===i?void 0:this,arguments),this},i[a[0]+"With"]=o.fireWith})),n.promise(i),e&&e.call(i,i),i},when:function(e){var t=arguments.length,r=t,n=Array(r),i=Ya.call(arguments),a=lo.Deferred(),o=function(e){return function(r){n[e]=this,i[e]=arguments.length>1?Ya.call(arguments):r,--t||a.resolveWith(n,i)}};if(t<=1&&(Io(e,a.done(o(r)).resolve,a.reject,!t),"pending"===a.state()||ao(i[r]&&i[r].then)))return a.then();for(;r--;)Io(i[r],o(r),a.reject);return a.promise()}});var Lo=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;lo.Deferred.exceptionHook=function(e,t){window.console&&window.console.warn&&e&&Lo.test(e.name)&&window.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},lo.readyException=function(e){window.setTimeout((function(){throw e}))};var Mo=lo.Deferred();function Po(){Wa.removeEventListener("DOMContentLoaded",Po),window.removeEventListener("load",Po),lo.ready()}lo.fn.ready=function(e){return Mo.then(e).catch((function(e){lo.readyException(e)})),this},lo.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--lo.readyWait:lo.isReady)||(lo.isReady=!0,!0!==e&&--lo.readyWait>0||Mo.resolveWith(Wa,[lo]))}}),lo.ready.then=Mo.then,"complete"===Wa.readyState||"loading"!==Wa.readyState&&!Wa.documentElement.doScroll?window.setTimeout(lo.ready):(Wa.addEventListener("DOMContentLoaded",Po),window.addEventListener("load",Po));var Oo=function e(t,r,n,i,a,o,s){var c=0,h=t.length,u=null==n;if("object"===ho(n))for(c in a=!0,n)e(t,r,c,n[c],!0,o,s);else if(void 0!==i&&(a=!0,ao(i)||(s=!0),u&&(s?(r.call(t,i),r=null):(u=r,r=function(e,t,r){return u.call(lo(e),r)})),r))for(;c<h;c++)r(t[c],n,s?i:i.call(t[c],c,r(t[c],n)));return a?t:u?r.call(t):h?r(t[0],n):o},Fo=/^-ms-/,No=/-([a-z])/g;function Do(e,t){return t.toUpperCase()}function Bo(e){return e.replace(Fo,"ms-").replace(No,Do)}var zo=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Uo(){this.expando=lo.expando+Uo.uid++}Uo.uid=1,Uo.prototype={cache:function(e){var t=e[this.expando];return t||(t={},zo(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,r){var n,i=this.cache(e);if("string"==typeof t)i[Bo(t)]=r;else for(n in t)i[Bo(n)]=t[n];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Bo(t)]},access:function(e,t,r){return void 0===t||t&&"string"==typeof t&&void 0===r?this.get(e,t):(this.set(e,t,r),void 0!==r?r:t)},remove:function(e,t){var r,n=e[this.expando];if(void 0!==n){if(void 0!==t){r=(t=Array.isArray(t)?t.map(Bo):(t=Bo(t))in n?[t]:t.match(Eo)||[]).length;for(;r--;)delete n[t[r]]}(void 0===t||lo.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!lo.isEmptyObject(t)}};var Ho=new Uo,$o=new Uo,jo=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,qo=/[A-Z]/g;function Go(e,t,r){var n;if(void 0===r&&1===e.nodeType)if(n="data-"+t.replace(qo,"-$&").toLowerCase(),"string"==typeof(r=e.getAttribute(n))){try{r=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:jo.test(e)?JSON.parse(e):e)}(r)}catch(e){}$o.set(e,t,r)}else r=void 0;return r}lo.extend({hasData:function(e){return $o.hasData(e)||Ho.hasData(e)},data:function(e,t,r){return $o.access(e,t,r)},removeData:function(e,t){$o.remove(e,t)},_data:function(e,t,r){return Ho.access(e,t,r)},_removeData:function(e,t){Ho.remove(e,t)}}),lo.fn.extend({data:function(e,t){var r,n,i,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(i=$o.get(a),1===a.nodeType&&!Ho.get(a,"hasDataAttrs"))){for(r=o.length;r--;)o[r]&&0===(n=o[r].name).indexOf("data-")&&(n=Bo(n.slice(5)),Go(a,n,i[n]));Ho.set(a,"hasDataAttrs",!0)}return i}return"object"===qr(e)?this.each((function(){$o.set(this,e)})):Oo(this,(function(t){var r;if(a&&void 0===t)return void 0!==(r=$o.get(a,e))?r:void 0!==(r=Go(a,e))?r:void 0;this.each((function(){$o.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){$o.remove(this,e)}))}}),lo.extend({queue:function(e,t,r){var n;if(e)return t=(t||"fx")+"queue",n=Ho.get(e,t),r&&(!n||Array.isArray(r)?n=Ho.access(e,t,lo.makeArray(r)):n.push(r)),n||[]},dequeue:function(e,t){var r=lo.queue(e,t=t||"fx"),n=r.length,i=r.shift(),a=lo._queueHooks(e,t);"inprogress"===i&&(i=r.shift(),n--),i&&("fx"===t&&r.unshift("inprogress"),delete a.stop,i.call(e,(function(){lo.dequeue(e,t)}),a)),!n&&a&&a.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return Ho.get(e,r)||Ho.access(e,r,{empty:lo.Callbacks("once memory").add((function(){Ho.remove(e,[t+"queue",r])}))})}}),lo.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length<r?lo.queue(this[0],e):void 0===t?this:this.each((function(){var r=lo.queue(this,e,t);lo._queueHooks(this,e),"fx"===e&&"inprogress"!==r[0]&&lo.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){lo.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var r,n=1,i=lo.Deferred(),a=this,o=this.length,s=function(){--n||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(r=Ho.get(a[o],e+"queueHooks"))&&r.empty&&(n++,r.empty.add(s));return s(),i.promise(t)}});var Vo=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Wo=new RegExp("^(?:([+-])=|)("+Vo+")([a-z%]*)$","i"),Zo=["Top","Right","Bottom","Left"],Yo=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&lo.contains(e.ownerDocument,e)&&"none"===lo.css(e,"display")},Xo=function(e,t,r,n){var i,a,o={};for(a in t)o[a]=e.style[a],e.style[a]=t[a];for(a in i=r.apply(e,n||[]),t)e.style[a]=o[a];return i},Ko={};function Qo(e){var t,r=e.ownerDocument,n=e.nodeName,i=Ko[n];return i||(t=r.body.appendChild(r.createElement(n)),i=lo.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Ko[n]=i,i)}function Jo(e,t){for(var r,n,i=[],a=0,o=e.length;a<o;a++)(n=e[a]).style&&(r=n.style.display,t?("none"===r&&(i[a]=Ho.get(n,"display")||null,i[a]||(n.style.display="")),""===n.style.display&&Yo(n)&&(i[a]=Qo(n))):"none"!==r&&(i[a]="none",Ho.set(n,"display",r)));for(a=0;a<o;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}lo.fn.extend({show:function(){return Jo(this,!0)},hide:function(){return Jo(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){Yo(this)?lo(this).show():lo(this).hide()}))}});var es=/^(?:checkbox|radio)$/i,ts=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,rs=/^$|^module$|\/(?:java|ecma)script/i,ns={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function is(e,t){var r;return r=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&bo(e,t)?lo.merge([e],r):r}function as(e,t){for(var r=0,n=e.length;r<n;r++)Ho.set(e[r],"globalEval",!t||Ho.get(t[r],"globalEval"))}ns.optgroup=ns.option,ns.tbody=ns.tfoot=ns.colgroup=ns.caption=ns.thead,ns.th=ns.td;var os,ss,cs=/<|&#?\w+;/;function hs(e,t,r,n,i){for(var a,o,s,c,h,u,l=t.createDocumentFragment(),f=[],p=0,d=e.length;p<d;p++)if((a=e[p])||0===a)if("object"===ho(a))lo.merge(f,a.nodeType?[a]:a);else if(cs.test(a)){for(o=o||l.appendChild(t.createElement("div")),s=(ts.exec(a)||["",""])[1].toLowerCase(),c=ns[s]||ns._default,o.innerHTML=c[1]+lo.htmlPrefilter(a)+c[2],u=c[0];u--;)o=o.lastChild;lo.merge(f,o.childNodes),(o=l.firstChild).textContent=""}else f.push(t.createTextNode(a));for(l.textContent="",p=0;a=f[p++];)if(n&&lo.inArray(a,n)>-1)i&&i.push(a);else if(h=lo.contains(a.ownerDocument,a),o=is(l.appendChild(a),"script"),h&&as(o),r)for(u=0;a=o[u++];)rs.test(a.type||"")&&r.push(a);return l}os=Wa.createDocumentFragment().appendChild(Wa.createElement("div")),(ss=Wa.createElement("input")).setAttribute("type","radio"),ss.setAttribute("checked","checked"),ss.setAttribute("name","t"),os.appendChild(ss),io.checkClone=os.cloneNode(!0).cloneNode(!0).lastChild.checked,os.innerHTML="<textarea>x</textarea>",io.noCloneChecked=!!os.cloneNode(!0).lastChild.defaultValue;var us=Wa.documentElement,ls=/^key/,fs=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ps=/^([^.]*)(?:\.(.+)|)/;function ds(){return!0}function gs(){return!1}function vs(){try{return Wa.activeElement}catch(e){}}function ms(e,t,r,n,i,a){var o,s;if("object"===qr(t)){for(s in"string"!=typeof r&&(n=n||r,r=void 0),t)ms(e,s,r,n,t[s],a);return e}if(null==n&&null==i?(i=r,n=r=void 0):null==i&&("string"==typeof r?(i=n,n=void 0):(i=n,n=r,r=void 0)),!1===i)i=gs;else if(!i)return e;return 1===a&&(o=i,(i=function(e){return lo().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=lo.guid++)),e.each((function(){lo.event.add(this,t,i,n,r)}))}lo.event={global:{},add:function(e,t,r,n,i){var a,o,s,c,h,u,l,f,p,d,g,v=Ho.get(e);if(v)for(r.handler&&(r=(a=r).handler,i=a.selector),i&&lo.find.matchesSelector(us,i),r.guid||(r.guid=lo.guid++),(c=v.events)||(c=v.events={}),(o=v.handle)||(o=v.handle=function(t){return lo.event.triggered!==t.type?lo.event.dispatch.apply(e,arguments):void 0}),h=(t=(t||"").match(Eo)||[""]).length;h--;)p=g=(s=ps.exec(t[h])||[])[1],d=(s[2]||"").split(".").sort(),p&&(l=lo.event.special[p]||{},p=(i?l.delegateType:l.bindType)||p,l=lo.event.special[p]||{},u=lo.extend({type:p,origType:g,data:n,handler:r,guid:r.guid,selector:i,needsContext:i&&lo.expr.match.needsContext.test(i),namespace:d.join(".")},a),(f=c[p])||((f=c[p]=[]).delegateCount=0,l.setup&&!1!==l.setup.call(e,n,d,o)||e.addEventListener&&e.addEventListener(p,o)),l.add&&(l.add.call(e,u),u.handler.guid||(u.handler.guid=r.guid)),i?f.splice(f.delegateCount++,0,u):f.push(u),lo.event.global[p]=!0)},remove:function(e,t,r,n,i){var a,o,s,c,h,u,l,f,p,d,g,v=Ho.hasData(e)&&Ho.get(e);if(v&&(c=v.events)){for(h=(t=(t||"").match(Eo)||[""]).length;h--;)if(p=g=(s=ps.exec(t[h])||[])[1],d=(s[2]||"").split(".").sort(),p){for(l=lo.event.special[p]||{},f=c[p=(n?l.delegateType:l.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=f.length;a--;)u=f[a],!i&&g!==u.origType||r&&r.guid!==u.guid||s&&!s.test(u.namespace)||n&&n!==u.selector&&("**"!==n||!u.selector)||(f.splice(a,1),u.selector&&f.delegateCount--,l.remove&&l.remove.call(e,u));o&&!f.length&&(l.teardown&&!1!==l.teardown.call(e,d,v.handle)||lo.removeEvent(e,p,v.handle),delete c[p])}else for(p in c)lo.event.remove(e,p+t[h],r,n,!0);lo.isEmptyObject(c)&&Ho.remove(e,"handle events")}},dispatch:function(e){var t,r,n,i,a,o,s=lo.event.fix(e),c=new Array(arguments.length),h=(Ho.get(this,"events")||{})[s.type]||[],u=lo.event.special[s.type]||{};for(c[0]=s,t=1;t<arguments.length;t++)c[t]=arguments[t];if(s.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,s)){for(o=lo.event.handlers.call(this,s,h),t=0;(i=o[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,r=0;(a=i.handlers[r++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(a.namespace)||(s.handleObj=a,s.data=a.data,void 0!==(n=((lo.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,c))&&!1===(s.result=n)&&(s.preventDefault(),s.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,s),s.result}},handlers:function(e,t){var r,n,i,a,o,s=[],c=t.delegateCount,h=e.target;if(c&&h.nodeType&&!("click"===e.type&&e.button>=1))for(;h!==this;h=h.parentNode||this)if(1===h.nodeType&&("click"!==e.type||!0!==h.disabled)){for(a=[],o={},r=0;r<c;r++)void 0===o[i=(n=t[r]).selector+" "]&&(o[i]=n.needsContext?lo(i,this).index(h)>-1:lo.find(i,this,null,[h]).length),o[i]&&a.push(n);a.length&&s.push({elem:h,handlers:a})}return h=this,c<t.length&&s.push({elem:h,handlers:t.slice(c)}),s},addProp:function(e,t){Object.defineProperty(lo.Event.prototype,e,{enumerable:!0,configurable:!0,get:ao(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[lo.expando]?e:new lo.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==vs()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===vs()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&bo(this,"input"))return this.click(),!1},_default:function(e){return bo(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},lo.removeEvent=function(e,t,r){e.removeEventListener&&e.removeEventListener(t,r)},(lo.Event=function(e,t){if(!(this instanceof lo.Event))return new lo.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ds:gs,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&lo.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[lo.expando]=!0}).prototype={constructor:lo.Event,isDefaultPrevented:gs,isPropagationStopped:gs,isImmediatePropagationStopped:gs,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ds,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ds,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ds,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},lo.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&ls.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&fs.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},lo.event.addProp),lo.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){lo.event.special[e]={delegateType:t,bindType:t,handle:function(e){var r,n=this,i=e.relatedTarget,a=e.handleObj;return i&&(i===n||lo.contains(n,i))||(e.type=a.origType,r=a.handler.apply(this,arguments),e.type=t),r}}})),lo.fn.extend({on:function(e,t,r,n){return ms(this,e,t,r,n)},one:function(e,t,r,n){return ms(this,e,t,r,n,1)},off:function(e,t,r){var n,i;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,lo(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"===qr(e)){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(r=t,t=void 0),!1===r&&(r=gs),this.each((function(){lo.event.remove(this,e,r,t)}))}});var ys=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,bs=/<script|<style|<link/i,ws=/checked\s*(?:[^=]|=\s*.checked.)/i,xs=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function ks(e,t){return bo(e,"table")&&bo(11!==t.nodeType?t:t.firstChild,"tr")&&lo(e).children("tbody")[0]||e}function Ss(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function _s(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Cs(e,t){var r,n,i,a,o,s,c,h;if(1===t.nodeType){if(Ho.hasData(e)&&(a=Ho.access(e),o=Ho.set(t,a),h=a.events))for(i in delete o.handle,o.events={},h)for(r=0,n=h[i].length;r<n;r++)lo.event.add(t,i,h[i][r]);$o.hasData(e)&&(s=$o.access(e),c=lo.extend({},s),$o.set(t,c))}}function As(e,t){var r=t.nodeName.toLowerCase();"input"===r&&es.test(e.type)?t.checked=e.checked:"input"!==r&&"textarea"!==r||(t.defaultValue=e.defaultValue)}function Es(e,t,r,n){t=Xa.apply([],t);var i,a,o,s,c,h,u=0,l=e.length,f=l-1,p=t[0],d=ao(p);if(d||l>1&&"string"==typeof p&&!io.checkClone&&ws.test(p))return e.each((function(i){var a=e.eq(i);d&&(t[0]=p.call(this,i,a.html())),Es(a,t,r,n)}));if(l&&(a=(i=hs(t,e[0].ownerDocument,!1,e,n)).firstChild,1===i.childNodes.length&&(i=a),a||n)){for(s=(o=lo.map(is(i,"script"),Ss)).length;u<l;u++)c=i,u!==f&&(c=lo.clone(c,!0,!0),s&&lo.merge(o,is(c,"script"))),r.call(e[u],c,u);if(s)for(h=o[o.length-1].ownerDocument,lo.map(o,_s),u=0;u<s;u++)c=o[u],rs.test(c.type||"")&&!Ho.access(c,"globalEval")&&lo.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?lo._evalUrl&&lo._evalUrl(c.src):co(c.textContent.replace(xs,""),h,c))}return e}function Rs(e,t,r){for(var n,i=t?lo.filter(t,e):e,a=0;null!=(n=i[a]);a++)r||1!==n.nodeType||lo.cleanData(is(n)),n.parentNode&&(r&&lo.contains(n.ownerDocument,n)&&as(is(n,"script")),n.parentNode.removeChild(n));return e}lo.extend({htmlPrefilter:function(e){return e.replace(ys,"<$1></$2>")},clone:function(e,t,r){var n,i,a,o,s=e.cloneNode(!0),c=lo.contains(e.ownerDocument,e);if(!(io.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||lo.isXMLDoc(e)))for(o=is(s),n=0,i=(a=is(e)).length;n<i;n++)As(a[n],o[n]);if(t)if(r)for(a=a||is(e),o=o||is(s),n=0,i=a.length;n<i;n++)Cs(a[n],o[n]);else Cs(e,s);return(o=is(s,"script")).length>0&&as(o,!c&&is(e,"script")),s},cleanData:function(e){for(var t,r,n,i=lo.event.special,a=0;void 0!==(r=e[a]);a++)if(zo(r)){if(t=r[Ho.expando]){if(t.events)for(n in t.events)i[n]?lo.event.remove(r,n):lo.removeEvent(r,n,t.handle);r[Ho.expando]=void 0}r[$o.expando]&&(r[$o.expando]=void 0)}}}),lo.fn.extend({detach:function(e){return Rs(this,e,!0)},remove:function(e){return Rs(this,e)},text:function(e){return Oo(this,(function(e){return void 0===e?lo.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Es(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ks(this,e).appendChild(e)}))},prepend:function(){return Es(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ks(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Es(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Es(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(lo.cleanData(is(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return lo.clone(this,e,t)}))},html:function(e){return Oo(this,(function(e){var t=this[0]||{},r=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!bs.test(e)&&!ns[(ts.exec(e)||["",""])[1].toLowerCase()]){e=lo.htmlPrefilter(e);try{for(;r<n;r++)1===(t=this[r]||{}).nodeType&&(lo.cleanData(is(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Es(this,arguments,(function(t){var r=this.parentNode;lo.inArray(this,e)<0&&(lo.cleanData(is(this)),r&&r.replaceChild(t,this))}),e)}}),lo.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){lo.fn[e]=function(e){for(var r,n=[],i=lo(e),a=i.length-1,o=0;o<=a;o++)r=o===a?this:this.clone(!0),lo(i[o])[t](r),Ka.apply(n,r.get());return this.pushStack(n)}}));var Ts=new RegExp("^("+Vo+")(?!px)[a-z%]+$","i"),Is=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=window),t.getComputedStyle(e)},Ls=new RegExp(Zo.join("|"),"i");function Ms(e,t,r){var n,i,a,o,s=e.style;return(r=r||Is(e))&&(""!==(o=r.getPropertyValue(t)||r[t])||lo.contains(e.ownerDocument,e)||(o=lo.style(e,t)),!io.pixelBoxStyles()&&Ts.test(o)&&Ls.test(t)&&(n=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=r.width,s.width=n,s.minWidth=i,s.maxWidth=a)),void 0!==o?o+"":o}function Ps(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",us.appendChild(s).appendChild(c);var e=window.getComputedStyle(c);r="1%"!==e.top,o=12===t(e.marginLeft),c.style.right="60%",a=36===t(e.right),n=36===t(e.width),c.style.position="absolute",i=36===c.offsetWidth||"absolute",us.removeChild(s),c=null}}function t(e){return Math.round(parseFloat(e))}var r,n,i,a,o,s=Wa.createElement("div"),c=Wa.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",io.clearCloneStyle="content-box"===c.style.backgroundClip,lo.extend(io,{boxSizingReliable:function(){return e(),n},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),o},scrollboxSize:function(){return e(),i}}))}();var Os=/^(none|table(?!-c[ea]).+)/,Fs=/^--/,Ns={position:"absolute",visibility:"hidden",display:"block"},Ds={letterSpacing:"0",fontWeight:"400"},Bs=["Webkit","Moz","ms"],zs=Wa.createElement("div").style;function Us(e){var t=lo.cssProps[e];return t||(t=lo.cssProps[e]=function(e){if(e in zs)return e;for(var t=e[0].toUpperCase()+e.slice(1),r=Bs.length;r--;)if((e=Bs[r]+t)in zs)return e}(e)||e),t}function Hs(e,t,r){var n=Wo.exec(t);return n?Math.max(0,n[2]-(r||0))+(n[3]||"px"):t}function $s(e,t,r,n,i,a){var o="width"===t?1:0,s=0,c=0;if(r===(n?"border":"content"))return 0;for(;o<4;o+=2)"margin"===r&&(c+=lo.css(e,r+Zo[o],!0,i)),n?("content"===r&&(c-=lo.css(e,"padding"+Zo[o],!0,i)),"margin"!==r&&(c-=lo.css(e,"border"+Zo[o]+"Width",!0,i))):(c+=lo.css(e,"padding"+Zo[o],!0,i),"padding"!==r?c+=lo.css(e,"border"+Zo[o]+"Width",!0,i):s+=lo.css(e,"border"+Zo[o]+"Width",!0,i));return!n&&a>=0&&(c+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-c-s-.5))),c}function js(e,t,r){var n=Is(e),i=Ms(e,t,n),a="border-box"===lo.css(e,"boxSizing",!1,n),o=a;if(Ts.test(i)){if(!r)return i;i="auto"}return o=o&&(io.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===lo.css(e,"display",!1,n))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],o=!0),(i=parseFloat(i)||0)+$s(e,t,r||(a?"border":"content"),o,n,i)+"px"}lo.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=Ms(e,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,o,s=Bo(t),c=Fs.test(t),h=e.style;if(c||(t=Us(s)),o=lo.cssHooks[t]||lo.cssHooks[s],void 0===r)return o&&"get"in o&&void 0!==(i=o.get(e,!1,n))?i:h[t];"string"===(a=qr(r))&&(i=Wo.exec(r))&&i[1]&&(r=function(e,t,r,n){var i,a,o=20,s=n?function(){return n.cur()}:function(){return lo.css(e,t,"")},c=s(),h=r&&r[3]||(lo.cssNumber[t]?"":"px"),u=(lo.cssNumber[t]||"px"!==h&&+c)&&Wo.exec(lo.css(e,t));if(u&&u[3]!==h){for(c/=2,h=h||u[3],u=+c||1;o--;)lo.style(e,t,u+h),(1-a)*(1-(a=s()/c||.5))<=0&&(o=0),u/=a;lo.style(e,t,(u*=2)+h),r=r||[]}return r&&(u=+u||+c||0,i=r[1]?u+(r[1]+1)*r[2]:+r[2],n&&(n.unit=h,n.start=u,n.end=i)),i}(e,t,i),a="number"),null!=r&&r==r&&("number"===a&&(r+=i&&i[3]||(lo.cssNumber[s]?"":"px")),io.clearCloneStyle||""!==r||0!==t.indexOf("background")||(h[t]="inherit"),o&&"set"in o&&void 0===(r=o.set(e,r,n))||(c?h.setProperty(t,r):h[t]=r))}},css:function(e,t,r,n){var i,a,o,s=Bo(t);return Fs.test(t)||(t=Us(s)),(o=lo.cssHooks[t]||lo.cssHooks[s])&&"get"in o&&(i=o.get(e,!0,r)),void 0===i&&(i=Ms(e,t,n)),"normal"===i&&t in Ds&&(i=Ds[t]),""===r||r?(a=parseFloat(i),!0===r||isFinite(a)?a||0:i):i}}),lo.each(["height","width"],(function(e,t){lo.cssHooks[t]={get:function(e,r,n){if(r)return!Os.test(lo.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?js(e,t,n):Xo(e,Ns,(function(){return js(e,t,n)}))},set:function(e,r,n){var i,a=Is(e),o="border-box"===lo.css(e,"boxSizing",!1,a),s=n&&$s(e,t,n,o,a);return o&&io.scrollboxSize()===a.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-$s(e,t,"border",!1,a)-.5)),s&&(i=Wo.exec(r))&&"px"!==(i[3]||"px")&&(e.style[t]=r,r=lo.css(e,t)),Hs(0,r,s)}}})),lo.cssHooks.marginLeft=Ps(io.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ms(e,"marginLeft"))||e.getBoundingClientRect().left-Xo(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),lo.each({margin:"",padding:"",border:"Width"},(function(e,t){lo.cssHooks[e+t]={expand:function(r){for(var n=0,i={},a="string"==typeof r?r.split(" "):[r];n<4;n++)i[e+Zo[n]+t]=a[n]||a[n-2]||a[0];return i}},"margin"!==e&&(lo.cssHooks[e+t].set=Hs)})),lo.fn.extend({css:function(e,t){return Oo(this,(function(e,t,r){var n,i,a={},o=0;if(Array.isArray(t)){for(n=Is(e),i=t.length;o<i;o++)a[t[o]]=lo.css(e,t[o],!1,n);return a}return void 0!==r?lo.style(e,t,r):lo.css(e,t)}),e,t,arguments.length>1)}}),lo.fn.delay=function(e,t){return e=lo.fx&&lo.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,r){var n=window.setTimeout(t,e);r.stop=function(){window.clearTimeout(n)}}))},function(){var e=Wa.createElement("input"),t=Wa.createElement("select").appendChild(Wa.createElement("option"));e.type="checkbox",io.checkOn=""!==e.value,io.optSelected=t.selected,(e=Wa.createElement("input")).value="t",e.type="radio",io.radioValue="t"===e.value}();var qs,Gs=lo.expr.attrHandle;lo.fn.extend({attr:function(e,t){return Oo(this,lo.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){lo.removeAttr(this,e)}))}}),lo.extend({attr:function(e,t,r){var n,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?lo.prop(e,t,r):(1===a&&lo.isXMLDoc(e)||(i=lo.attrHooks[t.toLowerCase()]||(lo.expr.match.bool.test(t)?qs:void 0)),void 0!==r?null===r?void lo.removeAttr(e,t):i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):i&&"get"in i&&null!==(n=i.get(e,t))?n:null==(n=lo.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!io.radioValue&&"radio"===t&&bo(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}},removeAttr:function(e,t){var r,n=0,i=t&&t.match(Eo);if(i&&1===e.nodeType)for(;r=i[n++];)e.removeAttribute(r)}}),qs={set:function(e,t,r){return!1===t?lo.removeAttr(e,r):e.setAttribute(r,r),r}},lo.each(lo.expr.match.bool.source.match(/\w+/g),(function(e,t){var r=Gs[t]||lo.find.attr;Gs[t]=function(e,t,n){var i,a,o=t.toLowerCase();return n||(a=Gs[o],Gs[o]=i,i=null!=r(e,t,n)?o:null,Gs[o]=a),i}}));var Vs=/^(?:input|select|textarea|button)$/i,Ws=/^(?:a|area)$/i;function Zs(e){return(e.match(Eo)||[]).join(" ")}function Ys(e){return e.getAttribute&&e.getAttribute("class")||""}function Xs(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(Eo)||[]}lo.fn.extend({prop:function(e,t){return Oo(this,lo.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[lo.propFix[e]||e]}))}}),lo.extend({prop:function(e,t,r){var n,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&lo.isXMLDoc(e)||(t=lo.propFix[t]||t,i=lo.propHooks[t]),void 0!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:e[t]=r:i&&"get"in i&&null!==(n=i.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=lo.find.attr(e,"tabindex");return t?parseInt(t,10):Vs.test(e.nodeName)||Ws.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),io.optSelected||(lo.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),lo.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){lo.propFix[this.toLowerCase()]=this})),lo.fn.extend({addClass:function(e){var t,r,n,i,a,o,s,c=0;if(ao(e))return this.each((function(t){lo(this).addClass(e.call(this,t,Ys(this)))}));if((t=Xs(e)).length)for(;r=this[c++];)if(i=Ys(r),n=1===r.nodeType&&" "+Zs(i)+" "){for(o=0;a=t[o++];)n.indexOf(" "+a+" ")<0&&(n+=a+" ");i!==(s=Zs(n))&&r.setAttribute("class",s)}return this},removeClass:function(e){var t,r,n,i,a,o,s,c=0;if(ao(e))return this.each((function(t){lo(this).removeClass(e.call(this,t,Ys(this)))}));if(!arguments.length)return this.attr("class","");if((t=Xs(e)).length)for(;r=this[c++];)if(i=Ys(r),n=1===r.nodeType&&" "+Zs(i)+" "){for(o=0;a=t[o++];)for(;n.indexOf(" "+a+" ")>-1;)n=n.replace(" "+a+" "," ");i!==(s=Zs(n))&&r.setAttribute("class",s)}return this},toggleClass:function(e,t){var r=qr(e),n="string"===r||Array.isArray(e);return"boolean"==typeof t&&n?t?this.addClass(e):this.removeClass(e):ao(e)?this.each((function(r){lo(this).toggleClass(e.call(this,r,Ys(this),t),t)})):this.each((function(){var t,i,a,o;if(n)for(i=0,a=lo(this),o=Xs(e);t=o[i++];)a.hasClass(t)?a.removeClass(t):a.addClass(t);else void 0!==e&&"boolean"!==r||((t=Ys(this))&&Ho.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Ho.get(this,"__className__")||""))}))},hasClass:function(e){var t,r,n=0;for(t=" "+e+" ";r=this[n++];)if(1===r.nodeType&&(" "+Zs(Ys(r))+" ").indexOf(t)>-1)return!0;return!1}});var Ks=/\r/g;lo.fn.extend({val:function(e){var t,r,n,i=this[0];return arguments.length?(n=ao(e),this.each((function(r){var i;1===this.nodeType&&(null==(i=n?e.call(this,r,lo(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=lo.map(i,(function(e){return null==e?"":e+""}))),(t=lo.valHooks[this.type]||lo.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=lo.valHooks[i.type]||lo.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(r=t.get(i,"value"))?r:"string"==typeof(r=i.value)?r.replace(Ks,""):null==r?"":r:void 0}}),lo.extend({valHooks:{option:{get:function(e){var t=lo.find.attr(e,"value");return null!=t?t:Zs(lo.text(e))}},select:{get:function(e){var t,r,n,i=e.options,a=e.selectedIndex,o="select-one"===e.type,s=o?null:[],c=o?a+1:i.length;for(n=a<0?c:o?a:0;n<c;n++)if(((r=i[n]).selected||n===a)&&!r.disabled&&(!r.parentNode.disabled||!bo(r.parentNode,"optgroup"))){if(t=lo(r).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var r,n,i=e.options,a=lo.makeArray(t),o=i.length;o--;)((n=i[o]).selected=lo.inArray(lo.valHooks.option.get(n),a)>-1)&&(r=!0);return r||(e.selectedIndex=-1),a}}}}),lo.each(["radio","checkbox"],(function(){lo.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=lo.inArray(lo(e).val(),t)>-1}},io.checkOn||(lo.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),io.focusin="onfocusin"in window;var Qs=/^(?:focusinfocus|focusoutblur)$/,Js=function(e){e.stopPropagation()};lo.extend(lo.event,{trigger:function(e,t,r,n){var i,a,o,s,c,h,u,l,f=[r||Wa],p=to.call(e,"type")?e.type:e,d=to.call(e,"namespace")?e.namespace.split("."):[];if(a=l=o=r=r||Wa,3!==r.nodeType&&8!==r.nodeType&&!Qs.test(p+lo.event.triggered)&&(p.indexOf(".")>-1&&(d=p.split("."),p=d.shift(),d.sort()),c=p.indexOf(":")<0&&"on"+p,(e=e[lo.expando]?e:new lo.Event(p,"object"===qr(e)&&e)).isTrigger=n?2:3,e.namespace=d.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:lo.makeArray(t,[e]),u=lo.event.special[p]||{},n||!u.trigger||!1!==u.trigger.apply(r,t))){if(!n&&!u.noBubble&&!oo(r)){for(s=u.delegateType||p,Qs.test(s+p)||(a=a.parentNode);a;a=a.parentNode)f.push(a),o=a;o===(r.ownerDocument||Wa)&&f.push(o.defaultView||o.parentWindow||window)}for(i=0;(a=f[i++])&&!e.isPropagationStopped();)l=a,e.type=i>1?s:u.bindType||p,(h=(Ho.get(a,"events")||{})[e.type]&&Ho.get(a,"handle"))&&h.apply(a,t),(h=c&&a[c])&&h.apply&&zo(a)&&(e.result=h.apply(a,t),!1===e.result&&e.preventDefault());return e.type=p,n||e.isDefaultPrevented()||u._default&&!1!==u._default.apply(f.pop(),t)||!zo(r)||c&&ao(r[p])&&!oo(r)&&((o=r[c])&&(r[c]=null),lo.event.triggered=p,e.isPropagationStopped()&&l.addEventListener(p,Js),r[p](),e.isPropagationStopped()&&l.removeEventListener(p,Js),lo.event.triggered=void 0,o&&(r[c]=o)),e.result}},simulate:function(e,t,r){var n=lo.extend(new lo.Event,r,{type:e,isSimulated:!0});lo.event.trigger(n,null,t)}}),lo.fn.extend({trigger:function(e,t){return this.each((function(){lo.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var r=this[0];if(r)return lo.event.trigger(e,t,r,!0)}}),io.focusin||lo.each({focus:"focusin",blur:"focusout"},(function(e,t){var r=function(e){lo.event.simulate(t,e.target,lo.event.fix(e))};lo.event.special[t]={setup:function(){var n=this.ownerDocument||this,i=Ho.access(n,t);i||n.addEventListener(e,r,!0),Ho.access(n,t,(i||0)+1)},teardown:function(){var n=this.ownerDocument||this,i=Ho.access(n,t)-1;i?Ho.access(n,t,i):(n.removeEventListener(e,r,!0),Ho.remove(n,t))}}}));var ec,tc=/\[\]$/,rc=/\r?\n/g,nc=/^(?:submit|button|image|reset|file)$/i,ic=/^(?:input|select|textarea|keygen)/i;function ac(e,t,r,n){var i;if(Array.isArray(t))lo.each(t,(function(t,i){r||tc.test(e)?n(e,i):ac(e+"["+("object"===qr(i)&&null!=i?t:"")+"]",i,r,n)}));else if(r||"object"!==ho(t))n(e,t);else for(i in t)ac(e+"["+i+"]",t[i],r,n)}lo.param=function(e,t){var r,n=[],i=function(e,t){var r=ao(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==r?"":r)};if(Array.isArray(e)||e.jquery&&!lo.isPlainObject(e))lo.each(e,(function(){i(this.name,this.value)}));else for(r in e)ac(r,e[r],t,i);return n.join("&")},lo.fn.extend({serialize:function(){return lo.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=lo.prop(this,"elements");return e?lo.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!lo(this).is(":disabled")&&ic.test(this.nodeName)&&!nc.test(e)&&(this.checked||!es.test(e))})).map((function(e,t){var r=lo(this).val();return null==r?null:Array.isArray(r)?lo.map(r,(function(e){return{name:t.name,value:e.replace(rc,"\r\n")}})):{name:t.name,value:r.replace(rc,"\r\n")}})).get()}}),lo.fn.extend({wrapAll:function(e){var t;return this[0]&&(ao(e)&&(e=e.call(this[0])),t=lo(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return ao(e)?this.each((function(t){lo(this).wrapInner(e.call(this,t))})):this.each((function(){var t=lo(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)}))},wrap:function(e){var t=ao(e);return this.each((function(r){lo(this).wrapAll(t?e.call(this,r):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){lo(this).replaceWith(this.childNodes)})),this}}),lo.expr.pseudos.hidden=function(e){return!lo.expr.pseudos.visible(e)},lo.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},io.createHTMLDocument=((ec=Wa.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===ec.childNodes.length),lo.parseHTML=function(e,t,r){return"string"!=typeof e?[]:("boolean"==typeof t&&(r=t,t=!1),t||(io.createHTMLDocument?((n=(t=Wa.implementation.createHTMLDocument("")).createElement("base")).href=Wa.location.href,t.head.appendChild(n)):t=Wa),a=!r&&[],(i=wo.exec(e))?[t.createElement(i[1])]:(i=hs([e],t,a),a&&a.length&&lo(a).remove(),lo.merge([],i.childNodes)));var n,i,a},lo.offset={setOffset:function(e,t,r){var n,i,a,o,s,c,h=lo.css(e,"position"),u=lo(e),l={};"static"===h&&(e.style.position="relative"),s=u.offset(),a=lo.css(e,"top"),c=lo.css(e,"left"),("absolute"===h||"fixed"===h)&&(a+c).indexOf("auto")>-1?(o=(n=u.position()).top,i=n.left):(o=parseFloat(a)||0,i=parseFloat(c)||0),ao(t)&&(t=t.call(e,r,lo.extend({},s))),null!=t.top&&(l.top=t.top-s.top+o),null!=t.left&&(l.left=t.left-s.left+i),"using"in t?t.using.call(e,l):u.css(l)}},lo.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){lo.offset.setOffset(this,e,t)}));var t,r,n=this[0];return n?n.getClientRects().length?(t=n.getBoundingClientRect(),r=n.ownerDocument.defaultView,{top:t.top+r.pageYOffset,left:t.left+r.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,r,n=this[0],i={top:0,left:0};if("fixed"===lo.css(n,"position"))t=n.getBoundingClientRect();else{for(t=this.offset(),r=n.ownerDocument,e=n.offsetParent||r.documentElement;e&&(e===r.body||e===r.documentElement)&&"static"===lo.css(e,"position");)e=e.parentNode;e&&e!==n&&1===e.nodeType&&((i=lo(e).offset()).top+=lo.css(e,"borderTopWidth",!0),i.left+=lo.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-lo.css(n,"marginTop",!0),left:t.left-i.left-lo.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===lo.css(e,"position");)e=e.offsetParent;return e||us}))}}),lo.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var r="pageYOffset"===t;lo.fn[e]=function(n){return Oo(this,(function(e,n,i){var a;if(oo(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===i)return a?a[t]:e[n];a?a.scrollTo(r?a.pageXOffset:i,r?i:a.pageYOffset):e[n]=i}),e,n,arguments.length)}})),lo.each(["top","left"],(function(e,t){lo.cssHooks[t]=Ps(io.pixelPosition,(function(e,r){if(r)return r=Ms(e,t),Ts.test(r)?lo(e).position()[t]+"px":r}))})),lo.each({Height:"height",Width:"width"},(function(e,t){lo.each({padding:"inner"+e,content:t,"":"outer"+e},(function(r,n){lo.fn[n]=function(i,a){var o=arguments.length&&(r||"boolean"!=typeof i),s=r||(!0===i||!0===a?"margin":"border");return Oo(this,(function(t,r,i){var a;return oo(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===i?lo.css(t,r,s):lo.style(t,r,i,s)}),t,o?i:void 0,o)}}))})),lo.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){lo.fn[t]=function(e,r){return arguments.length>0?this.on(t,null,e,r):this.trigger(t)}})),lo.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),lo.fn.extend({bind:function(e,t,r){return this.on(e,null,t,r)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,r,n){return this.on(t,e,r,n)},undelegate:function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)}}),lo.proxy=function(e,t){var r,n,i;if("string"==typeof t&&(r=e[t],t=e,e=r),ao(e))return n=Ya.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(Ya.call(arguments)))}).guid=e.guid=e.guid||lo.guid++,i},lo.holdReady=function(e){e?lo.readyWait++:lo.ready(!0)},lo.isArray=Array.isArray,lo.parseJSON=JSON.parse,lo.nodeName=bo,lo.isFunction=ao,lo.isWindow=oo,lo.camelCase=Bo,lo.type=ho,lo.now=Date.now,lo.isNumeric=function(e){var t=lo.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))};var oc=lo,sc=Object.assign,cc=Object.defineProperty,hc=!sc||s((function(){if(c&&1!==sc({b:1},sc(cc({},"a",{enumerable:!0,get:function(){cc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=sc({},e)[r]||"abcdefghijklmnopqrst"!=Tt(sc({},t)).join("")}))?function(e,t){for(var r=De(e),n=arguments.length,i=1,a=Se.f,o=l.f;n>i;)for(var s,h=v(arguments[i++]),u=a?Tt(h).concat(a(h)):Tt(h),f=u.length,p=0;f>p;)s=u[p++],c&&!o.call(h,s)||(r[s]=h[s]);return r}:sc;Oe({target:"Object",stat:!0,forced:Object.assign!==hc},{assign:hc});var uc=vn.f,lc=s((function(){return!Object.getOwnPropertyNames(1)}));Oe({target:"Object",stat:!0,forced:lc},{getOwnPropertyNames:uc});var fc=s((function(){Tt(1)}));Oe({target:"Object",stat:!0,forced:fc},{keys:function(e){return Tt(De(e))}});var pc=o.Promise,dc=function(e,t,r){for(var n in t)ie(e,n,t[n],r);return e},gc=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},vc=qe("iterator"),mc=Array.prototype,yc=function(e){return void 0!==e&&(wi.Array===e||mc[vc]===e)},bc=qe("iterator"),wc=function(e){if(null!=e)return e[bc]||e["@@iterator"]||wi[ha(e)]},xc=function(e,t,r,n){try{return n?t(T(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&T(i.call(e)),t}},kc=i((function(e){var t=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,r,n,i,a){var o,s,c,h,u,l,f,p=Ne(r,n,i?2:1);if(a)o=e;else{if("function"!=typeof(s=wc(e)))throw TypeError("Target is not iterable");if(yc(s)){for(c=0,h=fe(e.length);h>c;c++)if((u=i?p(T(f=e[c])[0],f[1]):p(e[c]))&&u instanceof t)return u;return new t(!1)}o=s.call(e)}for(l=o.next;!(f=l.call(o)).done;)if("object"==typeof(u=xc(o,p,f.value,i))&&u&&u instanceof t)return u;return new t(!1)}).stop=function(e){return new t(!0,e)}})),Sc=qe("iterator"),_c=!1;try{var Cc=0,Ac={next:function(){return{done:!!Cc++}},return:function(){_c=!0}};Ac[Sc]=function(){return this},Array.from(Ac,(function(){throw 2}))}catch(e){}var Ec,Rc,Tc,Ic=function(e,t){if(!t&&!_c)return!1;var r=!1;try{var n={};n[Sc]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},Lc=/(iphone|ipod|ipad).*applewebkit/i.test(Xe),Mc=o.location,Pc=o.setImmediate,Oc=o.clearImmediate,Fc=o.process,Nc=o.MessageChannel,Dc=o.Dispatch,Bc=0,zc={},Uc=function(e){if(zc.hasOwnProperty(e)){var t=zc[e];delete zc[e],t()}},Hc=function(e){return function(){Uc(e)}},$c=function(e){Uc(e.data)},jc=function(e){o.postMessage(e+"",Mc.protocol+"//"+Mc.host)};Pc&&Oc||(Pc=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return zc[++Bc]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Ec(Bc),Bc},Oc=function(e){delete zc[e]},"process"==d(Fc)?Ec=function(e){Fc.nextTick(Hc(e))}:Dc&&Dc.now?Ec=function(e){Dc.now(Hc(e))}:Nc&&!Lc?(Tc=(Rc=new Nc).port2,Rc.port1.onmessage=$c,Ec=Ne(Tc.postMessage,Tc,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||s(jc)?Ec="onreadystatechange"in C("script")?function(e){Lt.appendChild(C("script")).onreadystatechange=function(){Lt.removeChild(this),Uc(e)}}:function(e){setTimeout(Hc(e),0)}:(Ec=jc,o.addEventListener("message",$c,!1)));var qc,Gc,Vc,Wc,Zc,Yc,Xc,Kc,Qc={set:Pc,clear:Oc},Jc=R.f,eh=Qc.set,th=o.MutationObserver||o.WebKitMutationObserver,rh=o.process,nh=o.Promise,ih="process"==d(rh),ah=Jc(o,"queueMicrotask"),oh=ah&&ah.value;oh||(qc=function(){var e,t;for(ih&&(e=rh.domain)&&e.exit();Gc;){t=Gc.fn,Gc=Gc.next;try{t()}catch(e){throw Gc?Wc():Vc=void 0,e}}Vc=void 0,e&&e.enter()},ih?Wc=function(){rh.nextTick(qc)}:th&&!Lc?(Zc=!0,Yc=document.createTextNode(""),new th(qc).observe(Yc,{characterData:!0}),Wc=function(){Yc.data=Zc=!Zc}):nh&&nh.resolve?(Xc=nh.resolve(void 0),Kc=Xc.then,Wc=function(){Kc.call(Xc,qc)}):Wc=function(){eh.call(o,qc)});var sh,ch,hh,uh,lh=oh||function(e){var t={fn:e,next:void 0};Vc&&(Vc.next=t),Gc||(Gc=t,Wc()),Vc=t},fh=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=Fe(t),this.reject=Fe(r)},ph={f:function(e){return new fh(e)}},dh=function(e,t){if(T(e),b(t)&&t.constructor===e)return t;var r=ph.f(e);return(0,r.resolve)(t),r.promise},gh=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},vh=Qc.set,mh=qe("species"),yh="Promise",bh=ne.get,wh=ne.set,xh=ne.getterFor(yh),kh=pc,Sh=o.TypeError,_h=o.document,Ch=o.process,Ah=se("fetch"),Eh=ph.f,Rh=Eh,Th="process"==d(Ch),Ih=!!(_h&&_h.createEvent&&o.dispatchEvent),Lh=Me(yh,(function(){if(z(kh)===String(kh)){if(66===et)return!0;if(!Th&&"function"!=typeof PromiseRejectionEvent)return!0}if(et>=51&&/native code/.test(kh))return!1;var e=kh.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[mh]=t,!(e.then((function(){}))instanceof t)})),Mh=Lh||!Ic((function(e){kh.all(e).catch((function(){}))})),Ph=function(e){var t;return!(!b(e)||"function"!=typeof(t=e.then))&&t},Oh=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;lh((function(){for(var i=t.value,a=1==t.state,o=0;n.length>o;){var s,c,h,u=n[o++],l=a?u.ok:u.fail,f=u.resolve,p=u.reject,d=u.domain;try{l?(a||(2===t.rejection&&Bh(e,t),t.rejection=1),!0===l?s=i:(d&&d.enter(),s=l(i),d&&(d.exit(),h=!0)),s===u.promise?p(Sh("Promise-chain cycle")):(c=Ph(s))?c.call(s,f,p):f(s)):p(i)}catch(e){d&&!h&&d.exit(),p(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&Nh(e,t)}))}},Fh=function(e,t,r){var n,i;Ih?((n=_h.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),o.dispatchEvent(n)):n={promise:t,reason:r},(i=o["on"+e])?i(n):"unhandledrejection"===e&&function(e,t){var r=o.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},Nh=function(e,t){vh.call(o,(function(){var r,n=t.value;if(Dh(t)&&(r=gh((function(){Th?Ch.emit("unhandledRejection",n,e):Fh("unhandledrejection",e,n)})),t.rejection=Th||Dh(t)?2:1,r.error))throw r.value}))},Dh=function(e){return 1!==e.rejection&&!e.parent},Bh=function(e,t){vh.call(o,(function(){Th?Ch.emit("rejectionHandled",e):Fh("rejectionhandled",e,t.value)}))},zh=function(e,t,r,n){return function(i){e(t,r,i,n)}},Uh=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,Oh(e,t,!0))},Hh=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw Sh("Promise can't be resolved itself");var i=Ph(r);i?lh((function(){var n={done:!1};try{i.call(r,zh(Hh,e,n,t),zh(Uh,e,n,t))}catch(r){Uh(e,n,r,t)}})):(t.value=r,t.state=1,Oh(e,t,!1))}catch(r){Uh(e,{done:!1},r,t)}}};Lh&&(kh=function(e){gc(this,kh,yh),Fe(e),sh.call(this);var t=bh(this);try{e(zh(Hh,this,t),zh(Uh,this,t))}catch(e){Uh(this,t,e)}},(sh=function(e){wh(this,{type:yh,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=dc(kh.prototype,{then:function(e,t){var r=xh(this),n=Eh(Mr(this,kh));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=Th?Ch.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&Oh(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),ch=function(){var e=new sh,t=bh(e);this.promise=e,this.resolve=zh(Hh,e,t),this.reject=zh(Uh,e,t)},ph.f=Eh=function(e){return e===kh||e===hh?new ch(e):Rh(e)},"function"==typeof pc&&(uh=pc.prototype.then,ie(pc.prototype,"then",(function(e,t){var r=this;return new kh((function(e,t){uh.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Ah&&Oe({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return dh(kh,Ah.apply(o,arguments))}}))),Oe({global:!0,wrap:!0,forced:Lh},{Promise:kh}),kn(kh,yh,!1),fa(yh),hh=se(yh),Oe({target:yh,stat:!0,forced:Lh},{reject:function(e){var t=Eh(this);return t.reject.call(void 0,e),t.promise}}),Oe({target:yh,stat:!0,forced:Lh},{resolve:function(e){return dh(this,e)}}),Oe({target:yh,stat:!0,forced:Mh},{all:function(e){var t=this,r=Eh(t),n=r.resolve,i=r.reject,a=gh((function(){var r=Fe(t.resolve),a=[],o=0,s=1;kc(e,(function(e){var c=o++,h=!1;a.push(void 0),s++,r.call(t,e).then((function(e){h||(h=!0,a[c]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise},race:function(e){var t=this,r=Eh(t),n=r.reject,i=gh((function(){var i=Fe(t.resolve);kc(e,(function(e){i.call(t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var $h=R.f,jh="".startsWith,qh=Math.min,Gh=vr("startsWith"),Vh=!Gh&&!!function(){var e=$h(String.prototype,"startsWith");return e&&!e.writable}();Oe({target:"String",proto:!0,forced:!Vh&&!Gh},{startsWith:function(e){var t=String(m(this));dr(e);var r=fe(qh(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return jh?jh.call(t,n,r):t.slice(r,r+n.length)===n}});var Wh=$t.trim;Oe({target:"String",proto:!0,forced:function(e){return s((function(){return!!Dt[e]()||"​᠎"!="​᠎"[e]()||Dt[e].name!==e}))}("trim")},{trim:function(){return Wh(this)}});var Zh=qe("iterator"),Yh=!s((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Zh]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),Xh=function(e){var t,r,n,i,a,o,s=De(e),c="function"==typeof this?this:Array,h=arguments.length,u=h>1?arguments[1]:void 0,l=void 0!==u,f=wc(s),p=0;if(l&&(u=Ne(u,h>2?arguments[2]:void 0,2)),null==f||c==Array&&yc(f))for(r=new c(t=fe(s.length));t>p;p++)o=l?u(s[p],p):s[p],oi(r,p,o);else for(a=(i=f.call(s)).next,r=new c;!(n=a.call(i)).done;p++)o=l?xc(i,u,[n.value,p],!0):n.value,oi(r,p,o);return r.length=p,r},Kh=/[^\0-\u007E]/,Qh=/[.\u3002\uFF0E\uFF61]/g,Jh="Overflow: input needs wider integers to process",eu=Math.floor,tu=String.fromCharCode,ru=function(e){return e+22+75*(e<26)},nu=function(e,t,r){var n=0;for(e=r?eu(e/700):e>>1,e+=eu(e/t);e>455;n+=36)e=eu(e/35);return eu(n+36*e/(e+38))},iu=function(e){var t,r,n=[],i=(e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),r--)}else t.push(i)}return t}(e)).length,a=128,o=0,s=72;for(t=0;t<e.length;t++)(r=e[t])<128&&n.push(tu(r));var c=n.length,h=c;for(c&&n.push("-");h<i;){var u=2147483647;for(t=0;t<e.length;t++)(r=e[t])>=a&&r<u&&(u=r);var l=h+1;if(u-a>eu((2147483647-o)/l))throw RangeError(Jh);for(o+=(u-a)*l,a=u,t=0;t<e.length;t++){if((r=e[t])<a&&++o>2147483647)throw RangeError(Jh);if(r==a){for(var f=o,p=36;;p+=36){var d=p<=s?1:p>=s+26?26:p-s;if(f<d)break;var g=f-d,v=36-d;n.push(tu(ru(d+g%v))),f=eu(g/v)}n.push(tu(ru(f))),s=nu(o,l,h==c),o=0,++h}}++o,++a}return n.join("")},au=function(e){var t=wc(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return T(t.call(e))},ou=se("fetch"),su=se("Headers"),cu=qe("iterator"),hu=ne.set,uu=ne.getterFor("URLSearchParams"),lu=ne.getterFor("URLSearchParamsIterator"),fu=/\+/g,pu=Array(4),du=function(e){return pu[e-1]||(pu[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},gu=function(e){try{return decodeURIComponent(e)}catch(t){return e}},vu=function(e){var t=e.replace(fu," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=t.replace(du(r--),gu);return t}},mu=/[!'()~]|%20/g,yu={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},bu=function(e){return yu[e]},wu=function(e){return encodeURIComponent(e).replace(mu,bu)},xu=function(e,t){if(t)for(var r,n,i=t.split("&"),a=0;a<i.length;)(r=i[a++]).length&&(n=r.split("="),e.push({key:vu(n.shift()),value:vu(n.join("="))}))},ku=function(e){this.entries.length=0,xu(this.entries,e)},Su=function(e,t){if(e<t)throw TypeError("Not enough arguments")},_u=Ii((function(e,t){hu(this,{type:"URLSearchParamsIterator",iterator:au(uu(e).entries),kind:t})}),"Iterator",(function(){var e=lu(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r})),Cu=function(){gc(this,Cu,"URLSearchParams");var e,t,r,n,i,a,o,s,c,h=arguments.length>0?arguments[0]:void 0,u=this,l=[];if(hu(u,{type:"URLSearchParams",entries:l,updateURL:function(){},updateSearchParams:ku}),void 0!==h)if(b(h))if("function"==typeof(e=wc(h)))for(r=(t=e.call(h)).next;!(n=r.call(t)).done;){if((o=(a=(i=au(T(n.value))).next).call(i)).done||(s=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");l.push({key:o.value+"",value:s.value+""})}else for(c in h)k(h,c)&&l.push({key:c,value:h[c]+""});else xu(l,"string"==typeof h?"?"===h.charAt(0)?h.slice(1):h:h+"")},Au=Cu.prototype;dc(Au,{append:function(e,t){Su(arguments.length,2);var r=uu(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){Su(arguments.length,1);for(var t=uu(this),r=t.entries,n=e+"",i=0;i<r.length;)r[i].key===n?r.splice(i,1):i++;t.updateURL()},get:function(e){Su(arguments.length,1);for(var t=uu(this).entries,r=e+"",n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){Su(arguments.length,1);for(var t=uu(this).entries,r=e+"",n=[],i=0;i<t.length;i++)t[i].key===r&&n.push(t[i].value);return n},has:function(e){Su(arguments.length,1);for(var t=uu(this).entries,r=e+"",n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){Su(arguments.length,1);for(var r,n=uu(this),i=n.entries,a=!1,o=e+"",s=t+"",c=0;c<i.length;c++)(r=i[c]).key===o&&(a?i.splice(c--,1):(a=!0,r.value=s));a||i.push({key:o,value:s}),n.updateURL()},sort:function(){var e,t,r,n=uu(this),i=n.entries,a=i.slice();for(i.length=0,r=0;r<a.length;r++){for(e=a[r],t=0;t<r;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===r&&i.push(e)}n.updateURL()},forEach:function(e){for(var t,r=uu(this).entries,n=Ne(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new _u(this,"keys")},values:function(){return new _u(this,"values")},entries:function(){return new _u(this,"entries")}},{enumerable:!0}),ie(Au,cu,Au.entries),ie(Au,"toString",(function(){for(var e,t=uu(this).entries,r=[],n=0;n<t.length;)e=t[n++],r.push(wu(e.key)+"="+wu(e.value));return r.join("&")}),{enumerable:!0}),kn(Cu,"URLSearchParams"),Oe({global:!0,forced:!Yh},{URLSearchParams:Cu}),Yh||"function"!=typeof ou||"function"!=typeof su||Oe({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,r,n,i=[e];return arguments.length>1&&(t=arguments[1],b(t)&&(r=t.body,"URLSearchParams"===ha(r)&&((n=t.headers?new su(t.headers):new su).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Nt(t,{body:f(0,String(r)),headers:f(0,n)}))),i.push(t)),ou.apply(this,i)}});var Eu,Ru={URLSearchParams:Cu,getState:uu},Tu=Or.codeAt,Iu=o.URL,Lu=Ru.URLSearchParams,Mu=Ru.getState,Pu=ne.set,Ou=ne.getterFor("URL"),Fu=Math.floor,Nu=Math.pow,Du=/[A-Za-z]/,Bu=/[\d+\-.A-Za-z]/,zu=/\d/,Uu=/^(0x|0X)/,Hu=/^[0-7]+$/,$u=/^\d+$/,ju=/^[\dA-Fa-f]+$/,qu=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,Gu=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,Vu=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Wu=/[\u0009\u000A\u000D]/g,Zu=function(e,t){var r,n,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(r=Xu(t.slice(1,-1))))return"Invalid host";e.host=r}else if(il(e)){if(t=function(e){var t,r,n=[],i=e.toLowerCase().replace(Qh,".").split(".");for(t=0;t<i.length;t++)r=i[t],n.push(Kh.test(r)?"xn--"+iu(r):r);return n.join(".")}(t),qu.test(t))return"Invalid host";if(null===(r=Yu(t)))return"Invalid host";e.host=r}else{if(Gu.test(t))return"Invalid host";for(r="",n=Xh(t),i=0;i<n.length;i++)r+=rl(n[i],Qu);e.host=r}},Yu=function(e){var t,r,n,i,a,o,s,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(i=c[n]))return e;if(a=10,i.length>1&&"0"==i.charAt(0)&&(a=Uu.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?$u:8==a?Hu:ju).test(i))return e;o=parseInt(i,a)}r.push(o)}for(n=0;n<t;n++)if(o=r[n],n==t-1){if(o>=Nu(256,5-t))return null}else if(o>255)return null;for(s=r.pop(),n=0;n<r.length;n++)s+=r[n]*Nu(256,3-n);return s},Xu=function(e){var t,r,n,i,a,o,s,c=[0,0,0,0,0,0,0,0],h=0,u=null,l=0,f=function(){return e.charAt(l)};if(":"==f()){if(":"!=e.charAt(1))return;l+=2,u=++h}for(;f();){if(8==h)return;if(":"!=f()){for(t=r=0;r<4&&ju.test(f());)t=16*t+parseInt(f(),16),l++,r++;if("."==f()){if(0==r)return;if(l-=r,h>6)return;for(n=0;f();){if(i=null,n>0){if(!("."==f()&&n<4))return;l++}if(!zu.test(f()))return;for(;zu.test(f());){if(a=parseInt(f(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;l++}c[h]=256*c[h]+i,2!=++n&&4!=n||h++}if(4!=n)return;break}if(":"==f()){if(l++,!f())return}else if(f())return;c[h++]=t}else{if(null!==u)return;l++,u=++h}}if(null!==u)for(o=h-u,h=7;0!=h&&o>0;)s=c[h],c[h--]=c[u+o-1],c[u+--o]=s;else if(8!=h)return;return c},Ku=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=Fu(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,a=0;a<8;a++)0!==e[a]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=a),++i);return i>r&&(t=n,r=i),t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},Qu={},Ju=hc({},Qu,{" ":1,'"':1,"<":1,">":1,"`":1}),el=hc({},Ju,{"#":1,"?":1,"{":1,"}":1}),tl=hc({},el,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),rl=function(e,t){var r=Tu(e,0);return r>32&&r<127&&!k(t,e)?e:encodeURIComponent(e)},nl={ftp:21,file:null,http:80,https:443,ws:80,wss:443},il=function(e){return k(nl,e.scheme)},al=function(e){return""!=e.username||""!=e.password},ol=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},sl=function(e,t){var r;return 2==e.length&&Du.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},cl=function(e){var t;return e.length>1&&sl(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},hl=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&sl(t[0],!0)||t.pop()},ul=function(e){return"."===e||"%2e"===e.toLowerCase()},ll={},fl={},pl={},dl={},gl={},vl={},ml={},yl={},bl={},wl={},xl={},kl={},Sl={},_l={},Cl={},Al={},El={},Rl={},Tl={},Il={},Ll={},Ml=function(e,t,r,n){var i,a,o,s,c,h=r||ll,u=0,l="",f=!1,p=!1,d=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(Vu,"")),t=t.replace(Wu,""),i=Xh(t);u<=i.length;){switch(a=i[u],h){case ll:if(!a||!Du.test(a)){if(r)return"Invalid scheme";h=pl;continue}l+=a.toLowerCase(),h=fl;break;case fl:if(a&&(Bu.test(a)||"+"==a||"-"==a||"."==a))l+=a.toLowerCase();else{if(":"!=a){if(r)return"Invalid scheme";l="",h=pl,u=0;continue}if(r&&(il(e)!=k(nl,l)||"file"==l&&(al(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=l,r)return void(il(e)&&nl[e.scheme]==e.port&&(e.port=null));l="","file"==e.scheme?h=_l:il(e)&&n&&n.scheme==e.scheme?h=dl:il(e)?h=yl:"/"==i[u+1]?(h=gl,u++):(e.cannotBeABaseURL=!0,e.path.push(""),h=Tl)}break;case pl:if(!n||n.cannotBeABaseURL&&"#"!=a)return"Invalid scheme";if(n.cannotBeABaseURL&&"#"==a){e.scheme=n.scheme,e.path=n.path.slice(),e.query=n.query,e.fragment="",e.cannotBeABaseURL=!0,h=Ll;break}h="file"==n.scheme?_l:vl;continue;case dl:if("/"!=a||"/"!=i[u+1]){h=vl;continue}h=bl,u++;break;case gl:if("/"==a){h=wl;break}h=Rl;continue;case vl:if(e.scheme=n.scheme,a==Eu)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query;else if("/"==a||"\\"==a&&il(e))h=ml;else if("?"==a)e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query="",h=Il;else{if("#"!=a){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.path.pop(),h=Rl;continue}e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,e.path=n.path.slice(),e.query=n.query,e.fragment="",h=Ll}break;case ml:if(!il(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=n.username,e.password=n.password,e.host=n.host,e.port=n.port,h=Rl;continue}h=wl}else h=bl;break;case yl:if(h=bl,"/"!=a||"/"!=l.charAt(u+1))continue;u++;break;case bl:if("/"!=a&&"\\"!=a){h=wl;continue}break;case wl:if("@"==a){f&&(l="%40"+l),f=!0,o=Xh(l);for(var g=0;g<o.length;g++){var v=o[g];if(":"!=v||d){var m=rl(v,tl);d?e.password+=m:e.username+=m}else d=!0}l=""}else if(a==Eu||"/"==a||"?"==a||"#"==a||"\\"==a&&il(e)){if(f&&""==l)return"Invalid authority";u-=Xh(l).length+1,l="",h=xl}else l+=a;break;case xl:case kl:if(r&&"file"==e.scheme){h=Al;continue}if(":"!=a||p){if(a==Eu||"/"==a||"?"==a||"#"==a||"\\"==a&&il(e)){if(il(e)&&""==l)return"Invalid host";if(r&&""==l&&(al(e)||null!==e.port))return;if(s=Zu(e,l))return s;if(l="",h=El,r)return;continue}"["==a?p=!0:"]"==a&&(p=!1),l+=a}else{if(""==l)return"Invalid host";if(s=Zu(e,l))return s;if(l="",h=Sl,r==kl)return}break;case Sl:if(!zu.test(a)){if(a==Eu||"/"==a||"?"==a||"#"==a||"\\"==a&&il(e)||r){if(""!=l){var y=parseInt(l,10);if(y>65535)return"Invalid port";e.port=il(e)&&y===nl[e.scheme]?null:y,l=""}if(r)return;h=El;continue}return"Invalid port"}l+=a;break;case _l:if(e.scheme="file","/"==a||"\\"==a)h=Cl;else{if(!n||"file"!=n.scheme){h=Rl;continue}if(a==Eu)e.host=n.host,e.path=n.path.slice(),e.query=n.query;else if("?"==a)e.host=n.host,e.path=n.path.slice(),e.query="",h=Il;else{if("#"!=a){cl(i.slice(u).join(""))||(e.host=n.host,e.path=n.path.slice(),hl(e)),h=Rl;continue}e.host=n.host,e.path=n.path.slice(),e.query=n.query,e.fragment="",h=Ll}}break;case Cl:if("/"==a||"\\"==a){h=Al;break}n&&"file"==n.scheme&&!cl(i.slice(u).join(""))&&(sl(n.path[0],!0)?e.path.push(n.path[0]):e.host=n.host),h=Rl;continue;case Al:if(a==Eu||"/"==a||"\\"==a||"?"==a||"#"==a){if(!r&&sl(l))h=Rl;else if(""==l){if(e.host="",r)return;h=El}else{if(s=Zu(e,l))return s;if("localhost"==e.host&&(e.host=""),r)return;l="",h=El}continue}l+=a;break;case El:if(il(e)){if(h=Rl,"/"!=a&&"\\"!=a)continue}else if(r||"?"!=a)if(r||"#"!=a){if(a!=Eu&&(h=Rl,"/"!=a))continue}else e.fragment="",h=Ll;else e.query="",h=Il;break;case Rl:if(a==Eu||"/"==a||"\\"==a&&il(e)||!r&&("?"==a||"#"==a)){if(".."===(c=(c=l).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(hl(e),"/"==a||"\\"==a&&il(e)||e.path.push("")):ul(l)?"/"==a||"\\"==a&&il(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&sl(l)&&(e.host&&(e.host=""),l=l.charAt(0)+":"),e.path.push(l)),l="","file"==e.scheme&&(a==Eu||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",h=Il):"#"==a&&(e.fragment="",h=Ll)}else l+=rl(a,el);break;case Tl:"?"==a?(e.query="",h=Il):"#"==a?(e.fragment="",h=Ll):a!=Eu&&(e.path[0]+=rl(a,Qu));break;case Il:r||"#"!=a?a!=Eu&&("'"==a&&il(e)?e.query+="%27":e.query+="#"==a?"%23":rl(a,Qu)):(e.fragment="",h=Ll);break;case Ll:a!=Eu&&(e.fragment+=rl(a,Ju))}u++}},Pl=function(e){var t,r,n=gc(this,Pl,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),o=Pu(n,{type:"URL"});if(void 0!==i)if(i instanceof Pl)t=Ou(i);else if(r=Ml(t={},String(i)))throw TypeError(r);if(r=Ml(o,a,null,t))throw TypeError(r);var s=o.searchParams=new Lu,h=Mu(s);h.updateSearchParams(o.query),h.updateURL=function(){o.query=String(s)||null},c||(n.href=Fl.call(n),n.origin=Nl.call(n),n.protocol=Dl.call(n),n.username=Bl.call(n),n.password=zl.call(n),n.host=Ul.call(n),n.hostname=Hl.call(n),n.port=$l.call(n),n.pathname=jl.call(n),n.search=ql.call(n),n.searchParams=Gl.call(n),n.hash=Vl.call(n))},Ol=Pl.prototype,Fl=function(){var e=Ou(this),t=e.scheme,r=e.username,n=e.password,i=e.host,a=e.port,o=e.path,s=e.query,c=e.fragment,h=t+":";return null!==i?(h+="//",al(e)&&(h+=r+(n?":"+n:"")+"@"),h+=Ku(i),null!==a&&(h+=":"+a)):"file"==t&&(h+="//"),h+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(h+="?"+s),null!==c&&(h+="#"+c),h},Nl=function(){var e=Ou(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&il(e)?t+"://"+Ku(e.host)+(null!==r?":"+r:""):"null"},Dl=function(){return Ou(this).scheme+":"},Bl=function(){return Ou(this).username},zl=function(){return Ou(this).password},Ul=function(){var e=Ou(this),t=e.host,r=e.port;return null===t?"":null===r?Ku(t):Ku(t)+":"+r},Hl=function(){var e=Ou(this).host;return null===e?"":Ku(e)},$l=function(){var e=Ou(this).port;return null===e?"":String(e)},jl=function(){var e=Ou(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},ql=function(){var e=Ou(this).query;return e?"?"+e:""},Gl=function(){return Ou(this).searchParams},Vl=function(){var e=Ou(this).fragment;return e?"#"+e:""},Wl=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(c&&It(Ol,{href:Wl(Fl,(function(e){var t=Ou(this),r=String(e),n=Ml(t,r);if(n)throw TypeError(n);Mu(t.searchParams).updateSearchParams(t.query)})),origin:Wl(Nl),protocol:Wl(Dl,(function(e){var t=Ou(this);Ml(t,String(e)+":",ll)})),username:Wl(Bl,(function(e){var t=Ou(this),r=Xh(String(e));if(!ol(t)){t.username="";for(var n=0;n<r.length;n++)t.username+=rl(r[n],tl)}})),password:Wl(zl,(function(e){var t=Ou(this),r=Xh(String(e));if(!ol(t)){t.password="";for(var n=0;n<r.length;n++)t.password+=rl(r[n],tl)}})),host:Wl(Ul,(function(e){var t=Ou(this);t.cannotBeABaseURL||Ml(t,String(e),xl)})),hostname:Wl(Hl,(function(e){var t=Ou(this);t.cannotBeABaseURL||Ml(t,String(e),kl)})),port:Wl($l,(function(e){var t=Ou(this);ol(t)||(""==(e=String(e))?t.port=null:Ml(t,e,Sl))})),pathname:Wl(jl,(function(e){var t=Ou(this);t.cannotBeABaseURL||(t.path=[],Ml(t,e+"",El))})),search:Wl(ql,(function(e){var t=Ou(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Ml(t,e,Il)),Mu(t.searchParams).updateSearchParams(t.query)})),searchParams:Wl(Gl),hash:Wl(Vl,(function(e){var t=Ou(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Ml(t,e,Ll)):t.fragment=null}))}),ie(Ol,"toJSON",(function(){return Fl.call(this)}),{enumerable:!0}),ie(Ol,"toString",(function(){return Fl.call(this)}),{enumerable:!0}),Iu){var Zl=Iu.createObjectURL,Yl=Iu.revokeObjectURL;Zl&&ie(Pl,"createObjectURL",(function(e){return Zl.apply(Iu,arguments)})),Yl&&ie(Pl,"revokeObjectURL",(function(e){return Yl.apply(Iu,arguments)}))}kn(Pl,"URL"),Oe({global:!0,forced:!Yh,sham:!c},{URL:Pl}),Oe({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var Xl=function(e){return function(t,r,n,i){Fe(r);var a=De(t),o=v(a),s=fe(a.length),c=e?s-1:0,h=e?-1:1;if(n<2)for(;;){if(c in o){i=o[c],c+=h;break}if(c+=h,e?c<0:s<=c)throw TypeError("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=h)c in o&&(i=r(i,o[c],c,a));return i}},Kl={left:Xl(!1),right:Xl(!0)},Ql=Kl.left,Jl=ut("reduce"),ef=ot("reduce",{1:0});Oe({target:"Array",proto:!0,forced:!Jl||!ef},{reduce:function(e){return Ql(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var tf,rf,nf,af,of,sf=function(e){for(var t=De(this),r=fe(t.length),n=arguments.length,i=ge(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,o=void 0===a?r:ge(a,r);o>i;)t[i++]=e;return t};function cf(e,t){var r,n=Object.keys(t);for(r=0;r<n.length;r++)e=e.replace(new RegExp("\\{"+n[r]+"\\}","gi"),t[n[r]]);return e}function hf(e){var t,r,n;if(!e)throw new Error("cannot create a random attribute name for an undefined object");t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",r="";do{for(r="",n=0;n<12;n++)r+=t[Math.floor(Math.random()*t.length)]}while(e[r]);return r}function uf(e){var t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[e]||t.alphabetic}Oe({target:"Array",proto:!0},{fill:sf}),pi("fill"),of=function(e,t){var r,n,i,a={};for(e=e.split(","),t=t||10,r=0;r<e.length;r+=2)n="&"+e[r+1]+";",i=parseInt(e[r],t),a[n]="&#"+i+";";return a["\\xa0"]="&#160;",a}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),tf={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}},(nf=function(e,t){this.__root=e,this.__ctx=t}).prototype.addColorStop=function(e,t){var r,n=this.__ctx.__createElement("stop");n.setAttribute("offset",e),t&&-1!==t.indexOf("rgba")?(r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t),n.setAttribute("stop-color",cf("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4])):n.setAttribute("stop-color",t),this.__root.appendChild(n)},af=function(e,t){this.__root=e,this.__ctx=t},(rf=function(e){if(!(this instanceof rf))return new rf(e);if(this.config=e,this.width=e.width,this.height=e.height,this.enableMirroring=e.enableMirroring||!1,this.canvas=this,this.__document=document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.isSVG=!0,this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__createElement("svg"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__root.setAttribute("overflow","visible"),e.viewbox){var t=e.viewbox.x+" "+e.viewbox.y+" "+e.viewbox.width+" "+e.viewbox.height;this.__root.setAttribute("viewBox",t),this.viewbox=e.viewbox}this.__ids={},this.__defs=this.__createElement("defs"),this.__root.appendChild(this.__defs),this.multiLocusGap=e.multiLocusGap;var r={id:"svg_output_backdrop",width:"100%",height:"100%",fill:e.backdropColor||"white"},n=this.__createElement("rect",r);this.__root.appendChild(n),this.__rootGroup=this.__createElement("g",{id:"root-group"}),this.__root.appendChild(this.__rootGroup),this.__currentElement=this.__rootGroup}).prototype.setWidth=function(e){this.width=e,this.__root.setAttribute("width",this.width);var t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+e+" "+this.config.viewbox.height;this.__root.setAttribute("viewBox",t)},rf.prototype.setHeight=function(e){this.height=e,this.__root.setAttribute("height",this.height);var t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+this.config.viewbox.width+" "+e;this.__root.setAttribute("viewBox",t)},rf.prototype.__createElement=function(e,t,r){void 0===t&&(t={});var n=this.__document.createElementNS("http://www.w3.org/2000/svg",e);r&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(var i=0,a=Object.keys(t);i<a.length;i++){var o=a[i];n.setAttribute(o,t[o])}return n},rf.prototype.__setDefaultStyles=function(){var e,t,r=Object.keys(tf);for(e=0;e<r.length;e++)this[t=r[e]]=tf[t].canvas},rf.prototype.__applyStyleState=function(e){var t,r,n=Object.keys(e);for(t=0;t<n.length;t++)this[r=n[t]]=e[r]},rf.prototype.__getStyleState=function(){var e,t,r={},n=Object.keys(tf);for(e=0;e<n.length;e++)r[t=n[e]]=this[t];return r},rf.prototype.__applyStyleToCurrentElement=function(e){var t=this.__currentElement,r=this.__currentElementsToStyle;r&&(t.setAttribute(e,""),t=r.element,r.children.forEach((function(t){t.setAttribute(e,"")})));var n,i,a,o,s,c=Object.keys(tf);for(n=0;n<c.length;n++)if(i=tf[c[n]],a=this[c[n]],i.apply)if(a instanceof af){if(a.__ctx)for(;a.__ctx.__defs.childNodes.length;)o=a.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[o]=o,this.__defs.appendChild(a.__ctx.__defs.childNodes[0]);t.setAttribute(i.apply,cf("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof nf)t.setAttribute(i.apply,cf("url(#{id})",{id:a.__root.getAttribute("id")}));else if(i&&-1!==i.apply.indexOf(e)&&i.svg!==a)if("stroke"!==i.svgAttr&&"fill"!==i.svgAttr||!a||-1===a.indexOf("rgba")){var h=i.svgAttr;if("globalAlpha"===c[n]&&(h=e+"-"+i.svgAttr,t.getAttribute(h)))continue;t.setAttribute(h,a)}else{s=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a),t.setAttribute(i.svgAttr,cf("rgb({r},{g},{b})",{r:s[1],g:s[2],b:s[3]}));var u=s[4],l=this.globalAlpha;null!=l&&(u*=l),t.setAttribute(i.svgAttr+"-opacity",u)}},rf.prototype.__closestGroupOrSvg=function(e){return"g"===(e=e||this.__currentElement).nodeName||"svg"===e.nodeName?e:this.__closestGroupOrSvg(e.parentNode)},rf.prototype.getSerializedSvg=function(e){var t,r,n,i,a,o=(new XMLSerializer).serializeToString(this.__root);if(e)for(t=Object.keys(of),r=0;r<t.length;r++)n=t[r],i=of[n],(a=new RegExp(n,"gi")).test(o)&&(o=o.replace(a,i));return o},rf.prototype.getSvg=function(){return this.__root},rf.prototype.save=function(){var e=this.__createElement("g"),t=this.__closestGroupOrSvg();this.__groupStack.push(t),t.appendChild(e),this.__currentElement=e,this.__stack.push(this.__getStyleState())},rf.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var e=this.__stack.pop();this.__applyStyleState(e)},rf.prototype.__addTransform=function(e){var t=this.__closestGroupOrSvg();if(t.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:t,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var r=this.__createElement("g");t.appendChild(r),this.__currentElement=r}var n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=e,this.__currentElement.setAttribute("transform",n)},rf.prototype.addTrackGroupWithTranslationAndClipRect=function(e,t,r,n,i,a){var o=e+"_clip_rect",s=this.__createElement("clipPath",{id:o});this.__defs.appendChild(s),s.appendChild(this.__createElement("rect",{x:"0",y:a.toString(),width:n.toString(),height:i.toString()}));var c=this.__createElement("g");this.__rootGroup.appendChild(c),c.setAttribute("transform",cf("translate({x},{y})",{x:t,y:r})),c.setAttribute("id",e+"_group"),c.setAttribute("clip-path",cf("url(#{id})",{id:o})),this.__currentElement=c},rf.prototype.scale=function(e,t){void 0===t&&(t=e),this.__addTransform(cf("scale({x},{y})",{x:e,y:t}))},rf.prototype.rotate=function(e){var t=180*e/Math.PI;this.__addTransform(cf("rotate({angle},{cx},{cy})",{angle:t,cx:0,cy:0}))},rf.prototype.translate=function(e,t){this.__addTransform(cf("translate({x},{y})",{x:e,y:t}))},rf.prototype.transform=function(e,t,r,n,i,a){this.__addTransform(cf("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:t,c:r,d:n,e:i,f:a}))},rf.prototype.beginPath=function(){var e;this.__currentDefaultPath="",this.__currentPosition={},e=this.__createElement("path",{},!0),this.__closestGroupOrSvg().appendChild(e),this.__currentElement=e},rf.prototype.__applyCurrentDefaultPath=function(){var e=this.__currentElement;"path"===e.nodeName?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)},rf.prototype.__addPathCommand=function(e){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=e},rf.prototype.moveTo=function(e,t){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:t},this.__addPathCommand(cf("M {x} {y}",{x:e,y:t}))},rf.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},rf.prototype.lineTo=function(e,t){this.__currentPosition={x:e,y:t},this.__currentDefaultPath&&this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(cf("L {x} {y}",{x:e,y:t})):this.__addPathCommand(cf("M {x} {y}",{x:e,y:t}))},rf.prototype.bezierCurveTo=function(e,t,r,n,i,a){this.__currentPosition={x:i,y:a},this.__addPathCommand(cf("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:t,cp2x:r,cp2y:n,x:i,y:a}))},rf.prototype.quadraticCurveTo=function(e,t,r,n){this.__currentPosition={x:r,y:n},this.__addPathCommand(cf("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:t,x:r,y:n}))};var lf=function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]};rf.prototype.arcTo=function(e,t,r,n,i){var a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(void 0!==a&&void 0!==o){if(i<0)throw new Error("IndexSizeError: The radius provided ("+i+") is negative.");if(a===e&&o===t||e===r&&t===n||0===i)this.lineTo(e,t);else{var s=lf([a-e,o-t]),c=lf([r-e,n-t]);if(s[0]*c[1]!=s[1]*c[0]){var h=s[0]*c[0]+s[1]*c[1],u=Math.acos(Math.abs(h)),l=lf([s[0]+c[0],s[1]+c[1]]),f=i/Math.sin(u/2),p=e+f*l[0],d=t+f*l[1],g=[-s[1],s[0]],v=[c[1],-c[0]],m=function(e){var t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)},y=m(g),b=m(v);this.lineTo(p+g[0]*i,d+g[1]*i),this.arc(p,d,i,y,b)}else this.lineTo(e,t)}}},rf.prototype.stroke=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")},rf.prototype.fill=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")},rf.prototype.rect=function(e,t,r,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(e,t),this.lineTo(e+r,t),this.lineTo(e+r,t+n),this.lineTo(e,t+n),this.lineTo(e,t),this.closePath()},rf.prototype.fillRect=function(e,t,r,n){n<0&&(t+=n,n=-n),r<0&&(e+=r,r=-r);var i,a,o,s={x:e,y:t,width:r,height:n};(!this.viewbox||(i=this.viewbox,a=s,i.x<a.x+a.width&&i.x+i.width>a.x&&i.y<a.y+a.height&&i.y+i.height>a.y))&&(o=this.__createElement("rect",s,!0),this.__closestGroupOrSvg().appendChild(o),this.__currentElement=o,this.__applyStyleToCurrentElement("fill"))},rf.prototype.strokeRect=function(e,t,r,n){var i;i=this.__createElement("rect",{x:e,y:t,width:r,height:n},!0),this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyStyleToCurrentElement("stroke")},rf.prototype.__clearCanvas=function(){for(var e=this.__closestGroupOrSvg().getAttribute("transform"),t=this.__root.childNodes[1],r=t.childNodes,n=r.length-1;n>=0;n--)r[n]&&t.removeChild(r[n]);this.__currentElement=t,this.__groupStack=[],e&&this.__addTransform(e)},rf.prototype.clearRect=function(e,t,r,n){if(0!==e||0!==t||r!==this.width||n!==this.height){var i,a=this.__closestGroupOrSvg();i=this.__createElement("rect",{x:e,y:t,width:r,height:n,fill:"#FFFFFF"},!0),a.appendChild(i)}else this.__clearCanvas()},rf.prototype.createLinearGradient=function(e,t,r,n){var i=this.__createElement("linearGradient",{id:hf(this.__ids),x1:e+"px",x2:r+"px",y1:t+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(i),new nf(i,this)},rf.prototype.createRadialGradient=function(e,t,r,n,i,a){var o=this.__createElement("radialGradient",{id:hf(this.__ids),cx:n+"px",cy:i+"px",r:a+"px",fx:e+"px",fy:t+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new nf(o,this)},rf.prototype.__parseFont=function(){var e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i.exec(this.font),t={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(t.decoration="underline"),this.__fontHref&&(t.href=this.__fontHref),t},rf.prototype.__wrapTextLink=function(e,t){if(e.href){var r=this.__createElement("a");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.href),r.appendChild(t),r}return t},rf.prototype.__applyText=function(e,t,r,n){var i,a,o=this.__parseFont(),s=this.__closestGroupOrSvg(),c=this.__createElement("text",{"font-family":o.family,"font-size":o.size,"font-style":o.style,"font-weight":o.weight,"text-decoration":o.decoration,x:t,y:r,"text-anchor":(i=this.textAlign,a={left:"start",right:"end",center:"middle",start:"start",end:"end"},a[i]||a.start),"dominant-baseline":uf(this.textBaseline)},!0);c.appendChild(this.__document.createTextNode(e)),this.__currentElement=c,this.__applyStyleToCurrentElement(n),s.appendChild(this.__wrapTextLink(o,c))},rf.prototype.fillText=function(e,t,r){this.__applyText(e,t,r,"fill")},rf.prototype.strokeText=function(e,t,r){this.__applyText(e,t,r,"stroke")},rf.prototype.measureText=function(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)},rf.prototype.arc=function(e,t,r,n,i,a){if(n!==i){(n%=2*Math.PI)==(i%=2*Math.PI)&&(i=(i+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));var o=e+r*Math.cos(i),s=t+r*Math.sin(i),c=e+r*Math.cos(n),h=t+r*Math.sin(n),u=a?0:1,l=0,f=i-n;f<0&&(f+=2*Math.PI),l=a?f>Math.PI?0:1:f>Math.PI?1:0,this.lineTo(c,h),this.__addPathCommand(cf("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:r,ry:r,xAxisRotation:0,largeArcFlag:l,sweepFlag:u,endX:o,endY:s})),this.__currentPosition={x:o,y:s}}},rf.prototype.clip=function(){var e=this.__closestGroupOrSvg(),t=this.__createElement("clipPath"),r=hf(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),t.setAttribute("id",r),t.appendChild(this.__currentElement),this.__defs.appendChild(t),e.setAttribute("clip-path",cf("url(#{id})",{id:r})),e.appendChild(n),this.__currentElement=n},rf.prototype.drawImage=function(){var e,t,r,n,i,a,o,s,c,h,u,l,f,p=Array.prototype.slice.call(arguments),d=p[0],g=0,v=0;if(3===p.length)e=p[1],t=p[2],r=i=d.width,n=a=d.height;else if(5===p.length)e=p[1],t=p[2],r=p[3],n=p[4],i=d.width,a=d.height;else{if(9!==p.length)throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);g=p[1],v=p[2],i=p[3],a=p[4],e=p[5],t=p[6],r=p[7],n=p[8]}o=this.__closestGroupOrSvg(),this.__currentElement;var m="translate("+e+", "+t+")";if(d instanceof rf){if((s=d.getSvg().cloneNode(!0)).childNodes&&s.childNodes.length>1){for(c=s.childNodes[0];c.childNodes.length;)f=c.childNodes[0].getAttribute("id"),this.__ids[f]=f,this.__defs.appendChild(c.childNodes[0]);if(h=s.childNodes[1]){var y,b=h.getAttribute("transform");y=b?b+" "+m:m,h.setAttribute("transform",y),o.appendChild(h)}}}else"CANVAS"!==d.nodeName&&"IMG"!==d.nodeName||((u=this.__createElement("image")).setAttribute("width",r),u.setAttribute("height",n),u.setAttribute("preserveAspectRatio","none"),(g||v||i!==d.width||a!==d.height)&&((l=this.__document.createElement("canvas")).width=r,l.height=n,l.getContext("2d").drawImage(d,g,v,i,a,0,0,r,n),d=l),u.setAttribute("transform",m),u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===d.nodeName?d.toDataURL():d.getAttribute("src")),o.appendChild(u))},rf.prototype.createPattern=function(e,t){var r,n=this.__document.__createElement("pattern"),i=hf(this.__ids);return n.setAttribute("id",i),n.setAttribute("width",e.width),n.setAttribute("height",e.height),"CANVAS"===e.nodeName||"IMG"===e.nodeName?((r=this.__createElement("image")).setAttribute("width",e.width),r.setAttribute("height",e.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===e.nodeName?e.toDataURL():e.getAttribute("src")),n.appendChild(r),this.__defs.appendChild(n)):e instanceof rf&&(n.appendChild(e.__root.childNodes[1]),this.__defs.appendChild(n)),new af(n,this)},rf.prototype.setLineDash=function(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null},rf.prototype.drawFocusRing=function(){},rf.prototype.createImageData=function(){},rf.prototype.getImageData=function(){},rf.prototype.putImageData=function(){},rf.prototype.globalCompositeOperation=function(){},rf.prototype.setTransform=function(){};var ff,pf=rf;function df(e,t){oc(t).on("mousedown.igv_drag",gf.bind(e))}function gf(e){e.stopPropagation(),e.preventDefault();var t=Math.round(parseFloat(this.style.left.replace("px",""))),r=Math.round(parseFloat(this.style.top.replace("px",""))),n=vf.bind(this),i=mf.bind(this);ff={dragFunction:n,dragEndFunction:i,dx:t-e.screenX,dy:r-e.screenY},oc(document).on("mousemove.igv_drag",n),oc(document).on("mouseup.igv_drag",i),oc(document).on("mouseleave.igv_drag",i),oc(document).on("mouseexit.igv_drag",i)}function vf(e){if(ff){e.stopPropagation(),e.preventDefault();var t=ff.dx+e.screenX,r=ff.dy+e.screenY;this.style.left=t+"px",this.style.top=r+"px"}}function mf(e){if(ff){e.stopPropagation(),e.preventDefault();var t=ff.dx+e.screenX,r=ff.dy+e.screenY;this.style.left=t+"px",this.style.top=r+"px",oc(document).off(".igv_drag"),ff=void 0}}var yf=$t.trim,bf=o.parseInt,wf=/^[+-]?0[Xx]/,xf=8!==bf(Dt+"08")||22!==bf(Dt+"0x16")?function(e,t){var r=yf(String(e));return bf(r,t>>>0||(wf.test(r)?16:10))}:bf;Oe({target:"Number",stat:!0,forced:Number.parseInt!=xf},{parseInt:xf});var kf=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),Sf=i((function(e){var t=L.f,r=G("meta"),n=0,i=Object.isExtensible||function(){return!0},a=function(e){t(e,r,{value:{objectID:"O"+ ++n,weakData:{}}})},o=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!b(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!k(e,r)){if(!i(e))return"F";if(!t)return"E";a(e)}return e[r].objectID},getWeakData:function(e,t){if(!k(e,r)){if(!i(e))return!0;if(!t)return!1;a(e)}return e[r].weakData},onFreeze:function(e){return kf&&o.REQUIRED&&i(e)&&!k(e,r)&&a(e),e}};Z[r]=!0})),_f=(Sf.REQUIRED,Sf.fastKey,Sf.getWeakData,Sf.onFreeze,function(e,t,r){var n=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),a=n?"set":"add",c=o[e],h=c&&c.prototype,u=c,l={},f=function(e){var t=h[e];ie(h,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!b(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return i&&!b(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!b(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(Me(e,"function"!=typeof c||!(i||h.forEach&&!s((function(){(new c).entries().next()})))))u=r.getConstructor(t,e,n,a),Sf.REQUIRED=!0;else if(Me(e,!0)){var p=new u,d=p[a](i?{}:-0,1)!=p,g=s((function(){p.has(1)})),v=Ic((function(e){new c(e)})),m=!i&&s((function(){for(var e=new c,t=5;t--;)e[a](t,t);return!e.has(-0)}));v||((u=t((function(t,r){gc(t,u,e);var i=Rt(new c,t,u);return null!=r&&kc(r,i[a],i,n),i}))).prototype=h,h.constructor=u),(g||m)&&(f("delete"),f("has"),n&&f("get")),(m||d)&&f(a),i&&h.clear&&delete h.clear}return l[e]=u,Oe({global:!0,forced:u!=c},l),kn(u,e),i||r.setStrong(u,e,n),u}),Cf=L.f,Af=Sf.fastKey,Ef=ne.set,Rf=ne.getterFor,Tf={getConstructor:function(e,t,r,n){var i=e((function(e,a){gc(e,i,t),Ef(e,{type:t,index:Nt(null),first:void 0,last:void 0,size:0}),c||(e.size=0),null!=a&&kc(a,e[n],e,r)})),a=Rf(t),o=function(e,t,r){var n,i,o=a(e),h=s(e,t);return h?h.value=r:(o.last=h={index:i=Af(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=h),n&&(n.next=h),c?o.size++:e.size++,"F"!==i&&(o.index[i]=h)),e},s=function(e,t){var r,n=a(e),i=Af(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return dc(i.prototype,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,c?e.size=0:this.size=0},delete:function(e){var t=a(this),r=s(this,e);if(r){var n=r.next,i=r.previous;delete t.index[r.index],r.removed=!0,i&&(i.next=n),n&&(n.previous=i),t.first==r&&(t.first=n),t.last==r&&(t.last=i),c?t.size--:this.size--}return!!r},forEach:function(e){for(var t,r=a(this),n=Ne(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),dc(i.prototype,r?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),c&&Cf(i.prototype,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Rf(t),a=Rf(n);Fi(e,t,(function(e,t){Ef(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),fa(t)}},If=(_f("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Tf),{trackMenuItemList:function(e){var t,r=new Set(["alignment","annotation","variant","eqtl","snp"]),n=e.track.config&&void 0!==e.track.config.visibilityWindow,i=[];return"sequence"!==e.track.config.type&&(i.push(function(e){var t;return(t=oc("<div>")).text("Set track name"),{object:t,click:function(){var t,r;t=function(){var t;t=""===(t=e.browser.inputDialog.$input.val().trim())||void 0===t?"untitled":t,e.browser.setTrackLabelName(e,t)},e.browser.inputDialog.configure({label:"Track Name",input:(r=e.track,r.trackView.viewports[0].$trackLabel.text()||"unnamed"),click:t}),e.browser.inputDialog.present(oc(e.trackDiv))}}}(e)),i.push(function(e){var t;return(t=oc("<div>")).text("Set track height"),{object:t,click:function(){var t;t=function(){var t;void 0!==(t=parseFloat(e.browser.inputDialog.$input.val(),10))&&(void 0!==e.track.minHeight&&e.track.minHeight>t&&(e.track.minHeight=t),void 0!==e.track.maxHeight&&e.track.maxHeight<t&&(e.track.minHeight=t),e.setTrackHeight(t,!0,!0),e.track.autoHeight=!1)},e.browser.inputDialog.configure({label:"Track Height",input:e.trackDiv.clientHeight,click:t}),e.browser.inputDialog.present(oc(e.trackDiv))}}}(e))),("alignment"===(t=e.track).type||"annotation"===t.type||"variant"===t.type||"wig"===t.type)&&i.push(function(e){var t;return(t=oc("<div>")).text("Set track color"),{object:t,click:function(){e.presentColorPicker()}}}(e)),e.track.menuItemList&&(i=i.concat(e.track.menuItemList())),(n||r.has(e.track.config.type))&&(i.push("<hr/>"),i.push(function(e){var t=oc("<div>");return t.text("Set visibility window"),{object:t,click:function(){e.browser.inputDialog.configure({label:"Visibility Window",input:e.track.visibilityWindow,click:function(){var t=e.browser.inputDialog.$input.val().trim();""!==t&&void 0!==t||(t=-1),t=Number.parseInt(t),e.track.visibilityWindow=t,e.track.config.visibilityWindow=t,e.updateViews()}}),e.browser.inputDialog.present(oc(e.trackDiv))}}}(e))),!1!==e.track.removable&&(i.push("<hr/>"),i.push(function(e){var t;return(t=oc("<div>")).text("Remove track"),{object:t,click:function(){e.browser.removeTrack(e.track)}}}(e))),i},dataRangeMenuItem:function(e){var t;return(t=oc("<div>")).text("Set data range"),{object:t,click:function(){e.browser.dataRangeDialog.configure({trackView:e}),e.browser.dataRangeDialog.present(oc(e.trackDiv))}}},trackMenuItemListHelper:function(e,t){var r=[];return e.length>0&&(r=e.map((function(e,r){var n;if(e.name?(n=oc("<div>")).text(e.name):e.object?n=e.object:"string"==typeof e.label?(n=oc("<div>")).html(e.label):"string"==typeof e&&(n=e.startsWith("<")?oc(e):oc("<div>"+e+"</div>")),0===r&&n.addClass("igv-track-menu-border-top"),e.click){function i(r){e.click(r),t.hide(),r.preventDefault(),r.stopPropagation()}n.on("click",i),n.on("touchend",(function(e){i(e)})),n.on("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}return{object:n,init:e.init||void 0}}))),r}});var Lf=l.f,Mf=function(e){return function(t){for(var r,n=y(t),i=Tt(n),a=i.length,o=0,s=[];a>o;)r=i[o++],c&&!Lf.call(n,r)||s.push(e?[r,n[r]]:n[r]);return s}},Pf={entries:Mf(!0),values:Mf(!1)},Of=Pf.values;function Ff(e,t){var r=oc("<div>",{class:"igv-trackgear-popover-check-container"}),n=oc("<div>");r.append(n);var i=Df("check",!0===t?"#444":"transparent");n.append(i);var a=oc("<div>");return a.text(e),r.append(a),r}function Nf(e,t){return oc(Df(e,t))}function Df(e,t){t=t||"currentColor";var r=Bf[e];r||(console.error("No icon named: ".concat(e)),r=Bf.question);var n='<svg viewBox="0 0 '+r[0]+" "+r[1]+'">';return n+='<path fill="'+t+'" d="'+r[4]+'"></path>',n+="</svg>"}Oe({target:"Object",stat:!0},{values:function(e){return Of(e)}});var Bf={check:[512,512,[],"f00c","M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"],cog:[512,512,[],"f013","M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"],exclamation:[192,512,[],"f12a","M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z"],"exclamation-circle":[512,512,[],"f06a","M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"],"exclamation-triangle":[576,512,[],"f071","M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"],minus:[448,512,[],"f068","M424 318.2c13.3 0 24-10.7 24-24v-76.4c0-13.3-10.7-24-24-24H24c-13.3 0-24 10.7-24 24v76.4c0 13.3 10.7 24 24 24h400z"],"minus-circle":[512,512,[],"f056","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z"],"minus-square":[448,512,[],"f146","M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM92 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H92z"],plus:[448,512,[],"f067","M448 294.2v-76.4c0-13.3-10.7-24-24-24H286.2V56c0-13.3-10.7-24-24-24h-76.4c-13.3 0-24 10.7-24 24v137.8H24c-13.3 0-24 10.7-24 24v76.4c0 13.3 10.7 24 24 24h137.8V456c0 13.3 10.7 24 24 24h76.4c13.3 0 24-10.7 24-24V318.2H424c13.3 0 24-10.7 24-24z"],"plus-circle":[512,512,[],"f055","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"],"plus-square":[448,512,[],"f0fe","M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-32 252c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92H92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"],question:[384,512,[],"f128","M202.021 0C122.202 0 70.503 32.703 29.914 91.026c-7.363 10.58-5.093 25.086 5.178 32.874l43.138 32.709c10.373 7.865 25.132 6.026 33.253-4.148 25.049-31.381 43.63-49.449 82.757-49.449 30.764 0 68.816 19.799 68.816 49.631 0 22.552-18.617 34.134-48.993 51.164-35.423 19.86-82.299 44.576-82.299 106.405V320c0 13.255 10.745 24 24 24h72.471c13.255 0 24-10.745 24-24v-5.773c0-42.86 125.268-44.645 125.268-160.627C377.504 66.256 286.902 0 202.021 0zM192 373.459c-38.196 0-69.271 31.075-69.271 69.271 0 38.195 31.075 69.27 69.271 69.27s69.271-31.075 69.271-69.271-31.075-69.27-69.271-69.27z"],save:[448,512,[],"f0c7","M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"],search:[512,512,[],"f002","M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"],share:[512,512,[],"f064","M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"],spinner:[512,512,[],"f110","M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"],square:[448,512,[],"f0c8","M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"],"square-full":[512,512,[],"f45c","M512 512H0V0h512v512z"],times:[384,512,[],"f00d","M323.1 441l53.9-53.9c9.4-9.4 9.4-24.5 0-33.9L279.8 256l97.2-97.2c9.4-9.4 9.4-24.5 0-33.9L323.1 71c-9.4-9.4-24.5-9.4-33.9 0L192 168.2 94.8 71c-9.4-9.4-24.5-9.4-33.9 0L7 124.9c-9.4 9.4-9.4 24.5 0 33.9l97.2 97.2L7 353.2c-9.4 9.4-9.4 24.5 0 33.9L60.9 441c9.4 9.4 24.5 9.4 33.9 0l97.2-97.2 97.2 97.2c9.3 9.3 24.5 9.3 33.9 0z"],"times-circle":[512,512,[],"f057","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"],wrench:[512,512,[],"f0ad","M481.156 200c9.3 0 15.12 10.155 10.325 18.124C466.295 259.992 420.419 288 368 288c-79.222 0-143.501-63.974-143.997-143.079C223.505 65.469 288.548-.001 368.002 0c52.362.001 98.196 27.949 123.4 69.743C496.24 77.766 490.523 88 481.154 88H376l-40 56 40 56h105.156zm-171.649 93.003L109.255 493.255c-24.994 24.993-65.515 24.994-90.51 0-24.993-24.994-24.993-65.516 0-90.51L218.991 202.5c16.16 41.197 49.303 74.335 90.516 90.503zM104 432c0-13.255-10.745-24-24-24s-24 10.745-24 24 10.745 24 24 24 24-10.745 24-24z"]},zf={licorice:"#000000",lead:"#1e1e1e",tungsten:"#3a3a3a",iron:"#545453",steel:"#6e6e6e",tin:"#878687",nickel:"#888787",aluminum:"#a09fa0",magnesium:"#b8b8b8",silver:"#d0d0d0",mercury:"#e8e8e8",snow:"white",cayenne:"#891100",mocha:"#894800",aspargus:"#888501",fern:"#458401",clover:"#028401",moss:"#018448",teal:"#008688",ocean:"#004a88",midnight:"#001888",eggplant:"#491a88",plum:"#891e88",maroon:"#891648",maraschino:"#ff2101",tangerine:"#ff8802",lemon:"#fffa03",lime:"#83f902",spring:"#05f802",seam_foam:"#03f987",turquoise:"#00fdff",aqua:"#008cff",blueberry:"#002eff",grape:"#8931ff",magenta:"#ff39ff",strawberry:"#ff2987",salmon:"#ff726e",cantaloupe:"#ffce6e",banana:"#fffb6d",honeydew:"#cefa6e",flora:"#68f96e",spindrift:"#68fbd0",ice:"#68fdff",sky:"#6acfff",orchid:"#6e76ff",lavender:"#d278ff",bubblegum:"#ff7aff",carnation:"#ff7fd3"},Uf={A:[0,200,0],C:[0,0,200],T:[255,0,0],G:[209,113,5],a:[0,200,0],c:[0,0,200],t:[255,0,0],g:[209,113,5],N:[80,80,80]},Hf={A:"rgb(  0, 200,   0)",C:"rgb(  0,   0, 200)",T:"rgb(255,   0,   0)",G:"rgb(209, 113,   5)",a:"rgb(  0, 200,   0)",c:"rgb(  0,   0, 200)",t:"rgb(255,   0,   0)",g:"rgb(209, 113,   5)",N:"rgb(80, 80, 80)"},$f={Set1:["rgb(228,26,28)","rgb(55,126,184)","rgb(77,175,74)","rgb(166,86,40)","rgb(152,78,163)","rgb(255,127,0)","rgb(247,129,191)","rgb(153,153,153)","rgb(255,255,51)"],Dark2:["rgb(27,158,119)","rgb(217,95,2)","rgb(117,112,179)","rgb(231,41,138)","rgb(102,166,30)","rgb(230,171,2)","rgb(166,118,29)","rgb(102,102,102)"],Set2:["rgb(102, 194,165)","rgb(252,141,98)","rgb(141,160,203)","rgb(231,138,195)","rgb(166,216,84)","rgb(255,217,47)","rgb(229,196,148)","rgb(179,179,179)"],Set3:["rgb(141,211,199)","rgb(255,255,179)","rgb(190,186,218)","rgb(251,128,114)","rgb(128,177,211)","rgb(253,180,98)","rgb(179,222,105)","rgb(252,205,229)","rgb(217,217,217)","rgb(188,128,189)","rgb(204,235,197)","rgb(255,237,111)"],Pastel1:["rgb(251,180,174)","rgb(179,205,227)","rgb(204,235,197)","rgb(222,203,228)","rgb(254,217,166)","rgb(255,255,204)","rgb(229,216,189)","rgb(253,218,236)"],Pastel2:["rgb(173,226,207)","rgb(253,205,172)","rgb(203,213,232)","rgb(244,202,228)","rgb(230,245,201)","rgb(255,242,174)","rgb(243,225,206)"],Accent:["rgb(127,201,127)","rgb(190,174,212)","rgb(253,192,134)","rgb(255,255,153)","rgb(56,108,176)","rgb(240,2,127)","rgb(191,91,23)"]};function jf(e){this.colors=$f[e],Array.isArray(this.colors)||(this.colors=[]),this.colorTable={},this.nextIdx=0,this.colorGenerator=new qf}function qf(){this.hue=Math.random(),this.goldenRatio=.618033988749895,this.hexwidth=2}jf.prototype.getColor=function(e){return this.colorTable.hasOwnProperty(e)||(this.nextIdx<this.colors.length?this.colorTable[e]=this.colors[this.nextIdx]:this.colorTable[e]=this.colorGenerator.get(),this.nextIdx++),this.colorTable[e]},qf.prototype.hsvToRgb=function(e,t,r){var n=Math.floor(6*e),i=6*e-n,a=r*(1-t),o=r*(1-i*t),s=r*(1-(1-i)*t),c=255,h=255,u=255;switch(n){case 0:c=r,h=s,u=a;break;case 1:c=o,h=r,u=a;break;case 2:c=a,h=r,u=s;break;case 3:c=a,h=o,u=r;break;case 4:c=s,h=a,u=r;break;case 5:c=r,h=a,u=o}return[Math.floor(256*c),Math.floor(256*h),Math.floor(256*u)]},qf.prototype.padHex=function(e){return e.length>this.hexwidth?e:new Array(this.hexwidth-e.length+1).join("0")+e},qf.prototype.get=function(e,t){this.hue+=this.goldenRatio,this.hue%=1,"number"!=typeof e&&(e=.5),"number"!=typeof t&&(t=.95);var r=this.hsvToRgb(this.hue,e,t);return"#"+this.padHex(r[0].toString(16))+this.padHex(r[1].toString(16))+this.padHex(r[2].toString(16))};var Gf=new qf,Vf=me.includes,Wf=ot("indexOf",{ACCESSORS:!0,1:0});Oe({target:"Array",proto:!0,forced:!Wf},{includes:function(e){return Vf(this,e,arguments.length>1?arguments[1]:void 0)}}),pi("includes"),Oe({target:"String",proto:!0,forced:!vr("includes")},{includes:function(e){return!!~String(m(this)).indexOf(dr(e),arguments.length>1?arguments[1]:void 0)}});var Zf=function(e,t){if(0!==e.length){var r=Math.floor(e.length*((100-t)/100));return 0===r?(e.sort((function(e,t){return t-e})),e[r]):function(e,t){var r,n=new Kf;for(r=0;r<e.length;r++){var i=e[r];(n.content.length<t||i>n.content[0])&&(n.content.length===t&&n.pop(),n.push(i))}return n.content[0]}(e,r)}},Yf=function(e,t,r){return Math.min(Math.max(e,t),r)},Xf=function(e){return Math.log(e)/Math.LN2};function Kf(){this.content=[]}Kf.prototype={push:function(e){this.content.push(e),this.bubbleUp(this.content.length-1)},pop:function(){var e=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.sinkDown(0)),e},remove:function(e){for(var t=this.content.length,r=0;r<t;r++)if(this.content[r]===e){var n=this.content.pop();if(r===t-1)break;this.content[r]=n,this.bubbleUp(r),this.sinkDown(r);break}},size:function(){return this.content.length},bubbleUp:function(e){for(var t=this.content[e],r=t;e>0;){var n=Math.floor((e+1)/2)-1,i=this.content[n];if(r>=i)break;this.content[n]=t,this.content[e]=i,e=n}},sinkDown:function(e){for(var t=this.content.length,r=this.content[e],n=r;;){var i=2*(e+1),a=i-1,o=null;if(a<t){var s=this.content[a],c=s;s<n&&(o=a)}if(i<t&&this.content[i]<(null==o?n:c)&&(o=i),null==o)break;this.content[e]=this.content[o],this.content[o]=r,e=o}}},c&&("g"!=/./g.flags||nr.UNSUPPORTED_Y)&&L.f(RegExp.prototype,"flags",{configurable:!0,get:tr});var Qf,Jf="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,ep=L.f,tp=o.Int8Array,rp=tp&&tp.prototype,np=o.Uint8ClampedArray,ip=np&&np.prototype,ap=tp&&_i(tp),op=rp&&_i(rp),sp=Object.prototype,cp=sp.isPrototypeOf,hp=qe("toStringTag"),up=G("TYPED_ARRAY_TAG"),lp=Jf&&!!Et&&"Opera"!==ha(o.opera),fp=!1,pp={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},dp=function(e){return b(e)&&k(pp,ha(e))};for(Qf in pp)o[Qf]||(lp=!1);if((!lp||"function"!=typeof ap||ap===Function.prototype)&&(ap=function(){throw TypeError("Incorrect invocation")},lp))for(Qf in pp)o[Qf]&&Et(o[Qf],ap);if((!lp||!op||op===sp)&&(op=ap.prototype,lp))for(Qf in pp)o[Qf]&&Et(o[Qf].prototype,op);if(lp&&_i(ip)!==op&&Et(ip,op),c&&!k(op,hp))for(Qf in fp=!0,ep(op,hp,{get:function(){return b(this)?this[up]:void 0}}),pp)o[Qf]&&M(o[Qf],up,Qf);var gp={NATIVE_ARRAY_BUFFER_VIEWS:lp,TYPED_ARRAY_TAG:fp&&up,aTypedArray:function(e){if(dp(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Et){if(cp.call(ap,e))return e}else for(var t in pp)if(k(pp,Qf)){var r=o[t];if(r&&(e===r||cp.call(r,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(c){if(r)for(var n in pp){var i=o[n];i&&k(i.prototype,e)&&delete i.prototype[e]}op[e]&&!r||ie(op,e,r?t:lp&&rp[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(c){if(Et){if(r)for(n in pp)(i=o[n])&&k(i,e)&&delete i[e];if(ap[e]&&!r)return;try{return ie(ap,e,r?t:lp&&tp[e]||t)}catch(e){}}for(n in pp)!(i=o[n])||i[e]&&!r||ie(i,e,t)}},isView:function(e){var t=ha(e);return"DataView"===t||k(pp,t)},isTypedArray:dp,TypedArray:ap,TypedArrayPrototype:op},vp=gp.NATIVE_ARRAY_BUFFER_VIEWS,mp=o.ArrayBuffer,yp=o.Int8Array,bp=!vp||!s((function(){yp(1)}))||!s((function(){new yp(-1)}))||!Ic((function(e){new yp,new yp(null),new yp(1.5),new yp(e)}),!0)||s((function(){return 1!==new yp(new mp(2),1,void 0).length})),wp=function(e){if(void 0===e)return 0;var t=ue(e),r=fe(t);if(t!==r)throw RangeError("Wrong length or index");return r},xp=Math.abs,kp=Math.pow,Sp=Math.floor,_p=Math.log,Cp=Math.LN2,Ap=function(e,t,r){var n,i,a,o=new Array(r),s=8*r-t-1,c=(1<<s)-1,h=c>>1,u=23===t?kp(2,-24)-kp(2,-77):0,l=e<0||0===e&&1/e<0?1:0,f=0;for((e=xp(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(n=Sp(_p(e)/Cp),e*(a=kp(2,-n))<1&&(n--,a*=2),(e+=n+h>=1?u/a:u*kp(2,1-h))*a>=2&&(n++,a/=2),n+h>=c?(i=0,n=c):n+h>=1?(i=(e*a-1)*kp(2,t),n+=h):(i=e*kp(2,h-1)*kp(2,t),n=0));t>=8;o[f++]=255&i,i/=256,t-=8);for(n=n<<t|i,s+=t;s>0;o[f++]=255&n,n/=256,s-=8);return o[--f]|=128*l,o},Ep=function(e,t){var r,n=e.length,i=8*n-t-1,a=(1<<i)-1,o=a>>1,s=i-7,c=n-1,h=e[c--],u=127&h;for(h>>=7;s>0;u=256*u+e[c],c--,s-=8);for(r=u&(1<<-s)-1,u>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===u)u=1-o;else{if(u===a)return r?NaN:h?-1/0:1/0;r+=kp(2,t),u-=o}return(h?-1:1)*r*kp(2,u-t)},Rp=ke.f,Tp=L.f,Ip=ne.get,Lp=ne.set,Mp=o.ArrayBuffer,Pp=Mp,Op=o.DataView,Fp=Op&&Op.prototype,Np=Object.prototype,Dp=o.RangeError,Bp=Ap,zp=Ep,Up=function(e){return[255&e]},Hp=function(e){return[255&e,e>>8&255]},$p=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},jp=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},qp=function(e){return Bp(e,23,4)},Gp=function(e){return Bp(e,52,8)},Vp=function(e,t){Tp(e.prototype,t,{get:function(){return Ip(this)[t]}})},Wp=function(e,t,r,n){var i=wp(r),a=Ip(e);if(i+t>a.byteLength)throw Dp("Wrong index");var o=Ip(a.buffer).bytes,s=i+a.byteOffset,c=o.slice(s,s+t);return n?c:c.reverse()},Zp=function(e,t,r,n,i,a){var o=wp(r),s=Ip(e);if(o+t>s.byteLength)throw Dp("Wrong index");for(var c=Ip(s.buffer).bytes,h=o+s.byteOffset,u=n(+i),l=0;l<t;l++)c[h+l]=u[a?l:t-l-1]};if(Jf){if(!s((function(){Mp(1)}))||!s((function(){new Mp(-1)}))||s((function(){return new Mp,new Mp(1.5),new Mp(NaN),"ArrayBuffer"!=Mp.name}))){for(var Yp,Xp=(Pp=function(e){return gc(this,Pp),new Mp(wp(e))}).prototype=Mp.prototype,Kp=Rp(Mp),Qp=0;Kp.length>Qp;)(Yp=Kp[Qp++])in Pp||M(Pp,Yp,Mp[Yp]);Xp.constructor=Pp}Et&&_i(Fp)!==Np&&Et(Fp,Np);var Jp=new Op(new Pp(2)),ed=Fp.setInt8;Jp.setInt8(0,2147483648),Jp.setInt8(1,2147483649),!Jp.getInt8(0)&&Jp.getInt8(1)||dc(Fp,{setInt8:function(e,t){ed.call(this,e,t<<24>>24)},setUint8:function(e,t){ed.call(this,e,t<<24>>24)}},{unsafe:!0})}else Pp=function(e){gc(this,Pp,"ArrayBuffer");var t=wp(e);Lp(this,{bytes:sf.call(new Array(t),0),byteLength:t}),c||(this.byteLength=t)},Op=function(e,t,r){gc(this,Op,"DataView"),gc(e,Pp,"DataView");var n=Ip(e).byteLength,i=ue(t);if(i<0||i>n)throw Dp("Wrong offset");if(i+(r=void 0===r?n-i:fe(r))>n)throw Dp("Wrong length");Lp(this,{buffer:e,byteLength:r,byteOffset:i}),c||(this.buffer=e,this.byteLength=r,this.byteOffset=i)},c&&(Vp(Pp,"byteLength"),Vp(Op,"buffer"),Vp(Op,"byteLength"),Vp(Op,"byteOffset")),dc(Op.prototype,{getInt8:function(e){return Wp(this,1,e)[0]<<24>>24},getUint8:function(e){return Wp(this,1,e)[0]},getInt16:function(e){var t=Wp(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Wp(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return jp(Wp(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return jp(Wp(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return zp(Wp(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return zp(Wp(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Zp(this,1,e,Up,t)},setUint8:function(e,t){Zp(this,1,e,Up,t)},setInt16:function(e,t){Zp(this,2,e,Hp,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Zp(this,2,e,Hp,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Zp(this,4,e,$p,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Zp(this,4,e,$p,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Zp(this,4,e,qp,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Zp(this,8,e,Gp,t,arguments.length>2?arguments[2]:void 0)}});kn(Pp,"ArrayBuffer"),kn(Op,"DataView");var td={ArrayBuffer:Pp,DataView:Op},rd=function(e,t){var r=function(e){var t=ue(e);if(t<0)throw RangeError("The argument can't be less than 0");return t}(e);if(r%t)throw RangeError("Wrong offset");return r},nd=gp.aTypedArrayConstructor,id=function(e){var t,r,n,i,a,o,s=De(e),c=arguments.length,h=c>1?arguments[1]:void 0,u=void 0!==h,l=wc(s);if(null!=l&&!yc(l))for(o=(a=l.call(s)).next,s=[];!(i=o.call(a)).done;)s.push(i.value);for(u&&c>2&&(h=Ne(h,arguments[2],2)),r=fe(s.length),n=new(nd(this))(r),t=0;r>t;t++)n[t]=u?h(s[t],t):s[t];return n},ad=i((function(e){var t=ke.f,r=Ye.forEach,n=ne.get,i=ne.set,a=L.f,s=R.f,h=Math.round,u=o.RangeError,l=td.ArrayBuffer,p=td.DataView,d=gp.NATIVE_ARRAY_BUFFER_VIEWS,g=gp.TYPED_ARRAY_TAG,v=gp.TypedArray,m=gp.TypedArrayPrototype,y=gp.aTypedArrayConstructor,x=gp.isTypedArray,S=function(e,t){for(var r=0,n=t.length,i=new(y(e))(n);n>r;)i[r]=t[r++];return i},_=function(e,t){a(e,t,{get:function(){return n(this)[t]}})},C=function(e){var t;return e instanceof l||"ArrayBuffer"==(t=ha(e))||"SharedArrayBuffer"==t},A=function(e,t){return x(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},E=function(e,t){return A(e,t=w(t,!0))?f(2,e[t]):s(e,t)},T=function(e,t,r){return!(A(e,t=w(t,!0))&&b(r)&&k(r,"value"))||k(r,"get")||k(r,"set")||r.configurable||k(r,"writable")&&!r.writable||k(r,"enumerable")&&!r.enumerable?a(e,t,r):(e[t]=r.value,e)};c?(d||(R.f=E,L.f=T,_(m,"buffer"),_(m,"byteOffset"),_(m,"byteLength"),_(m,"length")),Oe({target:"Object",stat:!0,forced:!d},{getOwnPropertyDescriptor:E,defineProperty:T}),e.exports=function(e,s,c){var f=e.match(/\d+$/)[0]/8,y=e+(c?"Clamped":"")+"Array",w="get"+e,k="set"+e,_=o[y],A=_,E=A&&A.prototype,R={},T=function(e,t){a(e,t,{get:function(){return function(e,t){var r=n(e);return r.view[w](t*f+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=n(e);c&&(r=(r=h(r))<0?0:r>255?255:255&r),i.view[k](t*f+i.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};d?bp&&(A=s((function(e,t,r,n){return gc(e,A,y),Rt(b(t)?C(t)?void 0!==n?new _(t,rd(r,f),n):void 0!==r?new _(t,rd(r,f)):new _(t):x(t)?S(A,t):id.call(A,t):new _(wp(t)),e,A)})),Et&&Et(A,v),r(t(_),(function(e){e in A||M(A,e,_[e])})),A.prototype=E):(A=s((function(e,t,r,n){gc(e,A,y);var a,o,s,c=0,h=0;if(b(t)){if(!C(t))return x(t)?S(A,t):id.call(A,t);a=t,h=rd(r,f);var d=t.byteLength;if(void 0===n){if(d%f)throw u("Wrong length");if((o=d-h)<0)throw u("Wrong length")}else if((o=fe(n)*f)+h>d)throw u("Wrong length");s=o/f}else s=wp(t),a=new l(o=s*f);for(i(e,{buffer:a,byteOffset:h,byteLength:o,length:s,view:new p(a)});c<s;)T(e,c++)})),Et&&Et(A,v),E=A.prototype=Nt(m)),E.constructor!==A&&M(E,"constructor",A),g&&M(E,g,y),R[y]=A,Oe({global:!0,forced:A!=_,sham:!d},R),"BYTES_PER_ELEMENT"in A||M(A,"BYTES_PER_ELEMENT",f),"BYTES_PER_ELEMENT"in E||M(E,"BYTES_PER_ELEMENT",f),fa(y)}):e.exports=function(){}}));ad("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}})),ad("Uint16",(function(e){return function(t,r,n){return e(this,t,r,n)}})),ad("Uint32",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var od=Math.min,sd=[].copyWithin||function(e,t){var r=De(this),n=fe(r.length),i=ge(e,n),a=ge(t,n),o=arguments.length>2?arguments[2]:void 0,s=od((void 0===o?n:ge(o,n))-a,n-i),c=1;for(a<i&&i<a+s&&(c=-1,a+=s-1,i+=s-1);s-- >0;)a in r?r[i]=r[a]:delete r[i],i+=c,a+=c;return r},cd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("copyWithin",(function(e,t){return sd.call(cd(this),e,t,arguments.length>2?arguments[2]:void 0)}));var hd=Ye.every,ud=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("every",(function(e){return hd(ud(this),e,arguments.length>1?arguments[1]:void 0)}));var ld=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("fill",(function(e){return sf.apply(ld(this),arguments)}));var fd=Ye.filter,pd=gp.aTypedArray,dd=gp.aTypedArrayConstructor;(0,gp.exportTypedArrayMethod)("filter",(function(e){for(var t=fd(pd(this),e,arguments.length>1?arguments[1]:void 0),r=Mr(this,this.constructor),n=0,i=t.length,a=new(dd(r))(i);i>n;)a[n]=t[n++];return a}));var gd=Ye.find,vd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("find",(function(e){return gd(vd(this),e,arguments.length>1?arguments[1]:void 0)}));var md=Ye.findIndex,yd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("findIndex",(function(e){return md(yd(this),e,arguments.length>1?arguments[1]:void 0)}));var bd=Ye.forEach,wd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("forEach",(function(e){bd(wd(this),e,arguments.length>1?arguments[1]:void 0)}));var xd=me.includes,kd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("includes",(function(e){return xd(kd(this),e,arguments.length>1?arguments[1]:void 0)}));var Sd=me.indexOf,_d=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("indexOf",(function(e){return Sd(_d(this),e,arguments.length>1?arguments[1]:void 0)}));var Cd=qe("iterator"),Ad=o.Uint8Array,Ed=Bi.values,Rd=Bi.keys,Td=Bi.entries,Id=gp.aTypedArray,Ld=gp.exportTypedArrayMethod,Md=Ad&&Ad.prototype[Cd],Pd=!!Md&&("values"==Md.name||null==Md.name),Od=function(){return Ed.call(Id(this))};Ld("entries",(function(){return Td.call(Id(this))})),Ld("keys",(function(){return Rd.call(Id(this))})),Ld("values",Od,!Pd),Ld(Cd,Od,!Pd);var Fd=gp.aTypedArray,Nd=[].join;(0,gp.exportTypedArrayMethod)("join",(function(e){return Nd.apply(Fd(this),arguments)}));var Dd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("lastIndexOf",(function(e){return Ct.apply(Dd(this),arguments)}));var Bd=Ye.map,zd=gp.aTypedArray,Ud=gp.aTypedArrayConstructor;(0,gp.exportTypedArrayMethod)("map",(function(e){return Bd(zd(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Ud(Mr(e,e.constructor)))(t)}))}));var Hd=Kl.left,$d=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("reduce",(function(e){return Hd($d(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var jd=Kl.right,qd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("reduceRight",(function(e){return jd(qd(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var Gd=gp.aTypedArray,Vd=gp.exportTypedArrayMethod,Wd=Math.floor;Vd("reverse",(function(){for(var e,t=Gd(this).length,r=Wd(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this}));var Zd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("set",(function(e){Zd(this);var t=rd(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=De(e),i=fe(n.length),a=0;if(i+t>r)throw RangeError("Wrong length");for(;a<i;)this[t+a]=n[a++]}),s((function(){new Int8Array(1).set({})})));var Yd=gp.aTypedArray,Xd=gp.aTypedArrayConstructor,Kd=[].slice;(0,gp.exportTypedArrayMethod)("slice",(function(e,t){for(var r=Kd.call(Yd(this),e,t),n=Mr(this,this.constructor),i=0,a=r.length,o=new(Xd(n))(a);a>i;)o[i]=r[i++];return o}),s((function(){new Int8Array(1).slice()})));var Qd=Ye.some,Jd=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("some",(function(e){return Qd(Jd(this),e,arguments.length>1?arguments[1]:void 0)}));var eg=gp.aTypedArray,tg=[].sort;(0,gp.exportTypedArrayMethod)("sort",(function(e){return tg.call(eg(this),e)}));var rg=gp.aTypedArray;(0,gp.exportTypedArrayMethod)("subarray",(function(e,t){var r=rg(this),n=r.length,i=ge(e,n);return new(Mr(r,r.constructor))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,fe((void 0===t?n:ge(t,n))-i))}));var ng=o.Int8Array,ig=gp.aTypedArray,ag=gp.exportTypedArrayMethod,og=[].toLocaleString,sg=[].slice,cg=!!ng&&s((function(){og.call(new ng(1))}));ag("toLocaleString",(function(){return og.apply(cg?sg.call(ig(this)):ig(this),arguments)}),s((function(){return[1,2].toLocaleString()!=new ng([1,2]).toLocaleString()}))||!s((function(){ng.prototype.toLocaleString.call([1,2])})));var hg=gp.exportTypedArrayMethod,ug=o.Uint8Array,lg=ug&&ug.prototype||{},fg=[].toString,pg=[].join;s((function(){fg.call({})}))&&(fg=function(){return pg.call(this)});var dg=lg.toString!=fg;hg("toString",fg,dg);var gg={Huffman:{},Util:{},CRC32:{},CompressionMethod:{DEFLATE:8,RESERVED:15},Zip:function(e){e=e||{},this.files=[],this.comment=e.comment,this.password}};gg.Zip.CompressionMethod={STORE:0,DEFLATE:8},gg.Zip.OperatingSystem={MSDOS:0,UNIX:3,MACINTOSH:7},gg.Zip.Flags={ENCRYPT:1,DESCRIPTOR:8,UTF8:2048},gg.Zip.FileHeaderSignature=[80,75,1,2],gg.Zip.LocalFileHeaderSignature=[80,75,3,4],gg.Zip.CentralDirectorySignature=[80,75,5,6],gg.Zip.prototype.addFile=function(e,t){(t=t||{}).filename;var r,n=e.length,i=0;if(e instanceof Array&&(e=new Uint8Array(e)),"number"!=typeof t.compressionMethod&&(t.compressionMethod=gg.Zip.CompressionMethod.DEFLATE),t.compress)switch(t.compressionMethod){case gg.Zip.CompressionMethod.STORE:break;case gg.Zip.CompressionMethod.DEFLATE:i=gg.CRC32.calc(e),e=this.deflateWithOption(e,t),r=!0;break;default:throw new Error("unknown compression method:"+t.compressionMethod)}this.files.push({buffer:e,option:t,compressed:r,encrypted:!1,size:n,crc32:i})},gg.Zip.prototype.setPassword=function(e){this.password=e},gg.Zip.prototype.compress=function(){var e,t,r,n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w,x,k,S,_,C,A=this.files,E=0,R=0;for(k=0,S=A.length;k<S;++k){if(p=(e=A[k]).option.filename?e.option.filename.length:0,d=e.option.extraField?e.option.extraField.length:0,g=e.option.comment?e.option.comment.length:0,!e.compressed)switch(e.crc32=gg.CRC32.calc(e.buffer),e.option.compressionMethod){case gg.Zip.CompressionMethod.STORE:break;case gg.Zip.CompressionMethod.DEFLATE:e.buffer=this.deflateWithOption(e.buffer,e.option),e.compressed=!0;break;default:throw new Error("unknown compression method:"+e.option.compressionMethod)}if(void 0!==e.option.password||void 0!==this.password){for(x=this.createEncryptionKey(e.option.password||this.password),b=e.buffer,(w=new Uint8Array(b.length+12)).set(b,12),b=w,_=0;_<12;++_)b[_]=this.encode(x,11===k?255&e.crc32:256*Math.random()|0);for(C=b.length;_<C;++_)b[_]=this.encode(x,b[_]);e.buffer=b}E+=30+p+e.buffer.length,R+=46+p+g}for(a=22+(this.comment?this.comment.length:0),t=new Uint8Array(E+R+a),r=0,i=(n=E)+R,k=0,S=A.length;k<S;++k)p=(e=A[k]).option.filename?e.option.filename.length:0,d=0,g=e.option.comment?e.option.comment.length:0,o=r,t[r++]=gg.Zip.LocalFileHeaderSignature[0],t[r++]=gg.Zip.LocalFileHeaderSignature[1],t[r++]=gg.Zip.LocalFileHeaderSignature[2],t[r++]=gg.Zip.LocalFileHeaderSignature[3],t[n++]=gg.Zip.FileHeaderSignature[0],t[n++]=gg.Zip.FileHeaderSignature[1],t[n++]=gg.Zip.FileHeaderSignature[2],t[n++]=gg.Zip.FileHeaderSignature[3],t[n++]=20,t[n++]=e.option.os||gg.Zip.OperatingSystem.MSDOS,t[r++]=t[n++]=20,t[r++]=t[n++]=0,s=0,(e.option.password||this.password)&&(s|=gg.Zip.Flags.ENCRYPT),t[r++]=t[n++]=255&s,t[r++]=t[n++]=s>>8&255,c=e.option.compressionMethod,t[r++]=t[n++]=255&c,t[r++]=t[n++]=c>>8&255,h=e.option.date||new Date,t[r++]=t[n++]=(7&h.getMinutes())<<5|h.getSeconds()/2|0,t[r++]=t[n++]=h.getHours()<<3|h.getMinutes()>>3,t[r++]=t[n++]=(h.getMonth()+1&7)<<5|h.getDate(),t[r++]=t[n++]=(h.getFullYear()-1980&127)<<1|h.getMonth()+1>>3,u=e.crc32,t[r++]=t[n++]=255&u,t[r++]=t[n++]=u>>8&255,t[r++]=t[n++]=u>>16&255,t[r++]=t[n++]=u>>24&255,l=e.buffer.length,t[r++]=t[n++]=255&l,t[r++]=t[n++]=l>>8&255,t[r++]=t[n++]=l>>16&255,t[r++]=t[n++]=l>>24&255,f=e.size,t[r++]=t[n++]=255&f,t[r++]=t[n++]=f>>8&255,t[r++]=t[n++]=f>>16&255,t[r++]=t[n++]=f>>24&255,t[r++]=t[n++]=255&p,t[r++]=t[n++]=p>>8&255,t[r++]=t[n++]=255&d,t[r++]=t[n++]=d>>8&255,t[n++]=255&g,t[n++]=g>>8&255,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=255&o,t[n++]=o>>8&255,t[n++]=o>>16&255,t[n++]=o>>24&255,(v=e.option.filename)&&(t.set(v,r),t.set(v,n),r+=p,n+=p),(m=e.option.extraField)&&(t.set(m,r),t.set(m,n),r+=d,n+=d),(y=e.option.comment)&&(t.set(y,n),n+=g),t.set(e.buffer,r),r+=e.buffer.length;return t[i++]=gg.Zip.CentralDirectorySignature[0],t[i++]=gg.Zip.CentralDirectorySignature[1],t[i++]=gg.Zip.CentralDirectorySignature[2],t[i++]=gg.Zip.CentralDirectorySignature[3],t[i++]=0,t[i++]=0,t[i++]=0,t[i++]=0,t[i++]=255&S,t[i++]=S>>8&255,t[i++]=255&S,t[i++]=S>>8&255,t[i++]=255&R,t[i++]=R>>8&255,t[i++]=R>>16&255,t[i++]=R>>24&255,t[i++]=255&E,t[i++]=E>>8&255,t[i++]=E>>16&255,t[i++]=E>>24&255,g=this.comment?this.comment.length:0,t[i++]=255&g,t[i++]=g>>8&255,this.comment&&(t.set(this.comment,i),i+=g),t},gg.Zip.prototype.deflateWithOption=function(e,t){return new gg.RawDeflate(e,t.deflateOption).compress()},gg.Zip.prototype.getByte=function(e){var t=65535&e[2]|2;return t*(1^t)>>8&255},gg.Zip.prototype.encode=function(e,t){var r=this.getByte(e);return this.updateKeys(e,t),r^t},gg.Zip.prototype.updateKeys=function(e,t){e[0]=gg.CRC32.single(e[0],t),e[1]=1+(6681*(20173*(e[1]+(255&e[0]))>>>0)>>>0)>>>0,e[2]=gg.CRC32.single(e[2],e[1]>>>24)},gg.Zip.prototype.createEncryptionKey=function(e){var t,r,n=[305419896,591751049,878082192];for(n=new Uint32Array(n),t=0,r=e.length;t<r;++t)this.updateKeys(n,255&e[t]);return n},gg.Huffman.buildHuffmanTable=function(e){var t,r,n,i,a,o,s,c,h,u,l,f=e.length,p=0,d=Number.POSITIVE_INFINITY;for(c=0,h=f;c<h;++c)e[c]>p&&(p=e[c]),e[c]<d&&(d=e[c]);for(t=1<<p,r=new Uint32Array(t),n=1,i=0,a=2;n<=p;){for(c=0;c<f;++c)if(e[c]===n){for(o=0,s=i,u=0;u<n;++u)o=o<<1|1&s,s>>=1;for(l=n<<16|c,u=o;u<t;u+=a)r[u]=l;++i}++n,i<<=1,a<<=1}return[r,p,d]};var vg=gg.Huffman.buildHuffmanTable;function mg(e){return"string"==typeof e||e instanceof String}function yg(e){var t=String(e).split(/[.,]/);return t[0].split("").reverse().reduce((function(e,t,r){return r%3==0?e+","+t:e+t})).split("").reverse().join("")+(t[1]?"."+t[1]:"")}gg.RawInflate=function(e,t){switch(this.buffer,this.blocks=[],this.bufferSize=32768,this.totalpos=0,this.ip=0,this.bitsbuf=0,this.bitsbuflen=0,this.input=new Uint8Array(e),this.output,this.op,this.bfinal=!1,this.bufferType=gg.RawInflate.BufferType.ADAPTIVE,this.resize=!1,!t&&(t={})||(t.index&&(this.ip=t.index),t.bufferSize&&(this.bufferSize=t.bufferSize),t.bufferType&&(this.bufferType=t.bufferType),t.resize&&(this.resize=t.resize)),this.bufferType){case gg.RawInflate.BufferType.BLOCK:this.op=gg.RawInflate.MaxBackwardLength,this.output=new Uint8Array(gg.RawInflate.MaxBackwardLength+this.bufferSize+gg.RawInflate.MaxCopyLength);break;case gg.RawInflate.BufferType.ADAPTIVE:this.op=0,this.output=new Uint8Array(this.bufferSize);break;default:throw new Error("invalid inflate mode")}},gg.RawInflate.BufferType={BLOCK:0,ADAPTIVE:1},gg.RawInflate.prototype.decompress=function(){for(;!this.bfinal;)this.parseBlock();switch(this.bufferType){case gg.RawInflate.BufferType.BLOCK:return this.concatBufferBlock();case gg.RawInflate.BufferType.ADAPTIVE:return this.concatBufferDynamic();default:throw new Error("invalid inflate mode")}},gg.RawInflate.MaxBackwardLength=32768,gg.RawInflate.MaxCopyLength=258,gg.RawInflate.Order=new Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gg.RawInflate.LengthCodeTable=new Uint16Array([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,258,258]),gg.RawInflate.LengthExtraTable=new Uint8Array([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,0,0]),gg.RawInflate.DistCodeTable=new Uint16Array([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]),gg.RawInflate.DistExtraTable=new Uint8Array([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]),gg.RawInflate.FixedLiteralLengthTable=function(){var e,t,r=new Uint8Array(288);for(e=0,t=r.length;e<t;++e)r[e]=e<=143?8:e<=255?9:e<=279?7:8;return vg(r)}(),gg.RawInflate.FixedDistanceTable=function(){var e,t,r=new Uint8Array(30);for(e=0,t=r.length;e<t;++e)r[e]=5;return vg(r)}(),gg.RawInflate.prototype.parseBlock=function(){var e=this.readBits(3);switch(1&e&&(this.bfinal=!0),e>>>=1){case 0:this.parseUncompressedBlock();break;case 1:this.parseFixedHuffmanBlock();break;case 2:this.parseDynamicHuffmanBlock();break;default:throw new Error("unknown BTYPE: "+e)}},gg.RawInflate.prototype.readBits=function(e){var t,r=this.bitsbuf,n=this.bitsbuflen,i=this.input,a=this.ip;if(a+(e-n+7>>3)>=i.length)throw new Error("input buffer is broken");for(;n<e;)r|=i[a++]<<n,n+=8;return t=r&(1<<e)-1,r>>>=e,n-=e,this.bitsbuf=r,this.bitsbuflen=n,this.ip=a,t},gg.RawInflate.prototype.readCodeByTable=function(e){for(var t,r,n=this.bitsbuf,i=this.bitsbuflen,a=this.input,o=this.ip,s=a.length,c=e[0],h=e[1];i<h&&!(o>=s);)n|=a[o++]<<i,i+=8;if((r=(t=c[n&(1<<h)-1])>>>16)>i)throw new Error("invalid code length: "+r);return this.bitsbuf=n>>r,this.bitsbuflen=i-r,this.ip=o,65535&t},gg.RawInflate.prototype.parseUncompressedBlock=function(){var e,t,r=this.input,n=this.ip,i=this.output,a=this.op,o=r.length,s=i.length;if(this.bitsbuf=0,this.bitsbuflen=0,n+1>=o)throw new Error("invalid uncompressed block header: LEN");if(e=r[n++]|r[n++]<<8,n+1>=o)throw new Error("invalid uncompressed block header: NLEN");if(e===~(r[n++]|r[n++]<<8))throw new Error("invalid uncompressed block header: length verify");if(n+e>r.length)throw new Error("input buffer is broken");switch(this.bufferType){case gg.RawInflate.BufferType.BLOCK:for(;a+e>i.length;)e-=t=s-a,i.set(r.subarray(n,n+t),a),a+=t,n+=t,this.op=a,i=this.expandBufferBlock(),a=this.op;break;case gg.RawInflate.BufferType.ADAPTIVE:for(;a+e>i.length;)i=this.expandBufferAdaptive({fixRatio:2});break;default:throw new Error("invalid inflate mode")}i.set(r.subarray(n,n+e),a),a+=e,n+=e,this.ip=n,this.op=a,this.output=i},gg.RawInflate.prototype.parseFixedHuffmanBlock=function(){switch(this.bufferType){case gg.RawInflate.BufferType.ADAPTIVE:this.decodeHuffmanAdaptive(gg.RawInflate.FixedLiteralLengthTable,gg.RawInflate.FixedDistanceTable);break;case gg.RawInflate.BufferType.BLOCK:this.decodeHuffmanBlock(gg.RawInflate.FixedLiteralLengthTable,gg.RawInflate.FixedDistanceTable);break;default:throw new Error("invalid inflate mode")}},gg.RawInflate.prototype.parseDynamicHuffmanBlock=function(){var e,t,r,n,i,a,o,s,c,h=this.readBits(5)+257,u=this.readBits(5)+1,l=this.readBits(4)+4,f=new Uint8Array(gg.RawInflate.Order.length);for(s=0;s<l;++s)f[gg.RawInflate.Order[s]]=this.readBits(3);for(e=vg(f),n=new Uint8Array(h+u),s=0,c=h+u;s<c;)switch(i=this.readCodeByTable(e)){case 16:for(o=3+this.readBits(2);o--;)n[s++]=a;break;case 17:for(o=3+this.readBits(3);o--;)n[s++]=0;a=0;break;case 18:for(o=11+this.readBits(7);o--;)n[s++]=0;a=0;break;default:n[s++]=i,a=i}switch(t=vg(n.subarray(0,h)),r=vg(n.subarray(h)),this.bufferType){case gg.RawInflate.BufferType.ADAPTIVE:this.decodeHuffmanAdaptive(t,r);break;case gg.RawInflate.BufferType.BLOCK:this.decodeHuffmanBlock(t,r);break;default:throw new Error("invalid inflate mode")}},gg.RawInflate.prototype.decodeHuffmanBlock=function(e,t){var r=this.output,n=this.op;this.currentLitlenTable=e;for(var i,a,o,s,c=r.length-gg.RawInflate.MaxCopyLength,h=gg.RawInflate.LengthCodeTable,u=gg.RawInflate.LengthExtraTable,l=gg.RawInflate.DistCodeTable,f=gg.RawInflate.DistExtraTable;256!==(i=this.readCodeByTable(e));)if(i<256)n>=c&&(this.op=n,r=this.expandBufferBlock(),n=this.op),r[n++]=i;else for(s=h[a=i-257],u[a]>0&&(s+=this.readBits(u[a])),o=l[i=this.readCodeByTable(t)],f[i]>0&&(o+=this.readBits(f[i])),n>=c&&(this.op=n,r=this.expandBufferBlock(),n=this.op);s--;)r[n]=r[n++-o];for(;this.bitsbuflen>=8;)this.bitsbuflen-=8,this.ip--;this.op=n},gg.RawInflate.prototype.decodeHuffmanAdaptive=function(e,t){var r=this.output,n=this.op;this.currentLitlenTable=e;for(var i,a,o,s,c=r.length,h=gg.RawInflate.LengthCodeTable,u=gg.RawInflate.LengthExtraTable,l=gg.RawInflate.DistCodeTable,f=gg.RawInflate.DistExtraTable;256!==(i=this.readCodeByTable(e));)if(i<256)n>=c&&(c=(r=this.expandBufferAdaptive()).length),r[n++]=i;else for(s=h[a=i-257],u[a]>0&&(s+=this.readBits(u[a])),o=l[i=this.readCodeByTable(t)],f[i]>0&&(o+=this.readBits(f[i])),n+s>c&&(c=(r=this.expandBufferAdaptive()).length);s--;)r[n]=r[n++-o];for(;this.bitsbuflen>=8;)this.bitsbuflen-=8,this.ip--;this.op=n},gg.RawInflate.prototype.expandBufferBlock=function(e){var t=new Uint8Array(this.op-gg.RawInflate.MaxBackwardLength),r=this.op-gg.RawInflate.MaxBackwardLength,n=this.output;return t.set(n.subarray(gg.RawInflate.MaxBackwardLength,t.length)),this.blocks.push(t),this.totalpos+=t.length,n.set(n.subarray(r,r+gg.RawInflate.MaxBackwardLength)),this.op=gg.RawInflate.MaxBackwardLength,n},gg.RawInflate.prototype.expandBufferAdaptive=function(e){var t,r,n,i=this.input.length/this.ip+1|0,a=this.input,o=this.output;return e&&("number"==typeof e.fixRatio&&(i=e.fixRatio),"number"==typeof e.addRatio&&(i+=e.addRatio)),r=i<2?(n=(a.length-this.ip)/this.currentLitlenTable[2]/2*258|0)<o.length?o.length+n:o.length<<1:o.length*i,(t=new Uint8Array(r)).set(o),this.output=t,this.output},gg.RawInflate.prototype.concatBufferBlock=function(){var e,t,r,n,i,a=0,o=this.totalpos+(this.op-gg.RawInflate.MaxBackwardLength),s=this.output,c=this.blocks,h=new Uint8Array(o);if(0===c.length)return this.output.subarray(gg.RawInflate.MaxBackwardLength,this.op);for(t=0,r=c.length;t<r;++t)for(n=0,i=(e=c[t]).length;n<i;++n)h[a++]=e[n];for(t=gg.RawInflate.MaxBackwardLength,r=this.op;t<r;++t)h[a++]=s[t];return this.blocks=[],this.buffer=h,this.buffer},gg.RawInflate.prototype.concatBufferDynamic=function(){var e,t=this.op;return this.resize?(e=new Uint8Array(t)).set(this.output.subarray(0,t)):e=this.output.subarray(0,t),this.buffer=e,this.buffer},vg=gg.Huffman.buildHuffmanTable,gg.RawInflateStream=function(e,t,r){this.blocks=[],this.bufferSize=r||65e3,this.totalpos=0,this.ip=void 0===t?0:t,this.bitsbuf=0,this.bitsbuflen=0,this.input=new Uint8Array(e),this.output=new Uint8Array(this.bufferSize),this.op=0,this.bfinal=!1,this.blockLength,this.resize=!1,this.litlenTable,this.distTable,this.sp=0,this.status=gg.RawInflateStream.Status.INITIALIZED,this.ip_,this.bitsbuflen_,this.bitsbuf_},gg.RawInflateStream.BlockType={UNCOMPRESSED:0,FIXED:1,DYNAMIC:2},gg.RawInflateStream.Status={INITIALIZED:0,BLOCK_HEADER_START:1,BLOCK_HEADER_END:2,BLOCK_BODY_START:3,BLOCK_BODY_END:4,DECODE_BLOCK_START:5,DECODE_BLOCK_END:6},gg.RawInflateStream.prototype.decompress=function(e,t){var r=!1;for(void 0!==e&&(this.input=e),void 0!==t&&(this.ip=t);!r;)switch(this.status){case gg.RawInflateStream.Status.INITIALIZED:case gg.RawInflateStream.Status.BLOCK_HEADER_START:this.readBlockHeader()<0&&(r=!0);break;case gg.RawInflateStream.Status.BLOCK_HEADER_END:case gg.RawInflateStream.Status.BLOCK_BODY_START:switch(this.currentBlockType){case gg.RawInflateStream.BlockType.UNCOMPRESSED:this.readUncompressedBlockHeader()<0&&(r=!0);break;case gg.RawInflateStream.BlockType.FIXED:this.parseFixedHuffmanBlock()<0&&(r=!0);break;case gg.RawInflateStream.BlockType.DYNAMIC:this.parseDynamicHuffmanBlock()<0&&(r=!0)}break;case gg.RawInflateStream.Status.BLOCK_BODY_END:case gg.RawInflateStream.Status.DECODE_BLOCK_START:switch(this.currentBlockType){case gg.RawInflateStream.BlockType.UNCOMPRESSED:this.parseUncompressedBlock()<0&&(r=!0);break;case gg.RawInflateStream.BlockType.FIXED:case gg.RawInflateStream.BlockType.DYNAMIC:this.decodeHuffman()<0&&(r=!0)}break;case gg.RawInflateStream.Status.DECODE_BLOCK_END:this.bfinal?r=!0:this.status=gg.RawInflateStream.Status.INITIALIZED}return this.concatBuffer()},gg.RawInflateStream.MaxBackwardLength=32768,gg.RawInflateStream.MaxCopyLength=258,gg.RawInflateStream.Order=new Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gg.RawInflateStream.LengthCodeTable=new Uint16Array([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,258,258]),gg.RawInflateStream.LengthExtraTable=new Uint8Array([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,0,0]),gg.RawInflateStream.DistCodeTable=new Uint16Array([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]),gg.RawInflateStream.DistExtraTable=new Uint8Array([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]),gg.RawInflateStream.FixedLiteralLengthTable=function(){var e,t,r=new Uint8Array(288);for(e=0,t=r.length;e<t;++e)r[e]=e<=143?8:e<=255?9:e<=279?7:8;return vg(r)}(),gg.RawInflateStream.FixedDistanceTable=function(){var e,t,r=new Uint8Array(30);for(e=0,t=r.length;e<t;++e)r[e]=5;return vg(r)}(),gg.RawInflateStream.prototype.readBlockHeader=function(){var e;if(this.status=gg.RawInflateStream.Status.BLOCK_HEADER_START,this.save_(),(e=this.readBits(3))<0)return this.restore_(),-1;switch(1&e&&(this.bfinal=!0),e>>>=1){case 0:this.currentBlockType=gg.RawInflateStream.BlockType.UNCOMPRESSED;break;case 1:this.currentBlockType=gg.RawInflateStream.BlockType.FIXED;break;case 2:this.currentBlockType=gg.RawInflateStream.BlockType.DYNAMIC;break;default:throw new Error("unknown BTYPE: "+e)}this.status=gg.RawInflateStream.Status.BLOCK_HEADER_END},gg.RawInflateStream.prototype.readBits=function(e){for(var t,r=this.bitsbuf,n=this.bitsbuflen,i=this.input,a=this.ip;n<e;){if(i.length<=a)return-1;r|=(t=i[a++])<<n,n+=8}return t=r&(1<<e)-1,r>>>=e,n-=e,this.bitsbuf=r,this.bitsbuflen=n,this.ip=a,t},gg.RawInflateStream.prototype.readCodeByTable=function(e){for(var t,r,n=this.bitsbuf,i=this.bitsbuflen,a=this.input,o=this.ip,s=e[0],c=e[1];i<c;){if(a.length<=o)return-1;n|=a[o++]<<i,i+=8}if((r=(t=s[n&(1<<c)-1])>>>16)>i)throw new Error("invalid code length: "+r);return this.bitsbuf=n>>r,this.bitsbuflen=i-r,this.ip=o,65535&t},gg.RawInflateStream.prototype.readUncompressedBlockHeader=function(){var e,t=this.input,r=this.ip;if(this.status=gg.RawInflateStream.Status.BLOCK_BODY_START,r+4>=t.length)return-1;if((e=t[r++]|t[r++]<<8)==~(t[r++]|t[r++]<<8))throw new Error("invalid uncompressed block header: length verify");this.bitsbuf=0,this.bitsbuflen=0,this.ip=r,this.blockLength=e,this.status=gg.RawInflateStream.Status.BLOCK_BODY_END},gg.RawInflateStream.prototype.parseUncompressedBlock=function(){var e=this.input,t=this.ip,r=this.output,n=this.op,i=this.blockLength;for(this.status=gg.RawInflateStream.Status.DECODE_BLOCK_START;i--;){if(n===r.length&&(r=this.expandBuffer({fixRatio:2})),t>=e.length)return this.ip=t,this.op=n,this.blockLength=i+1,-1;r[n++]=e[t++]}return i<0&&(this.status=gg.RawInflateStream.Status.DECODE_BLOCK_END),this.ip=t,this.op=n,0},gg.RawInflateStream.prototype.parseFixedHuffmanBlock=function(){return this.status=gg.RawInflateStream.Status.BLOCK_BODY_START,this.litlenTable=gg.RawInflateStream.FixedLiteralLengthTable,this.distTable=gg.RawInflateStream.FixedDistanceTable,this.status=gg.RawInflateStream.Status.BLOCK_BODY_END,0},gg.RawInflateStream.prototype.save_=function(){this.ip_=this.ip,this.bitsbuflen_=this.bitsbuflen,this.bitsbuf_=this.bitsbuf},gg.RawInflateStream.prototype.restore_=function(){this.ip=this.ip_,this.bitsbuflen=this.bitsbuflen_,this.bitsbuf=this.bitsbuf_},gg.RawInflateStream.prototype.parseDynamicHuffmanBlock=function(){var e,t,r,n,i=new Uint8Array(gg.RawInflateStream.Order.length);if(this.status=gg.RawInflateStream.Status.BLOCK_BODY_START,this.save_(),e=this.readBits(5)+257,t=this.readBits(5)+1,r=this.readBits(4)+4,e<0||t<0||r<0)return this.restore_(),-1;try{(function(){var a,o,s,c,h,u,l=0;for(h=0;h<r;++h){if((a=this.readBits(3))<0)throw new Error("not enough input");i[gg.RawInflateStream.Order[h]]=a}for(n=vg(i),c=new Uint8Array(e+t),h=0,u=e+t;h<u;){if((o=this.readCodeByTable(n))<0)throw new Error("not enough input");switch(o){case 16:if((a=this.readBits(2))<0)throw new Error("not enough input");for(s=3+a;s--;)c[h++]=l;break;case 17:if((a=this.readBits(3))<0)throw new Error("not enough input");for(s=3+a;s--;)c[h++]=0;l=0;break;case 18:if((a=this.readBits(7))<0)throw new Error("not enough input");for(s=11+a;s--;)c[h++]=0;l=0;break;default:c[h++]=o,l=o}}this.litlenTable=vg(c.subarray(0,e)),this.distTable=vg(c.subarray(e))}).call(this)}catch(e){return this.restore_(),-1}return this.status=gg.RawInflateStream.Status.BLOCK_BODY_END,0},gg.RawInflateStream.prototype.decodeHuffman=function(){var e,t,r,n,i,a=this.output,o=this.op,s=this.litlenTable,c=this.distTable,h=a.length;for(this.status=gg.RawInflateStream.Status.DECODE_BLOCK_START;;){if(this.save_(),(e=this.readCodeByTable(s))<0)return this.op=o,this.restore_(),-1;if(256===e)break;if(e<256)o===h&&(h=(a=this.expandBuffer()).length),a[o++]=e;else{if(t=e-257,n=gg.RawInflateStream.LengthCodeTable[t],gg.RawInflateStream.LengthExtraTable[t]>0){if((i=this.readBits(gg.RawInflateStream.LengthExtraTable[t]))<0)return this.op=o,this.restore_(),-1;n+=i}if((e=this.readCodeByTable(c))<0)return this.op=o,this.restore_(),-1;if(r=gg.RawInflateStream.DistCodeTable[e],gg.RawInflateStream.DistExtraTable[e]>0){if((i=this.readBits(gg.RawInflateStream.DistExtraTable[e]))<0)return this.op=o,this.restore_(),-1;r+=i}for(o+n>=h&&(h=(a=this.expandBuffer()).length);n--;)a[o]=a[o++-r];if(this.ip===this.input.length)return this.op=o,-1}}for(;this.bitsbuflen>=8;)this.bitsbuflen-=8,this.ip--;this.op=o,this.status=gg.RawInflateStream.Status.DECODE_BLOCK_END},gg.RawInflateStream.prototype.expandBuffer=function(e){var t,r,n,i=this.input.length/this.ip+1|0,a=this.input,o=this.output;return e&&("number"==typeof e.fixRatio&&(i=e.fixRatio),"number"==typeof e.addRatio&&(i+=e.addRatio)),r=i<2?(n=(a.length-this.ip)/this.litlenTable[2]/2*258|0)<o.length?o.length+n:o.length<<1:o.length*i,(t=new Uint8Array(r)).set(o),this.output=t,this.output},gg.RawInflateStream.prototype.concatBuffer=function(){var e,t,r=this.op;return e=this.resize?new Uint8Array(this.output.subarray(this.sp,r)):this.output.subarray(this.sp,r),this.sp=r,r>gg.RawInflateStream.MaxBackwardLength+this.bufferSize&&(this.op=this.sp=gg.RawInflateStream.MaxBackwardLength,t=this.output,this.output=new Uint8Array(this.bufferSize+gg.RawInflateStream.MaxBackwardLength),this.output.set(t.subarray(r-gg.RawInflateStream.MaxBackwardLength,r))),e},gg.Inflate=function(e,t){var r,n;switch(this.input=e,this.ip=0,this.rawinflate,this.verify,!t&&(t={})||(t.index&&(this.ip=t.index),t.verify&&(this.verify=t.verify)),r=e[this.ip++],n=e[this.ip++],15&r){case gg.CompressionMethod.DEFLATE:this.method=gg.CompressionMethod.DEFLATE;break;default:throw new Error("unsupported compression method")}if(((r<<8)+n)%31!=0)throw new Error("invalid fcheck flag:"+((r<<8)+n)%31);if(32&n)throw new Error("fdict flag is not supported");this.rawinflate=new gg.RawInflate(e,{index:this.ip,bufferSize:t.bufferSize,bufferType:t.bufferType,resize:t.resize})},gg.Inflate.BufferType=gg.RawInflate.BufferType,gg.Inflate.prototype.decompress=function(){var e,t=this.input;if(e=this.rawinflate.decompress(),this.ip=this.rawinflate.ip,this.verify&&(t[this.ip++]<<24|t[this.ip++]<<16|t[this.ip++]<<8|t[this.ip++])>>>0!==gg.Adler32(e))throw new Error("invalid adler-32 checksum");return e},gg.InflateStream=function(e){this.input=void 0===e?new Uint8Array:e,this.ip=0,this.rawinflate=new gg.RawInflateStream(this.input,this.ip),this.method,this.output=this.rawinflate.output},gg.InflateStream.prototype.decompress=function(e){var t;if(void 0!==e){var r=new Uint8Array(this.input.length+e.length);r.set(this.input,0),r.set(e,this.input.length),this.input=r}return void 0===this.method&&this.readHeader()<0?new Uint8Array:(t=this.rawinflate.decompress(this.input,this.ip),0!==this.rawinflate.ip&&(this.input=this.input.subarray(this.rawinflate.ip),this.ip=0),t)},gg.InflateStream.prototype.readHeader=function(){var e=this.ip,t=this.input,r=t[e++],n=t[e++];if(void 0===r||void 0===n)return-1;switch(15&r){case gg.CompressionMethod.DEFLATE:this.method=gg.CompressionMethod.DEFLATE;break;default:throw new Error("unsupported compression method")}if(((r<<8)+n)%31!=0)throw new Error("invalid fcheck flag:"+((r<<8)+n)%31);if(32&n)throw new Error("fdict flag is not supported");this.ip=e},gg.Gunzip=function(e,t){this.input=e,this.ip=0,this.member=[],this.decompressed=!1},gg.Gunzip.prototype.getMembers=function(){return this.decompressed||this.decompress(),this.member.slice()},gg.Gunzip.prototype.decompress=function(){for(var e=this.input.length;this.ip<e;)this.decodeMember();return this.decompressed=!0,this.concatMember()},gg.Gunzip.prototype.decodeMember=function(){var e,t,r,n,i,a,o,s,c,h=new gg.GunzipMember,u=this.input,l=this.ip;if(h.id1=u[l++],h.id2=u[l++],31!==h.id1||139!==h.id2)throw new Error("invalid file signature:"+h.id1+","+h.id2);switch(h.cm=u[l++],h.cm){case 8:break;default:throw new Error("unknown compression method: "+h.cm)}if(h.flg=u[l++],s=u[l++]|u[l++]<<8|u[l++]<<16|u[l++]<<24,h.mtime=new Date(1e3*s),h.xfl=u[l++],h.os=u[l++],(h.flg&gg.Gzip.FlagsMask.FEXTRA)>0&&(h.xlen=u[l++]|u[l++]<<8,l=this.decodeSubField(l,h.xlen)),(h.flg&gg.Gzip.FlagsMask.FNAME)>0){for(o=[],a=0;(i=u[l++])>0;)o[a++]=String.fromCharCode(i);h.name=o.join("")}if((h.flg&gg.Gzip.FlagsMask.FCOMMENT)>0){for(o=[],a=0;(i=u[l++])>0;)o[a++]=String.fromCharCode(i);h.comment=o.join("")}if((h.flg&gg.Gzip.FlagsMask.FHCRC)>0&&(h.crc16=65535&gg.CRC32.calc(u,0,l),h.crc16!==(u[l++]|u[l++]<<8)))throw new Error("invalid header crc16");if(e=u[u.length-4]|u[u.length-3]<<8|u[u.length-2]<<16|u[u.length-1]<<24,u.length-l-4-4<512*e&&(n=e),t=new gg.RawInflate(u,{index:l,bufferSize:n}),h.data=r=t.decompress(),l=t.ip,h.crc32=c=(u[l++]|u[l++]<<8|u[l++]<<16|u[l++]<<24)>>>0,gg.CRC32.calc(r)!==c)throw new Error("invalid CRC-32 checksum: 0x"+gg.CRC32.calc(r).toString(16)+" / 0x"+c.toString(16));if(h.isize=e=(u[l++]|u[l++]<<8|u[l++]<<16|u[l++]<<24)>>>0,(4294967295&r.length)!==e)throw new Error("invalid input size: "+(4294967295&r.length)+" / "+e);this.member.push(h),this.ip=l},gg.Gunzip.prototype.decodeSubField=function(e,t){return e+t},gg.Gunzip.prototype.concatMember=function(){var e,t,r,n=this.member,i=0,a=0;for(e=0,t=n.length;e<t;++e)a+=n[e].data.length;for(r=new Uint8Array(a),e=0;e<t;++e)r.set(n[e].data,i),i+=n[e].data.length;return r},gg.GunzipMember=function(){this.id1,this.id2,this.cm,this.flg,this.mtime,this.xfl,this.os,this.crc16,this.xlen,this.crc32,this.isize,this.name,this.comment,this.data},gg.GunzipMember.prototype.getName=function(){return this.name},gg.GunzipMember.prototype.getData=function(){return this.data},gg.GunzipMember.prototype.getMtime=function(){return this.mtime},gg.Gzip=function(e,t){this.input=e,this.ip=0,this.output,this.op=0,this.flags={},this.filename,this.comment,this.deflateOptions,t&&(t.flags&&(this.flags=t.flags),"string"==typeof t.filename&&(this.filename=t.filename),"string"==typeof t.comment&&(this.comment=t.comment),t.deflateOptions&&(this.deflateOptions=t.deflateOptions)),this.deflateOptions||(this.deflateOptions={})},gg.Gzip.DefaultBufferSize=32768,gg.Gzip.prototype.compress=function(){var e,t,r,n,i,a,o,s,c=new Uint8Array(gg.Gzip.DefaultBufferSize),h=0,u=this.input,l=this.ip,f=this.filename,p=this.comment;if(c[h++]=31,c[h++]=139,c[h++]=8,e=0,this.flags.fname&&(e|=gg.Gzip.FlagsMask.FNAME),this.flags.fcomment&&(e|=gg.Gzip.FlagsMask.FCOMMENT),this.flags.fhcrc&&(e|=gg.Gzip.FlagsMask.FHCRC),c[h++]=e,t=(Date.now?Date.now():+new Date)/1e3|0,c[h++]=255&t,c[h++]=t>>>8&255,c[h++]=t>>>16&255,c[h++]=t>>>24&255,c[h++]=0,c[h++]=gg.Gzip.OperatingSystem.UNKNOWN,void 0!==this.flags.fname){for(o=0,s=f.length;o<s;++o)(a=f.charCodeAt(o))>255&&(c[h++]=a>>>8&255),c[h++]=255&a;c[h++]=0}if(this.flags.comment){for(o=0,s=p.length;o<s;++o)(a=p.charCodeAt(o))>255&&(c[h++]=a>>>8&255),c[h++]=255&a;c[h++]=0}return this.flags.fhcrc&&(r=65535&gg.CRC32.calc(c,0,h),c[h++]=255&r,c[h++]=r>>>8&255),this.deflateOptions.outputBuffer=c,this.deflateOptions.outputIndex=h,c=(i=new gg.RawDeflate(u,this.deflateOptions)).compress(),(h=i.op)+8>c.buffer.byteLength?(this.output=new Uint8Array(h+8),this.output.set(new Uint8Array(c.buffer)),c=this.output):c=new Uint8Array(c.buffer),n=gg.CRC32.calc(u),c[h++]=255&n,c[h++]=n>>>8&255,c[h++]=n>>>16&255,c[h++]=n>>>24&255,s=u.length,c[h++]=255&s,c[h++]=s>>>8&255,c[h++]=s>>>16&255,c[h++]=s>>>24&255,this.ip=l,h<c.length&&(this.output=c=c.subarray(0,h)),c},gg.Gzip.OperatingSystem={FAT:0,AMIGA:1,VMS:2,UNIX:3,VM_CMS:4,ATARI_TOS:5,HPFS:6,MACINTOSH:7,Z_SYSTEM:8,CP_M:9,TOPS_20:10,NTFS:11,QDOS:12,ACORN_RISCOS:13,UNKNOWN:255},gg.Gzip.FlagsMask={FTEXT:1,FHCRC:2,FEXTRA:4,FNAME:8,FCOMMENT:16},gg.Heap=function(e){this.buffer=new Uint16Array(2*e),this.length=0},gg.Heap.prototype.getParent=function(e){return 2*((e-2)/4|0)},gg.Heap.prototype.getChild=function(e){return 2*e+2},gg.Heap.prototype.push=function(e,t){var r,n,i,a=this.buffer;for(r=this.length,a[this.length++]=t,a[this.length++]=e;r>0&&(n=this.getParent(r),a[r]>a[n]);)i=a[r],a[r]=a[n],a[n]=i,i=a[r+1],a[r+1]=a[n+1],a[n+1]=i,r=n;return this.length},gg.Heap.prototype.pop=function(){var e,t,r,n,i,a=this.buffer;for(t=a[0],e=a[1],this.length-=2,a[0]=a[this.length],a[1]=a[this.length+1],i=0;!((n=this.getChild(i))>=this.length)&&(n+2<this.length&&a[n+2]>a[n]&&(n+=2),a[n]>a[i]);)r=a[i],a[i]=a[n],a[n]=r,r=a[i+1],a[i+1]=a[n+1],a[n+1]=r,i=n;return{index:e,value:t,length:this.length}},gg.RawDeflate=function(e,t){this.compressionType=gg.RawDeflate.CompressionType.DYNAMIC,this.lazy=0,this.freqsLitLen,this.freqsDist,this.input=e instanceof Array?new Uint8Array(e):e,this.output,this.op=0,t&&(t.lazy&&(this.lazy=t.lazy),"number"==typeof t.compressionType&&(this.compressionType=t.compressionType),t.outputBuffer&&(this.output=t.outputBuffer instanceof Array?new Uint8Array(t.outputBuffer):t.outputBuffer),"number"==typeof t.outputIndex&&(this.op=t.outputIndex)),this.output||(this.output=new Uint8Array(32768))},gg.RawDeflate.CompressionType={NONE:0,FIXED:1,DYNAMIC:2,RESERVED:3},gg.RawDeflate.Lz77MinLength=3,gg.RawDeflate.Lz77MaxLength=258,gg.RawDeflate.WindowSize=32768,gg.RawDeflate.MaxCodeLength=16,gg.RawDeflate.HUFMAX=286,gg.RawDeflate.FixedHuffmanTable=function(){var e,t=[];for(e=0;e<288;e++)switch(!0){case e<=143:t.push([e+48,8]);break;case e<=255:t.push([e-144+400,9]);break;case e<=279:t.push([e-256+0,7]);break;case e<=287:t.push([e-280+192,8]);break;default:throw"invalid literal: "+e}return t}(),gg.RawDeflate.prototype.compress=function(){var e,t,r,n=this.input;switch(this.compressionType){case gg.RawDeflate.CompressionType.NONE:for(t=0,r=n.length;t<r;)t+=(e=n.subarray(t,t+65535)).length,this.makeNocompressBlock(e,t===r);break;case gg.RawDeflate.CompressionType.FIXED:this.output=this.makeFixedHuffmanBlock(n,!0),this.op=this.output.length;break;case gg.RawDeflate.CompressionType.DYNAMIC:this.output=this.makeDynamicHuffmanBlock(n,!0),this.op=this.output.length;break;default:throw"invalid compression type"}return this.output},gg.RawDeflate.prototype.makeNocompressBlock=function(e,t){var r,n,i,a,o=this.output,s=this.op;for(o=new Uint8Array(this.output.buffer);o.length<=s+e.length+5;)o=new Uint8Array(o.length<<1);return o.set(this.output),r=t?1:0,n=gg.RawDeflate.CompressionType.NONE,o[s++]=r|n<<1,a=65536+~(i=e.length)&65535,o[s++]=255&i,o[s++]=i>>>8&255,o[s++]=255&a,o[s++]=a>>>8&255,o.set(e,s),s+=e.length,o=o.subarray(0,s),this.op=s,this.output=o,o},gg.RawDeflate.prototype.makeFixedHuffmanBlock=function(e,t){var r,n,i,a=new gg.BitStream(new Uint8Array(this.output.buffer),this.op);return r=t?1:0,n=gg.RawDeflate.CompressionType.FIXED,a.writeBits(r,1,!0),a.writeBits(n,2,!0),i=this.lz77(e),this.fixedHuffman(i,a),a.finish()},gg.RawDeflate.prototype.makeDynamicHuffmanBlock=function(e,t){var r,n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b=new gg.BitStream(new Uint8Array(this.output.buffer),this.op),w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],x=new Array(19);for(r=t?1:0,n=gg.RawDeflate.CompressionType.DYNAMIC,b.writeBits(r,1,!0),b.writeBits(n,2,!0),i=this.lz77(e),c=this.getLengths_(this.freqsLitLen,15),h=this.getCodesFromLengths_(c),u=this.getLengths_(this.freqsDist,7),l=this.getCodesFromLengths_(u),a=286;a>257&&0===c[a-1];a--);for(o=30;o>1&&0===u[o-1];o--);for(f=this.getTreeSymbols_(a,c,o,u),p=this.getLengths_(f.freqs,7),m=0;m<19;m++)x[m]=p[w[m]];for(s=19;s>4&&0===x[s-1];s--);for(d=this.getCodesFromLengths_(p),b.writeBits(a-257,5,!0),b.writeBits(o-1,5,!0),b.writeBits(s-4,4,!0),m=0;m<s;m++)b.writeBits(x[m],3,!0);for(m=0,y=f.codes.length;m<y;m++)if(g=f.codes[m],b.writeBits(d[g],p[g],!0),g>=16){switch(m++,g){case 16:v=2;break;case 17:v=3;break;case 18:v=7;break;default:throw"invalid code: "+g}b.writeBits(f.codes[m],v,!0)}return this.dynamicHuffman(i,[h,c],[l,u],b),b.finish()},gg.RawDeflate.prototype.dynamicHuffman=function(e,t,r,n){var i,a,o,s,c,h,u,l;for(c=t[0],h=t[1],u=r[0],l=r[1],i=0,a=e.length;i<a;++i)if(o=e[i],n.writeBits(c[o],h[o],!0),o>256)n.writeBits(e[++i],e[++i],!0),s=e[++i],n.writeBits(u[s],l[s],!0),n.writeBits(e[++i],e[++i],!0);else if(256===o)break;return n},gg.RawDeflate.prototype.fixedHuffman=function(e,t){var r,n,i;for(r=0,n=e.length;r<n;r++)if(i=e[r],gg.BitStream.prototype.writeBits.apply(t,gg.RawDeflate.FixedHuffmanTable[i]),i>256)t.writeBits(e[++r],e[++r],!0),t.writeBits(e[++r],5),t.writeBits(e[++r],e[++r],!0);else if(256===i)break;return t},gg.RawDeflate.Lz77Match=function(e,t){this.length=e,this.backwardDistance=t},gg.RawDeflate.Lz77Match.LengthCodeTable=function(e){return new Uint32Array(e)}(function(){var e,t,r=[];for(e=3;e<=258;e++)t=n(e),r[e]=t[2]<<24|t[1]<<16|t[0];function n(e){switch(!0){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case e<=12:return[265,e-11,1];case e<=14:return[266,e-13,1];case e<=16:return[267,e-15,1];case e<=18:return[268,e-17,1];case e<=22:return[269,e-19,2];case e<=26:return[270,e-23,2];case e<=30:return[271,e-27,2];case e<=34:return[272,e-31,2];case e<=42:return[273,e-35,3];case e<=50:return[274,e-43,3];case e<=58:return[275,e-51,3];case e<=66:return[276,e-59,3];case e<=82:return[277,e-67,4];case e<=98:return[278,e-83,4];case e<=114:return[279,e-99,4];case e<=130:return[280,e-115,4];case e<=162:return[281,e-131,5];case e<=194:return[282,e-163,5];case e<=226:return[283,e-195,5];case e<=257:return[284,e-227,5];case 258===e:return[285,e-258,0];default:throw"invalid length: "+e}}return r}()),gg.RawDeflate.Lz77Match.prototype.getDistanceCode_=function(e){var t;switch(!0){case 1===e:t=[0,e-1,0];break;case 2===e:t=[1,e-2,0];break;case 3===e:t=[2,e-3,0];break;case 4===e:t=[3,e-4,0];break;case e<=6:t=[4,e-5,1];break;case e<=8:t=[5,e-7,1];break;case e<=12:t=[6,e-9,2];break;case e<=16:t=[7,e-13,2];break;case e<=24:t=[8,e-17,3];break;case e<=32:t=[9,e-25,3];break;case e<=48:t=[10,e-33,4];break;case e<=64:t=[11,e-49,4];break;case e<=96:t=[12,e-65,5];break;case e<=128:t=[13,e-97,5];break;case e<=192:t=[14,e-129,6];break;case e<=256:t=[15,e-193,6];break;case e<=384:t=[16,e-257,7];break;case e<=512:t=[17,e-385,7];break;case e<=768:t=[18,e-513,8];break;case e<=1024:t=[19,e-769,8];break;case e<=1536:t=[20,e-1025,9];break;case e<=2048:t=[21,e-1537,9];break;case e<=3072:t=[22,e-2049,10];break;case e<=4096:t=[23,e-3073,10];break;case e<=6144:t=[24,e-4097,11];break;case e<=8192:t=[25,e-6145,11];break;case e<=12288:t=[26,e-8193,12];break;case e<=16384:t=[27,e-12289,12];break;case e<=24576:t=[28,e-16385,13];break;case e<=32768:t=[29,e-24577,13];break;default:throw"invalid distance"}return t},gg.RawDeflate.Lz77Match.prototype.toLz77Array=function(){var e,t=this.length,r=this.backwardDistance,n=[],i=0;return e=gg.RawDeflate.Lz77Match.LengthCodeTable[t],n[i++]=65535&e,n[i++]=e>>16&255,n[i++]=e>>24,e=this.getDistanceCode_(r),n[i++]=e[0],n[i++]=e[1],n[i++]=e[2],n},gg.RawDeflate.prototype.lz77=function(e){var t,r,n,i,a,o,s,c,h,u={},l=gg.RawDeflate.WindowSize,f=new Uint16Array(2*e.length),p=0,d=0,g=new Uint32Array(286),v=new Uint32Array(30),m=this.lazy;function y(e,t){var r,n,i=e.toLz77Array();for(r=0,n=i.length;r<n;++r)f[p++]=i[r];g[i[0]]++,v[i[3]]++,d=e.length+t-1,c=null}for(g[256]=1,t=0,r=e.length;t<r;++t){for(a=0,n=0,i=gg.RawDeflate.Lz77MinLength;n<i&&t+n!==r;++n)a=a<<8|e[t+n];if(void 0===u[a]&&(u[a]=[]),o=u[a],d-- >0)o.push(t);else{for(;o.length>0&&t-o[0]>l;)o.shift();if(t+gg.RawDeflate.Lz77MinLength>=r){for(c&&y(c,-1),n=0,i=r-t;n<i;++n)h=e[t+n],f[p++]=h,++g[h];break}o.length>0?(s=this.searchLongestMatch_(e,t,o),c?c.length<s.length?(h=e[t-1],f[p++]=h,++g[h],y(s,0)):y(c,-1):s.length<m?c=s:y(s,0)):c?y(c,-1):(h=e[t],f[p++]=h,++g[h]),o.push(t)}}return f[p++]=256,g[256]++,this.freqsLitLen=g,this.freqsDist=v,f.subarray(0,p)},gg.RawDeflate.prototype.searchLongestMatch_=function(e,t,r){var n,i,a,o,s,c,h=0,u=e.length;e:for(o=0,c=r.length;o<c;o++){if(n=r[c-o-1],a=gg.RawDeflate.Lz77MinLength,h>gg.RawDeflate.Lz77MinLength){for(s=h;s>gg.RawDeflate.Lz77MinLength;s--)if(e[n+s-1]!==e[t+s-1])continue e;a=h}for(;a<gg.RawDeflate.Lz77MaxLength&&t+a<u&&e[n+a]===e[t+a];)++a;if(a>h&&(i=n,h=a),a===gg.RawDeflate.Lz77MaxLength)break}return new gg.RawDeflate.Lz77Match(h,t-i)},gg.RawDeflate.prototype.getTreeSymbols_=function(e,t,r,n){var i,a,o,s,c,h,u=new Uint32Array(e+r),l=new Uint32Array(316),f=new Uint8Array(19);for(a=0,i=0;i<e;i++)u[a++]=t[i];for(i=0;i<r;i++)u[a++]=n[i];for(c=0,i=0,s=u.length;i<s;i+=a){for(a=1;i+a<s&&u[i+a]===u[i];++a);if(o=a,0===u[i])if(o<3)for(;o-- >0;)l[c++]=0,f[0]++;else for(;o>0;)(h=o<138?o:138)>o-3&&h<o&&(h=o-3),h<=10?(l[c++]=17,l[c++]=h-3,f[17]++):(l[c++]=18,l[c++]=h-11,f[18]++),o-=h;else if(l[c++]=u[i],f[u[i]]++,--o<3)for(;o-- >0;)l[c++]=u[i],f[u[i]]++;else for(;o>0;)(h=o<6?o:6)>o-3&&h<o&&(h=o-3),l[c++]=16,l[c++]=h-3,f[16]++,o-=h}return{codes:l.subarray(0,c),freqs:f}},gg.RawDeflate.prototype.getLengths_=function(e,t){var r,n,i,a,o,s=e.length,c=new gg.Heap(2*gg.RawDeflate.HUFMAX),h=new Uint8Array(s);for(a=0;a<s;++a)e[a]>0&&c.push(a,e[a]);if(r=new Array(c.length/2),n=new Uint32Array(c.length/2),1===r.length)return h[c.pop().index]=1,h;for(a=0,o=c.length/2;a<o;++a)r[a]=c.pop(),n[a]=r[a].value;for(i=this.reversePackageMerge_(n,n.length,t),a=0,o=r.length;a<o;++a)h[r[a].index]=i[a];return h},gg.RawDeflate.prototype.reversePackageMerge_=function(e,t,r){var n,i,a,o,s,c=new Uint16Array(r),h=new Uint8Array(r),u=new Uint8Array(t),l=new Array(r),f=new Array(r),p=new Array(r),d=(1<<r)-t,g=1<<r-1;function v(e){var r=f[e][p[e]];r===t?(v(e+1),v(e+1)):--u[r],++p[e]}for(c[r-1]=t,i=0;i<r;++i)d<g?h[i]=0:(h[i]=1,d-=g),d<<=1,c[r-2-i]=(c[r-1-i]/2|0)+t;for(c[0]=h[0],l[0]=new Array(c[0]),f[0]=new Array(c[0]),i=1;i<r;++i)c[i]>2*c[i-1]+h[i]&&(c[i]=2*c[i-1]+h[i]),l[i]=new Array(c[i]),f[i]=new Array(c[i]);for(n=0;n<t;++n)u[n]=r;for(a=0;a<c[r-1];++a)l[r-1][a]=e[a],f[r-1][a]=a;for(n=0;n<r;++n)p[n]=0;for(1===h[r-1]&&(--u[0],++p[r-1]),i=r-2;i>=0;--i){for(n=0,o=0,s=p[i+1],a=0;a<c[i];a++)(o=l[i+1][s]+l[i+1][s+1])>e[n]?(l[i][a]=o,f[i][a]=t,s+=2):(l[i][a]=e[n],f[i][a]=n,++n);p[i]=0,1===h[i]&&v(i)}return u},gg.RawDeflate.prototype.getCodesFromLengths_=function(e){var t,r,n,i,a=new Uint16Array(e.length),o=[],s=[],c=0;for(t=0,r=e.length;t<r;t++)o[e[t]]=1+(0|o[e[t]]);for(t=1,r=gg.RawDeflate.MaxCodeLength;t<=r;t++)s[t]=c,c+=0|o[t],c<<=1;for(t=0,r=e.length;t<r;t++)for(c=s[e[t]],s[e[t]]+=1,a[t]=0,n=0,i=e[t];n<i;n++)a[t]=a[t]<<1|1&c,c>>>=1;return a},gg.Unzip=function(e,t){t=t||{},this.input=e instanceof Array?new Uint8Array(e):e,this.ip=0,this.eocdrOffset,this.numberOfThisDisk,this.startDisk,this.totalEntriesThisDisk,this.totalEntries,this.centralDirectorySize,this.centralDirectoryOffset,this.commentLength,this.comment,this.fileHeaderList,this.filenameToIndex,this.verify=t.verify||!1,this.password=t.password},gg.Unzip.CompressionMethod=gg.Zip.CompressionMethod,gg.Unzip.FileHeaderSignature=gg.Zip.FileHeaderSignature,gg.Unzip.LocalFileHeaderSignature=gg.Zip.LocalFileHeaderSignature,gg.Unzip.CentralDirectorySignature=gg.Zip.CentralDirectorySignature,gg.Unzip.FileHeader=function(e,t){this.input=e,this.offset=t,this.length,this.version,this.os,this.needVersion,this.flags,this.compression,this.time,this.date,this.crc32,this.compressedSize,this.plainSize,this.fileNameLength,this.extraFieldLength,this.fileCommentLength,this.diskNumberStart,this.internalFileAttributes,this.externalFileAttributes,this.relativeOffset,this.filename,this.extraField,this.comment},gg.Unzip.FileHeader.prototype.parse=function(){var e=this.input,t=this.offset;if(e[t++]!==gg.Unzip.FileHeaderSignature[0]||e[t++]!==gg.Unzip.FileHeaderSignature[1]||e[t++]!==gg.Unzip.FileHeaderSignature[2]||e[t++]!==gg.Unzip.FileHeaderSignature[3])throw new Error("invalid file header signature");this.version=e[t++],this.os=e[t++],this.needVersion=e[t++]|e[t++]<<8,this.flags=e[t++]|e[t++]<<8,this.compression=e[t++]|e[t++]<<8,this.time=e[t++]|e[t++]<<8,this.date=e[t++]|e[t++]<<8,this.crc32=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.compressedSize=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.plainSize=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.fileNameLength=e[t++]|e[t++]<<8,this.extraFieldLength=e[t++]|e[t++]<<8,this.fileCommentLength=e[t++]|e[t++]<<8,this.diskNumberStart=e[t++]|e[t++]<<8,this.internalFileAttributes=e[t++]|e[t++]<<8,this.externalFileAttributes=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,this.relativeOffset=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.filename=String.fromCharCode.apply(null,e.subarray(t,t+=this.fileNameLength)),this.extraField=e.subarray(t,t+=this.extraFieldLength),this.comment=e.subarray(t,t+this.fileCommentLength),this.length=t-this.offset},gg.Unzip.LocalFileHeader=function(e,t){this.input=e,this.offset=t,this.length,this.needVersion,this.flags,this.compression,this.time,this.date,this.crc32,this.compressedSize,this.plainSize,this.fileNameLength,this.extraFieldLength,this.filename,this.extraField},gg.Unzip.LocalFileHeader.Flags=gg.Zip.Flags,gg.Unzip.LocalFileHeader.prototype.parse=function(){var e=this.input,t=this.offset;if(e[t++]!==gg.Unzip.LocalFileHeaderSignature[0]||e[t++]!==gg.Unzip.LocalFileHeaderSignature[1]||e[t++]!==gg.Unzip.LocalFileHeaderSignature[2]||e[t++]!==gg.Unzip.LocalFileHeaderSignature[3])throw new Error("invalid local file header signature");this.needVersion=e[t++]|e[t++]<<8,this.flags=e[t++]|e[t++]<<8,this.compression=e[t++]|e[t++]<<8,this.time=e[t++]|e[t++]<<8,this.date=e[t++]|e[t++]<<8,this.crc32=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.compressedSize=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.plainSize=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.fileNameLength=e[t++]|e[t++]<<8,this.extraFieldLength=e[t++]|e[t++]<<8,this.filename=String.fromCharCode.apply(null,e.subarray(t,t+=this.fileNameLength)),this.extraField=e.subarray(t,t+=this.extraFieldLength),this.length=t-this.offset},gg.Unzip.prototype.searchEndOfCentralDirectoryRecord=function(){var e,t=this.input;for(e=t.length-12;e>0;--e)if(t[e]===gg.Unzip.CentralDirectorySignature[0]&&t[e+1]===gg.Unzip.CentralDirectorySignature[1]&&t[e+2]===gg.Unzip.CentralDirectorySignature[2]&&t[e+3]===gg.Unzip.CentralDirectorySignature[3])return void(this.eocdrOffset=e);throw new Error("End of Central Directory Record not found")},gg.Unzip.prototype.parseEndOfCentralDirectoryRecord=function(){var e,t=this.input;if(this.eocdrOffset||this.searchEndOfCentralDirectoryRecord(),e=this.eocdrOffset,t[e++]!==gg.Unzip.CentralDirectorySignature[0]||t[e++]!==gg.Unzip.CentralDirectorySignature[1]||t[e++]!==gg.Unzip.CentralDirectorySignature[2]||t[e++]!==gg.Unzip.CentralDirectorySignature[3])throw new Error("invalid signature");this.numberOfThisDisk=t[e++]|t[e++]<<8,this.startDisk=t[e++]|t[e++]<<8,this.totalEntriesThisDisk=t[e++]|t[e++]<<8,this.totalEntries=t[e++]|t[e++]<<8,this.centralDirectorySize=(t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24)>>>0,this.centralDirectoryOffset=(t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24)>>>0,this.commentLength=t[e++]|t[e++]<<8,this.comment=t.subarray(e,e+this.commentLength)},gg.Unzip.prototype.parseFileHeader=function(){var e,t,r,n,i=[],a={};if(!this.fileHeaderList){for(void 0===this.centralDirectoryOffset&&this.parseEndOfCentralDirectoryRecord(),e=this.centralDirectoryOffset,r=0,n=this.totalEntries;r<n;++r)(t=new gg.Unzip.FileHeader(this.input,e)).parse(),e+=t.length,i[r]=t,a[t.filename]=r;if(this.centralDirectorySize<e-this.centralDirectoryOffset)throw new Error("invalid file header size");this.fileHeaderList=i,this.filenameToIndex=a}},gg.Unzip.prototype.getFileData=function(e,t){t=t||{};var r,n,i,a,o,s,c,h,u=this.input,l=this.fileHeaderList;if(l||this.parseFileHeader(),void 0===l[e])throw new Error("wrong index");if(n=l[e].relativeOffset,(r=new gg.Unzip.LocalFileHeader(this.input,n)).parse(),n+=r.length,i=r.compressedSize,0!=(r.flags&gg.Unzip.LocalFileHeader.Flags.ENCRYPT)){if(!t.password&&!this.password)throw new Error("please set password");for(s=this.createDecryptionKey(t.password||this.password),c=n,h=n+12;c<h;++c)this.decode(s,u[c]);for(c=n+=12,h=n+(i-=12);c<h;++c)u[c]=this.decode(s,u[c])}switch(r.compression){case gg.Unzip.CompressionMethod.STORE:a=this.input.subarray(n,n+i);break;case gg.Unzip.CompressionMethod.DEFLATE:a=new gg.RawInflate(this.input,{index:n,bufferSize:r.plainSize}).decompress();break;default:throw new Error("unknown compression type")}if(this.verify&&(o=gg.CRC32.calc(a),r.crc32!==o))throw new Error("wrong crc: file=0x"+r.crc32.toString(16)+", data=0x"+o.toString(16));return a},gg.Unzip.prototype.getFilenames=function(){var e,t,r,n=[];for(this.fileHeaderList||this.parseFileHeader(),e=0,t=(r=this.fileHeaderList).length;e<t;++e)n[e]=r[e].filename;return n},gg.Unzip.prototype.decompress=function(e,t){var r;if(this.filenameToIndex||this.parseFileHeader(),void 0===(r=this.filenameToIndex[e]))throw new Error(e+" not found");return this.getFileData(r,t)},gg.Unzip.prototype.setPassword=function(e){this.password=e},gg.Unzip.prototype.decode=function(e,t){return t^=this.getByte(e),this.updateKeys(e,t),t},gg.Unzip.prototype.updateKeys=gg.Zip.prototype.updateKeys,gg.Unzip.prototype.createDecryptionKey=gg.Zip.prototype.createEncryptionKey,gg.Unzip.prototype.getByte=gg.Zip.prototype.getByte,gg.Util.stringToByteArray=function(e){var t,r,n=e.split("");for(t=0,r=n.length;t<r;t++)n[t]=(255&n[t].charCodeAt(0))>>>0;return n},gg.Adler32=function(e){return"string"==typeof e&&(e=gg.Util.stringToByteArray(e)),gg.Adler32.update(1,e)},gg.Adler32.update=function(e,t){for(var r,n=65535&e,i=e>>>16&65535,a=t.length,o=0;a>0;){a-=r=a>gg.Adler32.OptimizationParameter?gg.Adler32.OptimizationParameter:a;do{i+=n+=t[o++]}while(--r);n%=65521,i%=65521}return(i<<16|n)>>>0},gg.Adler32.OptimizationParameter=1024,gg.BitStream=function(e,t){if(this.index="number"==typeof t?t:0,this.bitindex=0,this.buffer=e instanceof Uint8Array?e:new Uint8Array(gg.BitStream.DefaultBlockSize),2*this.buffer.length<=this.index)throw new Error("invalid index");this.buffer.length<=this.index&&this.expandBuffer()},gg.BitStream.DefaultBlockSize=32768,gg.BitStream.prototype.expandBuffer=function(){var e=this.buffer,t=e.length,r=new Uint8Array(t<<1);return r.set(e),this.buffer=r},gg.BitStream.prototype.writeBits=function(e,t,r){var n,i=this.buffer,a=this.index,o=this.bitindex,s=i[a];if(r&&t>1&&(e=t>8?function(e){return gg.BitStream.ReverseTable[255&e]<<24|gg.BitStream.ReverseTable[e>>>8&255]<<16|gg.BitStream.ReverseTable[e>>>16&255]<<8|gg.BitStream.ReverseTable[e>>>24&255]}(e)>>32-t:gg.BitStream.ReverseTable[e]>>8-t),t+o<8)s=s<<t|e,o+=t;else for(n=0;n<t;++n)s=s<<1|e>>t-n-1&1,8==++o&&(o=0,i[a++]=gg.BitStream.ReverseTable[s],s=0,a===i.length&&(i=this.expandBuffer()));i[a]=s,this.buffer=i,this.bitindex=o,this.index=a},gg.BitStream.prototype.finish=function(){var e=this.buffer,t=this.index;return this.bitindex>0&&(e[t]<<=8-this.bitindex,e[t]=gg.BitStream.ReverseTable[e[t]],t++),e.subarray(0,t)},gg.BitStream.ReverseTable=function(){var e,t=new Uint8Array(256);for(e=0;e<256;++e)t[e]=function(e){var t=e,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=1&e,--r;return(t<<r&255)>>>0}(e);return t}(),gg.CRC32.calc=function(e,t,r){return gg.CRC32.update(e,0,t,r)},gg.CRC32.update=function(e,t,r,n){var i=gg.CRC32.Table,a="number"==typeof r?r:r=0,o="number"==typeof n?n:e.length;for(t^=4294967295,a=7&o;a--;++r)t=t>>>8^i[255&(t^e[r])];for(a=o>>3;a--;r+=8)t=(t=(t=(t=(t=(t=(t=(t=t>>>8^i[255&(t^e[r])])>>>8^i[255&(t^e[r+1])])>>>8^i[255&(t^e[r+2])])>>>8^i[255&(t^e[r+3])])>>>8^i[255&(t^e[r+4])])>>>8^i[255&(t^e[r+5])])>>>8^i[255&(t^e[r+6])])>>>8^i[255&(t^e[r+7])];return(4294967295^t)>>>0},gg.CRC32.single=function(e,t){return(gg.CRC32.Table[255&(e^t)]^e>>>8)>>>0},gg.CRC32.Table_=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],gg.CRC32.Table=new Uint32Array(gg.CRC32.Table_),gg.Deflate=function(e,t){this.input=e,this.output=new Uint8Array(gg.Deflate.DefaultBufferSize),this.compressionType=gg.Deflate.CompressionType.DYNAMIC,this.rawDeflate;var r,n={};for(r in!t&&(t={})||"number"==typeof t.compressionType&&(this.compressionType=t.compressionType),t)n[r]=t[r];n.outputBuffer=this.output,this.rawDeflate=new gg.RawDeflate(this.input,n)},gg.Deflate.DefaultBufferSize=32768,gg.Deflate.CompressionType=gg.RawDeflate.CompressionType,gg.Deflate.compress=function(e,t){return new gg.Deflate(e,t).compress()},gg.Deflate.prototype.compress=function(){var e,t,r,n,i,a,o,s=0;switch(o=this.output,e=gg.CompressionMethod.DEFLATE){case gg.CompressionMethod.DEFLATE:t=Math.LOG2E*Math.log(gg.RawDeflate.WindowSize)-8;break;default:throw new Error("invalid compression method")}switch(r=t<<4|e,o[s++]=r,e){case gg.CompressionMethod.DEFLATE:switch(this.compressionType){case gg.Deflate.CompressionType.NONE:i=0;break;case gg.Deflate.CompressionType.FIXED:i=1;break;case gg.Deflate.CompressionType.DYNAMIC:i=2;break;default:throw new Error("unsupported compression type")}break;default:throw new Error("invalid compression method")}return n=i<<6|0,n|=31-(256*r+n)%31,o[s++]=n,a=gg.Adler32(this.input),this.rawDeflate.op=s,s=(o=this.rawDeflate.compress()).length,(o=new Uint8Array(o.buffer)).length<=s+4&&(this.output=new Uint8Array(o.length+4),this.output.set(o),o=this.output),(o=o.subarray(0,s+4))[s++]=a>>24&255,o[s++]=a>>16&255,o[s++]=a>>8&255,o[s++]=255&a,o};var bg=function(e){return e.split(/\n|\r\n|\r/g)};function wg(e,t){var r,n,i=[],a=e.length,o=0,s=!1;if(a>0)for(i[o]=e.charAt(0),r=1;r<a;r++)'"'===(n=e.charAt(r))?s=!s:s||n!==t?i[o]+=n:i[++o]="";return i}function xg(e){return e.split("").reduce((function(e,t){return(e=(e<<5)-e+t.charCodeAt(0))&e}),0)}var kg={rgbListFromHSV:function(){for(var e=[],t=1;t>=.5;t-=.1)for(var r=0;r<1;r+=1/28){var n="rgb("+kg.hsvToRgb(r,1,t).join(",")+")";e.push(n)}return e.pop(),e.push(kg.rgbColor(16,16,16)),e},rgbToHex:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""},hexToRgb:function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(null!==t)return"rgb("+parseInt(t[1],16)+","+parseInt(t[2],16)+","+parseInt(t[3],16)+")"},hsvToRgb:function(e,t,r){var n,i,a,o=Math.floor(6*e),s=6*e-o,c=r*(1-t),h=r*(1-s*t),u=r*(1-(1-s)*t);switch(o%6){case 0:n=r,i=u,a=c;break;case 1:n=h,i=r,a=c;break;case 2:n=c,i=r,a=u;break;case 3:n=c,i=h,a=r;break;case 4:n=u,i=c,a=r;break;case 5:n=r,i=c,a=h}return[Math.floor(255*n),Math.floor(255*i),Math.floor(255*a)]},hslToRgb:function(e,t,r){var n,i,a;if(0===t)n=i=a=r;else{var o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;n=kg.hue2rgb(s,o,e+1/3),i=kg.hue2rgb(s,o,e),a=kg.hue2rgb(s,o,e-1/3)}return[255*n,255*i,255*a]},hue2rgb:function(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e},rgbaColor:function(e,t,r,n){return"rgba("+(e=Yf(e,0,255))+","+(t=Yf(t,0,255))+","+(r=Yf(r,0,255))+","+(n=Yf(n,0,1))+")"},rgbColor:function(e,t,r){return"rgb("+(e=Yf(e,0,255))+","+(t=Yf(t,0,255))+","+(r=Yf(r,0,255))+")"},greyScale:function(e){var t=Yf(e,0,255);return"rgb("+t+","+t+","+t+")"},randomGrey:function(e,t){e=Yf(e,0,255),t=Yf(t,0,255);var r=Math.round(Math.random(e,t)).toString(10);return"rgb("+r+","+r+","+r+")"},randomRGB:function(e,t){return e=Yf(e,0,255),t=Yf(t,0,255),"rgb("+Math.round(Math.random(e,t)).toString(10)+","+Math.round(Math.random(e,t)).toString(10)+","+Math.round(Math.random(e,t)).toString(10)+")"},randomRGBConstantAlpha:function(e,t,r){return e=Yf(e,0,255),t=Yf(t,0,255),"rgba("+Math.round(Math.random(e,t)).toString(10)+","+Math.round(Math.random(e,t)).toString(10)+","+Math.round(Math.random(e,t)).toString(10)+","+r+")"},addAlpha:function(e,t){var r=this.colorNameToHex(e);r&&(e=r);var n=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e);return e.startsWith("rgba")?e:(n&&(e=kg.hexToRgb(e)),e.startsWith("rgb")?e.replace("rgb","rgba").replace(")",", "+t+")"):e)},getCompositeColor:function(e,t,r){return"rgb("+Math.floor(r*t[0]+(1-r)*e[0])+","+Math.floor(r*t[1]+(1-r)*e[1])+","+Math.floor(r*t[2]+(1-r)*e[2])+")"},createColorString:function(e){return(e=function(e){return(e.startsWith("'")||e.startsWith('"'))&&(e=e.substring(1)),(e.endsWith("'")||e.endsWith('"'))&&(e=e.substring(0,e.length-1)),e}(e)).includes(",")?e.startsWith("rgb")?e:"rgb("+e+")":e},darkenLighten:function(e,t){var r=this.colorNameToHex(e),n=(r?kg.hexToRgb(r):e.startsWith("rgb(")?e:kg.hexToRgb(e)).replace(")","").substring(4).split(","),i=Math.max(0,Math.min(255,Number.parseInt(n[0].trim())+t)),a=Math.max(0,Math.min(255,Number.parseInt(n[1].trim())+t)),o=Math.max(0,Math.min(255,Number.parseInt(n[2].trim())+t));return"rgb("+i.toString()+","+a.toString()+","+o.toString()+")"},colorNameToHex:function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",darkgrey:"#a9a9a9",darkslategrey:"#2f4f4f",dimgrey:"#696969",grey:"#808080",lightgray:"#d3d3d3",lightslategrey:"#778899",slategrey:"#708090"}[e]}};function Sg(e,t){var r=oc("<div>");e.append(r),r.append(Nf("times")),r.on("click",(function(e){e.preventDefault(),e.stopPropagation(),t()}))}function _g(e,t,r){var n=Object.values(zf);r&&"function"!=typeof r&&(n.splice(11,1),n.unshift(kg.rgbToHex(r)));for(var i=function(){var r=o[a],n=oc("<div>",{class:"igv-color-swatch"});e.append(n),n.css("background-color",r),"white"===r||(n.hover((function(){n.get(0).style.borderColor=r}),(function(){n.get(0).style.borderColor="white"})),n.on("click.trackview",(function(e){e.stopPropagation(),t(r)})),n.on("touchend.trackview",(function(e){e.stopPropagation(),t(r)})))},a=0,o=n;a<o.length;a++)i()}function Cg(e){if(e.type.startsWith("touch")){var t=e.touches[0];return{x:t.pageX,y:t.pageY}}return{x:e.pageX,y:e.pageY}}function Ag(e,t){var r=oc(t);r.offset();var n=Cg(e);return{x:n.x-r.offset().left,y:n.y-r.offset().top}}function Eg(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)}var Rg=If.trackMenuItemListHelper,Tg=function(e,t){this.browser=t,this.$parent=Ig.call(this,e)};function Ig(e){var t,r=this;return this.$popover=oc('<div class="igv-popover">'),e.append(this.$popover),t=oc('<div class="igv-popover-header">'),this.$popover.append(t),Sg(t,(function(){r.hide()})),this.$popoverContent=oc("<div>"),this.$popover.append(this.$popoverContent),df(this.$popover.get(0),t.get(0)),e}function Lg(e,t,r){var n,i,a=e,o=oc(window).width(),s=(oc(window).height(),e),c=t;return n=s-=r.$parent.offset().left,a+(i={x:s,y:c-=r.$parent.offset().top,width:r.$popover.outerWidth(),height:r.$popover.outerHeight()}).width>o&&(n=s-i.width),{left:n+"px",top:c+"px"}}Tg.prototype.hide=function(){this.$popover.hide()},Tg.prototype.presentTrackContextMenu=function(e,t){var r=this.$popover;if(oc(".igv-popover").hide(),t.length>0){t=Rg(t,r),this.$popoverContent.empty(),this.$popoverContent.removeClass(),this.$popoverContent.addClass("igv-popover-track-popup-content");var n,i=fn(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;this.$popoverContent.append(a.object)}}catch(e){i.e(e)}finally{i.f()}var o=Cg(e);r.css(Lg(o.x,o.y,this)),r.show()}},Tg.prototype.presentTrackContent=function(e,t,r){oc(".igv-popover").hide(),void 0!==r&&(this.$popoverContent.empty(),this.$popoverContent.removeClass(),this.$popoverContent.addClass("igv-popover-track-popup-content"),this.$popoverContent.html(r),this.$popover.css(Lg(e,t,this)),this.$popover.show())},Tg.prototype.dispose=function(){this.$popover.empty(),this.$popoverContent.empty(),Object.keys(this).forEach((function(e){this[e]=void 0}))},Oe({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Mg="".repeat||function(e){var t=String(m(this)),r="",n=ue(e);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},Pg=1..toFixed,Og=Math.floor,Fg=function(e,t,r){return 0===t?r:t%2==1?Fg(e,t-1,r*e):Fg(e*e,t/2,r)},Ng=Pg&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!s((function(){Pg.call({})}));Oe({target:"Number",proto:!0,forced:Ng},{toFixed:function(e){var t,r,n,i,a=function(e){if("number"!=typeof e&&"Number"!=d(e))throw TypeError("Incorrect invocation");return+e}(this),o=ue(e),s=[0,0,0,0,0,0],c="",h="0",u=function(e,t){for(var r=-1,n=t;++r<6;)n+=e*s[r],s[r]=n%1e7,n=Og(n/1e7)},l=function(e){for(var t=6,r=0;--t>=0;)r+=s[t],s[t]=Og(r/e),r=r%e*1e7},f=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var r=String(s[e]);t=""===t?r:t+Mg.call("0",7-r.length)+r}return t};if(o<0||o>20)throw RangeError("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(c="-",a=-a),a>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(a*Fg(2,69,1))-69)<0?a*Fg(2,-t,1):a/Fg(2,t,1),r*=4503599627370496,(t=52-t)>0){for(u(0,r),n=o;n>=7;)u(1e7,0),n-=7;for(u(Fg(10,n,1),0),n=t-1;n>=23;)l(1<<23),n-=23;l(1<<n),u(1,1),l(2),h=f()}else u(0,r),u(1<<-t,0),h=f()+Mg.call("0",o);return h=o>0?c+((i=h.length)<=o?"0."+Mg.call("0",o-i)+h:h.slice(0,i-o)+"."+h.slice(i-o)):c+h}});var Dg=function(e,t){return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype._super=Object.getPrototypeOf(t.prototype),t};function Bg(e){var t=new Set(["boolean","number","string","symbol"]),r=qr(e);return void 0!==e&&(t.has(r)||e.substring||e.toFixed)}function zg(e,t){var r={oauthToken:e.oauthToken,headers:e.headers,withCredentials:e.withCredentials,filename:e.filename};return Object.assign(r,t)}function Ug(e,t){var r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("download",e),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Hg=function(e){var t,r;return e.length>0?(t=Number.MAX_VALUE,r=-Number.MAX_VALUE,e.forEach((function(e){Number.isNaN(e.value)||(t=Math.min(t,e.value),r=Math.max(r,e.value))})),r>0&&(t=Math.min(0,t)),r<0&&(r=0)):(t=0,r=100),{min:t,max:r}},$g=function(e,t,r){var n=t.start,i=t.end;if(void 0===i)(i=(n-=r/2)+r)>e?n=(i=e)-r:n<0&&(n=0,i=r);else if(i-n<r){var a=(i+n)/2;a-r/2<0?i=(n=0)+r:a+r/2>e?n=(i=e)-r:i=(n=a-r/2)+r}t.start=Math.ceil(n),t.end=Math.floor(i)},jg=function(e){this.viewport=e,this.browser=e.browser,this.$rulerSweeper=oc('<div class="igv-ruler-sweeper-div">'),oc(e.contentDiv).append(this.$rulerSweeper),this.namespace=".sweeper_"+Eg(),this.addMouseHandlers()};function qg(e){return this.viewport.genomicState.referenceFrame.start+e*this.viewport.genomicState.referenceFrame.bpPerPixel}jg.prototype.disableMouseHandlers=function(){oc(document).off(this.namespace),this.viewport.$viewport.off(this.namespace)},jg.prototype.addMouseHandlers=function(){var e,t,r,n,i,a,o=this.browser,s=this;this.disableMouseHandlers(),e=t=r=void 0,oc(this.browser.$root).on("mousedown"+this.namespace,(function(a){t=!0,r=Ag(a,s.viewport.$viewport).x,!0===e&&(s.$rulerSweeper.show(),i=1,n=r,s.$rulerSweeper.css({left:n+"px"}),s.$rulerSweeper.width(i))})),oc(this.browser.$root).on("mousemove"+this.namespace,(function(o){var c;e&&t&&(c=Ag(o,s.viewport.$viewport).x,c=Math.min(c,s.viewport.$viewport.width()),c=Math.max(c,0),a=c-r,i=Math.abs(a),s.$rulerSweeper.width(i),a<0&&(n=r+a,s.$rulerSweeper.css({left:n+"px"})))})),oc(this.browser.$root).on("mouseup"+this.namespace,(function(r){var a;!0===e&&!0===t&&(e=t=void 0,s.$rulerSweeper.hide(),(a={}).start=qg.call(s,n),a.end=qg.call(s,n+i),i>1&&($g(o.genome.getChromosome(s.viewport.genomicState.referenceFrame.chrName).bpLength,a,o.minimumBases()),s.viewport.genomicState.referenceFrame.bpPerPixel=(Math.round(a.end)-Math.round(a.start))/s.viewport.$viewport.width(),s.viewport.genomicState.referenceFrame.start=Math.round(a.start),o.updateViews(s.viewport.genomicState)))})),this.viewport.$viewport.on("mousedown"+this.namespace,(function(t){e=!0}))},jg.prototype.dispose=function(){this.disableMouseHandlers()};var Gg=function(e,t,r,n){this.start=e,this.end=t,this.name=r,this.stain=0,"acen"===n?this.type="c":(this.type=n.charAt(1),"p"===this.type&&(this.stain=parseInt(n.substring(4))))},Vg=function(e,t,r,n){this.chr=e,this.start=t,this.end=r,this.features=n};Vg.prototype.contains=function(e,t,r){return this.chr===e&&this.start<=t&&this.end>=r},Vg.prototype.containsRange=function(e){return this.chr===e.chr&&this.start<=e.start&&this.end>=e.end};var Wg=function(e,t,r,n,i){this.name=e,this.order=t,this.bpStart=r,this.bpLength=n,this.rangeLocus=i},Zg=String.fromCharCode,Yg=String.fromCodePoint,Xg=!!Yg&&1!=Yg.length;Oe({target:"String",stat:!0,forced:Xg},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],ge(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?Zg(t):Zg(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}});var Kg={fileInfoCache:{},isGoogleURL:function(e){return e.includes("googleapis")&&!e.includes("urlshortener")||this.isGoogleCloudURL(e)||this.isGoogleStorageURL(e)||this.isGoogleDrive(e)},isGoogleStorageURL:function(e){return e.startsWith("https://www.googleapis.com/storage")||e.startsWith("https://storage.cloud.google.com")||e.startsWith("https://storage.googleapis.com")},isGoogleCloudURL:function(e){return e.startsWith("gs://")},isGoogleDrive:function(e){return e.indexOf("drive.google.com")>=0||e.indexOf("www.googleapis.com/drive")>0},setApiKey:function(e){this.apiKey=e},translateGoogleCloudURL:function(e){var t,r,n,i,a,o;return t=e.indexOf("/",5),i=e.indexOf("?"),t<0?e:(r=e.substring(5,t),a=i<0?e.substring(t+1):e.substring(t+1,i),n=encodeURIComponent(a),i>0&&(o=e.substring(i)),"https://www.googleapis.com/storage/v1/b/"+r+"/o/"+n+(o?o+"&alt=media":"?alt=media"))},addApiKey:function(e){var t=this.apiKey;if(void 0!==t&&!e.includes("key=")){var r=e.includes("?")?"&":"?";e=e+r+"key="+t}return e},driveDownloadURL:function(e){var t=Qg(e);return t?"https://www.googleapis.com/drive/v3/files/"+t+"?alt=media&supportsTeamDrives=true":e},getDriveFileInfo:function(e){var t="https://www.googleapis.com/drive/v3/files/"+Qg(e)+"?supportsTeamDrives=true";return Sv.loadJson(t,zg({}))},loadGoogleProperties:function(e){var t=this;return Sv.loadArrayBuffer(e).then((function(e){var r,n;r=new gg.Gunzip(new Uint8Array(e)).decompress(),n=String.fromCharCode.apply(null,r);var i=JSON.parse(n);return t.setApiKey(i.api_key),t.properties=i,i}))}};function Qg(e){var t,r;if(e.includes("/open?id=")){if(t=e.indexOf("/open?id=")+9,r=e.indexOf("&"),t>0&&r>t)return e.substring(t,r);if(t>0)return e.substring(t)}else if(e.includes("/file/d/"))return t=e.indexOf("/file/d/")+8,r=e.lastIndexOf("/"),e.substring(t,r)}var Jg={oauthTokens:{},setToken:function(e,t){t?this.oauthTokens[t]=e:this.google.access_token=e},getToken:function(e){var t;if(e){for(var r in this.oauthTokens)if(new RegExp("^"+r.split(/\*+/).map(ev).join(".*")+"$").test(e)){t=this.oauthTokens[r];break}}else t=this.google.access_token;return t},removeToken:function(e){e?delete this.oauthTokens[e]:delete Jg.google.access_token},google:{setToken:function(e){this.access_token=e}}};function ev(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function tv(e,t){var r=[],n=0,i=0;for(t=t||e.byteLength-18;n<t;)try{var a=new Uint8Array(e,n,18),o=a[11]<<8|a[10],s=(a[12],a[13],a[15],a[14],1+(a[17]<<8|a[16])),c=12+o+n,h=e.byteLength-c,u=s-o-19;if(h<u)break;var l=new Uint8Array(e,c,u),f=new gg.RawInflate(l),p=f.decompress();n+=f.ip+26,i+=p.byteLength,r.push(p)}catch(e){console.error(e);break}if(1===r.length)return r[0];for(var d=new Uint8Array(i),g=0,v=0;v<r.length;++v){var m=new Uint8Array(r[v]);iv(m,0,d,g,m.length),g+=m.length}return d}function rv(e){var t=new Uint8Array(e);return t[17]<<8|t[16]+1}var nv="function"==typeof new Uint8Array(1).subarray;function iv(e,t,r,n,i){if(0!==i){if(!e)throw"Undef src";if(!r)throw"Undef dest";0===t&&i===e.length?av(e,r,n):nv?av(e.subarray(t,t+i),r,n):1===e.BYTES_PER_ELEMENT&&i>100?av(new Uint8Array(e.buffer,e.byteOffset+t,i),r,n):function(e,t,r,n,i){for(var a=0;a<i;++a)r[n+a]=e[t+a]}(e,t,r,n,i)}}function av(e,t,r){t.set(e,r)}function ov(e){var t,r;return e instanceof File?e.name:((t=(r=(t=e.lastIndexOf("/"))<0?e:e.substr(t+1)).indexOf("?"))>0&&(r=r.substr(0,t)),r)}function sv(e){return e instanceof File}function cv(e){var t=e.split(","),r=t[0].split(":")[1],n=t[1];n=r.indexOf("base64")>=0?atob(n):decodeURI(n);for(var i=new Uint8Array(n.length),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return r.indexOf("gzip")>0?new gg.Gunzip(i).decompress():i}function hv(e){for(var t=uv,r=t.parser.loose.exec(e),n={},i=14;i--;)n[t.key[i]]=r[i]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,(function(e,r,i){r&&(n[t.q.name][r]=i)})),n}"object"===(void 0===r?"undefined":qr(r))&&"undefined"==typeof window&&(t.atob=function(e){return n.from(e,"base64").toString("binary")});var uv={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function lv(e){return fv.apply(this,arguments)}function fv(){return(fv=Vr(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof t&&(t=t()),!(t instanceof Promise)){e.next=5;break}return e.next=4,t;case 4:t=e.sent;case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pv,dv={401:"Access unauthorized",403:"Access forbidden",404:"Not found"},gv=function(e){var t=this;this.$container=oc("<div>",{class:"igv-alert-dialog-container"}),e.append(this.$container);var r=oc("<div>");this.$container.append(r);var n=oc("<div>",{id:"igv-alert-dialog-body"});this.$container.append(n),this.$body=oc("<div>",{id:"igv-alert-dialog-body-copy"}),n.append(this.$body);var i=oc("<div>");this.$container.append(i),this.$ok=oc("<div>"),i.append(this.$ok),this.$ok.text("OK"),this.$ok.on("click",(function(){t.$body.html(""),t.$container.hide()})),this.$container.hide()};gv.prototype.configure=function(e){this.$body.html(e.label)},gv.prototype.present=function(e,t){var r=this,n=e.message||e;dv.hasOwnProperty(n)&&(n=dv[n]),this.$body.html(n),this.$ok.on("click",(function(){"function"==typeof t&&t("OK"),r.$body.html(""),r.$container.hide()})),this.$container.show()};var vv={init:function(e){pv||(pv=new gv(e))},presentAlert:function(e,t){pv.present(e,t)}};function mv(e){this.requestsPerSecond=e.requestsPerSecond,this.promiseImplementation=e.promiseImplementation||Promise,this.lastStartTime=0,this.queued=[]}mv.prototype.add=function(e,t){var r=this,n=t||{};return new r.promiseImplementation((function(t,i){r.queued.push({resolve:t,reject:i,promise:e,weight:n.weight||1,signal:n.signal}),r.dequeue()}))},mv.prototype.addAll=function(e,t){var r=e.map(function(e){return this.add(e,t)}.bind(this));return Promise.all(r)},mv.prototype.dequeue=function(){if(this.queued.length>0){var e=new Date,t=this.queued[0].weight,r=1e3/this.requestsPerSecond*t+1,n=e-this.lastStartTime;n>=r?this._execute():setTimeout(function(){this.dequeue()}.bind(this),r-n)}},mv.prototype._execute=function(){this.lastStartTime=new Date;var e=this.queued.shift();e.signal&&e.signal.aborted?e.reject(new DOMException("","AbortError")):e.promise().then((function(t){e.resolve(t)})).catch((function(t){e.reject(t)}))};var yv,bv,wv,xv,kv=new mv({requestsPerSecond:10,promiseImplementation:Promise}),Sv={load:(yv=Vr(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=r||{},e.next=3,"function"==typeof t?t():t;case 3:if(!((t=e.sent)instanceof File)){e.next=8;break}return e.abrupt("return",Av(t,r));case 8:if("function"!=typeof t.startsWith){e.next=21;break}if(!t.startsWith("data:")){e.next=13;break}return e.abrupt("return",cv(t));case 13:if(t.startsWith("https://drive.google.com")&&(t=Kg.driveDownloadURL(t)),!Pv(t)){e.next=18;break}return e.abrupt("return",kv.add((function(){return _v(t,r)})));case 18:return e.abrupt("return",_v(t,r));case 19:e.next=22;break;case 21:throw Error("url must be either a 'string', 'function', or 'Promise'.  Actual type: ".concat(qr(t)));case 22:case"end":return e.stop()}}),e)}))),function(e,t){return yv.apply(this,arguments)}),loadArrayBuffer:function(e,t){return(t=t||{}).responseType||(t.responseType="arraybuffer"),e instanceof File?Av(e,t):Sv.load(e,t)},loadJson:function(e,t){return"POST"===((t=t||{}).method||(t.sendData?"POST":"GET"))&&(t.contentType="application/json"),Sv.load(e,t).then((function(e){return e?JSON.parse(e):e}))},loadString:function(e,t){return t=t||{},e instanceof File?function(e,t){var r=(t=t||{}).range?e.slice(t.range.start,t.range.start+t.range.size):e;return new Promise((function(n,i){var a=new FileReader,o=0;t.bgz||e.name.endsWith(".bgz")?o=2:e.name.endsWith(".gz")&&(o=1),a.onload=function(e){return n(0===o?a.result:Mv(a.result,o))},a.onerror=function(t){var r=a.error;i(r+" "+e.name,a)},0===o?a.readAsText(r):a.readAsArrayBuffer(r)}))}(e,t):function(e,t){return Ev.apply(this,arguments)}(e,t)},startup:function(){var e=window.document.location.href;hv(e).host,0!==Dv||e.includes("localhost")||e.includes("127.0.0.1")||(Dv++,Sv.load("https://data.broadinstitute.org/igv/projects/current/counter_igvjs.php?version=0").then((function(e){})).catch((function(e){})))}};function _v(e,t){return Cv.apply(this,arguments)}function Cv(){return(Cv=Vr(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Lv(t),!(n=(r=r||{}).oauthToken||Tv(t))){e.next=7;break}return e.next=6,"function"==typeof n?n():n;case 6:n=e.sent;case 7:return e.abrupt("return",new Promise((function(e,i){Kg.isGoogleURL(t)&&(t.startsWith("gs://")?t=Kg.translateGoogleCloudURL(t):Kg.isGoogleStorageURL(t)&&(t.includes("altMedia=")||(t+=t.includes("?")?"&altMedia=true":"?altMedia=true")));var a=r.headers||{};n&&Iv(a,n);var o=r.range,s=navigator.userAgent.indexOf("Chrome")>-1;0===navigator.vendor.indexOf("Apple")&&/\sSafari\//.test(navigator.userAgent),o&&s&&!Rv(t)&&(t+=t.includes("?")?"&":"?",t+="someRandomSeed="+Math.random().toString(36));var c=new XMLHttpRequest,h=r.sendData||r.body,u=r.method||(h?"POST":"GET"),l=r.responseType,f=r.contentType,p=r.mimeType;if(c.open(u,t),o){var d=o.size?o.start+o.size-1:"";c.setRequestHeader("Range","bytes="+o.start+"-"+d)}if(f&&c.setRequestHeader("Content-Type",f),p&&c.overrideMimeType(p),l&&(c.responseType=l),a)for(var g=0,v=Object.keys(a);g<v.length;g++){var m=v[g],y=a[m];c.setRequestHeader(m,y)}!0===r.withCredentials&&(c.withCredentials=!0),c.onload=function(){var n=Vr(regeneratorRuntime.mark((function n(i){var a,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(0===c.status||c.status>=200&&c.status<=300)){n.next=4;break}o&&206!==c.status&&0!==o.start?(c.response.length>1e5&&vv.presentAlert("Warning: Range header ignored for URL: ".concat(t,".  This can have performance impacts.")),e(c.response.slice(o.start,o.start+o.size))):e(c.response),n.next=23;break;case 4:if("undefined"==typeof gapi||404!==c.status&&401!==c.status&&403!==c.status||!Kg.isGoogleURL(t)||r.retries){n.next=22;break}return n.prev=5,r.retries=1,n.next=9,Ov();case 9:return a=n.sent,r.oauthToken=a,n.next=13,Sv.load(t,r);case 13:s=n.sent,e(s),n.next=20;break;case 17:n.prev=17,n.t0=n.catch(5),b(n.t0);case 20:n.next=23;break;case 22:403===c.status?b("Access forbidden: "+t):416===c.status?b("Unsatisfiable range"):b(c.status);case 23:case"end":return n.stop()}}),n,null,[[5,17]])})));return function(e){return n.apply(this,arguments)}}(),c.onerror=function(e){b("Error accessing resource: "+t+" Status: "+c.status)},c.ontimeout=function(e){b("Timed out")},c.onabort=function(e){i(e)};try{c.send(h)}catch(e){i(e)}function b(e){if(!i)throw new Error(e);i(new Error(e))}})));case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Av(e,t){return new Promise((function(r,n){var i=new FileReader;if(i.onload=function(e){r(i.result)},i.onerror=function(e){n(null,i)},t.range){var a=e.slice(t.range.start,t.range.start+t.range.size);"arraybuffer"===t.responseType?i.readAsArrayBuffer(a):i.readAsBinaryString(a)}else"arraybuffer"===t.responseType?i.readAsArrayBuffer(e):i.readAsBinaryString(e)}))}function Ev(){return(Ev=Vr(regeneratorRuntime.mark((function e(t,r){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(r=r||{}).filename||ov(t),i=3,r.bgz?i=2:n.endsWith(".gz")&&(i=1),r.responseType="arraybuffer",e.abrupt("return",Sv.load(t,r).then((function(e){return Mv(e,i)})));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rv(e){return e.indexOf("X-Amz-Signature")>-1}function Tv(e){var t=hv(e).host,r=Jg.getToken(t);return!r&&Kg.isGoogleURL(e)&&(r=Jg.google.access_token),r}function Iv(e,t){return t&&(e["Cache-Control"]="no-cache",e.Authorization="Bearer "+t),e}function Lv(e){return e.includes("//www.dropbox.com")?e.replace("//www.dropbox.com","//dl.dropboxusercontent.com"):e.includes("//drive.google.com")?Kg.driveDownloadURL(e):e.includes("//www.broadinstitute.org/igvdata")?e.replace("//www.broadinstitute.org/igvdata","//data.broadinstitute.org/igvdata"):e.includes("//igvdata.broadinstitute.org")?e.replace("//igvdata.broadinstitute.org","https://dn7ywbm9isq8j.cloudfront.net"):e.startsWith("ftp://ftp.ncbi.nlm.nih.gov/geo")?e.replace("ftp://","https://"):e}function Mv(e,r){if(3===r&&e.byteLength>2){var n=new Uint8Array(e,0,2);31===n[0]&&139===n[1]&&(r=1)}var i;return i=1===r?new gg.Gunzip(new Uint8Array(e)).decompress():2===r?tv(e):new Uint8Array(e),"TextDecoder"in("undefined"!=typeof self?self:void 0!==t?t:window)?(new TextDecoder).decode(i):function(e){for(var t="",r=0;r<e.length;){var n=e[r],i=0,a=0;if(n<=127?(i=0,a=255&n):n<=223?(i=1,a=31&n):n<=239?(i=2,a=15&n):n<=244&&(i=3,a=7&n),e.length-r-i>0)for(var o=0;o<i;)n=e[r+o+1],a=a<<6|63&n,o+=1;else a=65533,i=e.length-r;t+=String.fromCodePoint(a),r+=i+1}return t}(i)}function Pv(e){return e.includes("drive.google.com")||e.includes("www.googleapis.com/drive")}function Ov(){return Fv.apply(this,arguments)}function Fv(){return(Fv=Vr(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Jg.google.access_token){e.next=9;break}if(!(wv&&Date.now()>wv&&xv)){e.next=8;break}return t=xv,e.next=5,t.reloadAuthResponse();case 5:r=e.sent,Jg.google.access_token=r.access_token,wv=r.expires_at;case 8:return e.abrupt("return",Jg.google.access_token);case 9:if(!bv){e.next=11;break}return e.abrupt("return",bv);case 11:if(gapi&&gapi.auth2){e.next=13;break}throw new Error("The Google oAuth API is required but not loaded");case 13:if(gapi.auth2.getAuthInstance()){e.next=17;break}return vv.presentAlert("Authorization is required, but Google oAuth has not been initalized.  Contact your site administrator for assistance."),e.abrupt("return",void 0);case 17:return(n=new gapi.auth2.SigninOptionsBuilder).setPrompt("select_account"),n.setScope("https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/drive.readonly"),bv=new Promise((function(e,t){vv.presentAlert("Google Login required",(function(){gapi.auth2.getAuthInstance().signIn(n).then((function(t){xv=t;var r=t.getAuthResponse();Jg.google.setToken(r.access_token),wv=r.expires_at,e(r.access_token),bv=void 0})).catch((function(e){bv=void 0,t(e)}))}))})),e.abrupt("return",bv);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nv,Dv=0,Bv=new Set(["fastaURL","indexURL","cytobandURL","indexed"]),zv=function(e){"string"==typeof e.fastaURL&&e.fastaURL.startsWith("data:")?(this.file=function(e){var t,r=e.split(","),n=r[0].split(":")[1],i=r[1];i=n.indexOf("base64")>=0?atob(i):decodeURI(i),t=new Uint8Array(i.length);for(var a=0;a<i.length;a++)t[a]=i.charCodeAt(a);for(var o=new gg.Gunzip(t).decompress(),s="",c=o.length,h=0;h<c;h++)s+=String.fromCharCode(o[h]);return s}(e.fastaURL),this.indexed=!1,this.isDataURI=!0):(this.file=e.fastaURL,this.indexed=!1!==e.indexed,this.indexed&&(this.indexFile=e.indexURL||e.indexFile||this.file+".fai")),this.withCredentials=e.withCredentials,this.chromosomeNames=[],this.chromosomes={},this.sequences={},this.offsets={},this.config=function(e){var t,r={};for(t in e)e.hasOwnProperty(t)&&!Bv.has(t)&&(r[t]=e[t]);return r}(e)};function Uv(e,t,r){var n=this,i=n.interval;if(i&&i.contains(e,t,r))return Promise.resolve(h(i,t,r));var a=t,o=r;if(r-t<5e4){var s=r-t,c=Math.round(t+s/2);a=Math.max(0,c-25e3),o=c+25e3}return n.readSequence(e,a,o).then((function(i){return n.interval=new Vg(e,a,o,i),h(n.interval,t,r)}));function h(e,t,r){var n=t-e.start,i=r-t;return e.features?e.features.substr(n,i):null}}function Hv(e,t,r){this.offsets[e]&&(t-=this.offsets[e],r-=this.offsets[e]);var n="";if(t<0)for(var i=t;i<Math.min(r,0);i++)n+="*";if(r<=0)return Promise.resolve(n);var a=this.sequences[e];return Math.min(r,a.length),Promise.resolve(n+a.substring(t,r))}zv.prototype.init=function(){return this.indexed?this.getIndex():this.loadAll()},zv.prototype.getSequence=function(e,t,r){return this.indexed?Uv.call(this,e,t,r):Hv.call(this,e,t,r)},zv.prototype.getIndex=function(){if(this.index)return Promise.resolve(this.index);var e=this;return Sv.load(e.indexFile,zg(e.config)).then((function(t){var r=bg(t),n=r.length,i=0,a=0;for(e.index={};i<n;){var o=r[i++].split("\t");if(5===o.length){var s=o[0],c=parseInt(o[1]),h={size:c,position:parseInt(o[2]),basesPerLine:parseInt(o[3]),bytesPerLine:parseInt(o[4])};e.chromosomeNames.push(s),e.index[s]=h,e.chromosomes[s]=new Wg(s,a++,0,c)}}return e.index}))},zv.prototype.loadAll=function(){var e=this;return this.isDataURI?Promise.resolve(t(this.file)):Sv.load(e.file,zg(e.config)).then(t);function t(t){for(var r,n,i=bg(t),a=i.length,o=0,s="",c=void 0,h=0,u=0;o<a;)if((r=i[o++].trim()).startsWith("#")||0===r.length);else if(r.startsWith(">")){s&&(e.chromosomeNames.push(n),e.sequences[n]=s,e.chromosomes[n]=new Wg(n,u++,h,h+s.length,c));var l=r.substr(1).split(/\s+/)[0].split(":");if(n=l[0],s="",h=0,c=void 0,l.length>1&&l[1].indexOf("-")>0){var f=l[1].split("-");2===f.length&&/^[0-9]+$/.test(f[0])&&/^[0-9]+$/.test(f[1]);var p=Number.parseInt(f[0]);Number.parseInt(f[1])>p&&(h=p-1,e.offsets[n]=h,c=l[1])}}else s+=r;s&&(e.chromosomeNames.push(n),e.sequences[n]=s,e.chromosomes[n]=new Wg(n,u++,h,h+s.length,c))}},zv.prototype.readSequence=function(e,t,r){var n,i,a,o,s,c=this;return c.getIndex().then((function(){var h=c.index[e];if(h){i=Math.max(0,t),a=Math.min(h.size,r);var u=h.bytesPerLine;o=h.basesPerLine;var l=h.position;s=u-o;var f=Math.floor(i/o),p=Math.floor(a/o),d=l+f*u+(n=i-f*o),g=l+p*u+(a-p*o)-1-d+1;return g<=0?(console.error("No sequence for "+e+":"+t+"-"+r),""):Sv.load(c.file,zg(c.config,{range:{start:d,size:g}}))}return c.interval=new Vg(e,t,r,null),null})).then((function(e){if(e){var t,r="",c=0,h=e.length;for(n>0&&(t=Math.min(a-i,o-n),r+=e.substr(c,t),c+=t+s);c<h;)t=Math.min(o,h-c),r+=e.substr(c,t),c+=t+s;return r}return null}))};var $v,jv,qv={loadGenome:(jv=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cytobandURL,n=t.aliasURL,i=new zv(t),e.next=5,i.init();case 5:if(!r){e.next=9;break}return e.next=8,Wv(r,i.config);case 8:a=e.sent;case 9:if(!n){e.next=13;break}return e.next=12,Zv(n,i.config);case 12:o=e.sent;case 13:return e.abrupt("return",new Gv(t,i,a,o));case 14:case"end":return e.stop()}}),e)}))),function(e){return jv.apply(this,arguments)}),getKnownGenomes:($v=Vr(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=function(e){var t={};return e.forEach((function(e){t[e.id]=e})),Nv=t,t},t=qv.genomeList,!Nv){e.next=6;break}return e.abrupt("return",Nv);case 6:if(t){e.next=10;break}return e.abrupt("return",{});case 10:if("string"!=typeof t){e.next=17;break}return e.next=13,Sv.loadJson(t,{});case 13:return r=e.sent,e.abrupt("return",n(r));case 17:return e.abrupt("return",n(t));case 18:case"end":return e.stop()}}),e)}))),function(){return $v.apply(this,arguments)}),isWholeGenomeView:function(e){return"all"===e.chrName.toLowerCase()}},Gv=function(e,t,r,n){this.config=e,this.id=e.id,this.sequence=t,this.chromosomeNames=t.chromosomeNames,this.chromosomes=t.chromosomes,this.ideograms=r,this.wholeGenomeView=void 0===e.wholeGenomeView||e.wholeGenomeView,this.wholeGenomeView&&Object.keys(t.chromosomes).length>1?function(e,t){var r;if(t.chromosomeOrder)e.wgChromosomeNames=t.chromosomeOrder.split(",").map((function(e){return e.trim()})),r=e.wgChromosomeNames.map((function(t){return e.chromosomes[t]})).filter((function(e){return void 0!==e}));else{var n=Object.keys(e.chromosomes).map((function(t){return e.chromosomes[t].bpLength})).reduce((function(e,t){return Math.max(e,t)}))/50,i=(r=Object.values(e.chromosomes).filter((function(e){return e.bpLength>n}))).filter((function(e){return l(e.name.replace("chr",""))})),a=r.filter((function(e){return!l(e.name.replace("chr",""))}));i.sort((function(e,t){return Number.parseInt(e.name.replace("chr",""))-Number.parseInt(t.name.replace("chr",""))}));var o,s=i.map((function(e){return e.name})),c=fn(a);try{for(c.s();!(o=c.n()).done;){var h=o.value;s.push(h.name)}}catch(e){c.e(e)}finally{c.f()}e.wgChromosomeNames=s}var u=r.reduce((function(e,t){return e+t.bpLength}),0);function l(e){return/^\d+$/.test(e)}e.chromosomes.all={name:"all",bpLength:u}}(this,e):this.wgChromosomeNames=t.chromosomeNames;var i={},a=this;i.all="all",this.chromosomeNames.forEach((function(e){var t=e.startsWith("chr")?e.substring(3):"chr"+e;i[t.toLowerCase()]=e,"chrM"===e&&(i.mt="chrM"),"MT"===e&&(i.chrm="MT"),i[e.toLowerCase()]=e})),n&&n.forEach((function(e){var t,r;for(r=0;r<e.length;r++)if(a.chromosomes[e[r]]){t=e[r];break}t&&e.forEach((function(e){e!==t&&(i[e.toLowerCase()]=t,i[e]=t)}))})),this.chrAliasTable=i};function Vv(){var e,t={},r=0,n=fn(this.wgChromosomeNames);try{for(n.s();!(e=n.n()).done;){var i=e.value;t[i]=Math.floor(r),r+=this.getChromosome(i).bpLength}}catch(e){n.e(e)}finally{n.f()}return t}function Wv(e,t){if(e.startsWith("data:")){var r=function(e){var t;if(e.startsWith("data:application/gzip;base64"))t=cv(e);else{var r,n=e.split(","),i=n[0].split(":")[1],a=n[1];a=i.indexOf("base64")>=0?atob(a):decodeURI(a),r=new Uint8Array(a.length);for(var o=0;o<a.length;o++)r[o]=a.charCodeAt(o);var s=new gg.Gunzip(r);t=s.decompress()}for(var c="",h=t.length,u=0;u<h;u++)c+=String.fromCharCode(t[u]);return c}(e);return Promise.resolve(n(r))}return Sv.loadString(e,zg(t)).then((function(e){return n(e)}));function n(e){for(var t,r=[],n=0,i=bg(e),a=i.length,o={},s=0;s<a;s++){var c=i[s].split("\t"),h=c[0];if(t||(t=h),h!==t&&(o[t]=r,r=[],t=h,n=0),5===c.length){var u=parseInt(c[1]),l=parseInt(c[2]),f=c[3],p=c[4];r[n++]=new Gg(u,l,f,p)}}return o}}function Zv(e,t){return Sv.loadString(e,zg(t)).then((function(e){var t=bg(e),r=[];return t.forEach((function(e){!e.startsWith("#")&&e.length>0&&r.push(e.split("\t"))})),r}))}Gv.prototype.showWholeGenomeView=function(){return!1!==this.config.wholeGenomeView},Gv.prototype.toJSON=function(){return Object.assign({},this.config,{tracks:void 0})},Gv.prototype.getInitialLocus=function(){},Gv.prototype.getHomeChromosomeName=function(){if(this.showWholeGenomeView()&&this.chromosomes.hasOwnProperty("all"))return"all";var e=this.chromosomes[this.chromosomeNames[0]];return e.rangeLocus?e.name+":"+e.rangeLocus:this.chromosomeNames[0]},Gv.prototype.getChromosomeName=function(e){var t=this.chrAliasTable[e.toLowerCase()];return t||e},Gv.prototype.getChromosome=function(e){return e=this.getChromosomeName(e),this.chromosomes[e]},Gv.prototype.getCytobands=function(e){return this.ideograms?this.ideograms[e]:null},Gv.prototype.getLongestChromosome=function(){var e,t=this.chromosomes;for(var r in t){if(t.hasOwnProperty(r)){var n=t[r];(void 0===e||n.bpLength>e.bpLength)&&(e=n)}return e}},Gv.prototype.getChromosomes=function(){return this.chromosomes},Gv.prototype.getGenomeCoordinate=function(e,t){var r=this.getCumulativeOffset(e);if(void 0!==r)return r+t},Gv.prototype.getChromosomeCoordinate=function(e){void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=Vv.call(this));var t,r=void 0,n=0,i=fn(this.wgChromosomeNames);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=this.cumulativeOffsets[a];if(o>e)return{chr:r,position:e-n};r=a,n=o}}catch(e){i.e(e)}finally{i.f()}return{chr:this.chromosomeNames[this.chromosomeNames.length-1],position:0}},Gv.prototype.getCumulativeOffset=function(e){void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=Vv.call(this));var t=this.getChromosomeName(e);return this.cumulativeOffsets[t]},Gv.prototype.getGenomeLength=function(){var e=this;if(!this.bpLength){var t=0;e.wgChromosomeNames.forEach((function(r){var n=e.chromosomes[r];t+=n.bpLength})),this.bpLength=t}return this.bpLength};var Yv=function(){function e(t,r,n,i){Wr(this,e);var a=this;this.guid=Eg(),this.trackView=t,this.genomicState=n,this.browser=t.browser,this.$viewport=oc('<div class="igv-viewport-div">'),r.append(this.$viewport),this.$viewport.data("viewportGUID",this.guid);var o=oc("<div>",{class:"igv-viewport-content-div"});this.$viewport.append(o),o.height(this.$viewport.height()),this.contentDiv=o.get(0);var s=oc('<canvas class ="igv-canvas">');if(oc(this.contentDiv).append(s),this.canvas=s.get(0),this.ctx=this.canvas.getContext("2d"),this.setWidth(i),"sequence"===t.track.type&&this.$viewport.addClass("igv-viewport-sequence"),"ruler"===t.track.type)this.rulerSweeper=new jg(this),t.track.appendMultiPanelCloseButton(this.$viewport,this.genomicState),this.$rulerLabel=oc('<div class = "igv-multi-locus-panel-label-div">'),this.$rulerLabel.click((function(e){a.browser.selectMultiLocusPanelWithGenomicState(a.genomicState)})),oc(this.contentDiv).append(this.$rulerLabel),!0===qv.isWholeGenomeView(this.genomicState.referenceFrame)?Jv.call(this):em.call(this);else if(nm.call(this),this.$spinner=oc('<div class="igv-viewport-spinner">'),this.$spinner.append(Nf("spinner")),this.$viewport.append(this.$spinner),this.stopSpinner(),"sequence"!==t.track.type){this.popover=new Tg(this.browser.$content);var c=t.track.name.toLowerCase().split(" ").join("_");c=c+"_"+this.browser.genomicStateList.indexOf(this.genomicState),this.popover.$popover.attr("id",c),this.$zoomInNotice=Xv.call(this,oc(this.contentDiv))}t.track.name&&(this.$trackLabel=oc('<div class="igv-track-label">'),this.$viewport.append(this.$trackLabel),this.setTrackLabel(t.track.name),!1===this.browser.trackLabelsVisible&&this.$trackLabel.hide(),this.$trackLabel.click((function(e){var r;e.stopPropagation(),r="function"==typeof t.track.description?t.track.description():t.track.description?t.track.description:t.track.name;var n=Cg(e);a.popover.presentTrackContent(n.x,n.y,r)})),this.$trackLabel.mousedown((function(e){e.stopPropagation()})),this.$trackLabel.mouseup((function(e){e.stopPropagation()})),this.$trackLabel.mousemove((function(e){e.stopPropagation()})))}var t,r,n,i,a;return Yr(e,[{key:"isVisible",value:function(){return this.$viewport.width()}},{key:"setTrackLabel",value:function(e){this.trackView.track.name=this.trackView.track.config.name=e,this.$trackLabel.empty(),this.$trackLabel.html(e);var t=this.$trackLabel.text();this.$trackLabel.attr("title",t)}},{key:"setWidth",value:function(e){this.$viewport.outerWidth(e),this.canvas.style.width=this.$viewport.width()+"px",this.canvas.setAttribute("width",this.$viewport.width())}},{key:"startSpinner",value:function(){var e=this.$spinner;e&&(e.addClass("igv-fa5-spin"),e.show())}},{key:"stopSpinner",value:function(){var e=this.$spinner;e&&(e.hide(),e.removeClass("igv-fa5-spin"))}},{key:"showMessage",value:function(e){this.messageDiv||(this.messageDiv=document.createElement("div"),this.messageDiv.className="igv-viewport-message",this.contentDiv.append(this.messageDiv)),this.messageDiv.textContent=e,this.messageDiv.style.display="inline-block"}},{key:"hideMessage",value:function(e){this.messageDiv&&(this.messageDiv.style.display="none")}},{key:"checkZoomIn",value:function(){if(!Qv.call(this))return!1;if(this.$zoomInNotice){if(function(){var e=this.genomicState.referenceFrame;if("all"!==e.chrName.toLowerCase()||this.trackView.track.supportsWholeGenome()){var t="function"==typeof this.trackView.track.getVisibilityWindow?this.trackView.track.getVisibilityWindow():this.trackView.track.visibilityWindow;return void 0!==t&&t>0&&e.bpPerPixel*this.$viewport.width()>t}return!0}.call(this)){if(this.canvas&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.tile=void 0),this.$zoomInNotice.show(),this.trackView.track.autoHeight){var e=this.trackView.minHeight||0;this.setContentHeight(e)}return!1}return this.$zoomInNotice.hide(),!0}return!0}},{key:"shift",value:function(){var e=this.genomicState.referenceFrame;if(this.canvas&&this.tile&&this.tile.chr===e.chrName&&this.tile.bpPerPixel===e.bpPerPixel){var t=Math.round((this.tile.startBP-e.start)/e.bpPerPixel);this.canvas.style.left=t+"px"}}},{key:"setTop",value:function(e){var t=-e,r=t+this.$viewport.height();oc(this.contentDiv).css("top",e+"px"),(!this.canvasVerticalRange||this.canvasVerticalRange.bottom<r||this.canvasVerticalRange.top>t)&&this.repaint()}},{key:"loadFeatures",value:(a=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,h,u,l,f,p,d,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.genomicState,r=t.referenceFrame,n=r.chrName,i=this.browser.genome.getChromosome(n).bpLength,a=3*oc(this.contentDiv).width(),o=a*r.bpPerPixel,s=Math.floor(Math.max(0,r.start-o/3)),c=Math.ceil(Math.min(i,s+o)),!this.loading||this.loading.start!==s||this.loading.end!==c){e.next=10;break}return e.abrupt("return",void 0);case 10:return this.loading={start:s,end:c},this.startSpinner(),e.prev=12,e.next=15,this.getFeatures(this.trackView.track,r.chrName,s,c,r.bpPerPixel);case 15:if(h=e.sent,u=[],v=this.browser.roi,m=this.trackView.track.roi,!(l=v&&m?v.concat(m):v||m)){e.next=38;break}f=fn(l),e.prev=20,f.s();case 22:if((p=f.n()).done){e.next=30;break}return d=p.value,e.next=26,d.getFeatures(r.chrName,s,c,r.bpPerPixel);case 26:g=e.sent,u.push({track:d,features:g});case 28:e.next=22;break;case 30:e.next=35;break;case 32:e.prev=32,e.t0=e.catch(20),f.e(e.t0);case 35:return e.prev=35,f.f(),e.finish(35);case 38:return this.tile=new rm(r.chrName,s,c,r.bpPerPixel,h,u),this.loading=!1,this.hideMessage(),this.stopSpinner(),e.abrupt("return",this.tile);case 45:e.prev=45,e.t1=e.catch(12),this.showMessage("Error loading track data"),console.error(e.t1);case 49:return e.prev=49,this.loading=!1,this.stopSpinner(),e.finish(49);case 53:case"end":return e.stop()}var v,m}),e,this,[[12,45,49,53],[20,32,35,38]])}))),function(){return a.apply(this,arguments)})},{key:"repaint",value:(i=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this,r=this.tile){e.next=4;break}return e.abrupt("return");case 4:if(n=qv.isWholeGenomeView(this.genomicState.referenceFrame),i=r.features,a=r.roiFeatures,o=this.genomicState,s=o.referenceFrame,c=n?s.initialEnd/this.$viewport.width():r.bpPerPixel,h=n?0:r.startBP,u=n?s.initialEnd:r.endBP,l=n?this.$viewport.width():Math.ceil((u-h)/c),f=this.$viewport.height(),p=a?Math.max(t.getContentHeight(),f):t.getContentHeight(),d=Math.min(p,3*f),0!==l&&0!==d){e.next=19;break}return t.canvas&&oc(t.canvas).remove(),e.abrupt("return");case 19:g=Math.max(0,-oc(this.contentDiv).position().top-f),v="FILL"===this.trackView.track.displayMode?window.devicePixelRatio:!1===this.trackView.track.supportHiDPI?1:window.devicePixelRatio,m={features:i,pixelWidth:l,pixelHeight:d,pixelTop:g,bpStart:h,bpEnd:u,bpPerPixel:c,referenceFrame:s,genomicState:o,selection:t.selection,viewport:t,viewportWidth:t.$viewport.width(),viewportContainerX:s.toPixels(s.start-h),viewportContainerWidth:this.browser.viewportContainerWidth()},(y=oc('<canvas class="igv-canvas">').get(0)).style.width=l+"px",y.style.height=d+"px",y.width=v*l,y.height=v*d,(b=y.getContext("2d")).scale(v,v),w=Math.round((h-s.start)/s.bpPerPixel),y.style.position="absolute",y.style.left=w+"px",y.style.top=g+"px",m.context=b,b.translate(0,-g),this.draw(m,i,a),this.canvasVerticalRange={top:g,bottom:g+d},t.canvas&&oc(t.canvas).remove(),oc(t.contentDiv).append(y),t.canvas=y,t.ctx=b;case 41:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"draw",value:function(e,t,r){if(t&&(e.features=t,this.trackView.track.draw(e)),r){var n,i=fn(r);try{for(i.s();!(n=i.n()).done;){var a=n.value;e.features=a.features,a.track.draw(e)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"toSVG",value:(n=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,h,u,l,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.$zoomInNotice||!this.$zoomInNotice.is(":visible")){e.next=2;break}return e.abrupt("return");case 2:return r=this.genomicState,n=r.referenceFrame,i=t.bpPerPixel,a=t.features,o=t.roiFeatures,s=this.$viewport.width(),c=this.$viewport.height(),h=n.start,u=n.start+s*n.bpPerPixel,l=new pf({width:s,height:c,viewbox:{x:0,y:-oc(this.contentDiv).position().top,width:s,height:c}}),f={viewport:this,context:l,top:-oc(this.contentDiv).position().top,pixelTop:0,pixelWidth:s,pixelHeight:c,bpStart:h,bpEnd:u,bpPerPixel:i,referenceFrame:n,genomicState:this.genomicState,selection:this.selection,viewportWidth:s,viewportContainerX:0,viewportContainerWidth:this.browser.viewportContainerWidth()},Kv.call(this,f,a,o),e.abrupt("return",l.getSerializedSvg(!0));case 15:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setContentHeight",value:function(e){e=Math.min(e,32e3),oc(this.contentDiv).height(e),this.tile&&(this.tile.invalidate=!0)}},{key:"getContentHeight",value:function(){return oc(this.contentDiv).height()}},{key:"getContentTop",value:function(){return this.contentDiv.offsetTop}},{key:"isLoading",value:function(){return this.loading}},{key:"saveImage",value:function(){if(this.ctx){var e=this.canvasVerticalRange?this.canvasVerticalRange.top:0,t=window.devicePixelRatio,r=this.$viewport.width()*t,n=this.$viewport.height()*t,i=-oc(this.canvas).position().left*t,a=(-oc(this.contentDiv).position().top-e)*t,o=this.ctx.getImageData(i,a,r,n),s=document.createElement("canvas"),c=s.getContext("2d");s.width=o.width,s.height=o.height,c.putImageData(o,0,0),Ug((this.$trackLabel.text()?this.$trackLabel.text():"image")+".png",s.toDataURL("image/png"))}}},{key:"renderSVGContext",value:(r=Vr(regeneratorRuntime.mark((function e(t,r){var n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.$zoomInNotice||!this.$zoomInNotice.is(":visible")){e.next=2;break}return e.abrupt("return");case 2:n=(n=this.trackView.track.name||this.trackView.track.id).replace(/\W/g,""),i=this.browser.genomicStateList.indexOf(this.genomicState),a=n.toLowerCase()+"_genomic_state_index_"+i,0===i&&"function"==typeof this.trackView.track.paintAxis&&(o=this.trackView.controlCanvas.getBoundingClientRect(),t.addTrackGroupWithTranslationAndClipRect(a+"_axis",r.deltaX-o.width,r.deltaY,o.width,o.height,0),t.save(),this.trackView.track.paintAxis(t,o.width,o.height),t.restore()),s=oc(this.contentDiv).position().top,c=r.deltaX+i*t.multiLocusGap,h=r.deltaY+s,u=this.$viewport.get(0).getBoundingClientRect(),l=u.width,f=u.height,t.addTrackGroupWithTranslationAndClipRect(a,c,h,l,f,-s),p=this.genomicState.referenceFrame,d=p.start,g=p.bpPerPixel,t.save(),v={context:t,viewport:this,referenceFrame:p,genomicState:this.genomicState,pixelWidth:l,pixelTop:0,pixelHeight:f,viewportWidth:l,viewportContainerX:0,viewportContainerWidth:this.browser.viewportContainerWidth(),bpStart:d,bpEnd:d+l*g,bpPerPixel:g,selection:this.selection},m=this.tile?this.tile.features:[],y=this.tile?this.tile.roiFeatures:void 0,Kv.call(this,v,m,y),this.$trackLabel&&!0===this.browser.trackLabelsVisible&&tm.call(this,t),t.restore();case 21:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"saveSVG",value:function(){var e=this.$viewport.width(),t=this.$viewport.height(),r=new pf({width:e,height:t,viewbox:{x:0,y:-oc(this.contentDiv).position().top,width:e,height:t}}),n=this.genomicState.referenceFrame,i=n.start,a=n.bpPerPixel,o={viewport:this,context:r,top:-oc(this.contentDiv).position().top,pixelTop:0,pixelWidth:e,pixelHeight:t,bpStart:i,bpEnd:i+e*a,bpPerPixel:a,referenceFrame:this.genomicState.referenceFrame,genomicState:this.genomicState,selection:this.selection,viewportWidth:e,viewportContainerX:0,viewportContainerWidth:this.browser.viewportContainerWidth()},s=this.tile?this.tile.roiFeatures:void 0;Kv.call(this,o,this.tile.features,s),this.$trackLabel&&!0===this.browser.trackLabelsVisible&&tm.call(this,r);var c=o.context.getSerializedSvg(!0),h=URL.createObjectURL(new Blob([c],{type:"application/octet-stream"}));Ug((this.$trackLabel?this.$trackLabel.text():this.trackView.track.id)+".svg",h)}},{key:"dispose",value:function(){var e=this;this.popover&&(this.popover.$popover.off(),this.popover.$popover.empty(),this.popover.$popover.remove()),oc(this.canvas).off(),oc(this.canvas).empty(),oc(this.contentDiv).off(),oc(this.contentDiv).empty(),this.$viewport.off(),this.$viewport.empty(),Object.keys(this).forEach((function(t,r,n){e[t]=void 0}))}},{key:"getCachedFeatures",value:function(){return this.tile?this.tile.features:[]}},{key:"checkContentHeight",value:function(){var e=this.trackView.track;if("FILL"===e.displayMode)this.setContentHeight(this.$viewport.height());else if("function"==typeof e.computePixelHeight){var t=this.cachedFeatures;if(t){var r=e.computePixelHeight(t);r!==oc(this.contentDiv).height()&&this.setContentHeight(r)}}}},{key:"getFeatures",value:(t=Vr(regeneratorRuntime.mark((function e(t,r,n,i,a){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tile||!this.tile.containsRange(r,n,i,a)){e.next=4;break}return e.abrupt("return",this.tile.features);case 4:if("function"!=typeof t.getFeatures){e.next=13;break}return e.next=7,t.getFeatures(r,n,i,a,this);case 7:return o=e.sent,this.cachedFeatures=o,this.checkContentHeight(),e.abrupt("return",o);case 13:return e.abrupt("return",void 0);case 14:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i,a){return t.apply(this,arguments)})}]),e}();function Xv(e){var t=oc('<div class="zoom-in-notice-container">');e.append(t);var r=oc("<div>");return t.append(r),r.text("Zoom in to see features"),t.hide(),t}function Kv(e,t,r){if(t&&(e.features=t,this.trackView.track.draw(e)),r){var n,i=fn(r);try{for(i.s();!(n=i.n()).done;){var a=n.value;e.features=a.features,a.track.draw(e)}}catch(e){i.e(e)}finally{i.f()}}}function Qv(){return this.browser&&this.browser.genomicStateList&&this.genomicState.referenceFrame}function Jv(){var e=".ruler_track_viewport_"+this.browser.genomicStateList.indexOf(this.genomicState),t=this;this.$viewport.on("click"+e,(function(e){var r,n=Ag(e,t.$viewport.get(0)).x,i=Math.round(t.genomicState.referenceFrame.start+t.genomicState.referenceFrame.toBP(n));if(1===t.browser.genomicStateList.length)r=t.browser.genome.getChromosomeCoordinate(i).chr;else{var a=t.browser.genomicStateList.map((function(e){return e.locusSearchString}));a[t.browser.genomicStateList.indexOf(t.genomicState)]=t.browser.genome.getChromosomeCoordinate(i).chr,r=a.join(" ")}t.browser.search(r)}))}function em(){var e=".ruler_track_viewport_"+this.browser.genomicStateList.indexOf(this.genomicState);this.$viewport.off(e)}function tm(e){var t,r,n,i,a,o,s=(t=this.$viewport.get(0),r=this.$trackLabel.get(0),n=t.getBoundingClientRect(),i=n.x,a=n.y,n.width,n.height,{x:(o=r.getBoundingClientRect()).x-i,y:o.y-a,width:o.width,height:o.height}),c=s.x,h=s.y,u=s.width,l=s.height,f=e.measureText(this.$trackLabel.text()).width;e.fillStyle="white",e.fillRect(c,h,u,l),e.font="12px Arial",e.fillStyle="rgb(68, 68, 68)";var p=.25*(u-f),d=.7*(l-12);e.fillText(this.$trackLabel.text(),c+p,h+l-d),e.strokeStyle="rgb(68, 68, 68)",e.strokeRect(c,h,u,l)}var rm=function(e,t,r,n,i,a){this.chr=e,this.startBP=t,this.endBP=r,this.bpPerPixel=n,this.features=i,this.roiFeatures=a};function nm(){var e,t=this,r=this.browser,n=0;function i(e){if(t.browser.dragObject||t.browser.isScrolling)return t.browser.cancelTrackPan(),e.preventDefault(),e.stopPropagation(),void(t.enableClick=!1);t.browser.cancelTrackPan(),t.browser.endTrackDrag()}function a(e,t){var r=t.genomicState.referenceFrame,n=Ag(e,t.contentDiv),i=Ag(e,t.canvas),a=r.start+r.toBP(n.x);if(void 0!==a&&null!==t.tile)return{viewport:t,referenceFrame:r,genomicLocation:a,x:n.x,y:n.y,canvasX:i.x,canvasY:i.y}}this.$viewport.on("contextmenu",(function(e){if(t.browser.dragObject)return!1;var r=a(e,t);if(void 0===r)return!1;e.preventDefault();var n=[];"function"==typeof t.trackView.track.contextMenuItemList&&(n=t.trackView.track.contextMenuItemList(r)),n.length>0&&n.push({label:oc("<HR>")}),n.push({label:"Save Image (PNG)",click:function(){t.saveImage()}}),n.push({label:"Save Image (SVG)",click:function(){t.saveSVG()}}),t.popover&&t.popover.presentTrackContextMenu(e,n)})),this.$viewport.on("mousedown",(function(e){t.enableClick=!0,r.mouseDownOnViewport(e,t),Cg(e)})),this.$viewport.on("touchstart",(function(e){t.enableClick=!0,r.mouseDownOnViewport(e,t),Cg(e)})),this.$viewport.on("mouseup",i),this.$viewport.on("touchend",i),this.$viewport.on("click",(function(i){t.enableClick&&function(i){if(3!==i.which&&!i.ctrlKey&&(oc(".igv-popover").hide(),!r.dragObject&&!r.isScrolling)){i.preventDefault(),i.stopPropagation();var o=Ag(i,t.$viewport.get(0)).x,s=Ag(i,t.canvas).x,c=t.genomicState.referenceFrame,h=Math.floor(c.start+c.toBP(s)),u=Date.now();if(u-n<r.constants.doubleClickDelay){e&&(window.clearTimeout(e),e=void 0);var l,f=Math.round(c.start+c.toBP(o));if("all"===c.chrName.toLowerCase()){var p=r.genome.getChromosomeCoordinate(f).chr;if(1===r.genomicStateList.length)l=p;else{var d=r.genomicStateList.map((function(e){return e.locusSearchString}));d[r.genomicStateList.indexOf(t.genomicState)]=p,l=d.join(" ")}r.search(l)}else r.zoomWithScaleFactor(.5,f,t)}else i.shiftKey&&"function"==typeof t.trackView.track.shiftClick?t.trackView.track.shiftClick(h,i):"function"==typeof t.trackView.track.popupData&&(e=setTimeout((function(){var n=function(e,t){var n=a(e,t);if(void 0!==n){var i,o,s=t.trackView.track,c=s.popupData(n),h=r.fireEvent("trackclick",[s,c]);return void 0===h||!0===h?c&&c.length>0&&(o='<table class="igv-popover-table">',c.forEach((function(e){e.name?o+='<tr><td class="igv-popover-td"><div class="igv-popover-name-value"><span class="igv-popover-name">'+e.name+'</span><span class="igv-popover-value">'+e.value+"</span></div></td></tr>":o+="<tr><td>"+e.toString()+"</td></tr>"})),i=o+="</table>"):"string"==typeof h&&(i=h),i}}(i,t);if(n){var o=Cg(i);t.popover.presentTrackContent(o.x,o.y,n)}clearTimeout(e),e=void 0}),r.constants.doubleClickDelay));n=u}}(i)}))}rm.prototype.containsRange=function(e,t,r,n){return this.bpPerPixel===n&&t>=this.startBP&&r<=this.endBP&&e===this.chr},rm.prototype.overlapsRange=function(e,t,r){return this.chr===e&&r>=this.startBP&&t<=this.endBP};var im={color:1};im.parent=im,im.left=im,im.right=im;var am=function(){this.root=im};function om(e,t,r){return t.interval.overlaps(e)&&r.push(t.interval),t.left!==im&&t.left.max>=e.low&&om.call(this,e,t.left,r),t.right!==im&&t.right.min<=e.high&&om.call(this,e,t.right,r),r}function sm(e){var t=e.right;e.right=t.left,t.left!==im&&(t.left.parent=e),t.parent=e.parent,e.parent===im?this.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,hm.call(this,e)}function cm(e){var t=e.left;e.left=t.right,t.right!==im&&(t.right.parent=e),t.parent=e.parent,e.parent===im?this.root=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,hm.call(this,e)}function hm(e){for(;e!==im;){var t=e.left.max>e.right.max?e.left.max:e.right.max,r=e.interval.high;e.max=t>r?t:r;var n=e.left.min<e.right.min?e.left.min:e.right.min,i=e.interval.low;e.min=n<i?n:i,e=e.parent}}function um(e,t,r){this.low=e,this.high=t,this.value=r}function lm(e){this.parent=im,this.left=im,this.right=im,this.interval=e,this.color=2}am.prototype.insert=function(e,t,r){var n=new lm(new um(e,t,r));for(this.treeInsert(n),n.color=2;n!==this.root&&2===n.parent.color;)if(n.parent===n.parent.parent.left){var i=n.parent.parent.right;2===i.color?(n.parent.color=1,i.color=1,n.parent.parent.color=2,n=n.parent.parent):(n===n.parent.right&&(n=n.parent,sm.call(this,n)),n.parent.color=1,n.parent.parent.color=2,cm.call(this,n.parent.parent))}else{var a=n.parent.parent.left;2===a.color?(n.parent.color=1,a.color=1,n.parent.parent.color=2,n=n.parent.parent):(n===n.parent.left&&(n=n.parent,cm.call(this,n)),n.parent.color=1,n.parent.parent.color=2,sm.call(this,n.parent.parent))}this.root.color=1},am.prototype.findOverlapping=function(e,t){var r=new um(e,t,0);if(this.root===im)return[];var n=om.call(this,r,this.root,[]);return n.length>1&&n.sort((function(e,t){return e.low-t.low})),n},am.prototype.logIntervals=function(){!function e(t,r){t.left!==im&&e(t.left),t.right!==im&&e(t.right)}(this.root)},am.prototype.mapIntervals=function(e){!function t(r){e(r.interval),r.left!==im&&t(r.left),r.right!==im&&t(r.right)}(this.root)},am.prototype.treeInsert=function(e){for(var t=this.root,r=im;t!==im;)r=t,t=e.interval.low<=t.interval.low?t.left:t.right;e.parent=r,r===im?(this.root=e,e.left=e.right=im):e.interval.low<=r.interval.low?r.left=e:r.right=e,hm.call(this,e)},um.prototype.equals=function(e){return!!e&&(this===e||this.low===e.low&&this.high===e.high)},um.prototype.compareTo=function(e){return this.low<e.low?-1:this.low>e.low?1:this.high<e.high?-1:this.high>e.high?1:0},um.prototype.overlaps=function(e){try{return this.low<=e.high&&e.low<=this.high}catch(e){vv.presentAlert(e,void 0)}};var fm=function(e,t,r){if(e&&0!==e.length){var n=function(e){var t=new am,r=e.length,n=Math.max(10,Math.round(r/100));e.sort((function(e,t){return e.start===t.start?0:e.start>t.start?1:-1}));for(var i=function(i){var a=Math.min(r,i+n),o=e.slice(i,a),s=o[0].start,c=s;o.forEach((function(e){c=Math.max(c,e.end)})),t.insert(s,c,o)},a=0;a<r;a+=n)i(a);return t}(e).findOverlapping(t,r);return 0===n.length?[]:(e=[],n.forEach((function(n){for(var i=n.value,a=i.length,o=0;o<a;o++){var s=i[o];if(s.start>r)break;s.end>t&&e.push(s)}})),e.sort((function(e,t){return e.start-t.start})),e)}return[]},pm=Math.log,dm=Math.LOG10E;Oe({target:"Math",stat:!0},{log10:function(e){return pm(e)*dm}});var gm={setProperties:function(e,t){for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];e[r]=n}},strokeLine:function(e,t,r,n,i,a){t=Math.floor(t)+.5,r=Math.floor(r)+.5,n=Math.floor(n)+.5,i=Math.floor(i)+.5,a&&(e.save(),gm.setProperties(e,a)),e.beginPath(),e.moveTo(t,r),e.lineTo(n,i),e.stroke(),a&&e.restore()},fillRect:function(e,t,r,n,i,a){t=Math.round(t),r=Math.round(r),a&&(e.save(),gm.setProperties(e,a)),e.fillRect(t,r,n,i),a&&e.restore()},fillPolygon:function(e,t,r,n){n&&(e.save(),gm.setProperties(e,n)),vm(e,t,r),e.fill(),n&&e.restore()},strokePolygon:function(e,t,r,n){n&&(e.save(),gm.setProperties(e,n)),vm(e,t,r),e.stroke(),n&&e.restore()},fillText:function(e,t,r,n,i,a){if((i||a)&&e.save(),i&&gm.setProperties(e,i),a){for(var o in e.translate(r,n),a){var s=a[o];"translate"===o&&e.translate(s.x,s.y),"rotate"===o&&e.rotate(s.angle*Math.PI/180)}e.fillText(t,0,0)}else e.fillText(t,r,n);(i||a)&&e.restore()},strokeText:function(e,t,r,n,i,a){if((i||a)&&e.save(),i&&gm.setProperties(e,i),a){for(var o in e.translate(r,n),a){var s=a[o];"translate"===o&&e.translate(s.x,s.y),"rotate"===o&&e.rotate(s.angle*Math.PI/180)}e.strokeText(t,0,0)}else e.strokeText(t,r,n);(i||a)&&e.restore()},strokeCircle:function(e,t,r,n,i){i&&(e.save(),gm.setProperties(e,i)),e.beginPath(),e.arc(t,r,n,0,2*Math.PI),e.stroke(),i&&e.restore()},fillCircle:function(e,t,r,n,i){i&&(e.save(),gm.setProperties(e,i)),e.beginPath(),e.arc(t,r,n,0,2*Math.PI),e.fill(),i&&e.restore()},drawArrowhead:function(e,t,r,n,i){e.save(),n||(n=5),i&&(e.lineWidth=i),e.beginPath(),e.moveTo(t,r-n/2),e.lineTo(t,r+n/2),e.lineTo(t+n,r),e.lineTo(t,r-n/2),e.closePath(),e.fill(),e.restore()},dashedLine:function(e,t,r,n,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{};void 0===a&&(a=2),e.setLineDash([a,a]),gm.strokeLine(e,t,r,n,i,o),e.setLineDash([])},roundRect:function(e,t,r,n,i,a,o,s){void 0===s&&(s=!0),void 0===a&&(a=5),e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+i-a),e.quadraticCurveTo(t+n,r+i,t+n-a,r+i),e.lineTo(t+a,r+i),e.quadraticCurveTo(t,r+i,t,r+i-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath(),s&&e.stroke(),o&&e.fill()},polygon:function(e,t,r,n,i){void 0===i&&(i=!0),e.beginPath();var a=t.length;e.moveTo(t[0],r[0]);for(var o=1;o<a;o++)e.lineTo(t[o],r[o]);e.closePath(),i&&e.stroke(),n&&e.fill()}};function vm(e,t,r){var n,i=t.length;for(n=0;n<i;n++)t[n]=Math.round(t[n]),r[n]=Math.round(r[n]);for(e.beginPath(),e.moveTo(t[0],r[0]),n=1;n<i;n++)e.lineTo(t[n],r[n]);e.closePath()}var mm=function(e){this.browser=e,this.height=40,this.name="",this.id="ruler",this.disableButtons=!0,this.ignoreTrackMenu=!0,this.order=-Number.MAX_SAFE_INTEGER,this.removable=!1,this.type="ruler"};function ym(e){e.context.save(),gm.fillRect(e.context,0,0,e.pixelWidth,e.pixelHeight,{fillStyle:"white"});var t,r=e.pixelHeight,n=fn(this.browser.genome.wgChromosomeNames);try{for(n.s();!(t=n.n()).done;){var i=t.value,a=this.browser.genome.getCumulativeOffset(i),o=this.browser.genome.getChromosome(i).bpLength,s=Math.round(a/e.bpPerPixel),c=Math.round(o/e.bpPerPixel);bm.call(this,e.context,s,0,c,r,i)}}catch(e){n.e(e)}finally{n.f()}e.context.restore()}function bm(e,t,r,n,i,a){e.textAlign="center",e.textBaseline="middle",e.font="12px sans-serif",gm.strokeLine(e,t+n,r,t+n,r+i,{strokeStyle:kg.greyScale(191)});var o=a.startsWith("chr")?a.substring(3):a;n>e.measureText(o).width&&gm.fillText(e,o,t+n/2,r+i/2,{fillStyle:kg.greyScale(68)})}mm.prototype.updateLocusLabel=function(){this.trackView.viewports.forEach((function(e){var t;t=e.genomicState.referenceFrame.showLocus(e.$viewport.width()),e.$rulerLabel.text(t)}))},mm.prototype.appendMultiPanelCloseButton=function(e,t){var r,n=this.browser;e.addClass("igv-viewport-ruler"),r=oc('<div class="igv-multi-locus-panel-close-container">'),e.append(r),r.append(Nf("times-circle")),r.click((function(e){n.removeMultiLocusPanelWithGenomicState(t,!0)}))},mm.prototype.getFeatures=function(e,t,r){return Promise.resolve([])},mm.prototype.computePixelHeight=function(e){return this.height},mm.prototype.draw=function(e){if(qv.isWholeGenomeView(e.referenceFrame))e.viewport.rulerSweeper.disableMouseHandlers(),ym.call(this,e);else{e.viewport.rulerSweeper.addMouseHandlers();var t=1+Math.floor(e.referenceFrame.toBP(e.pixelWidth));new wm(t,e).drawTicks(e,6,2,this.height),gm.strokeLine(e.context,0,this.height-2,e.pixelWidth,this.height-2)}},mm.prototype.supportsWholeGenome=function(){return!0},mm.prototype.dispose=function(){};var wm=function(e,t){function r(e,t,r,n){this.majorTick=!0===n?2*e:e,this.majorUnit=t,this.halfTick=e/2,this.unitMultiplier=r}(function(e,t){var n,i,a,o,s=t.context.isSVG||!1;e<10&&r.call(this,1,"bp",1,s),(n=Math.floor(Math.log10(e)))>9?(i="gb",a=1e9):n>6?(i="mb",a=1e6):n>3?(i="kb",a=1e3):(i="bp",a=1),o=yg(Math.floor(e/a))+" "+i,this.labelWidthBP=Math.round(t.referenceFrame.toBP(t.context.measureText(o).width)),e/Math.pow(10,n-1)<25?r.call(this,Math.pow(10,n-1),i,a,s):r.call(this,Math.pow(10,n)/2,i,a,s)}).call(this,e,t)};wm.prototype.drawTicks=function(e,t,r,n){var i,a,o,s,c,h,u;for(i=Math.floor(e.bpStart/this.majorTick)-1,c=0,h=0,o=0;o<e.pixelWidth;)a=Math.floor(i*this.majorTick),o=Math.round(e.referenceFrame.toPixels(a-1-e.bpStart+.5)),s=yg(Math.floor(a/this.unitMultiplier))+" "+this.majorUnit,c=e.context.measureText(s).width,h=Math.round(o-c/2),gm.fillText(e.context,s,h,n-t/.75),gm.strokeLine(e.context,o,n-t,o,n-r),++i;for(i=Math.floor(e.bpStart/this.halfTick)-1,o=0;o<e.pixelWidth;)a=Math.floor(i*this.halfTick),o=Math.round(e.referenceFrame.toPixels(a-1-e.bpStart+.5)),(u=a/this.unitMultiplier)===Math.floor(u)&&this.majorTick/this.labelWidthBP>8&&(s=yg(Math.floor(u))+" "+this.majorUnit,h=o-(c=e.context.measureText(s).width)/2,gm.fillText(e.context,s,h,n-t/.75)),gm.strokeLine(e.context,o,n-t,o,n-r),++i},wm.prototype.description=function(e){};var xm=If.trackMenuItemListHelper,km=function(e){this.$popover=oc("<div>",{class:"igv-trackgear-popover"}),e.append(this.$popover);var t=oc("<div>",{class:"igv-trackgear-popover-header"});this.$popover.append(t);var r=this;Sg(t,(function(){r.$popover.hide()})),this.$popoverContent=oc("<div>"),this.$popover.append(this.$popoverContent),df(this.$popover.get(0),t.get(0)),t.on("click.track_gear_popover",(function(e){e.stopPropagation(),e.preventDefault()}))};km.prototype.presentMenuList=function(e,t,r){if(r.length>0){this.$popoverContent.empty();var n,i=fn(r=xm(r,this.$popover));try{for(i.s();!(n=i.n()).done;){var a=n.value;a.init&&a.init();var o=a.object;0===r.indexOf(a)&&o.removeClass("igv-track-menu-border-top"),o.hasClass("igv-track-menu-border-top")||o.hasClass("igv-trackgear-popover-check-container")||o.is("div")&&o.addClass("igv-trackgear-popover-shim"),this.$popoverContent.append(o)}}catch(e){i.e(e)}finally{i.f()}this.$popover.css({left:e+"px",top:t+"px"}),this.$popover.show()}},km.prototype.dispose=function(){this.$popover.empty(),this.$popoverContent.empty(),Object.keys(this).forEach((function(e){this[e]=void 0}))};var Sm=function(e){var t,r=e.$parent,n=e.width,i=e.height,a=e.closeHandler;this.namespace=".generic_container_"+Eg();var o=oc("<div>",{class:"igv-generic-container"});r.append(o),this.$container=o,n&&this.$container.width(n),i&&this.$container.height(i);var s=r.get(0).getBoundingClientRect();this.origin={x:s.x,y:s.y},this.$container.offset({left:this.origin.x,top:this.origin.y}),t=oc("<div>"),this.$container.append(t);var c=oc("<i>");t.append(c),c.append(Nf("times")),c.on("mousedown"+this.namespace,(function(e){e.stopPropagation()})),c.on("mouseup"+this.namespace,(function(e){e.stopPropagation()})),c.on("click"+this.namespace,(function(e){e.preventDefault(),e.stopPropagation(),a(e)})),c.on("touchend"+this.namespace,(function(e){e.preventDefault(),e.stopPropagation(),a(e)})),df(this.$container.get(0),t.get(0))},_m=function(e,t,r){var n,i,a=this;this.browser=e,this.track=r,r.trackView=this,i=oc('<div class="igv-track-div">'),this.trackDiv=i.get(0),t.append(i),this.namespace=".trackview_"+Eg(),this.track instanceof mm&&(this.trackDiv.dataset.rulerTrack="rulerTrack"),r.height&&(this.trackDiv.style.height=r.height+"px"),this.appendLeftHandGutter(oc(this.trackDiv)),this.$viewportContainer=oc('<div class="igv-viewport-container">'),oc(this.trackDiv).append(this.$viewportContainer),this.viewports=[],n=this.browser.viewportContainerWidth()/this.browser.genomicStateList.length,e.genomicStateList.forEach((function(e){var t;t=new Yv(a,a.$viewportContainer,e,n),a.viewports.push(t)})),this.decorateViewports(),this.configureViewportContainer(this.$viewportContainer,this.viewports),!0===this.track.ignoreTrackMenu||this.appendRightHandGutter(oc(this.trackDiv)),this.track instanceof mm||Em.call(this,oc(this.trackDiv),this.$viewportContainer),"sequence"===this.track.type||this.track instanceof mm||this.createColorPicker()};function Cm(e){var t=oc("<div>",{class:"igv-trackgear-container"});e.append(t),t.append(Nf("cog")),this.trackGearPopover=new km(e),this.trackGearPopover.$popover.hide();var r=this;t.click((function(e){e.preventDefault(),e.stopPropagation(),r.trackGearPopover.presentMenuList(-r.trackGearPopover.$popover.width(),0,If.trackMenuItemList(r))}))}function Am(e,t){var r=window.devicePixelRatio;if(this.leftHandGutter){this.controlCanvas&&oc(this.controlCanvas).remove();var n=oc('<canvas class ="igv-canvas">');this.controlCanvas=n[0],oc(this.leftHandGutter).append(n),this.controlCanvas.height=r*t,this.controlCanvas.width=r*e,this.controlCanvas.style.height=t+"px",this.controlCanvas.style.width=e+"px",this.controlCtx=this.controlCanvas.getContext("2d"),this.controlCtx.scale(r,r)}}function Em(e,t){var r=this,n=this.browser;this.$trackDragScrim=oc('<div class="igv-track-drag-scrim">'),t.append(this.$trackDragScrim),this.$trackDragScrim.hide(),r.$trackManipulationHandle=oc('<div class="igv-track-manipulation-handle">'),e.append(r.$trackManipulationHandle),r.$trackManipulationHandle.on("mousedown",(function(e){e.preventDefault(),e.stopPropagation(),r.$trackDragScrim.show(),n.startTrackDrag(r)})),r.$trackManipulationHandle.on("mouseup",(function(e){e.preventDefault(),e.stopPropagation(),n.endTrackDrag(),r.$trackDragScrim.hide()})),e.on("mouseenter",(function(e){n.dragTrack&&(e.preventDefault(),e.stopPropagation(),n.updateTrackDrag(r))})),r.$trackManipulationHandle.on("mouseleave",(function(e){n.dragTrack||(e.preventDefault(),e.stopPropagation(),r.$trackDragScrim.hide())}))}function Rm(e){return this.viewports.filter((function(t){if(!t.isVisible())return!1;if(t.checkZoomIn()){var r=t.genomicState.referenceFrame,n=r.chrName,i=r.start,a=i+r.toBP(oc(t.contentDiv).width()),o=r.bpPerPixel;return e||!t.tile||t.tile.invalidate||!t.tile.containsRange(n,i,a,o)}return!1}))}function Tm(){var e,t,r=this.maxContentHeight();if(this.track.autoHeight?this.setTrackHeight(r,!1):this.track.paintAxis&&this.track.paintAxis(this.controlCtx,oc(this.controlCanvas).width(),oc(this.controlCanvas).height()),this.scrollbar){var n=this.viewports[0].getContentTop(),i=Math.min(0,this.$viewportContainer.height()-(e=this.viewports,t=e.map((function(e){return e.getContentHeight()})),Math.min.apply(Math,on(t))));n<i&&this.viewports.forEach((function(e){oc(e.contentDiv).css("top",i+"px")})),this.scrollbar.update()}}function Im(e){var t=e.map((function(e){return e.getContentHeight()}));return Math.max.apply(Math,on(t))}_m.prototype.renderSVGContext=function(e,t){var r,n=fn(this.viewports);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=i.browser.genomicStateList.indexOf(i.genomicState),o=i.$viewport.get(0).getBoundingClientRect(),s={deltaX:t.deltaX+a*i.$viewport.width(),deltaY:t.deltaY+o.y};i.renderSVGContext(e,s)}}catch(e){n.e(e)}finally{n.f()}},_m.prototype.configureViewportContainer=function(e,t){return"hidden"===e.css("overflow-y")&&(this.scrollbar=new Lm(e,t,this.browser.$root),e.append(this.scrollbar.$outerScroll)),e},_m.prototype.removeViewportWithLocusIndex=function(e){this.viewports[e].$viewport.remove(),this.viewports.splice(e,1),this.decorateViewports()},_m.prototype.decorateViewports=function(){var e=this;this.viewports.forEach((function(t,r){var n;n=t.$viewport,e.viewports.length>1?(n.find(".igv-multi-locus-panel-close-container").show(),n.find(".igv-multi-locus-panel-label-div").show()):(n.find(".igv-multi-locus-panel-close-container").hide(),n.find(".igv-multi-locus-panel-label-div").hide()),r<e.viewports.length&&1+r!==e.viewports.length?n.addClass("igv-viewport-div-border-right"):n.removeClass("igv-viewport-div-border-right")}))},_m.prototype.appendLeftHandGutter=function(e){var t,r,n=this;t=oc('<div class="igv-left-hand-gutter">'),this.leftHandGutter=t[0],e.append(t),"function"==typeof this.track.paintAxis&&(this.track.dataRange&&(t.click((function(e){n.browser.dataRangeDialog.configure({trackView:n}),n.browser.dataRangeDialog.present(oc(n.trackDiv))})),t.addClass("igv-clickable")),r=oc('<canvas class ="igv-canvas">'),t.append(r),this.controlCanvas=r.get(0),Am.call(this,t.outerWidth(),t.outerHeight()))},_m.prototype.appendRightHandGutter=function(e){var t=oc('<div class="igv-right-hand-gutter">');e.append(t),Cm.call(this,t)},_m.prototype.dataRange=function(){return this.track.dataRange?this.track.dataRange:void 0},_m.prototype.setDataRange=function(e,t,r){void 0!==e&&(this.track.dataRange.min=e,this.track.config.min=e),void 0!==t&&(this.track.dataRange.max=t,this.track.config.max=t),this.track.autoscale=r,this.track.config.autoScale=r,r?this.updateViews():this.repaintViews()},_m.prototype.setColor=function(e){this.track.color=e,this.track.config.color=e,this.repaintViews(!0)},_m.prototype.createColorPicker=function(){var e=this,t={$parent:oc(this.trackDiv),width:384,height:void 0,closeHandler:function(){e.colorPicker.$container.hide(),e.colorPicker.$container.get(0).style.top=0,e.colorPicker.$container.get(0).style.left=0}};this.colorPicker=new Sm(t),_g(this.colorPicker.$container,(function(t){return e.setColor(t)}),this.track.color),this.colorPicker.$container.hide()},_m.prototype.presentColorPicker=function(){this.colorPicker.$container.get(0).style.top=0,this.colorPicker.$container.get(0).style.left=0,this.colorPicker.$container.show()},_m.prototype.setTrackHeight=function(e,t,r){r||(this.track.minHeight&&(e=Math.max(this.track.minHeight,e)),this.track.maxHeight&&(e=Math.min(this.track.maxHeight,e))),this.track.height=e,this.track.config.height=e,oc(this.trackDiv).height(e),"function"!=typeof this.track.computePixelHeight&&(this.viewports.forEach((function(t){t.setContentHeight(e),t.tile&&(t.tile.invalidate=!0)})),this.repaintViews()),Am.call(this,oc(this.leftHandGutter).outerWidth(),e),this.track.paintAxis&&this.track.paintAxis(this.controlCtx,oc(this.controlCanvas).width(),oc(this.controlCanvas).height()),this.scrollbar&&this.scrollbar.update()},_m.prototype.isLoading=function(){for(var e=0;e<this.viewports.length;e++)if(this.viewports[e].isLoading())return!0},_m.prototype.resize=function(){var e;if(0!=(e=this.browser.viewportContainerWidth()/this.browser.genomicStateList.length)){this.viewports.forEach((function(t){t.setWidth(e)}));var t=oc(this.leftHandGutter);Am.call(this,t.outerWidth(),t.outerHeight()),this.updateViews(!0)}},_m.prototype.repaintViews=function(){this.viewports.forEach((function(e){e.repaint()})),this.track.paintAxis&&this.track.paintAxis(this.controlCtx,oc(this.controlCanvas).width(),oc(this.controlCanvas).height())},_m.prototype.updateViews=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.browser&&this.browser.genomicStateList){e.next=2;break}return e.abrupt("return");case 2:(r=this.viewports.filter((function(e){return e.isVisible()}))).forEach((function(e){e.shift()})),n=Rm.call(this,t),i=fn(n),e.prev=6,i.s();case 8:if((a=i.n()).done){e.next=14;break}return o=a.value,e.next=12,o.loadFeatures();case 12:e.next=8;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(6),i.e(e.t0);case 19:return e.prev=19,i.f(),e.finish(19);case 22:if(!(s=this.browser.dragObject)&&this.track.autoscale){c=[],h=fn(r);try{for(h.s();!(u=h.n()).done;)l=u.value,f=l.genomicState.referenceFrame,p=f.start,d=p+f.toBP(oc(l.contentDiv).width()),l.tile&&l.tile.features&&(c=c.concat(fm(l.tile.features,p,d)))}catch(e){h.e(e)}finally{h.f()}"function"==typeof this.track.doAutoscale?this.track.dataRange=this.track.doAutoscale(c):this.track.dataRange=Hg(c)}if(s||!this.track.autoscale&&!this.track.autoscaleGroup){m=fn(n);try{for(m.s();!(y=m.n()).done;)y.value.repaint()}catch(e){m.e(e)}finally{m.f()}}else{g=fn(r);try{for(g.s();!(v=g.n()).done;)v.value.repaint()}catch(e){g.e(e)}finally{g.f()}}Tm.call(this);case 26:case"end":return e.stop()}}),e,this,[[6,16,19,22]])})));return function(t){return e.apply(this,arguments)}}(),_m.prototype.getInViewFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,h,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.browser&&this.browser.genomicStateList){e.next=2;break}return e.abrupt("return",[]);case 2:return r=Rm.call(this,t),n=r.map((function(e){return e.loadFeatures()})),e.next=6,Promise.all(n);case 6:i=[],a=fn(this.viewports);try{for(a.s();!(o=a.n()).done;)(s=o.value).tile&&s.tile.features&&(c=s.genomicState.referenceFrame,h=c.start,u=h+c.toBP(oc(s.contentDiv).width()),i=i.concat(fm(s.tile.features,h,u)))}catch(e){a.e(e)}finally{a.f()}return e.abrupt("return",i);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),_m.prototype.checkContentHeight=function(){this.viewports.forEach((function(e){e.checkContentHeight()})),Tm.call(this)},_m.prototype.maxContentHeight=function(){return Im(this.viewports)},_m.prototype.dispose=function(){var e=this;this.$trackManipulationHandle&&this.$trackManipulationHandle.off(),this.scrollbar&&this.scrollbar.dispose(),oc(document).off(this.namespace),"function"==typeof this.track.dispose&&this.track.dispose();var t=this.track;"function"==typeof t.dispose&&t.dispose(),Object.keys(t).forEach((function(e){t[e]=void 0})),this.viewports.forEach((function(e){e.dispose()})),Object.keys(this).forEach((function(t){e[t]=void 0}))},_m.prototype.scrollBy=function(e){this.scrollbar.moveScrollerBy(e)};var Lm=function(e,t,r){var n,i=this,a=".trackscrollbar"+Eg();function o(e){e.preventDefault(),e.stopPropagation();var t=Cg(e);i.moveScrollerBy(t.y-n),n=t.y}function s(e){oc(document).off(i.namespace)}this.namespace=a,this.$outerScroll=oc('<div class="igv-scrollbar-outer-div">'),this.$innerScroll=oc("<div>"),this.$outerScroll.append(this.$innerScroll),this.$viewportContainer=e,this.viewports=t,this.$innerScroll.on("mousedown",(function(e){e.preventDefault();var t=Cg(e);n=t.y,oc(document).on("mousemove"+a,o),oc(document).on("mouseup"+a,s),oc(document).on("mouseleave"+a,s),e.stopPropagation()})),this.$innerScroll.on("click",(function(e){e.stopPropagation()})),this.$outerScroll.on("click",(function(e){i.moveScrollerBy(e.offsetY-i.$innerScroll.height()/2),e.stopPropagation()}))};Lm.prototype.moveScrollerBy=function(e){var t=this.$innerScroll.position().top+e;this.moveScrollerTo(t)},Lm.prototype.moveScrollerTo=function(e){var t=this.$outerScroll.height(),r=this.$innerScroll.height(),n=Math.min(Math.max(0,e),t-r),i=Im(this.viewports),a=-Math.round(n*(i/this.$viewportContainer.height()));this.$innerScroll.css("top",n+"px"),this.viewports.forEach((function(e){e.setTop(a)}))},Lm.prototype.dispose=function(){oc(window).off(this.namespace),this.$innerScroll.off()},Lm.prototype.update=function(){var e,t,r;e=this.$viewportContainer.height(),t=Im(this.viewports),r=Math.round(e/t*e),t>e?(this.$outerScroll.show(),this.$innerScroll.height(r)):this.$outerScroll.hide()};var Mm=$t.trim,Pm=o.parseFloat,Om=1/Pm(Dt+"-0")!=-1/0?function(e){var t=Mm(String(e)),r=Pm(t);return 0===r&&"-"==t.charAt(0)?-0:r}:Pm;Oe({target:"Number",stat:!0,forced:Number.parseFloat!=Om},{parseFloat:Om});var Fm=Pf.entries;function Nm(e){return"string"==typeof e||e instanceof String?new Dm(e):new Bm(e)}Oe({target:"Object",stat:!0},{entries:function(e){return Fm(e)}});var Dm=function(e){this.data=e,this.ptr=0};Dm.prototype.nextLine=function(){var e=this.ptr,t=this.data.indexOf("\n",e);return t>0?(this.ptr=t+1,t===e?void 0:this.data.substring(e,t).trim()):(this.ptr=this.data.length,e>=this.data.length?void 0:this.data.substring(e).trim())},Dm.prototype.nextLineNoTrim=function(){var e=this.ptr,t=this.data.indexOf("\n",e),r=this.data;if(t>0)return this.ptr=t+1,t>e&&"\r"===r.charAt(t-1)?r.substring(e,t-1):r.substring(e,t);var n=r.length;return this.ptr=n,e>=n?void 0:r.substring(e)};var Bm=function(e){this.data=e,this.length=this.data.length,this.ptr=0};Bm.prototype.nextLine=function(){var e,t;if(t="",!(this.ptr>=this.length)){for(var r=this.ptr;r<this.length;r++)if("\r"!==(e=String.fromCharCode(this.data[r]))){if("\n"===e)break;t+=e}return this.ptr=r+1,t}},Bm.prototype.nextLineNoTrim=Bm.prototype.nextLine;var zm={gwascatalog:{fields:["bin","chr","start","end","name","pubMedID","author","pubDate","journal","title","trait","initSample","replSample","region","genes","riskAllele","riskAlFreq","pValue","pValueDesc","orOrBeta","ci95","platform","cnv"]},wgrna:{fields:["bin","chr","start","end","name","score","strand","thickStart","thickEnd","type"]},cpgislandext:{fields:["bin","chr","start","end","name","length","cpgNum","gcNum","perCpg","perGc","obsExp"]},clinVarMain:{fields:["chr1","start","end","name","score","strand","thickStart","thickEnd","reserved","blockCount","blockSizes","chromStarts","origName","clinSign","reviewStatus","type","geneId","snpId","nsvId","rcvAcc","testedInGtr","phenotypeList","phenotype","origin","assembly","cytogenetic","hgvsCod","hgvsProt","numSubmit","lastEval","guidelines","otherIds"]}},Um=new Set(["narrowpeak","broadpeak","regionpeak","peaks","bedgraph","wig","gff3","gff","gtf","fusionjuncspan","refflat","seg","aed","bed","vcf","bb","bigbed","bw","bigwig","bam","tdf","refgene","genepred","genepredext","bedpe","bp","snp","rmsk","cram","gwas"]);function Hm(e){if(function(e){e.featureType&&(e.type=e.type||e.featureType,e.featureType=void 0),"junctions"===e.type?e.type="spliceJunctions":"bed"===e.type?(e.type="annotation",e.format=e.format||"bed"):"annotations"===e.type?e.type="annotation":"alignments"===e.type?e.type="alignment":"bam"===e.type?(e.type="alignment",e.format="bam"):"vcf"===e.type?(e.type="variant",e.format="vcf"):"t2d"===e.type?e.type="gwas":"FusionJuncSpan"!==e.type||e.format?"aed"===e.type&&(e.type="annotation",e.format=e.format||"aed"):e.format="fusionjuncspan"}(e),void 0===e.sourceType&&e.url&&(e.sourceType="file"),"file"===e.sourceType)if(void 0===e.format){var t=sv(e.url)?e.url.name:e.url;e.format=$m(t)}else e.format=e.format.toLowerCase();if(void 0===e.type){if(e.type)return;if(e.format)switch(e.format.toLowerCase()){case"bw":case"bigwig":case"wig":case"bedgraph":case"tdf":e.type="wig";break;case"vcf":e.type="variant";break;case"seg":e.type="seg";break;case"bam":case"cram":e.type="alignment";break;case"bedpe":case"bedpe-loop":e.type="interaction";break;case"bp":e.type="arc";break;case"gwas":e.type="gwas";break;default:e.type="annotation"}}}function $m(e){var t,r;if((e=e.toLowerCase()).endsWith("refgene.txt.gz")||e.endsWith("refgene.txt.bgz")||e.endsWith("refgene.txt")||e.endsWith("refgene.sorted.txt.gz")||e.endsWith("refgene.sorted.txt.bgz"))return"refgene";switch((t=e.indexOf("?"))>0&&(e=e.substr(0,t)),e.endsWith(".gz")&&(e=e.substr(0,e.length-3)),(e.endsWith(".txt")||e.endsWith(".tab")||e.endsWith(".bgz"))&&(e=e.substr(0,e.length-4)),r=(t=e.lastIndexOf("."))<0?e:e.substr(t+1)){case"bw":return"bigwig";case"bb":return"bigbed";default:return Um.has(r)?r:void 0}}var jm=Number.MAX_SAFE_INTEGER,qm=["Name","gene_name","gene","gene_id","alias","locus","name"],Gm=function(e,t,r){var n;if(void 0!==e&&(this.format=e.toLowerCase()),this.nameField=r?r.nameField:void 0,this.skipRows=0,t)this.decode=t;else switch(this.format){case"narrowpeak":case"broadpeak":case"regionpeak":case"peaks":this.decode=ry,this.delimiter=/\s+/;break;case"bedgraph":this.decode=ny,this.delimiter=/\s+/;break;case"wig":this.decode=iy,this.delimiter=/\s+/;break;case"gff3":case"gff":case"gtf":this.decode=cy,this.delimiter="\t";break;case"fusionjuncspan":this.decode=ay,this.delimiter=/\s+/;break;case"gtexgwas":this.skipRows=1,this.decode=oy,this.delimiter="\t";break;case"refflat":this.decode=ey,this.delimiter=/\s+/;break;case"genepred":this.decode=Qm,this.delimiter=/\s+/;break;case"genepredext":this.decode=Jm,this.delimiter=/\s+/;break;case"ensgene":this.decode=Qm,this.shift=1,this.delimiter=/\s+/;break;case"refgene":this.decode=Jm,this.delimiter=/\s+/,this.shift=1;break;case"bed":this.decode=Xm,this.delimiter=r.delimiter||/\s+/;break;case"bedpe":this.skipRows=1,this.decode=uy,this.delimiter=/\s+/;break;case"bedpe-domain":this.decode=ly,this.headerLine=!0,this.delimiter=/\s+/;break;case"bedpe-loop":this.decode=uy,this.delimiter=/\s+/,this.skipRows=1,this.header={colorColumn:7};break;case"snp":this.decode=fy,this.delimiter="\t";break;case"rmsk":this.decode=Km,this.delimiter="\t";break;default:void 0!==(n=function(e){return zm&&zm[e]?function(e){for(var t=e.fields,r=["chr","start","end"],n=0;n<t.length;n++){var i,a=fn(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;o===t[n]&&(e[o]=n)}}catch(e){a.e(e)}finally{a.f()}}return e}(zm[e]):void 0}(this.format))?(this.decode=py,this.format=n,this.delimiter=n.delimiter||"\t"):(this.decode=Xm,this.delimiter=/\s+/)}};function Vm(e){var t=e.split(/\s+/);return{format:"fixedStep",chrom:t[1].split("=")[1],start:parseInt(t[2].split("=")[1],10)-1,step:parseInt(t[3].split("=")[1],10),span:t.length>4?parseInt(t[4].split("=")[1],10):1,index:0}}function Wm(e){var t=e.split(/\s+/);return{format:"variableStep",chrom:t[1].split("=")[1],span:t.length>2?parseInt(t[2].split("=")[1],10):1}}function Zm(e){var t,r,n={},i=[],a=fn(e.split(/(?:")([^"]+)(?:")|([^\s"]+)(?=\s+|$)/g));try{for(a.s();!(r=a.n()).done;){var o=r.value;o&&0!==o.trim().length&&(o.endsWith("=")>0?t=o:t?(i.push(t+o),t=void 0):i.push(o))}}catch(e){a.e(e)}finally{a.f()}for(var s=0,c=i;s<c.length;s++){var h=c[s];if(!h)return;var u=h.split("=",2);if(2===u.length){var l=u[0].trim(),f=u[1].trim();n[l]=f}}return n}function Ym(e){var t={},r=e.split(/\s+/);return 2===r.length&&r[1].split(";").forEach((function(e){var r=e.split("=");"color"===r[0]?t.colorColumn=Number.parseInt(r[1])-1:"thickness"===r[0]&&(t.thicknessColumn=Number.parseInt(r[1])-1)})),t}function Xm(e,t){var r,n,i,a,o,s,c,h;if(!(e.length<3)){if(this.header&&this.header.gffTags,s={chr:e[0],start:r=parseInt(e[1]),end:e.length>2?parseInt(e[2]):r+1,score:1e3},e.length>3){if(e[3].indexOf(";")>0){var u,l=sy(e[3],"="),f=fn(qm);try{for(f.s();!(u=f.n()).done;){var p=u.value;if(l.hasOwnProperty(p)){s.name=l[p],delete l[p];break}}}catch(e){f.e(e)}finally{f.f()}s.attributes=l}s.name?s.nameField=e[3]:s.name=e[3]}if(e.length>4&&(s.score=parseFloat(e[4])),e.length>5&&(s.strand=e[5]),e.length>6&&(s.cdStart=parseInt(e[6])),e.length>7&&(s.cdEnd=parseInt(e[7])),e.length>8&&"."!==e[8]&&"0"!==e[8]&&(s.color=kg.createColorString(e[8])),e.length>11){n=parseInt(e[9]),i=e[10].split(","),a=e[11].split(","),o=[];for(var d=0;d<n;d++)h=(c=r+parseInt(a[d]))+parseInt(i[d]),o.push({start:c,end:h});ty(o,s.cdStart,s.cdEnd),s.exons=o}if(this.header){var g=this.header.thicknessColumn,v=this.header.colorColumn;v&&v<e.length&&(s.color=kg.createColorString(e[v])),g&&g<e.length&&(s.thickness=e[g])}return s}}function Km(e,t){if(!(e.length<=15))return{swScore:Number.parseInt(e[1]),milliDiv:Number.parseInt(e[2]),milliDel:Number.parseInt(e[3]),milliIns:Number.parseInt(e[4]),chr:e[5],start:Number.parseInt(e[6]),end:Number.parseInt(e[7]),strand:e[9],repName:e[10],repClass:e[11],repFamily:e[12],repStart:Number.parseInt(e[13]),repEnd:Number.parseInt(e[14]),repLeft:Number.parseInt(e[15])}}function Qm(e,t){var r=void 0===this.shift?0:1;if(!(e.length<=9+r)){for(var n=parseInt(e[5+r]),i=parseInt(e[6+r]),a={name:e[0+r],chr:e[1+r],strand:e[2+r],start:parseInt(e[3+r]),end:parseInt(e[4+r]),cdStart:n,cdEnd:i,id:e[0+r]},o=parseInt(e[7+r]),s=e[8+r].split(","),c=e[9+r].split(","),h=[],u=0;u<o;u++){var l=parseInt(s[u]),f=parseInt(c[u]);h.push({start:l,end:f})}return ty(h,n,i),a.exons=h,a}}function Jm(e,t){var r=void 0===this.shift?0:1;if(!(e.length<=11+r)){for(var n=parseInt(e[5+r]),i=parseInt(e[6+r]),a={name:e[11+r],chr:e[1+r],strand:e[2+r],start:parseInt(e[3+r]),end:parseInt(e[4+r]),cdStart:n,cdEnd:i,id:e[0+r]},o=parseInt(e[7+r]),s=e[8+r].split(","),c=e[9+r].split(","),h=[],u=0;u<o;u++){var l=parseInt(s[u]),f=parseInt(c[u]);h.push({start:l,end:f})}return ty(h,n,i),a.exons=h,a}}function ey(e,t){var r=void 0===this.shift?0:1;if(!(e.length<=10+r)){for(var n=parseInt(e[6+r]),i=parseInt(e[7+r]),a={name:e[0+r],id:e[1+r],chr:e[2+r],strand:e[3+r],start:parseInt(e[4+r]),end:parseInt(e[5+r]),cdStart:n,cdEnd:i},o=parseInt(e[8+r]),s=e[9+r].split(","),c=e[10+r].split(","),h=[],u=0;u<o;u++){var l=parseInt(s[u]),f=parseInt(c[u]);h.push({start:l,end:f})}return ty(h,n,i),a.exons=h,a}}function ty(e,t,r){var n,i=fn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.end,s=a.start;o<t||s>r?a.utr=!0:(t>=s&&t<=o&&(a.cdStart=t),r>=s&&r<=o&&(a.cdEnd=r))}}catch(e){i.e(e)}finally{i.f()}}function ry(e,t){var r,n,i,a,o,s,c;if(!(e.length<=9))return r=e[0],n=parseInt(e[1]),i=parseInt(e[2]),o=e[3],s=parseFloat(e[4]),a=e[5].trim(),c=parseFloat(e[6]),0===s&&(s=c),{chr:r,start:n,end:i,name:o,score:s,strand:a,signal:c,pValue:parseFloat(e[7]),qValue:parseFloat(e[8])}}function ny(e,t){if(!(e.length<=3)){var r={chr:e[0],start:parseInt(e[1]),end:parseInt(e[2]),value:parseFloat(e[3])};if(this.header){var n=this.header.colorColumn;n&&n<e.length&&(r.color=kg.createColorString(e[n]))}return r}}function iy(e,t){var r,n,i;return"fixedStep"===t.format?(n=(r=t.index*t.step+t.start)+t.span,i=parseFloat(e[0]),++t.index,isNaN(i)?null:{chr:t.chrom,start:r,end:n,value:i}):"variableStep"===t.format?e.length<2?null:(n=(r=parseInt(e[0],10)-1)+t.span,i=parseFloat(e[1]),isNaN(i)?null:{chr:t.chrom,start:r,end:n,value:i}):ny(e)}function ay(e,t){if(!(e.length<7)){var r=e[0],n=e[1],i=parseInt(e[2]),a=parseInt(e[3]),o=parseInt(e[4]),s=parseInt(e[5]),c=e[6],h={chr:r,name:n,junction_left:i,junction_right:a,num_junction_reads:o,num_spanning_frags:s,spanning_frag_coords:[],start:-1,end:-1},u=i,l=a;if(s>0)for(var f=c.split(","),p=0;p<f.length;p++){var d=f[p].split("-"),g=d[0],v=d[1];g<u&&(u=g),v>l&&(l=v),h.spanning_frag_coords.push({left:g,right:v})}return h.start=u,h.end=l,h}}function oy(e,t){if(e.length<7)return null;var r={chr:e[0],start:parseInt(e[1])-1,end:parseInt(e[2]),"Strongest SNP-risk allele":e[3],"Disease/Phenotype":e[4],"P-value":e[5],"Odds ratio or beta":e[6]};return e.length>6&&(r.PUBMEDID='<a target = "blank" href = "https://www.ncbi.nlm.nih.gov/pubmed/'.concat(e[7],'">').concat(e[7],"</a>")),r}function sy(e,t){var r,n={},i=fn(e.split(";"));try{for(i.s();!(r=i.n()).done;){var a=r.value.trim().split(t,2);if(2===a.length){var o=a[0].trim(),s=a[1].trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.substr(1,s.length-2)),n[o]=s}}}catch(e){i.e(e)}finally{i.f()}return n}function cy(e,t){var r,n,i,a,o,s,c,h,u,l,f=this.format;if(e.length<9)return null;r=e[0],o=e[2],n=parseInt(e[3])-1,i=parseInt(e[4]),s="."===e[5]?0:parseFloat(e[5]),a=e[6],"."===e[7]||parseInt(e[7]);for(var p="gff3"===f?"=":/\s+/,d=sy(c=e[8],p),g=0,v=Object.entries(d);g<v.length;g++){var m=an(v[g],2),y=m[0],b=m[1],w=y.toLowerCase();if("color"===w||"colour"===w)h=kg.createColorString(b);else if("gff3"===f)try{d[y]=unescape(b)}catch(e){d[y]=b,console.error("Malformed gff3 attibute value: ".concat(b))}}if(this.nameField)u=d[this.nameField];else for(l=0;l<qm.length;l++)if(d.hasOwnProperty(qm[l])){this.nameField=qm[l],u=d[this.nameField];break}return new hy({id:d.ID||d.transcript_id,parent:d.Parent,name:u,type:o,chr:r,start:n,end:i,score:s,strand:a,color:h,attributeString:c,delim:p})}function hy(e){Object.assign(this,e)}function uy(e,t){if(!(e.length<6)){var r={chr1:e[0],start1:Number.parseInt(e[1]),end1:Number.parseInt(e[2]),chr2:e[3],start2:Number.parseInt(e[4]),end2:Number.parseInt(e[5])};e.length>6&&(r.name=e[6]),e.length>7&&(r.score=e[7]),r.chr=r.chr1===r.chr2?r.chr1:"MIXED",r.start=Math.min(r.start1,r.start2),r.end=Math.max(r.end1,r.end2);var n=(r.start1+r.end1)/2,i=(r.start2+r.end2)/2;if(r.m1=n<i?n:i,r.m2=n<i?i:n,this.header){var a=this.header.thicknessColumn,o=this.header.colorColumn;o&&o<e.length&&(r.color=kg.createColorString(e[o])),a&&a<e.length&&(r.thickness=e[a])}return r}}function ly(e,t){if(!(e.length<8))return{chr:e[0],start:Number.parseInt(e[1]),end:Number.parseInt(e[2]),color:kg.createColorString(e[6]),score:Number.parseFloat(e[7])}}function fy(e,t){if(!(e.length<6)){for(var r=["bin","chr","start","end","name","score","strand","refNCBI","refUCSC","observed","molType","class","valid","avHet","avHetSE","func","locType","weight","exceptions","submitterCount","submitters","alleleFreqCount","alleles","alleleNs","alleleFreqs","bitfields"],n={chr:e[1],start:Number.parseInt(e[2]),end:Number.parseInt(e[3]),name:e[4],score:Number.parseInt(e[5])},i=Math.min(e.length,r.length),a=6;a<i;a++)n[r[a]]=e[a];return n}}function py(e,t){if(!(e.length<this.format.fields.length)){var r=this.format,n=r.coords||0,i=e[r.chr],a=parseInt(e[r.start])-n,o={chr:i,start:a,end:void 0!==r.end?parseInt(e[r.end]):a+1};return r.fields&&r.fields.forEach((function(t,n){n!==r.chr&&n!==r.start&&n!==r.end&&(o[t]=e[n])})),o}}Gm.prototype.parseHeader=function(e){var t,r,n;for(n=Nm(e);(t=n.nextLine())&&(t.startsWith("track")||t.startsWith("#")||t.startsWith("browser"));)if(t.startsWith("track")||t.startsWith("#track")){var i=Zm(t);r?Object.assign(r,i):r=i}else if(t.startsWith("#columns")){var a=Ym(t);r?Object.assign(r,a):r=a}else t.startsWith("##gff-version 3")?(this.format="gff3",r||(r={}),r.format="gff3"):t.startsWith("#gffTags")&&(r||(r={}),r.gffTags=!0);return this.header=r,r},Gm.prototype.parseFeatures=function(e){if(!e)return null;for(var t,r,n=Nm(e),i=n.nextLine.bind(n),a=[],o=0,s=this.decode,c=this.format,h=this.delimiter||"\t",u=0;t=i();)if(!(++u<=this.skipRows||t.startsWith("track")||t.startsWith("#")||t.startsWith("browser")))if("wig"===c&&t.startsWith("fixedStep"))r=Vm(t);else if("wig"===c&&t.startsWith("variableStep"))r=Wm(t);else{var l=t.split(h);if(!(l.length<1)){var f=s.call(this,l,r);if(f){if(a.length<jm)a.push(f);else{var p=Math.floor(Math.random()*o);p<jm&&(a[p]=f)}o++}}}return a},hy.prototype.popupData=function(e){var t=this.attributeString.split(";"),r=[];this.name&&r.push({name:"name:",value:this.name}),r.push({name:"type:",value:this.type});var n,i=fn(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.trim().split(this.delim,2);if(2===a.length&&void 0!==a[1]){var o=a[0].trim();if("name"===o.toLowerCase())continue;var s=a[1].trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.substr(1,s.length-2)),r.push({name:o+":",value:s})}}}catch(e){i.e(e)}finally{i.f()}return r.push({name:"position:",value:"".concat(this.chr,":").concat(yg(this.start+1),"-").concat(yg(this.end))}),r};var dy=function(){function e(){Wr(this,e)}return Yr(e,[{key:"parseHeader",value:function(e){var t,r=fn(bg(e));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(!n.startsWith("#")){var i=n.split("\t");this.header={headings:i};break}}}catch(e){r.e(e)}finally{r.f()}return this.header}},{key:"parseFeatures",value:function(e){var t=Nm(e),r=t.nextLine.bind(t),n=[];this.header||(this.header=this.parseHeader(r()));for(var i,a=this.header.headings.length-1;i=r();){var o=i.split("\t");o.length>a&&n.push({sampleKey:o[0],sample:o[0],chr:o[1],start:parseInt(o[2]),end:parseInt(o[3]),value:parseFloat(o[a])})}return n}}]),e}(),gy=function(e,t){e.displayMode&&(e.displayMode=e.displayMode.toUpperCase()),this.config=e,this.browser=t,this.url=e.url,this.type=e.type,this.description=e.description,this.supportHiDPI=void 0===e.supportHiDPI||e.supportHiDPI,e.name=e.name||e.label,e.name?this.name=e.name:sv(e.url)?this.name=e.url.name:this.name=e.url,this.order=e.order,"civic-ws"===e.sourceType?this.color="rgb(155,20,20)":this.color=e.color||e.defaultColor||"rgb(0,0,150)",this.autoscaleGroup=e.autoscaleGroup,this.removable=void 0===e.removable||e.removable,this.height=e.height||100,this.autoHeight=e.autoHeight,this.minHeight=e.minHeight||Math.min(25,this.height),this.maxHeight=e.maxHeight||Math.max(1e3,this.height),this.visibilityWindow=e.visibilityWindow};function vy(e){var t,r,n=new wy;return n.chr=e[0],n.pos=parseInt(e[1]),n.names=e[2],n.referenceBases=e[3],n.alternateBases=e[4],n.quality=e[5],n.filter=e[6],n.info=(t=e[7],r={},t&&t.split(";").forEach((function(e){var t=e.split("=");r[t[0]]=t[1]})),r),my(n),n}function my(e){var t=e.referenceBases,r=e.alternateBases;if(e.info&&(e.info.VT?e.type=e.info.VT:e.info.SVTYPE?e.type="SV":e.info.PERIOD&&(e.type="STR")),void 0===e.type&&(e.type=function(e,t){var r=e.length;if(void 0===t)return"UNKNOWN";if(0===t.trim().length||"<NON_REF>"===t||"<*>"===t||"."===t)return"NONVARIANT";var n,i=t.split(",").map((function(e){return 1===r&&1===e.length?"SNP":"<NON_REF>"===e?"NONVARIANT":"OTHER"})),a=i[0],o=fn(i);try{for(o.s();!(n=o.n()).done;)if(n.value!==a)return"MIXED"}catch(e){o.e(e)}finally{o.f()}return a}(t,r)),"NONVARIANT"===e.type&&(e.heterozygosity=0,e.start=e.pos-1,e.end=e.start+t.length),e.info.END)e.start=e.pos-1,e.end=Number.parseInt(e.info.END);else if("NONVARIANT"!==e.type){var n=r.split(",").filter((function(e){return e.length>0}));e.alleles=[],e.start=e.pos,e.end=e.pos;var i,a=fn(n);try{for(a.s();!(i=a.n()).done;){var o=i.value;if(e.alleles.push(o),"SV"!==e.type&&by(o)){var s=o.length,c=t.length,h=0;for(t.charCodeAt(0)===o.charCodeAt(0)&&(h++,s--,c--);s>0&&c>0&&o.charCodeAt(h+s-1)===t.charCodeAt(h+c-1);)s--,c--;for(;s>0&&c>0&&o.charCodeAt(h+s-1)===t.charCodeAt(h+c-1);)h++,s--,c--;var u=e.pos+h-1,l=u+Math.max(1,c);e.start=Math.min(e.start,u),e.end=Math.max(e.end,l)}}}catch(e){a.e(e)}finally{a.f()}}}gy.prototype.getState=function(){var e=Object.assign({},this.config),t=this;return Object.keys(e).forEach((function(r){var n=t[r];n&&(Bg(n)||"boolean"==typeof n)&&(e[r]=n)})),e},gy.prototype.supportsWholeGenome=function(){return!1},gy.prototype.clickedFeatures=function(e){var t=e.viewport.getCachedFeatures();if(!t||0===t.length)return[];var r=e.genomicLocation,n=e.referenceFrame.bpPerPixel>.2?3*e.referenceFrame.bpPerPixel:0,i=Math.floor(r)-n,a=Math.floor(r)+n;return fm(t,i,a)},gy.prototype.setTrackProperties=function(e){for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];switch(n){case"name":case"useScore":this[n]=e[n];break;case"visibility":switch(e[n]){case"2":case"3":case"pack":case"full":this.displayMode="EXPANDED";break;case"4":case"squish":this.displayMode="SQUISHED";break;case"1":case"dense":this.displayMode="COLLAPSED"}break;case"color":case"altColor":this[n]="rgb("+e[n]+")";break;case"featureVisiblityWindow":this.visibilityWindow=Number.parseInt(e[n])}}},gy.prototype.getVisibilityWindow=function(){return this.visibilityWindow},gy.extractPopupData=function(e,t){var r,n,i=new Set(["row","color"]),a=[];for(var o in e)if(e.hasOwnProperty(o)&&!i.has(o)&&Bg(e[o])){var s=e[o];"start"===o&&(s+=1),a.push({name:o,value:s}),"alleles"===o?r=e[o]:"alleleFreqs"===o&&(n=e[o])}if(r&&n){r.endsWith(",")&&(r=r.substr(0,r.length-1)),n.endsWith(",")&&(n=n.substr(0,n.length-1));var c=r.split(","),h=n.split(",");if(h.length>1){for(var u=[],l=0;l<h.length;l++)u.push({a:c[l],af:Number.parseFloat(h[l])});u.sort((function(e,t){return e.af-t.af}));var f=u[u.length-1].a;if(1===f.length)for(var p=u.length-2;p>=0;p--){var d=u[p].a;if(1===d.length){var g=gy.getCravatLink(e.chr,e.start+1,f,d,t);g&&(a.push("<hr/>"),a.push(g))}}}}if(e.attributes)for(var v=0,m=Object.keys(e.attributes);v<m.length;v++){var y=m[v];a.push({name:y,value:e.attributes[y]})}return a},gy.prototype.getGenomeId=function(){return this.browser.genome?this.browser.genome.id:void 0},gy.getCravatLink=function(e,t,r,n,i){if("hg38"===i||"GRCh38"===i){var a=e.startsWith("chr")?e:"chr"+e;return'<a target="_blank" href="https://run.opencravat.org/result/nocache/variant.html'+"?chrom=".concat(a,"&pos=").concat(t,"&ref_base=").concat(r,"&alt_base=").concat(n,'">Cravat ').concat(r,"->").concat(n,"</a>")}};var yy=new Set(["A","C","T","G"].map((function(e){return e.charCodeAt(0)})));function by(e){for(var t=0;t<e.length;t++)if(!yy.has(e.charCodeAt(t)))return!1;return!0}var wy=function(){};function xy(e,t){return void 0===t&&(t=","),Array.isArray(e)?e.join(t):e}wy.prototype.popupData=function(e,t){var r,n,i=this,a=this.end===this.pos?this.pos:"".concat(this.pos,"-").concat(this.end);if(r=[{name:"Chr",value:this.chr},{name:"Pos",value:a},{name:"Names",value:this.names?this.names:""},{name:"Ref",value:this.referenceBases},{name:"Alt",value:this.alternateBases.replace("<","&lt;")},{name:"Qual",value:this.quality},{name:"Filter",value:this.filter}],"SNP"===this.type){var o=this.referenceBases;if(1===o.length){var s,c=fn(this.alternateBases.split(","));try{for(c.s();!(s=c.n()).done;){var h=s.value;if(1===h.length){var u=gy.getCravatLink(this.chr,this.pos,o,h,t);u&&(r.push("<hr/>"),r.push(u))}}}catch(e){c.e(e)}finally{c.f()}}}return this.hasOwnProperty("heterozygosity")&&r.push({name:"Heterozygosity",value:this.heterozygosity}),this.info&&(r.push("<hr>"),Object.keys(this.info).forEach((function(e){r.push({name:e,value:xy(i.info[e])})}))),this.calls&&1===this.calls.length&&(r.push("<hr>"),n=this.alleles[this.calls[0].genotype[0]]+this.alleles[this.calls[0].genotype[1]],r.push({name:"Genotype",value:n})),r},wy.prototype.isRefBlock=function(){return"NONVARIANT"===this.type};var ky=function(){};function Sy(e){for(var t={genotypeIndex:-1,fields:e},r=0;r<e.length;r++)"GT"===e[r]&&(t.genotypeIndex=r);return t}ky.prototype.parseHeader=function(e){var t={},r=Nm(e),n=r.nextLine();if(!n.startsWith("##fileformat"))throw new Error("Invalid VCF file: missing fileformat line");for(t.version=n.substr(13);(n=r.nextLine())&&n.startsWith("#");){var i=void 0,a={};if(n.startsWith("##")){if(n.startsWith("##INFO")||n.startsWith("##FILTER")||n.startsWith("##FORMAT")){var o=n.indexOf("<"),s=n.lastIndexOf(">");if(!(o>2&&s>0))continue;var c=n.substring(2,o-1);t[c]||(t[c]={});var h,u=fn(wg(n.substring(o+1,s-1),","));try{for(u.s();!(h=u.n()).done;){var l=h.value.split("=");l.length>1&&("ID"===l[0]?i=l[1]:a[l[0]]=l[1])}}catch(e){u.e(e)}finally{u.f()}i&&(t[c][i]=a)}}else if(n.startsWith("#CHROM")){var f=n.split("\t");if(f.length>8){t.callSets=[];for(var p=9;p<f.length;p++)t.callSets.push({id:p,name:f[p]})}}}return this.header=t,t},ky.prototype.parseFeatures=function(e){for(var t,r=[],n=this.header.callSets,i=Nm(e),a=8+(n?n.length+1:0);t=i.nextLine();)if(!t.startsWith("#")){var o=t.split("\t");if(o.length===a){var s,c,h=vy(o);h.header=this.header,r.push(h),o.length>9&&function(){var e=Sy(o[8].split(":"));h.calls={};for(var t=9;t<o.length;t++){var r=o[t];s=n[t-9],c={callSetName:s.name,info:{}},h.calls[s.id]=c,r.split(":").forEach((function(t,r){switch(r){case e.genotypeIndex:c.genotype=[],t.split(/[\|\/]/).forEach((function(e){c.genotype.push("."===e?e:parseInt(e))}));break;default:c.info[e.fields[r]]=t}}))}}()}}return r};var _y=function(){function e(){Wr(this,e)}return Yr(e,[{key:"parseFeatures",value:function(e){if(!e)return null;for(var t,r=this.parseHeader(e),n=Nm(e),i=[];t=n.nextLine();){var a=t.split("\t"),o=a[0],s=parseInt(a[1]),c=parseInt(a[2]),h=a.slice(3).map(parseFloat);h.length==r.length&&i.push({chr:o,start:s,end:c,values:h})}return console.warn("Parsed",i.length,"features from",r.length,"samples"),i}},{key:"parseHeader",value:function(e){if(!this.sampleNames){var t=Nm(e);this.sampleNames=t.nextLine().split("\t").slice(3),console.warn("Parsed",this.sampleNames.length,"samples from gCNV track file header:",this.sampleNames)}return this.sampleNames}}]),e}(),Cy=function(e,t){this.littleEndian=void 0===t||t,this.position=0,this.view=e,this.length=e.byteLength};function Ay(e,t){this.block=e,this.offset=t}function Ey(e,t,r,n){return Ry.apply(this,arguments)}function Ry(){return(Ry=Vr(regeneratorRuntime.mark((function e(t,r,n,i){var a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w,x,k,S,_,C,A,E,R;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sv.loadArrayBuffer(t,zg(r));case 2:if(a=e.sent,o=[],s=Number.MAX_SAFE_INTEGER,c=0,a){e.next=7;break}return e.abrupt("return");case 7:if(n&&(h=new gg.Gunzip(new Uint8Array(a)),a=h.decompress().buffer),u=new Cy(new DataView(a)),l=u.getInt(),f={},!(21578050===l||n&&21578324===l)){e.next=17;break}if(p=u.getInt(),n)for(u.getInt(),u.getInt(),u.getInt(),u.getInt(),u.getInt(),u.getInt(),u.getInt(),d=0;d<p;d++)g=u.getString(),i&&(g=i.getChromosomeName(g)),f[g]=d;for(v=0;v<p;v++){for(m={},y=[],b=u.getInt(),w=0;w<b;w++)if(37450===(x=u.getInt()))u.getInt(),u.getVPointer(),u.getVPointer(),u.getLong(),u.getLong();else for(m[x]=[],k=u.getInt(),S=0;S<k;S++)_=u.getVPointer(),C=u.getVPointer(),_&&C&&(_.block<s&&(s=_.block),C.block>c&&(c=C.block),m[x].push([_,C]));for(A=u.getInt(),E=0;E<A;E++)R=u.getVPointer(),y.push(R);b>0&&(o[v]={binIndex:m,linearIndex:y})}e.next=18;break;case 17:throw new Error(t+" is not a "+(n?"tabix":"bai")+" file");case 18:return e.abrupt("return",new Ty(o,s,c,f,n));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Cy.prototype.available=function(){return this.length-this.position},Cy.prototype.remLength=function(){return this.length-this.position},Cy.prototype.hasNext=function(){return this.position<this.length-1},Cy.prototype.getByte=function(){var e=this.view.getUint8(this.position,this.littleEndian);return this.position++,e},Cy.prototype.getShort=function(){var e=this.view.getInt16(this.position,this.littleEndian);return this.position+=2,e},Cy.prototype.getUShort=function(){var e=this.view.getUint16(this.position,this.littleEndian);return this.position+=2,e},Cy.prototype.getInt=function(){var e=this.view.getInt32(this.position,this.littleEndian);return this.position+=4,e},Cy.prototype.getUInt=function(){var e=this.view.getUint32(this.position,this.littleEndian);return this.position+=4,e},Cy.prototype.getLong=function(){var e=[];e[0]=this.view.getUint8(this.position),e[1]=this.view.getUint8(this.position+1),e[2]=this.view.getUint8(this.position+2),e[3]=this.view.getUint8(this.position+3),e[4]=this.view.getUint8(this.position+4),e[5]=this.view.getUint8(this.position+5),e[6]=this.view.getUint8(this.position+6),e[7]=this.view.getUint8(this.position+7);var t=0;if(this.littleEndian)for(var r=e.length-1;r>=0;r--)t=256*t+e[r];else for(var n=0;n<e.length;n++)t=256*t+e[n];return this.position+=8,t},Cy.prototype.getString=function(e){for(var t,r="";0!==(t=this.view.getUint8(this.position++))&&(r+=String.fromCharCode(t),!e||r.length!==e););return r},Cy.prototype.getFixedLengthString=function(e){var t,r,n="";for(t=0;t<e;t++)(r=this.view.getUint8(this.position++))>0&&(n+=String.fromCharCode(r));return n},Cy.prototype.getFixedLengthTrimmedString=function(e){var t,r,n="";for(t=0;t<e;t++)(r=this.view.getUint8(this.position++))>32&&(n+=String.fromCharCode(r));return n},Cy.prototype.getFloat=function(){var e=this.view.getFloat32(this.position,this.littleEndian);return this.position+=4,e},Cy.prototype.getDouble=function(){var e=this.view.getFloat64(this.position,this.littleEndian);return this.position+=8,e},Cy.prototype.skip=function(e){return this.position+=e,this.position},Cy.prototype.getVPointer=function(){var e=this.position,t=this.view.getUint8(e+1)<<8|this.view.getUint8(e),r=4294967296*(255&this.view.getUint8(e+6))+16777216*(255&this.view.getUint8(e+5))+65536*(255&this.view.getUint8(e+4))+256*(255&this.view.getUint8(e+3))+(255&this.view.getUint8(e+2));return this.position+=8,new Ay(r,t)},Ay.prototype.isLessThan=function(e){return this.block<e.block||this.block===e.block&&this.offset<e.offset},Ay.prototype.isGreaterThan=function(e){return this.block>e.block||this.block===e.block&&this.offset>e.offset},Ay.prototype.print=function(){return this.block+":"+this.offset};var Ty=function(e,t,r,n,i){this.firstAlignmentBlock=t,this.lastAlignmentBlock=r,this.indices=e,this.sequenceIndexMap=n,this.tabix=i};function Iy(e,t,r){return Ly.apply(this,arguments)}function Ly(){return(Ly=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=function(e){var t=e.getString();n&&(t=n.getChromosomeName(t));for(var r=e.getInt(),i=e.getInt(),a=e.getInt(),o=(e.getInt(),e.getInt(),e.getLong()),s=new Array,c=0;c<i;c++){var h=e.getLong();s.push({min:o,max:h}),o=h}return{chr:t,blocks:s,longestFeature:a,binWidth:r}},h=function(e){e.getInt(),e.getInt();var t=e.getInt();if(e.getString(),e.getLong(),e.getLong(),e.getString(),e.getInt(),t>=3)for(var r=e.getInt();r-- >0;)e.getString(),e.getString()},e.next=4,Sv.loadArrayBuffer(t,zg(r));case 4:if(!(i=e.sent)){e.next=14;break}for(a={},o=new Cy(new DataView(i)),h(o),s=o.getInt();s-- >0;)c=u(o),a[c.chr]=c;return e.abrupt("return",new My(a));case 14:return e.abrupt("return",void 0);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Ty.prototype.blocksForRange=function(e,t,r){var n=this.indices[e];if(n){var i=function(e,t){var r,n=[];for(t>=1<<29&&(t=1<<29),--t,n.push(0),r=1+(e>>26);r<=1+(t>>26);++r)n.push(r);for(r=9+(e>>23);r<=9+(t>>23);++r)n.push(r);for(r=73+(e>>20);r<=73+(t>>20);++r)n.push(r);for(r=585+(e>>17);r<=585+(t>>17);++r)n.push(r);for(r=4681+(e>>14);r<=4681+(t>>14);++r)n.push(r);return n}(t,r),a=[];i.forEach((function(e){if(n.binIndex[e])for(var t=n.binIndex[e],r=t.length,i=0;i<r;++i){var o=t[i][0],s=t[i][1];a.push({minv:o,maxv:s,bin:e})}}));for(var o=n.linearIndex.length,s=null,c=Math.min(t>>14,o-1),h=Math.min(r>>14,o-1),u=c;u<=h;++u){var l=n.linearIndex[u];l&&(s&&!l.isLessThan(s)||(s=l))}return function(e,t){var r=[],n=null;return 0===e.length?e:(e.sort((function(e,t){var r=e.minv.block-t.minv.block;return 0!==r?r:e.minv.offset-t.minv.offset})),e.forEach((function(e){var i,a;t&&!e.maxv.isGreaterThan(t)||(null===n?(r.push(e),n=e):(i=n,(a=e).minv.block-i.maxv.block<65e3&&a.maxv.block-i.minv.block<5e6?e.maxv.isGreaterThan(n.maxv)&&(n.maxv=e.maxv):(r.push(e),n=e)))})),r)}(a,s)}return[]};var My=function(){function e(t){Wr(this,e),this.chrIndex=t}return Yr(e,[{key:"blocksForRange",value:function(e,t,r){var n=this.chrIndex[e];if(n){var i=n.blocks,a=n.longestFeature,o=n.binWidth,s=Math.max(t-a,0),c=Math.floor(s/o);if(c>=i.length)return[];var h=Math.min(Math.floor((r-1)/o),i.length-1),u=i[c].min,l=i[h].max;return 0==l-u?[]:[{minv:{block:u,offset:0},maxv:{block:l,offset:0}}]}}}]),e}(),Py=function(){function e(t){if(Wr(this,e),this.config=t,t.columns){if(void 0===t.columns.chromosome||void 0===t.columns.position||void 0===t.columns.value)throw Error("columns property must define chrCol, posCol, and valueCol");this.posCol=t.columns.position-1,this.chrCol=t.columns.chromosome-1,this.pvalueCol=t.columns.value-1}else this.posCol=2,this.chrCol=1,this.pvalueCol=3}return Yr(e,[{key:"parseHeader",value:function(e){var t=Nm(e).nextLine();return this.parseHeaderLine(t)}},{key:"parseHeaderLine",value:function(e){if(this.columns=e.split(/\t/),!this.config.columns)for(var t=0;t<this.columns.length;t++)switch(this.columns[t].toLowerCase()){case"chr":case"chromosome":case"chr_id":this.chrCol=t;break;case"bp":case"pos":case"position":case"chr_pos":this.posCol=t;break;case"p":case"pval":case"pvalue":case"p-value":case"p.value":this.pvalueCol=t}return this.columns}},{key:"parseFeatures",value:function(e){if(!e)return null;var t,r=Nm(e),n=[],i=r.nextLine();for(this.columns||this.parseHeaderLine(i);t=r.nextLine();){var a=t.split(/\t/);if(a.length===this.columns.length){var o=a[this.chrCol],s=parseInt(a[this.posCol])-1,c=s+1,h=parseFloat(a[this.pvalueCol]);n.push(new Oy({chr:o,start:s,end:c,value:h,line:t,columns:this.columns}))}}return n}}]),e}(),Oy=function(){function e(t){var r=t.chr,n=t.start,i=t.end,a=t.value,o=t.line,s=t.columns;Wr(this,e),this.chr=r,this.start=n,this.end=i,this.value=a,this.line=o,this.columns=s}return Yr(e,[{key:"popupData",value:function(){var e=this.line.split(/\t/);return this.columns.map((function(t,r){return{name:t,value:e[r]}}))}},{key:"getAttribute",value:function(e){for(var t=this.line.split(/\t/),r=0;r<this.columns.length;r++)if(this.columns[r]===e)return t[r]}}]),e}(),Fy=new RegExp("([^:]*)\\(([^)]*)\\)"),Ny=new RegExp("([^:]*):([^(]*)\\(([^)]*)\\)"),Dy=function(){function e(t,r,n){Wr(this,e),this.nameField=n?n.nameField:void 0,this.skipRows=0,this.decode=r||jy,this.delimiter="\t"}return Yr(e,[{key:"parseHeader",value:function(e){for(var t,r,n=Nm(e);(t=n.nextLine())&&(t.startsWith("track")||t.startsWith("#")||t.startsWith("browser"));)if(t.startsWith("track")||t.startsWith("#track")){var i=Uy(t);r?Object.assign(r,i):r=i}else if(t.startsWith("#columns")){var a=Hy(t);r?Object.assign(r,a):r=a}else t.startsWith("##gff-version 3")&&(this.format="gff3",r||(r={}),r.format="gff3");return this.header=r,r}},{key:"parseFeatures",value:function(e){if(!e)return null;for(var t,r=Nm(e),n=r.nextLineNoTrim.bind(r),i=[],a=this.decode,o=this.delimiter||"\t",s=0;t=n();)if(!(++s<=this.skipRows||t.startsWith("track")||t.startsWith("#")||t.startsWith("browser"))){var c=u();if(!(c.length<1))if(this.aed){var h=a.call(this,c,void 0);h&&i.push(h)}else this.aed=zy(c)}return i;function u(){for(var e,r,i=[],a="",s=!1;t||""===t;){for(e=0;e<t.length;e++)(r=t.charAt(e))===o?s?a+=r:(i.push(a),a=""):'"'===r?e+1<t.length&&'"'===t.charAt(e+1)?(s&&(a+='"'),e++):s=!s:a+=r;if(!s)break;a+="\n",t=n()}return i.push(a),i}}}]),e}();function By(e){var t=Ny.exec(e);if(t)return{namespace:t[1],name:t[2],type:t[3]};if(t=Fy.exec(e))return{namespace:"?",name:t[1],type:t[2]};throw new Error("Error parsing the header row of AED file - column not in ns:name(ns:type) format")}function zy(e){var t,r,n;for(t={columns:[],metadata:{}},r=0;r<e.length;r++)n=By(e[r]),t.columns.push(n);return t}function Uy(e){var t,r,n={},i=[],a=fn(e.split(/(?:")([^"]+)(?:")|([^\s"]+)(?=\s+|$)/g));try{for(a.s();!(r=a.n()).done;){var o=r.value;o&&0!==o.trim().length&&(o.endsWith("=")>0?t=o:t?(i.push(t+o),t=void 0):i.push(o))}}catch(e){a.e(e)}finally{a.f()}for(var s=0,c=i;s<c.length;s++){var h=c[s];if(!h)return;var u=h.split("=",2);if(2===u.length){var l=u[0].trim(),f=u[1].trim();n[l]=f}}return n}function Hy(e){var t={},r=e.split(/\s+/);return 2===r.length&&r[1].split(";").forEach((function(e){var r=e.split("=");"color"===r[0]?t.colorColumn=Number.parseInt(r[1])-1:"thickness"===r[0]&&(t.thicknessColumn=Number.parseInt(r[1])-1)})),t}function $y(e,t){var r,n,i=e.columns;this.aed=e,this.allColumns=t,this.chr=null,this.start=null,this.end=null,this.score=1e3,this.strand=".",this.cdStart=null,this.cdEnd=null,this.name=null,this.color=null;for(var a=0;a<t.length;a++)(r=t[a])&&("aed:Integer"===(n=i[a]).type&&(r=parseInt(r)),"bio"===n.namespace?"sequence"===n.name?this.chr=r:"start"===n.name?this.start=r:"end"===n.name?this.end=r:"cdsMin"===n.name?this.cdStart=r:"cdsMax"===n.name?this.cdEnd=r:"strand"===n.name&&(this.strand=r):"aed"===n.namespace?"name"===n.name&&(this.name=r):"style"===n.namespace&&"color"===n.name&&(this.color=kg.createColorString(r)))}function jy(e,t){var r,n,i,a,o,s,c=0,h=this.aed.columns;if(e.length===h.length){for(s=0;s<e.length;s++)a=h[s],""!==(i=e[s])&&c++,"name"===a.name&&"aed"===a.namespace?r=i:"value"===a.name&&"aed"===a.namespace&&(n=i);if(2===c&&r&&n)return o=By(r),this.aed.metadata[o.namespace]||(this.aed.metadata[o.namespace]={}),void(this.aed.metadata[o.namespace][o.name]||(this.aed.metadata[o.namespace][o.name]={type:o.type,value:n}));var u=new $y(this.aed,e);if(u.chr&&(u.start||0===u.start)&&u.end)return u}}$y.prototype.popupData=function(){for(var e=[],t=this.aed,r=0;r<this.allColumns.length;r++){var n=this.allColumns[r],i=t.columns[r].name;"sequence"!==i&&"color"!==i&&n&&e.push({name:i,value:n})}return e};var qy=function(){function e(t,r){var n;Wr(this,e),this.config=t||{},this.genome=r,this.indexURL=t.indexURL,this.indexed=t.indexed,sv(this.config.url)?this.filename=this.config.url.name:mg(this.config.url)&&this.config.url.startsWith("data:")?(this.indexed=!1,this.dataURI=t.url):(n=hv(this.config.url),this.filename=t.filename||n.file),this.format=this.config.format,this.parser=this.getParser(this.format,this.config.decode,this.config),"vcf"!==this.config.format||this.config.indexURL||console.warn("Warning: index file not specified.  The entire vcf file will be loaded.")}var t,r,n,i,a,o;return Yr(e,[{key:"readFeatures",value:(o=Vr(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getIndex();case 2:if(!e.sent){e.next=7;break}return e.abrupt("return",this.loadFeaturesWithIndex(t,r,n));case 7:if(!this.dataURI){e.next=11;break}return e.abrupt("return",this.loadFeaturesFromDataURI());case 11:return e.abrupt("return",this.loadFeaturesNoIndex());case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})},{key:"readHeader",value:(a=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,h,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.header){e.next=38;break}if(!this.dataURI){e.next=9;break}return e.next=4,this.loadFeaturesFromDataURI(this.dataURI);case 4:r=e.sent,(t=this.header||{}).features=r,e.next=38;break;case 9:if(!this.config.indexURL){e.next=30;break}return e.next=12,this.getIndex();case 12:if(n=e.sent){e.next=15;break}throw new Error("Unable to load index: "+this.config.indexURL);case 15:if(i="vcf"===this.config.format?65e3:1e3,!n.tabix){e.next=23;break}return a=zg(this.config,{range:{start:n.firstAlignmentBlock,size:26}}),e.next=20,Sv.loadArrayBuffer(this.config.url,a);case 20:o=e.sent,s=rv(o),i=n.firstAlignmentBlock+s;case 23:return c=zg(this.config,{bgz:n.tabix,range:{start:0,size:i}}),e.next=26,Sv.loadString(this.config.url,c);case 26:h=e.sent,t=this.parser.parseHeader(h),e.next=35;break;case 30:return e.next=32,this.loadFeaturesNoIndex();case 32:u=e.sent,(t=this.header||{}).features=u;case 35:return t&&this.parser&&(this.parser.header=t),this.header=t,e.abrupt("return",t);case 38:return e.abrupt("return",this.header);case 39:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"getParser",value:function(e,t,r){switch(e){case"vcf":return new ky(r);case"seg":return new dy;case"gcnv":return new _y;case"gwas":return new Py(r);case"aed":return new Dy(e,t,r);default:return new Gm(e,t,r)}}},{key:"loadFeaturesNoIndex",value:(i=Vr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=zg(this.config),e.next=3,Sv.loadString(this.config.url,t);case 3:return r=e.sent,this.header=this.parser.parseHeader(r),this.header instanceof String&&this.header.startsWith("##gff-version 3")&&(this.format="gff3"),e.abrupt("return",this.parser.parseFeatures(r));case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadFeaturesWithIndex",value:(n=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u,l,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.config,a=this.parser,o=this.index.tabix,s=o?this.index.sequenceIndexMap[t]:t,c=[],h=this.genome,(u=this.index.blocksForRange(s,r,n))&&0!==u.length){e.next=11;break}return e.abrupt("return",[]);case 11:l=fn(u),e.prev=12,p=regeneratorRuntime.mark((function e(){var s,u,l,p,d,g,v,m,y,b,w,x,k;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k=function(e){for(var i=l?e.slice(l):e,o=a.parseFeatures(i),s=!1,u=0;u<o.length;u++){var f=o[u];if(h.getChromosomeName(f.chr)!==t){if(0===c.length)continue;break}if(f.start>n){c.push(f);break}f.end>=r&&f.start<=n&&(s||(s=!0,u>0&&c.push(o[u-1])),c.push(f))}},s=f.value,u=s.minv.block,l=s.minv.offset,p=s.maxv.offset,d=void 0,!o){e.next=17;break}if(g=0,!(p>0)){e.next=14;break}return v=zg(i,{range:{start:s.maxv.block,size:26}}),e.next=12,Sv.loadArrayBuffer(i.url,v);case 12:m=e.sent,g=rv(m);case 14:d=s.maxv.block+g,e.next=18;break;case 17:d=s.maxv.block;case 18:if(y=zg(i,{range:{start:u,size:d-u+1}}),!o){e.next=27;break}return e.next=22,Sv.loadArrayBuffer(i.url,y);case 22:b=e.sent,w=tv(b),k(w),e.next=31;break;case 27:return e.next=29,Sv.loadString(i.url,y);case 29:x=e.sent,k(x);case 31:case"end":return e.stop()}}),e)})),l.s();case 15:if((f=l.n()).done){e.next=19;break}return e.delegateYield(p(),"t0",17);case 17:e.next=15;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(12),l.e(e.t1);case 24:return e.prev=24,l.f(),e.finish(24);case 27:return c.sort((function(e,t){return e.start-t.start})),e.abrupt("return",c);case 29:case"end":return e.stop()}}),e,this,[[12,21,24,27]])}))),function(e,t,r){return n.apply(this,arguments)})},{key:"getIndex",value:function(){var e=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.index&&this.config.indexURL){e.next=4;break}return e.abrupt("return",this.index);case 4:return e.next=6,this.loadIndex();case 6:return this.index=e.sent,e.abrupt("return",this.index);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"loadIndex",value:(r=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(sv(t=this.config.indexURL)?r=t.name:(n=hv(t),r=n.file),!(r.endsWith(".tbi")||this.filename.endsWith(".gz")||this.filename.endsWith(".bgz"))){e.next=9;break}return e.next=6,Ey(t,this.config,!0,this.genome);case 6:i=e.sent,e.next=12;break;case 9:return e.next=11,Iy(t,this.config,this.genome);case 11:i=e.sent;case 12:return e.abrupt("return",i);case 13:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"loadFeaturesFromDataURI",value:(t=Vr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=cv(this.dataURI),this.header=this.parser.parseHeader(t),this.header instanceof String&&this.header.startsWith("##gff-version 3")&&(this.format="gff3"),r=this.parser.parseFeatures(t),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Gy=function(e,t,r){this.treeMap=this.buildTreeMap(e,t),this.range=r,this.count=e.length};function Vy(e){for(var t=new am,r=e.length,n=Math.max(10,Math.round(r/10)),i=0;i<r;i+=n){for(var a=Math.min(r,i+n),o=new Wy(i,a),s=e[i].start,c=s,h=i;h<a;h++)c=Math.max(c,e[h].end);t.insert(s,c,o)}return t}Gy.prototype.containsRange=function(e){return void 0===this.range||this.range.contains(e.chr,e.start,e.end)},Gy.prototype.queryFeatures=function(e,t,r){var n=this.treeMap[e];if(!n)return[];var i=n.findOverlapping(t,r);if(0===i.length)return[];var a=[],o=this.allFeatures[e];if(o){var s,c=fn(i);try{for(c.s();!(s=c.n()).done;)for(var h=s.value.value,u=h.start;u<h.end;u++){var l=o[u];if(l.start>r)break;l.end>=t&&a.push(l)}}catch(e){c.e(e)}finally{c.f()}a.sort((function(e,t){return e.start-t.start}))}return a},Gy.prototype.getAllFeatures=function(){return this.allFeatures},Gy.prototype.buildTreeMap=function(e,t){var r={},n=[];if(this.allFeatures={},e){var i,a=fn(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=o.chr;t&&(s=t.getChromosomeName(s));var c=this.allFeatures[s];c||(n.push(s),c=[],this.allFeatures[s]=c),c.push(o)}}catch(e){a.e(e)}finally{a.f()}var h,u=fn(n);try{for(u.s();!(h=u.n()).done;){var l=h.value,f=this.allFeatures[l];f.sort((function(e,t){return e.start===t.start?0:e.start>t.start?1:-1})),r[l]=Vy(f)}}catch(e){u.e(e)}finally{u.f()}}return r};var Wy=function e(t,r){Wr(this,e),this.start=t,this.end=r},Zy=function(){function e(t){Wr(this,e),this.config=t}var t;return Yr(e,[{key:"readFeatures",value:(t=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u,l,f,p,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="function"==typeof this.config.url?this.config.url({chr:t,start:r,end:n}):this.config.url.replace("$CHR",t).replace("$START",r).replace("$END",n),a=Object.assign({},this.config),void 0!==this.config.body&&("function"==typeof this.config.body?a.body=this.config.body({chr:t,start:r,end:n}):a.body=this.config.body.replace("$CHR",t).replace("$START",r).replace("$END",n)),e.next=5,Sv.load(i,a);case 5:if((s=e.sent)&&(o="function"==typeof this.config.parser?this.config.parser(s):mg(s)?JSON.parse(s):s),this.config.mappings){c=Object.keys(this.config.mappings),h=fn(o);try{for(h.s();!(u=h.n()).done;){l=u.value,f=fn(c);try{for(f.s();!(p=f.n()).done;)d=p.value,l[d]=l[this.config.mappings[d]]}catch(e){f.e(e)}finally{f.f()}}}catch(e){h.e(e)}finally{h.f()}}return e.abrupt("return",o);case 9:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}(),Yy=function(e,t){this.config=e,this.genome=t,this.expandQueryInterval=!1};Yy.prototype.readFeatures=function(e,t,r){var n=Math.max(0,Math.floor(t)),i=Math.ceil(r);if(this.genome){var a=this.genome.getChromosome(e);a&&i>a.bpLength&&(i=a.bpLength)}var o=this.config.url+"?db="+this.config.db+"&table="+this.config.tableName+"&chr="+e+"&start="+n+"&end="+i;return Sv.loadJson(o,this.config).then((function(e){return e?(e.forEach((function(e){e.hasOwnProperty("exonStarts")&&e.hasOwnProperty("exonEnds")&&e.hasOwnProperty("exonCount")&&e.hasOwnProperty("cdsStart")&&e.hasOwnProperty("cdsEnd")&&function(e){var t,r,n,i,a,o;t=e.exonCount,r=e.exonStarts.split(","),n=e.exonEnds.split(","),i=[];for(var s=0;s<t;s++){a=parseInt(r[s]),o=parseInt(n[s]);var c={start:a,end:o};(e.cdsStart>o||e.cdsEnd<e.cdsStart)&&(c.utr=!0),e.cdsStart>=a&&e.cdsStart<=o&&(c.cdStart=e.cdsStart),e.cdsEnd>=a&&e.cdsEnd<=o&&(c.cdEnd=e.cdsEnd),i.push(c)}e.exons=i}(e)})),e):null}))};for(var Xy=new Set(["transcript","primary_transcript","processed_transcript","mRNA","mrna"]),Ky=new Set(["CDS","cds"]),Qy=new Set(["start_codon","stop_codon"]),Jy=new Set(["5UTR","3UTR","UTR","five_prime_UTR","three_prime_UTR","3'-UTR","5'-UTR"]),eb=new Set(["exon","coding-exon"]),tb=new Set,rb=0,nb=[Xy,Ky,Qy,Jy,eb];rb<nb.length;rb++){var ib,ab=fn(nb[rb]);try{for(ab.s();!(ib=ab.n()).done;){var ob=ib.value;tb.add(ob)}}catch(e){ab.e(e)}finally{ab.f()}}var sb=function(){function e(t){Wr(this,e),this.format=t.format,t.filterTypes&&(this.filterTypes=new Set(t.filterTypes))}return Yr(e,[{key:"combineFeatures",value:function(e){var t;if("gff3"===this.format){var r=this.combineFeaturesById(e);t=this.combineFeaturesGFF(r)}else t=this.combineFeaturesGTF(e);return t.sort((function(e,t){return e.start-t.start})),t}},{key:"combineFeaturesById",value:function(e){var t,r=[],n={},i=fn(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;if(void 0===a.id)r.push(a);else{var o=n[a.chr];if(o||(o={},n[a.chr]=o),o.hasOwnProperty(a.id)){var s=o[a.id];if(s.hasOwnProperty("exons"))s.start=Math.min(s.start,a.start),s.end=Math.max(s.end,a.end),s.exons.push(a);else{var c={id:a.id,type:a.type,chr:a.chr,strand:a.strand,start:Math.min(a.start,s.start),end:Math.max(a.end,s.end),exons:[s,a]};a.parent&&""!==a.parent.trim()&&(c.parent=a.parent),o[a.id]=c}}else o[a.id]=a}}}catch(e){i.e(e)}finally{i.f()}for(var h=0,u=Object.keys(n);h<u.length;h++)for(var l=n[u[h]],f=0,p=Object.keys(l);f<p.length;f++){var d=p[f];r.push(l[d])}return r}},{key:"combineFeaturesGTF",value:function(e){var t,r=Object.create(null),n=[],i=new Set,a=this.filterTypes,o=fn(e=e.filter((function(e){return void 0===a||!a.has(e.type)})));try{for(o.s();!(t=o.n()).done;){var s=t.value;if(Xy.has(s.type)){var c=s.id;if(void 0!==c){var h=new cb(s);r[c]=h,n.push(h),i.add(s)}}}}catch(e){o.e(e)}finally{o.f()}var u,l=fn(e);try{for(l.s();!(u=l.n()).done;){var f=u.value;if(eb.has(f.type)){var p=f.id;if(p){var d=r[p];void 0===d&&(d=new cb(f),r[p]=d,n.push(d)),d.addExon(f),i.add(f)}}}}catch(e){l.e(e)}finally{l.f()}var g,v=fn(e);try{for(v.s();!(g=v.n()).done;){var m=g.value;if(Ky.has(m.type)||Jy.has(m.type)||Qy.has(m.type)){var y=m.id;if(y){var b=r[y];void 0===b&&(b=new cb(m),r[y]=b,n.push(b)),Jy.has(m.type)?b.addUTR(m):Ky.has(m.type)?b.addCDS(m):Qy.has(m.type),i.add(m)}}}}catch(e){v.e(e)}finally{v.f()}for(var w=0,x=n;w<x.length;w++){var k=x[w];"function"==typeof k.finish&&k.finish()}var S,_=fn(e.filter((function(e){return!i.has(e)})));try{for(_.s();!(S=_.n()).done;){var C=S.value;n.push(C)}}catch(e){_.e(e)}finally{_.f()}return n}},{key:"combineFeaturesGFF",value:function(e){var t,r=e.filter((function(e){return"gene"===e.type})),n=Object.create(null),i=fn(r);try{for(i.s();!(t=i.n()).done;){var a=t.value;n[a.id]=a}}catch(e){i.e(e)}finally{i.f()}var o,s=Object.create(null),c=[],h=new Set,u=this.filterTypes,l=fn(e=e.filter((function(e){return void 0===u||!u.has(e.type)})));try{for(l.s();!(o=l.n()).done;){var f=o.value;if(Xy.has(f.type)){var p=f.id;if(void 0!==p){var d=new cb(f);s[p]=d,c.push(d),h.add(f);var g=n[f.parent];g&&(d.gene=n[f.parent],h.add(g))}}}}catch(e){l.e(e)}finally{l.f()}var v,m=fn(e);try{for(m.s();!(v=m.n()).done;){var y=v.value;if(eb.has(y.type)){var b=B(y);if(b){var w,x=fn(b);try{for(x.s();!(w=x.n()).done;){var k=s[w.value];void 0!==k&&(k.addExon(y),h.add(y))}}catch(e){x.e(e)}finally{x.f()}}}}}catch(e){m.e(e)}finally{m.f()}var S,_=fn(e);try{for(_.s();!(S=_.n()).done;){var C=S.value;if(Ky.has(C.type)||Jy.has(C.type)||Qy.has(C.type)){var A=B(C);if(A){var E,R=fn(A);try{for(R.s();!(E=R.n()).done;){var T=s[E.value];void 0!==T&&(Jy.has(C.type)?T.addUTR(C):Ky.has(C.type)?T.addCDS(C):Qy.has(C.type),h.add(C))}}catch(e){R.e(e)}finally{R.f()}}}}}catch(e){_.e(e)}finally{_.f()}var I,L=fn(e.filter((function(e){return"intron"===e.type})));try{for(L.s();!(I=L.n()).done;){var M,P=I.value,O=fn(B(P));try{for(O.s();!(M=O.n()).done;)if(s[M.value]){h.add(P);break}}catch(e){O.e(e)}finally{O.f()}}}catch(e){L.e(e)}finally{L.f()}c.forEach((function(e){"function"==typeof e.finish&&e.finish()}));var F,N=fn(e.filter((function(e){return!h.has(e)})));try{for(N.s();!(F=N.n()).done;){var D=F.value;c.push(D)}}catch(e){N.e(e)}finally{N.f()}return c;function B(e){return e.parent&&""!==e.parent.trim()?e.parent.trim().split(","):null}}}]),e}(),cb=function(e){Object.assign(this,e),this.exons=[]};cb.prototype.addExon=function(e){this.exons.push(e),this.start=Math.min(this.start,e.start),this.end=Math.max(this.end,e.end)},cb.prototype.addCDS=function(e){for(var t,r=this.exons,n=0;n<r.length;n++)if(r[n].start<=e.start&&r[n].end>=e.end){t=r[n];break}t?(t.cdStart=t.cdStart?Math.min(e.start,t.cdStart):e.start,t.cdEnd=t.cdEnd?Math.max(e.end,t.cdEnd):e.end,t.children||(t.children=[]),t.children.push(e)):(e.cdStart=e.start,e.cdEnd=e.end,r.push(e)),this.start=Math.min(this.start,e.start),this.end=Math.max(this.end,e.end),this.cdStart=this.cdStart?Math.min(e.start,this.cdStart):e.start,this.cdEnd=this.cdEnd?Math.max(e.end,this.cdEnd):e.end},cb.prototype.addUTR=function(e){for(var t,r=this.exons,n=0;n<r.length;n++)if(r[n].start<=e.start&&r[n].end>=e.end){t=r[n];break}t?(e.start===t.start&&e.end===t.end?t.utr=!0:(e.end<t.end&&(t.cdStart=e.end),e.start>t.start&&(t.cdEnd=e.start)),t.children||(t.children=[]),t.children.push(e)):(e.utr=!0,r.push(e)),this.start=Math.min(this.start,e.start),this.end=Math.max(this.end,e.end)},cb.prototype.finish=function(){var e=this.cdStart,t=this.cdEnd;this.exons.sort((function(e,t){return e.start-t.start})),e&&this.exons.forEach((function(r){(r.end<e||r.start>t)&&(r.utr=!0)}))},cb.prototype.popupData=function(e){var t=this.attributeString.split(";"),r=[];if(this.gene&&"function"==typeof this.gene.popupData){var n,i=fn(this.gene.popupData(e));try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(a)}}catch(e){i.e(e)}finally{i.f()}r.push("<hr>")}this.name&&r.push({name:"name",value:this.name}),r.push({name:"type",value:this.type});var o,s=fn(t);try{for(s.s();!(o=s.n()).done;){var c=o.value.trim().split(this.delim,2);if(2===c.length&&void 0!==c[1]){var h=c[0].trim();if("name"===h.toLowerCase())continue;var u=c[1].trim();u.startsWith('"')&&u.endsWith('"')&&(u=u.substr(1,u.length-2)),r.push({name:h,value:u})}}}catch(e){s.e(e)}finally{s.f()}r.push({name:"position",value:"".concat(this.chr,":").concat(yg(this.start+1),"-").concat(yg(this.end))});var l,f=fn(this.exons);try{for(f.s();!(l=f.n()).done;){var p=l.value;if(e>=p.start&&e<p.end&&"function"==typeof p.popupData){r.push("<hr>");var d,g=fn(p.popupData(e));try{for(g.s();!(d=g.n()).done;){var v=d.value;r.push(v)}}catch(e){g.e(e)}finally{g.f()}if(p.children){var m,y=fn(p.children);try{for(y.s();!(m=y.n()).done;){var b=m.value;r.push("<hr>");var w,x=fn(b.popupData(e));try{for(x.s();!(w=x.n()).done;){var k=w.value;r.push(k)}}catch(e){x.e(e)}finally{x.f()}}}catch(e){y.e(e)}finally{y.f()}}}}}catch(e){f.e(e)}finally{f.f()}return r};var hb=function(e){this.config=e,this.url=e.url,this.tissueId=e.tissueSiteDetailId,this.indexed=!0,this.datasetId=e.datasetId||"gtex_v8"};hb.prototype.readFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this,a=t.startsWith("chr")?t:"chr"+t,o=Math.floor(r),s=Math.ceil(n),c=this.datasetId,h=this.url+"?chromosome="+a+"&start="+o+"&end="+s+"&tissueSiteDetailId="+this.tissueId+"&datasetId="+c,e.next=3,Sv.loadJson(h,{withCredentials:i.config.withCredentials});case 3:if(!(u=e.sent)||!u.singleTissueEqtl){e.next=9;break}return u.singleTissueEqtl.forEach((function(e){e.chr=e.chromosome,e.position=e.pos,e.start=e.pos-1,e.end=e.start+1,e.snp=e.snpId,e.geneName=e.geneSymbol,e.geneId=e.gencodeId})),e.abrupt("return",u.singleTissueEqtl);case 9:return e.abrupt("return",void 0);case 10:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}();var ub=function(e){this.config=e,this.url=e.url,this.cellConditionId=e.cellConditionId,this.valueThreshold=e.valueThreshold?e.valueThreshold:.05};function lb(e){var t=e.url+"/"+e.entity+"/"+e.entityId;return e.headers={"Cache-Control":"no-cache"},Sv.loadJson(t,e)}function fb(e){return new Promise((function(t,r){var n=e.results?e.results:[],i=e.url,a=e.body,o=e.decode,s=Kg.apiKey,c="?",h=e.fields;return s&&(i=i+c+"key="+s,c="&"),h&&(i=i+c+"fields="+h),function e(s){s?a.pageToken=s:void 0!==a.pageToken&&delete a.pageToken;var c=JSON.stringify(a);Sv.loadJson(i,{sendData:c,contentType:"application/json",headers:{"Cache-Control":"no-cache"}}).then((function(r){var i,a;r?((a=o?o(r):r)&&a.forEach((function(e){n.push(e)})),(i=r.nextPageToken)?e(i):t(n)):t(n)})).catch((function(e){r(e)}))}()}))}ub.prototype.readFeatures=function(e,t,r){var n=this,i=this.url+"?chromosome="+e+"&start="+t+"&end="+r+"&cell_condition_id="+this.cellConditionId;return new Promise((function(e,t){Sv.loadJson(i,{withCredentials:n.config.withCredentials}).then((function(t){t?(t.eqtls.forEach((function(e){e.chr=e.chromosome,e.start=e.position,e.end=e.position+1})),e(t.eqtls)):e(null)})).catch((function(e){t(e)}))}))};var pb=function(e,t){this.config=e,this.genome=t,this.url=e.url,this.variantSetId=e.variantSetId,this.callSetIds=e.callSetIds,this.includeCalls=void 0===e.includeCalls||e.includeCalls};pb.prototype.readHeader=function(){var e=this;return e.header?Promise.resolve(e.header):(e.header={},!1===e.includeCalls?Promise.resolve(e.header):fb({url:e.url+"/callsets/search",fields:"nextPageToken,callSets(id,name)",body:{variantSetIds:Array.isArray(e.variantSetId)?e.variantSetId:[e.variantSetId],pageSize:"10000"},decode:function(t){if(e.callSetIds){var r=[],n=new Set;return e.callSetIds.forEach((function(e){n.add(e)})),t.callSets.forEach((function(e){n.has(e.id)&&r.push(e)})),r}return t.callSets}}).then((function(t){return e.header.callSets=t,e.header})))},pb.prototype.readFeatures=function(e,t,r){var n=this,i=this.genome;return n.readHeader().then((function(e){return new Promise((function(e,t){n.chrAliasTable?e(n.chrAliasTable):n.readMetadata().then((function(t){n.metadata=t.metadata,n.chrAliasTable={},t.referenceBounds&&i&&t.referenceBounds.forEach((function(e){var t=e.referenceName,r=i.getChromosomeName(t);n.chrAliasTable[r]=t})),e(n.chrAliasTable)}))}))})).then((function(i){var a=i.hasOwnProperty(e)?i[e]:e;return fb({url:n.url+"/variants/search",fields:n.includeCalls?void 0:"nextPageToken,variants(id,variantSetId,names,referenceName,start,end,referenceBases,alternateBases,quality,filter,info)",body:{variantSetIds:Array.isArray(n.variantSetId)?n.variantSetId:[n.variantSetId],callSetIds:n.callSetIds?n.callSetIds:void 0,referenceName:a,start:t.toString(),end:r.toString(),pageSize:"10000"},decode:function(e){var t,r=[];return e.variants.forEach((function(e){(t=function(e){var t,r=new wy;return r.chr=e.referenceName,r.start=parseInt(e.start),r.end=parseInt(e.end),r.pos=r.start+1,r.names=xy(e.names,"; "),r.referenceBases=e.referenceBases,r.alternateBases=xy(e.alternateBases),r.quality=e.quality,r.filter=xy(e.filter),r.info={},e.info&&Object.keys(e.info).forEach((function(t){var n,i=e.info[t];n=Array.isArray(i)?i.join(","):i,r.info[t]=n})),r.calls={},e.calls&&e.calls.forEach((function(e){t=e.callSetId,r.calls[t]=e})),my(r),r}(e)).isRefBlock()||r.push(t)})),r}})}))},pb.prototype.readMetadata=function(){return lb({url:this.url,entity:"variantsets",entityId:this.variantSetId})};var db=function(e){this.config=e};function gb(e,t,r,n){if(this.chr=e,this.start=t,this.end=r,this.id=n.id,this.entrezName=n.entrez_name,this.name=n.name,this.actionabilityScore=n.civic_actionability_score,n.coordinates.reference_bases&&(this.refBases=n.coordinates.reference_bases),n.coordinates.variant_bases&&(this.altBases=n.coordinates.variant_bases),n.variant_types&&(this.variant_types=n.variant_types),this.locationString=this.chr+":"+yg(this.start+1)+"-"+yg(this.end),void 0!==this.actionabilityScore){var i;if(this.actionabilityScore<=10)i=.2;else{var a=Math.min(30,this.actionabilityScore);i=.2+.8*Math.log10((a-10)/2)}this.alpha=i}}function vb(e,t){t=t||Number.MAX_SAFE_INTEGER;var r=[];e.sort((function(e,t){return e.start-t.start})),r.push(-1e3);var n,i=fn(e);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=0,s=Math.min(r.length,t);for(o=0;o<s;o++)if(a.start>r[o]){a.row=o,r[o]=a.end;break}a.row=o,r[o]=a.end}}catch(e){i.e(e)}finally{i.f()}}db.prototype.readFeatures=function(e,t,r){return Sv.loadJson(this.config.url+"/variants/?count=5000").then((function(e){var t,r=[],n=fn(e.records);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.coordinates){i.id;var a=i.coordinates;a.chromosome&&r.push(new gb(a.chromosome,a.start-1,a.stop,i)),a.chromosome2&&r.push(new gb(a.chromosome2,a.start2-1,a.stop2,i))}}}catch(e){n.e(e)}finally{n.f()}return r}))},gb.prototype.popupData=function(){var e=s("CIViC","https://civicdb.org/links/variants/"+this.id),t=(this.refBases!==this.altBases&&this.refBases&&1===this.refBases.length&&this.altBases&&this.altBases.length,[e]);if(t.push({name:"Entrez",value:s(this.entrezName,"https://ghr.nlm.nih.gov/gene/"+this.entrezName)}),t.push({name:"Name",value:this.name}),this.variant_types&&this.variant_types.length>0){var r,n,i=1===this.variant_types.length?"Type":"Types",a=fn(this.variant_types);try{for(a.s();!(n=a.n()).done;){var o=n.value;r?r+=", "+o.display_name:r=o.display_name}}catch(e){a.e(e)}finally{a.f()}t.push({name:i,value:r})}return t.push({name:"Actionability",value:this.actionabilityScore}),t.push({name:"Location",value:this.locationString}),t;function s(e,t){return"<a target='_blank' href='"+t+"'>"+e+"</a>"}};var mb=new Set(["bigwig","bw","bigbed","bb","tdf"]),yb=function(){function e(t,r){if(Wr(this,e),this.config=t||{},this.genome=r,this.sourceType=void 0===t.sourceType?"file":t.sourceType,void 0===t.filterTypes&&(t.filterTypes=["chromosome"]),t.features&&Array.isArray(t.features)){var n=t.features;bb(n),t.mappings&&function(e,t){var r=Object.keys(t);e.forEach((function(e){r.forEach((function(r){e[r]=e[t[r]]}))}))}(n,t.mappings),this.featureCache=new Gy(n,r),this.static=!0}else"ga4gh"===t.sourceType?(this.reader=new pb(t,r),this.queryable=!0):"immvar"===t.sourceType?(this.reader=new ub(t),this.queryable=!0):"eqtl"===t.type&&"gtex-ws"===t.sourceType?(this.reader=new hb(t),this.queryable=!0,this.expandQuery=!!t.expandQuery):"ucscservice"===t.sourceType?(this.reader=new Yy(t.source),this.queryable=!0):"custom"===t.sourceType||void 0!==t.source?(this.reader=new Zy(t.source),this.queryable=void 0===t.source.queryable||t.source.queryable,this.expandQuery=!!t.expandQuery):t.reader?(this.reader=t.reader,this.queryable=void 0===t.queryable||t.queryable,this.expandQuery=!!t.expandQuery):"civic-ws"===t.sourceType?(this.reader=new db(t),this.queryable=!1,this.expandQuery=!!t.expandQuery):(this.reader=new qy(t,r),void 0!==t.queryable?this.queryable=t.queryable:mb.has(t.format)&&(this.queryable=mb.has(t.format)||this.reader.indexed));this.supportsWG=!this.queryable}var t,r;return Yr(e,[{key:"supportsWholeGenome",value:function(){return this.supportsWG}},{key:"getFileHeader",value:(r=Vr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.header){e.next=10;break}if(!this.reader||"function"!=typeof this.reader.readHeader){e.next=9;break}return e.next=4,this.reader.readHeader();case 4:(t=e.sent)&&(this.header=t,(r=t.features)&&this.ingestFeatures(r),t.format&&(this.config.format=t.format)),this.header=t,e.next=10;break;case 9:this.header={};case 10:return e.abrupt("return",this.header);case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getFeatures",value:(t=Vr(regeneratorRuntime.mark((function e(t,r,n,i,a){var o,s,c,h,u,l,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=function(){return(f=Vr(regeneratorRuntime.mark((function e(){var i,s,h,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=new Vg(c,i=r,s=n),!0===this.config.disableCache||!this.featureCache||!this.static&&!this.featureCache.containsRange(h)&&"all"!==t.toLowerCase()){e.next=7;break}return e.abrupt("return",this.featureCache);case 7:return(!a||a<=0)&&!1!==this.expandQuery?(i=0,s=Number.MAX_SAFE_INTEGER):a>n-r&&!1!==this.expandQuery&&(u=Math.min(4.1*(n-r),a),i=Math.max(0,(r+n-u)/2),s=r+u),h=new Vg(c,i,s),e.next=11,o.readFeatures(c,h.start,h.end);case 11:return l=e.sent,void 0===this.queryable&&(this.queryable=o.indexed),l?this.ingestFeatures(l,h):this.featureCache=new Gy,e.abrupt("return",this.featureCache);case 15:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)},l=function(){return f.apply(this,arguments)},o=this.reader,s=this.genome,c=s?s.getChromosomeName(t):t,e.next=7,l.call(this);case 7:if(h=e.sent,u=this.queryable,"all"!==t.toLowerCase()){e.next=22;break}if(!u){e.next=14;break}return e.abrupt("return",[]);case 14:if(!this.wgFeatures){e.next=18;break}return e.abrupt("return",this.wgFeatures);case 18:return this.wgFeatures=this.getWGFeatures(h.getAllFeatures()),e.abrupt("return",this.wgFeatures);case 20:e.next=23;break;case 22:return e.abrupt("return",h.queryFeatures(c,r,n));case 23:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i,a){return t.apply(this,arguments)})},{key:"ingestFeatures",value:function(e,t){"gtf"!==this.config.format&&"gff3"!==this.config.format&&"gff"!==this.config.format||(e=new sb(this.config).combineFeatures(e)),"wig"!==this.config.format&&"junctions"!==this.config.type&&bb(e,this.config.maxRows||500),this.featureCache=new Gy(e,this.genome,t),this.config.searchable&&this.addFeaturesToDB(e)}},{key:"addFeaturesToDB",value:function(e){var t=this;e.forEach((function(e){e.name&&(t.config.browser.featureDB[e.name.toUpperCase()]=e)}))}},{key:"getWGFeatures",value:function(e){var t,r=this.genome,n=new Set(r.wgChromosomeNames),i=[],a=fn(r.wgChromosomeNames);try{for(a.s();!(t=a.n()).done;){var o=e[t.value];if(o){var s,c=fn(o);try{for(c.s();!(s=c.n()).done;){var h=s.value,u=r.getChromosomeName(h.chr);if(n.has(u)){var l=Object.create(Object.getPrototypeOf(h));Object.assign(l,h),l.realChr=h.chr,l.realStart=h.start,l.realEnd=h.end,l.chr="all",l.start=r.getGenomeCoordinate(h.chr,h.start),l.end=r.getGenomeCoordinate(h.chr,h.end),l.originalFeature=h,l.exons&&delete l.exons,l.popupData=function(e){if("function"==typeof this.originalFeature.popupData)return this.originalFeature.popupData();var t=Object.assign({},this);return t.chr=this.realChr,t.start=this.realStart+1,t.end=this.realEnd,delete t.realChr,delete t.realStart,delete t.realEnd,delete t.px,delete t.py,gy.extractPopupData(t,r.id)},i.push(l)}}}catch(e){c.e(e)}finally{c.f()}}}}catch(e){a.e(e)}finally{a.f()}return i.sort((function(e,t){return e.start-t.start})),i}}]),e}();function bb(e,t){if(t=t||1e3,null!=e&&0!==e.length){var r={},n=[];e.forEach((function(e){var t=e.chr,i=r[t];i||(i=[],r[t]=i,n.push(t)),i.push(e)})),n.forEach((function(e){vb(r[e],t)}))}}var wb=o.isFinite,xb=Number.isFinite||function(e){return"number"==typeof e&&wb(e)};Oe({target:"Number",stat:!0},{isFinite:xb});var kb=function(e,t,r){this.path=e.url,this.bufferSize=r||512e3,this.range={start:-1,size:-1},this.config=e};kb.prototype.dataViewForRange=function(e,t){var r,n,i=this;return i.data&&i.range.start<=e.start&&i.range.start+i.range.size>=e.start+e.size?Promise.resolve(a(i,e,t)):(r=e.size?Math.max(i.bufferSize,e.size):i.bufferSize,n={start:e.start,size:r},Sv.loadArrayBuffer(i.path,zg(i.config,{range:n})).then((function(r){return i.data=r,i.range=n,a(i,e,t)})));function a(e,t,r){var n=e.data.byteLength,i=t.start-e.range.start;return r?new Uint8Array(e.data,i,n-i):new DataView(e.data,i,n-i)}};var Sb=function(e,t){this.path=e.url,this.genome=t,this.rpTreeCache={},this.config=e};function _b(e,t){this.index=e,this.reductionLevel=t.getInt(),this.reserved=t.getInt(),this.dataOffset=t.getLong(),this.indexOffset=t.getLong()}function Cb(e,t,r){this.config=t,this.fileOffset=e,this.path=t.url,this.littleEndian=r}function Ab(e){this.items=e;var t,r,n=Number.MAX_SAFE_INTEGER,i=0,a=Number.MAX_SAFE_INTEGER,o=0;for(t=0;t<e.length;t++)r=e[t],n=Math.min(n,r.startChrom),i=Math.max(i,r.endChrom),a=Math.min(a,r.startBase),o=Math.max(o,r.endBase);this.startChrom=n,this.endChrom=i,this.startBase=a,this.endBase=o}function Eb(e,t,r){var n=e.getInt(),i=e.getInt(),a=e.getInt(),o=e.getInt(),s=e.getLong(),c=e.getLong(),h={},u=[];this.header={magic:n,blockSize:i,keySize:a,valSize:o,itemCount:s,reserved:c},this.chromToID=h,this.idToChrom=u,function e(n,i){i>=0&&(n.position=i);var o,s,c,l,f,p,d=n.getByte(),g=(n.getByte(),n.getUShort());if(1===d)for(o=0;o<g;o++)s=n.getFixedLengthTrimmedString(a),c=n.getInt(),n.getInt(),r&&(s=r.getChromosomeName(s)),h[s]=c,u[c]=s;else for(o=0;o<g;o++)s=n.getFixedLengthTrimmedString(a),l=n.getLong(),f=l-t,p=n.position,e(n,f),n.position=p}(e,-1)}function Rb(e,t,r,n,i){return!!e&&(n>e.startChrom||n===e.startChrom&&i>=e.startBase)&&(t<e.endChrom||t===e.endChrom&&r<=e.endBase)}function Tb(e){e?(this.basesCovered=e.getLong(),this.minVal=e.getDouble(),this.maxVal=e.getDouble(),this.sumData=e.getDouble(),this.sumSquares=e.getDouble(),Ib.call(this)):(this.basesCovered=0,this.minVal=0,this.maxVal=0,this.sumData=0,this.sumSquares=0,this.mean=0,this.stddev=0)}function Ib(){var e=this.basesCovered;if(e>0){this.mean=this.sumData/e,this.stddev=Math.sqrt(this.sumSquares/(e-1));var t=this.minVal<0?this.mean-2*this.stddev:0,r=this.maxVal>0?this.mean+2*this.stddev:0;this.defaultRange={min:t,max:r}}}function Lb(e,t,r,n,i,a,o){var s,c,h=new Cy(e),u=h.getInt(),l=h.getInt(),f=h.getInt(),p=h.getInt(),d=h.getInt(),g=h.getByte(),v=(h.getByte(),h.getUShort());if(u>=t&&u<=n)for(;v-- >0;){switch(g){case 1:l=h.getInt(),f=h.getInt(),s=h.getFloat();break;case 2:l=h.getInt(),s=h.getFloat(),f=l+d;break;case 3:s=h.getFloat(),f=l+d,l+=p}if(!(u<t||u===t&&f<r)){if(u>n||u===n&&l>=i)break;Number.isFinite(s)&&(c=o[u],a.push({chr:c,start:l,end:f,value:s}))}}}function Mb(e,t,r,n,i,a,o){for(var s=new Cy(e);s.remLength()>=13;){var c=s.getInt(),h=o[c],u=s.getInt(),l=s.getInt(),f=s.getString();if(!(c<t||c===t&&l<r)){if(c>n||c===n&&u>=i)break;var p={chr:h,start:u,end:l};a.push(p);var d=f.split("\t");if(d.length>0&&(p.name=d[0]),d.length>1&&(p.score=parseFloat(d[1])),d.length>2&&(p.strand=d[2]),d.length>3&&(p.cdStart=parseInt(d[3])),d.length>4&&(p.cdEnd=parseInt(d[4])),d.length>5&&"."!==d[5]&&"0"!==d[5]&&"-1"!==d[5]){var g=kg.createColorString(d[5]);p.color=g.startsWith("rgb")?g:void 0}if(d.length>8){for(var v=parseInt(d[6]),m=d[7].split(","),y=d[8].split(","),b=[],w=0;w<v;w++){var x=u+parseInt(y[w]),k=x+parseInt(m[w]);b.push({start:x,end:k})}p.exons=b}}}}function Pb(e,t,r,n,i,a,o,s){for(var c,h,u,l,f,p,d,g,v,m=new Cy(e);m.remLength()>=32;){switch(v=o[c=m.getInt()],h=m.getInt(),u=m.getInt(),l=m.getInt(),f=m.getFloat(),p=m.getFloat(),d=m.getFloat(),m.getFloat(),s){case"min":g=f;break;case"max":g=p;break;default:g=0===l?0:d/l}if(!(c<t||c===t&&u<r)){if(c>n||c===n&&h>=i)break;Number.isFinite(g)&&a.push({chr:v,start:h,end:u,value:g})}}}Sb.prototype.readWGFeatures=function(e,t){var r=this;return this.genome,r.getZoomHeaders().then((function(n){var i,a,o;return i=r.chromTree.idToChrom.length-1,a=r.chromTree.idToChrom[0],o=r.chromTree.idToChrom[i],r.readFeatures(a,0,o,Number.MAX_VALUE,e,t)}))},Sb.prototype.readFeatures=function(e,t,r,n,i,a){var o,s,c,h=this;return h.getZoomHeaders().then((function(e){var t,r=function(e,t){var r,n,i=null;for(r=0;r<t.length;r++)if((n=t[r]).reductionLevel<e){i=n;break}return i}(i,e);return r?(t=r.indexOffset,o=Pb):(t=h.header.fullIndexOffset,o="BigWig"===h.type?Lb:Mb),h.loadRPTree(t)})).then((function(i){return s=h.chromTree.chromToID[e],c=h.chromTree.chromToID[r],void 0===s||void 0===c?void 0:i.findLeafItemsOverlapping(s,t,c,n)})).then((function(e){if(e&&0!==e.length){var r,i=Number.MAX_VALUE,u=0,l=fn(e);try{for(l.s();!(r=l.n()).done;){var f=r.value;i=Math.min(i,f.dataOffset),u=Math.max(u,f.dataOffset+f.dataSize)}}catch(e){l.e(e)}finally{l.f()}var p=u-i;return Sv.loadArrayBuffer(h.config.url,zg(h.config,{range:{start:i,size:p}})).then((function(r){var u,l=[],f=new Uint8Array(r),p=fn(e);try{for(p.s();!(u=p.n()).done;){var d=u.value,g=f.subarray(d.dataOffset-i,d.dataOffset+d.dataSize),v=void 0;v=h.header.uncompressBuffSize>0?new gg.Inflate(g).decompress():g,o(new DataView(v.buffer),s,t,c,n,l,h.chromTree.idToChrom,a)}}catch(e){p.e(e)}finally{p.f()}return l.sort((function(e,t){return e.start-t.start})),l}))}return[]}))},Sb.prototype.getZoomHeaders=function(){var e=this;return e.zoomLevelHeaders?Promise.resolve(e.zoomLevelHeaders):e.loadHeader().then((function(){return e.zoomLevelHeaders}))},Sb.prototype.loadHeader=function(){var e=this;return e.header?Promise.resolve(e.header):Sv.loadArrayBuffer(e.path,zg(e.config,{range:{start:0,size:64}})).then((function(t){var r;e.littleEndian=!0;var n=new Cy(new DataView(t)),i=n.getUInt();if(2291137574===i)e.type="BigWig";else if(2273964779===i)e.type="BigBed";else{e.littleEndian=!1,n.littleEndian=!1,n.position=0;var a=n.getUInt();654085990===a?e.type="BigWig":3958540679===a&&(e.type="BigBed")}return(r={}).bwVersion=n.getUShort(),r.nZoomLevels=n.getUShort(),r.chromTreeOffset=n.getLong(),r.fullDataOffset=n.getLong(),r.fullIndexOffset=n.getLong(),r.fieldCount=n.getUShort(),r.definedFieldCount=n.getUShort(),r.autoSqlOffset=n.getLong(),r.totalSummaryOffset=n.getLong(),r.uncompressBuffSize=n.getInt(),r.reserved=n.getLong(),r})).then((function(r){return e.header=r,t.call(e)}));function t(){var e=this,t={start:64,size:e.header.fullDataOffset-64+5};return Sv.loadArrayBuffer(e.path,zg(e.config,{range:t})).then((function(t){var r=e.header.nZoomLevels,n=new Cy(new DataView(t));e.zoomLevelHeaders=[],e.firstZoomDataOffset=Number.MAX_SAFE_INTEGER;for(var i=1;i<=r;i++){var a=r-i,o=new _b(a,n);e.firstZoomDataOffset=Math.min(o.dataOffset,e.firstZoomDataOffset),e.zoomLevelHeaders[a]=o}if(e.header.autoSqlOffset>0&&(n.position=e.header.autoSqlOffset-64,e.autoSql=n.getString()),e.header.totalSummaryOffset>0&&(n.position=e.header.totalSummaryOffset-64,e.totalSummary=new Tb(n)),!(e.header.chromTreeOffset>0))throw"BigWig chromosome tree offset <= 0";return n.position=e.header.chromTreeOffset-64,e.chromTree=new Eb(n,64,e.genome),n.position=e.header.fullDataOffset-64,e.header.dataCount=n.getInt(),e.header}))}},Sb.prototype.loadRPTree=function(e){var t=this,r=t.rpTreeCache[e];return r?Promise.resolve(r):(r=new Cb(e,t.config,t.littleEndian)).load().then((function(){return t.rpTreeCache[e]=r,r}))},Cb.prototype.load=function(){var e=this,t=e.fileOffset+48,r=new kb(e.config,512e3);return e.readNode(t,r).then((function(t){return e.rootNode=t,e}))},Cb.prototype.readNode=function(e,t){var r,n,i=this;return t.dataViewForRange({start:e,size:4},!1).then((function(a){var o,s;s=(o=new Cy(a,i.littleEndian)).getByte(),n=1===s,o.getByte(),r=o.getUShort();var c={start:e+=4,size:r*(n?32:24)};return t.dataViewForRange(c,!1)})).then((function(e){var t,i=new Array(r),a=new Cy(e);if(n){for(t=0;t<r;t++){var o={isLeaf:!0,startChrom:a.getInt(),startBase:a.getInt(),endChrom:a.getInt(),endBase:a.getInt(),dataOffset:a.getLong(),dataSize:a.getLong()};i[t]=o}return new Ab(i)}for(t=0;t<r;t++){var s={isLeaf:!1,startChrom:a.getInt(),startBase:a.getInt(),endChrom:a.getInt(),endBase:a.getInt(),childOffset:a.getLong()};i[t]=s}return new Ab(i)}))},Cb.prototype.findLeafItemsOverlapping=function(e,t,r,n){var i=this;return new Promise((function(a,o){var s=[],c=new Set,h=new kb(i.config,512e3);c.add(0),function u(l,f){Rb(l,e,t,r,n)&&l.items.forEach((function(a){Rb(a,e,t,r,n)&&(a.isLeaf?s.push(a):a.childNode?u(a.childNode):(c.add(a.childOffset),i.readNode(a.childOffset,h).then((function(e){a.childNode=e,u(e,a.childOffset)})).catch(o)))})),void 0!==f&&c.delete(f),0===c.size&&a(s)}(i.rootNode,0)}))};var Ob=function(e,t){this.reader=new Sb(e,t),this.genome=t,this.format=e.format||"bigwig",this.wgValues={}};Ob.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i,a){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("all"!==t.toLowerCase()){e.next=6;break}return e.next=3,this.getWGValues(a);case 3:e.t0=e.sent,e.next=9;break;case 6:return e.next=8,this.reader.readFeatures(t,r,t,n,i,a);case 8:e.t0=e.sent;case 9:return o=e.t0,"bigwig"===this.format.toLowerCase()||"bw"===this.format.toLowerCase()||vb(o),e.abrupt("return",o);case 13:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,a){return e.apply(this,arguments)}}(),Ob.prototype.getDefaultRange=function(){return void 0!==this.reader.totalSummary?this.reader.totalSummary.defaultRange:void 0},Ob.prototype.defaultVisibilityWindow=function(){if("bigwig"===this.reader.type)return Promise.resolve(void 0);var e=this.genome?this.genome.getGenomeLength():3088286401;return this.reader.loadHeader().then((function(t){return e/t.dataCount*1e3}))},Ob.prototype.getWGValues=function(e){var t,r=this,n=this.genome;return r.wgValues[e]?Promise.resolve(r.wgValues[e]):(t=n.getGenomeLength()/500,r.reader.readWGFeatures(t,e).then((function(t){var i=[];return t.forEach((function(e){var t,r,a;a=e.chr,r=n.getCumulativeOffset(a),(t=Object.assign({},e)).chr="all",t.start=r+e.start,t.end=r+e.end,i.push(t)})),r.wgValues[e]=i,i})))},Ob.prototype.supportsWholeGenome=function(){return!0};var Fb={getTissueInfo:function(e,t){var r=(t=t||"https://gtexportal.org/rest/v1")+"/dataset/tissueInfo?datasetId="+(e=e||"gtex_v8");return Sv.loadJson(r,{})},trackConfiguration:function(e,t){return{type:"eqtl",sourceType:"gtex-ws",url:(t=t||"https://gtexportal.org/rest/v1")+"/association/singleTissueEqtlByLocation",tissueSiteDetailId:e.tissueSiteDetailId,name:e.tissueSiteDetailId.split("_").join(" "),visibilityWindow:25e4}}},Nb=new jf("Dark2");["GT/AG","CT/AC","GC/AG","CT/GC","AT/AC","GT/AT","non-canonical"].forEach((function(e){Nb.getColor(e)}));var Db=Dg(gy,(function(e,t){this.type="feature",gy.call(this,e,t),void 0===e.maxRows&&(e.maxRows=500),this.maxRows=e.maxRows,this.displayMode=e.displayMode||"EXPANDED",this.labelDisplayMode=e.labelDisplayMode;var r=e.format?e.format.toLowerCase():void 0;this.featureSource="bigwig"===r||"bigbed"===r?new Ob(e,t.genome):new yb(e,t.genome),this.autoHeight=e.autoHeight,this.margin=void 0===e.margin?10:e.margin,this.featureHeight=e.featureHeight||14,"FusionJuncSpan"===e.type?(this.squishedRowHeight=e.squishedRowHeight||50,this.expandedRowHeight=e.expandedRowHeight||50,this.height=e.height||this.margin+2*this.expandedRowHeight):"snp"===e.type?(this.expandedRowHeight=e.expandedRowHeight||10,this.squishedRowHeight=e.squishedRowHeight||5,this.height=e.height||30):(this.squishedRowHeight=e.squishedRowHeight||15,this.expandedRowHeight=e.expandedRowHeight||30,this.height=e.height||this.margin+2*this.expandedRowHeight),void 0!==this.height&&this.height||(this.height=100),"spliceJunctions"===e.type&&void 0===e.colorByNumReadsThreshold&&(e.colorByNumReadsThreshold=5),e.render?this.render=e.render:"FusionJuncSpan"===e.type?this.render=Hb:"spliceJunctions"===e.type?this.render=$b:"snp"===e.type?(this.render=Wb,this.snpColors=["rgb(0,0,0)","rgb(0,0,255)","rgb(0,255,0)","rgb(255,0,0)"],this.colorBy="function"):(this.render=zb,this.arrowSpacing=30,function(e){function t(){e.trackView&&e.trackView.tile&&"SQUISHED"!==e.displayMode&&e.trackView.repaintViews()}e.browser.on&&(e.browser.on("trackdragend",t),e.browser.on("trackremoved",(function r(n){e.browser.un&&e===n&&(e.browser.un("trackdrag",t),e.browser.un("trackremoved",r))})))}(this))}));function Bb(e,t,r){var n=(e.start-t)/r,i=(e.end-t)/r,a=i-n;return a<3&&(a=3,n-=1.5),{px:n,px1:i,pw:a}}function zb(e,t,r,n,i,a){var o,s,c=this.browser,h=this.color;if(e.alpha&&1!==e.alpha&&(h=kg.addAlpha(this.color,e.alpha)),this.config.colorBy){var u=e[this.config.colorBy.field];u&&(h=this.config.colorBy.pallete[u])}else e.color&&(h=e.color);i.fillStyle=h,i.strokeStyle=h,"SQUISHED"===this.displayMode&&void 0!==e.row?(o=this.featureHeight/2,s=this.margin+this.squishedRowHeight*e.row):"EXPANDED"===this.displayMode&&void 0!==e.row?(o=this.featureHeight,s=this.margin+this.expandedRowHeight*e.row):(o=this.featureHeight,s=this.margin);var l=s+o/2,f=o/2,p=l-f/2,d=e.exons?e.exons.length:0,g=Bb(e,t,r),v=this.arrowSpacing,m="+"===e.strand?1:"-"===e.strand?-1:0;if(0===d){if(i.fillRect(g.px,s,g.pw,o),0!==m){i.fillStyle="white",i.strokeStyle="white";for(var y=g.px+v/2;y<g.px1;y+=v)gm.strokeLine(i,y-2*m,l-2,y,l),gm.strokeLine(i,y-2*m,l+2,y,l);i.fillStyle=h,i.strokeStyle=h}}else{gm.strokeLine(i,g.px+1,l,g.px1-1,l);for(var b=a.pixelWidth,w=Math.max(0,g.px)+v/2,x=Math.min(b,g.px1),k=w;k<x;k+=v)gm.strokeLine(i,k-2*m,l-2,k,l),gm.strokeLine(i,k-2*m,l+2,k,l);for(var S=0;S<d;S++){var _=e.exons[S],C=Math.round((_.start-t)/r),A=Math.round((_.end-t)/r),E=Math.max(1,A-C),R=void 0;if(!(C+E<0)){if(C>b)break;if(_.utr)i.fillRect(C,p,E,f);else if(_.cdStart&&(R=Math.round((_.cdStart-t)/r),i.fillRect(C,p,R-C,f),E-=R-C,C=R),_.cdEnd&&(R=Math.round((_.cdEnd-t)/r),i.fillRect(R,p,A-R,f),E-=A-R,A=R),i.fillRect(C,s,E,o),E>v+5&&0!==m){i.fillStyle="white",i.strokeStyle="white";for(var T=C+v/2;T<A;T+=v)gm.strokeLine(i,T-2*m,l-2,T,l),gm.strokeLine(i,T-2*m,l+2,T,l);i.fillStyle=h,i.strokeStyle=h}}}}var I=Math.round(a.viewportContainerX),L=c.genomicStateList?c.genomicStateList.length:1,M=I+a.viewportContainerWidth/L;a.drawLabel&&Ub.call(this,i,e,g.px,g.px1,s,I,M,a.genomicState,a)}function Ub(e,t,r,n,i,a,o,s,c){var h=t.name;if(void 0===h&&t.gene&&(h=t.gene.name),void 0===h&&(h=t.id||t.ID),void 0!==h){var u,l,f;n<a||r>o?(u=r,l=n):(u=Math.max(r,a),l=Math.min(n,o));var p=!1;if(s.selection&&Fb.gtexLoaded&&(p=!0,f=s.selection.colorForGene(h)),"SQUISHED"!==this.displayMode){var d,g={textAlign:"SLANT"===this.labelDisplayMode?void 0:"center",fillStyle:f||t.color||this.color,strokeStyle:f||t.color||this.color};"COLLAPSED"===this.displayMode&&"SLANT"===this.labelDisplayMode&&(d={rotate:{angle:45}});var v=u+(l-u)/2,m=function(e,t){return t?e+20:e+25}(i,d),y=e.measureText(h),b=v-y.width/2,w=v+y.width/2;(c.labelAllFeatures||b>c.rowLastX[t.row]||p)&&(c.rowLastX[t.row]=w,c.labelTransform?(e.save(),c.labelTransform(e,v),gm.fillText(e,h,v,m,g,void 0),e.restore()):gm.fillText(e,h,v,m,g,d))}}}function Hb(e,t,r,n,i){var a,o="EXPANDED"===this.displayMode?this.expandedRowHeight:this.squishedRowHeight;"COLLAPSED"===this.display&&(a=this.margin),"SQUISHED"===this.displayMode&&void 0!==e.row?a=this.margin+o*e.row:"EXPANDED"===this.displayMode&&void 0!==e.row&&(a=this.margin+o*e.row);var s=a+.5*o,c=s-.5*o,h=s+.5*o,u=Math.round((e.junction_left-t)/r),l=Math.round((e.junction_right-t)/r);i.beginPath(),i.moveTo(u,s),i.bezierCurveTo(u,c,l,c,l,s),i.lineWidth=1+Math.log(e.num_junction_reads)/Math.log(2),i.strokeStyle="blue",i.stroke();for(var f=e.spanning_frag_coords,p=0;p<f.length;p++){var d=f[p],g=Math.round((d.left-t)/r),v=Math.round((d.right-t)/r);i.beginPath(),i.moveTo(g,s),i.bezierCurveTo(g,h,v,h,v,s),i.lineWidth=1,i.strokeStyle="purple",i.stroke()}}function $b(e,t,r,n,i){if(!(this.config.hideAnnotatedJunctions&&"true"===e.attributes.annotated_junction||this.config.hideUnannotatedJunctions&&"false"===e.attributes.annotated_junction||this.config.hideMotifs&&this.config.hideMotifs.includes(e.attributes.motif)||this.config.hideStrand===e.strand)){var a=parseInt(e.attributes.uniquely_mapped);if(!(a<this.config.minUniquelyMappedReads)){var o=parseInt(e.attributes.multi_mapped),s=a+o;if(!(s<this.config.minTotalReads||s>0&&o/s>this.config.maxFractionMultiMappedReads||parseInt(e.attributes.maximum_spliced_alignment_overhang)<this.config.minSplicedAlignmentOverhang)){var c,h,u,l=this.margin,f=this.height,p=l+.5*f,d=l,g=l+f-10,v=Math.round((e.start-t)/r),m=Math.round((e.end-t)/r),y=(v+m)/2,b=(v+y)/2,w=(y+m)/2;void 0===this.config.thicknessBasedOn||"numUniqueReads"===this.config.thicknessBasedOn?c=a:"numReads"===this.config.thicknessBasedOn?c=s:"isAnnotatedJunction"===this.config.thicknessBasedOn&&(c="true"===e.attributes.annotated_junction?20:100),c=1+Math.log(c+1)/Math.log(12),void 0===this.config.bounceHeightBasedOn||"random"===this.config.bounceHeightBasedOn?h=(e.start+e.end)%7:"distance"===this.config.bounceHeightBasedOn?h=(e.end-e.start)/1e3:"thickness"===this.config.bounceHeightBasedOn&&(h=2*c),d+=f*Math.max(7-h,0)/10,e.color?u=e.color:void 0===this.config.colorBy||"numUniqueReads"===this.config.colorBy?u=a>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"numReads"===this.config.colorBy?u=s>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"isAnnotatedJunction"===this.config.colorBy?u="true"===e.attributes.annotated_junction?"#b0b0ec":"orange":"strand"===this.config.colorBy?u="+"===e.strand?"#b0b0ec":"#ecb0b0":"motif"===this.config.colorBy&&(u=Nb.getColor(e.attributes.motif));var x="";void 0===this.config.labelUniqueReadCount&&void 0===this.config.labelMultiMappedReadCount&&void 0===this.config.labelTotalReadCount?x+=a+(0==o?"":"(+"+o+")"):(this.config.labelTotalReadCount?x+=s:this.config.labelUniqueReadCount&&(x+=a),this.config.labelMultiMappedReadCount&&o>0&&(x+=" (+"+o+")")),this.config.labelAnnotatedJunction&&"true"===e.attributes.annotated_junction&&(x+=this.config.labelAnnotatedJunction),this.config.labelMotif&&e.attributes.motif&&(x+=" ".concat(e.attributes.motif)),i.beginPath(),i.moveTo(v,g),i.bezierCurveTo(b,d,w,d,m,g),i.lineWidth=c,i.strokeStyle=u,i.stroke(),i.fillText(x,y-i.measureText(x).width/2,(7*d+p)/8)}}}}Db.prototype.postInit=Vr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.readFileHeader();case 2:if((t=e.sent)&&this.setTrackProperties(t),!(r=this.config.format)||"bigbed"!==r.toLowerCase()||void 0!==this.visibilityWindow||"function"!=typeof this.featureSource.defaultVisibilityWindow){e.next=10;break}return e.next=8,this.featureSource.defaultVisibilityWindow();case 8:this.visibilityWindow=e.sent,this.featureSource.visibilityWindow=this.visibilityWindow;case 10:return e.abrupt("return",this);case 11:case"end":return e.stop()}}),e,this)}))),Db.prototype.supportsWholeGenome=function(){return!1===this.config.indexed&&!1!==this.config.supportsWholeGenome},Db.prototype.readFileHeader=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof this.featureSource.getFileHeader){e.next=4;break}return e.next=3,this.featureSource.getFileHeader();case 3:this.header=e.sent;case 4:return e.abrupt("return",this.header);case 5:case"end":return e.stop()}}),e,this)}))),Db.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.featureSource.getFeatures(t,r,n,i,this.visibilityWindow));case 1:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i){return e.apply(this,arguments)}}(),Db.prototype.computePixelHeight=function(e){if("spliceJunctions"===this.type)return this.height;if("COLLAPSED"===this.displayMode)return this.margin+this.expandedRowHeight;var t=0;if(e&&"function"==typeof e.forEach){var r,n=fn(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;i.row&&i.row>t&&(t=i.row)}}catch(e){n.e(e)}finally{n.f()}}return this.margin+(t+1)*("SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight)},Db.prototype.draw=function(e){var t=e.features,r=e.context,n=e.bpPerPixel,i=e.bpStart,a=e.pixelWidth,o=e.pixelHeight,s=i+a*n+1;if(this.config.isMergedTrack||gm.fillRect(r,0,e.pixelTop,a,o,{fillStyle:"rgb(255, 255, 255)"}),t){var c=[];e.rowLastX=[];var h,u=fn(t);try{for(u.s();!(h=u.n()).done;){var l=h.value.row||0;void 0===c[l]?c[l]=1:c[l]++,e.rowLastX[l]=-Number.MAX_SAFE_INTEGER}}catch(e){u.e(e)}finally{u.f()}var f,p=[],d=fn(t);try{for(d.s();!(f=d.n()).done;){var g=f.value;if(!(g.end<i)){if(g.start>s)break;var v="COLLAPSED"===this.displayMode?0:g.row,m=a/c[v];e.drawLabel=e.labelAllFeatures||m>10;var y=Math.ceil((g.end-i)/n),b=p[v];if((!b||y>b||"spliceJunctions"===this.config.type)&&(this.render.call(this,g,i,n,o,r,e),"spliceJunctions"!==this.config.type)){var w=Math.floor((g.start-i)/n);b&&w-b<=0&&(r.globalAlpha=.5,gm.strokeLine(r,w,0,w,o,{strokeStyle:"rgb(255, 255, 255)"}),r.globalAlpha=1),p[v]=y}}}}catch(e){d.e(e)}finally{d.f()}}},Db.prototype.clickedFeatures=function(e){var t,r=e.y-this.margin,n=gy.prototype.clickedFeatures.call(this,e);switch(this.displayMode){case"SQUISHED":t=Math.floor(r/this.squishedRowHeight);break;case"EXPANDED":t=Math.floor(r/this.expandedRowHeight);break;default:t=void 0}return n.filter((function(e){return void 0===t||void 0===e.row||t===e.row}))},Db.prototype.popupData=function(e,t){t||(t=this.clickedFeatures(e));var r,n=e.genomicLocation,i=[],a=fn(t);try{for(a.s();!(r=a.n()).done;){var o=r.value,s="function"==typeof o.popupData?o.popupData(n):gy.extractPopupData(o,this.getGenomeId());s&&(i.length>0&&i.push("<HR>"),Array.prototype.push.apply(i,s))}}catch(e){a.e(e)}finally{a.f()}return i},Db.prototype.menuItemList=function(){var e=this,t=[];return this.render===Wb&&(["function","class"].forEach((function(r){t.push({object:Ff("Color by "+r,r===e.colorBy),click:function(){e.colorBy=r,e.trackView.repaintViews()}})})),t.push({object:oc('<div class="igv-track-menu-border-top">')})),t.push({object:oc('<div class="igv-track-menu-border-top">')}),["COLLAPSED","SQUISHED","EXPANDED"].forEach((function(r){t.push({object:Ff({COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"}[r],r===e.displayMode),click:function(){e.displayMode=r,e.config.displayMode=r,e.trackView.checkContentHeight(),e.trackView.repaintViews()}})})),t},Db.prototype.description=function(){if(Wb===this.render){var e="<html>"+this.name+"<hr>";return e+="<em>Color By Function:</em><br>",e+='<span style="color:red">Red</span>: Coding-Non-Synonymous, Splice Site<br>',e+='<span style="color:green">Green</span>: Coding-Synonymous<br>',e+='<span style="color:blue">Blue</span>: Untranslated<br>',e+='<span style="color:black">Black</span>: Intron, Locus, Unknown<br><br>',e+="<em>Color By Class:</em><br>",e+='<span style="color:red">Red</span>: Deletion<br>',e+='<span style="color:green">Green</span>: MNP<br>',e+='<span style="color:blue">Blue</span>: Microsatellite, Named<br>',e+='<span style="color:black">Black</span>: Indel, Insertion, SNP',e+="</html>"}return this.name},Db.prototype.dispose=function(){this.trackView=void 0};var jb=new Set(["nonsense","missense","stop-loss","frameshift","cds-indel"]),qb=new Set(["coding-synon"]),Gb=new Set(["splice-3","splice-5"]),Vb=new Set(["untranslated-5","untranslated-3"]);function Wb(e,t,r,n,i){var a,o,s,c,h=Bb(e,t,r),u=this.margin,l=this.snpColors.length;switch(a="squished"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight,this.colorBy){case"function":c=e.func,o=c.split(",").map((function(e){return jb.has(e)||Gb.has(e)?l-1:qb.has(e)?l-2:Vb.has(e)?l-3:0})).reduce((function(e,t){return Math.max(e,t)}));break;case"class":o="deletion"===(s=e.class)?l-1:"mnp"===s?l-2:"microsatellite"===s||"named"===s?l-3:0}i.fillStyle=this.snpColors[o],i.fillRect(h.px,u,h.pw,a)}var Zb=function(e,t){this.type="sequence",this.browser=t,this.removable=!1,this.config=e,this.name="",this.id="sequence",this.sequenceType=e.sequenceType||"dna",this.height=25,this.disableButtons=!1,this.order=e.order||-Number.MAX_SAFE_INTEGER,this.ignoreTrackMenu=!1,this.removable=!1,this.reversed=!1,this.frameTranslate=!1,this.complement={A:"T",C:"G",G:"C",T:"A"},this.translationDict={TTT:"F",TTC:"F",TTA:"L",TTG:"L",CTT:"L",CTC:"L",CTA:"L",CTG:"L",ATT:"I",ATC:"I",ATA:"I",ATG:"M",GTT:"V",GTC:"V",GTA:"V",GTG:"V",TCT:"S",TCC:"S",TCA:"S",TCG:"S",CCT:"P",CCC:"P",CCA:"P",CCG:"P",ACT:"T",ACC:"T",ACA:"T",ACG:"T",GCT:"A",GCC:"A",GCA:"A",GCG:"A",TAT:"Y",TAC:"Y",TAA:"STOP",TAG:"STOP",CAT:"H",CAC:"H",CAA:"Q",CAG:"Q",AAT:"N",AAC:"N",AAA:"K",AAG:"K",GAT:"D",GAC:"D",GAA:"E",GAG:"E",TGT:"C",TGC:"C",TGA:"STOP",TGG:"W",CGT:"R",CGC:"R",CGA:"R",CGG:"R",AGT:"S",AGC:"S",AGA:"R",AGG:"R",GGT:"G",GGC:"G",GGA:"G",GGG:"G"}};function Yb(e){return this.color?this.color:"dna"===this.sequenceType?Hf[e]||"gray":"rgb(0, 0, 150)"}Zb.prototype.menuItemList=function(){var e=this;return[{name:e.reversed?"Forward":"Reverse",click:function(){e.reversed=!e.reversed,e.trackView.repaintViews()}},{name:e.frameTranslate?"Close Translation":"Three-frame Translate",click:function(){e.frameTranslate=!e.frameTranslate,e.frameTranslate?(e.trackView.viewports.forEach((function(e){e.setContentHeight(115)})),e.trackView.setTrackHeight(115)):(e.trackView.viewports.forEach((function(e){e.setContentHeight(25)})),e.trackView.setTrackHeight(25)),e.trackView.repaintViews()}}]},Zb.prototype.translateSequence=function(e){var t=[[],[],[]],r=this;return[0,1,2].forEach((function(n){for(var i,a,o=n;e.length-o>=3;)i={},a=e.slice(o,o+3),r.reversed&&(a=a.split("").reverse().join("")),i.codons=a,i.aminoA=r.translationDict[a.toUpperCase()],t[n].push(i),i=null,o+=3})),t},Zb.prototype.getFeatures=function(e,t,r,n){var i=this.browser;return n&&n>1?Promise.resolve(null):i.genome.sequence.getSequence(e,t,r).then((function(e){return{bpStart:t,sequence:e}}))},Zb.prototype.draw=function(e){var t=this,r=e.context;if(e.features){for(var n=e.features.sequence,i=e.features.bpStart,a=1+e.bpStart+e.pixelWidth*e.bpPerPixel,o=i;o<=a;o++){var s=Math.floor(o-i);if(s<n.length){var c=n[s];this.reversed&&(c=this.complement[c.toUpperCase()]);var h=o-e.bpStart,u=h/e.bpPerPixel,l=(h+1)/e.bpPerPixel,f=Yb.call(this,c);if(e.bpPerPixel>.1)gm.fillRect(r,u,5,l-u,10,{fillStyle:f});else{var p=.5*(u+l-r.measureText(c).width);gm.strokeText(r,c,p,15,{strokeStyle:f})}}}if(this.frameTranslate){var d;d=this.reversed?(d=n.split("").map((function(e){return t.complement[e]}))).join(""):n;var g,v=15,m=this.translateSequence(d),y=fn(m);try{for(y.s();!(g=y.n()).done;){var b=g.value,w=m.indexOf(b),x=w;v=0===w?v+10:v+30;var k,S=fn(b);try{for(S.s();!(k=S.n()).done;){var _=k.value,C=void 0,A=b.indexOf(_),E=A+x+2*A,R=0==A%2?"rgb(160,160,160)":"rgb(224,224,224)",T=Math.floor(E/e.bpPerPixel),I=Math.floor((E+3)/e.bpPerPixel),L=Math.round((T+I)/2);_.aminoA.indexOf("STOP")>-1?(R="rgb(255, 0, 0)",C="STOP"):C=_.aminoA,"M"===_.aminoA&&(R="rgb(0, 153, 0)",C="START"),gm.fillRect(r,T,v,I-T,25,{fillStyle:R}),e.bpPerPixel<=.1&&gm.strokeText(r,C,L-r.measureText(C).width/2,v+15)}}catch(e){S.e(e)}finally{S.f()}}}catch(e){y.e(e)}finally{y.f()}}}},Zb.prototype.supportsWholeGenome=function(){return!1},Zb.prototype.computePixelHeight=function(e){return this.height};var Xb=function(e,t){this.config=e,this.genome=t,this.path=e.url,this.groupCache={},this.datasetCache={}};function Kb(e,t){for(var r=e.getInt(),n=e.getInt(),i=e.getFloat(),a=[],o=t;o-- >0;){for(var s=r,c=[];s-- >0;)c.push(e.getFloat());a.push(c)}return{type:"fixedStep",start:n,span:i,data:a,nTracks:t,nPositions:r}}function Qb(e,t){for(var r=e.getInt(),n=e.getFloat(),i=e.getInt(),a=[],o=i;o-- >0;)a.push(e.getInt());e.getInt();for(var s=[],c=t;c-- >0;){o=i;for(var h=[];o-- >0;)h.push(e.getFloat());s.push(h)}return{type:"variableStep",tileStart:r,span:n,start:a,data:s,nTracks:t,nPositions:i}}function Jb(e,t,r){for(var n=e.getInt(),i=n,a=[];i-- >0;)a.push(e.getInt());i=n;for(var o=[];i-- >0;)o.push(e.getInt());e.getInt();for(var s=[],c=t;c-- >0;){for(var h=n,u=[];h-- >0;)u.push(e.getFloat());s.push(u)}if("bedWithName"===r){i=n;for(var l=[];i-- >0;)l.push(e.getString())}return{type:r,start:a,end:o,data:s,name:name,nTracks:t,nPositions:n}}Xb.prototype.readHeader=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c,h,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===this.magic){e.next=2;break}return e.abrupt("return",this);case 2:return e.next=4,Sv.loadArrayBuffer(this.path,zg(this.config,{range:{start:0,size:64e3}}));case 4:if(t=e.sent,r=new Cy(new DataView(t)),this.magic=r.getInt(),this.version=r.getInt(),this.indexPos=r.getLong(),this.indexSize=r.getInt(),r.getInt(),this.version>=2)for(n=r.getInt(),this.windowFunctions=[];n-- >0;)this.windowFunctions.push(r.getString());for(this.trackType=r.getString(),this.trackLine=r.getString(),i=r.getInt(),this.trackNames=[];i-- >0;)this.trackNames.push(r.getString());return this.genomeID=r.getString(),this.flags=r.getInt(),this.compressed=0!=(1&this.flags),e.next=22,Sv.loadArrayBuffer(this.path,zg(this.config,{range:{start:this.indexPos,size:this.indexSize}}));case 22:for(t=e.sent,r=new Cy(new DataView(t)),this.datasetIndex={},a=r.getInt();a-- >0;)o=r.getString(),s=r.getLong(),c=r.getInt(),this.datasetIndex[o]={position:s,size:c};for(this.groupIndex={},a=r.getInt();a-- >0;)h=r.getString(),u=r.getLong(),l=r.getInt(),this.groupIndex[h]={position:u,size:l};return e.abrupt("return",this);case 31:case"end":return e.stop()}}),e,this)}))),Xb.prototype.readDataset=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u,l,f,p,d,g,v,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t+"_"+r+"_"+n,!this.datasetCache[i]){e.next=5;break}return e.abrupt("return",this.datasetCache[i]);case 5:return e.next=7,this.readHeader();case 7:if(a=this.version<2?"":"/"+r,o="all"===t.toLowerCase()||void 0===n?"0":n.toString(),s="raw"===r?"/"+t+"/raw":"/"+t+"/z"+o+a,void 0!==(c=this.datasetIndex[s])){e.next=13;break}return e.abrupt("return",void 0);case 13:return e.next=15,Sv.loadArrayBuffer(this.path,zg(this.config,{range:{start:c.position,size:c.size}}));case 15:if(h=e.sent){e.next=18;break}return e.abrupt("return",void 0);case 18:for(u=new Cy(new DataView(h)),l=u.getInt(),f={};l-- >0;)f[u.getString()]=u.getString();for(p=u.getString(),d=u.getFloat(),g=u.getInt(),v=[];g-- >0;)v.push({position:u.getLong(),size:u.getInt()});return m={name:s,attributes:f,dataType:p,tileWidth:d,tiles:v},this.datasetCache[i]=m,e.abrupt("return",m);case 30:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}(),Xb.prototype.readRootGroup=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.genome,!(r=this.groupCache["/"])){e.next=6;break}return e.abrupt("return",r);case 6:return e.next=8,this.readGroup("/");case 8:return n=e.sent,i=n.chromosomes,(a=n.maxZoom)&&(this.maxZoom=Number(a)),o={},i&&i.split(",").forEach((function(e){var r=t.getChromosomeName(e);o[r]=e})),this.chrAliasTable=o,this.groupCache["/"]=n,e.abrupt("return",n);case 17:case"end":return e.stop()}}),e,this)}))),Xb.prototype.readGroup=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.groupCache[t])){e.next=5;break}return e.abrupt("return",r);case 5:return e.next=7,this.readHeader();case 7:if(void 0!==(n=this.groupIndex[t])){e.next=10;break}return e.abrupt("return",void 0);case 10:return e.next=12,Sv.loadArrayBuffer(this.path,zg(this.config,{range:{start:n.position,size:n.size}}));case 12:if(i=e.sent){e.next=15;break}return e.abrupt("return",void 0);case 15:for(a=new Cy(new DataView(i)),o={name:t},s=a.getInt();s-- >0;)c=a.getString(),h=a.getString(),o[c]=h;return this.groupCache[t]=o,e.abrupt("return",o);case 21:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),Xb.prototype.readTiles=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r){var n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.sort((function(e,t){return e.position-t.position})),0!==(t=t.filter((function(e){return e.size>0}))).length){e.next=4;break}return e.abrupt("return",Promise.resolve([]));case 4:return n=t[0],i=t[t.length-1],a=n.position,o=i.position+i.size-a,e.next=10,Sv.loadArrayBuffer(this.path,zg(this.config,{range:{start:a,size:o}}));case 10:s=e.sent,c=[],h=fn(t),e.prev=13,h.s();case 15:if((u=h.n()).done){e.next=38;break}if(l=u.value,f=l.position-a,!((p=l.size)>0)){e.next=36;break}d=void 0,this.compressed?(g=new gg.Inflate(new Uint8Array(s,f,p)),v=g.decompress(),d=v.buffer):d=s.slice(f,f+p),m=new Cy(new DataView(d)),y=m.getString(),b=void 0,e.t0=y,e.next="fixedStep"===e.t0?28:"variableStep"===e.t0?30:"bed"===e.t0?32:"bedWithName"===e.t0?32:34;break;case 28:return b=Kb(m,r),e.abrupt("break",35);case 30:return b=Qb(m,r),e.abrupt("break",35);case 32:return b=Jb(m,r,y),e.abrupt("break",35);case 34:throw"Unknown tile type: "+y;case 35:c.push(b);case 36:e.next=15;break;case 38:e.next=43;break;case 40:e.prev=40,e.t1=e.catch(13),h.e(e.t1);case 43:return e.prev=43,h.f(),e.finish(43);case 46:return e.abrupt("return",c);case 47:case"end":return e.stop()}}),e,this,[[13,40,43,46]])})));return function(t,r){return e.apply(this,arguments)}}(),Xb.prototype.readTile=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r){var n,i,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sv.loadArrayBuffer(this.path,zg(this.config,{range:{start:t.position,size:t.size}}));case 2:n=e.sent,this.compressed&&(i=new gg.Inflate(new Uint8Array(n)),a=i.decompress(),n=a.buffer),o=new Cy(new DataView(n)),s=o.getString(),e.t0=s,e.next="fixedStep"===e.t0?9:"variableStep"===e.t0?10:"bed"===e.t0?11:"bedWithName"===e.t0?11:12;break;case 9:return e.abrupt("return",Kb(o,r));case 10:return e.abrupt("return",Qb(o,r));case 11:return e.abrupt("return",Jb(o,r,s));case 12:throw"Unknown tile type: "+s;case 13:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}();var ew=function(e,t){this.genome=t,this.windowFunction=e.windowFunction||"mean",this.reader=new Xb(e,t)};function tw(e,t,r,n,i,a){for(var o=e.nPositions,s=e.start,c=e.end,h=e.data[0],u=0;u<o;u++){var l=s[u],f=c[u];if(!(f<r)){if(l>n)break;a.push({chr:t,start:l,end:f,value:h[u]})}}}function rw(e,t,r,n,i,a){for(var o=e.nPositions,s=e.start,c=e.span,h=e.data[0],u=0;u<o;u++){var l=s[u],f=l+c;if(!(f<r)){if(l>n)break;a.push({chr:t,start:l,end:f,value:h[u]})}}}function nw(e,t,r,n,i,a){for(var o=e.nPositions,s=e.start,c=e.span,h=e.data[0],u=0;u<o;u++){var l=s+c;if(s>n)break;l>=r&&(Number.isNaN(h[u])||a.push({chr:t,start:s,end:l,value:h[u]})),s=l}}ew.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i){var a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x=function(){return(x=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.rootGroup){e.next=4;break}return e.abrupt("return",this.rootGroup);case 4:return e.next=6,this.reader.readRootGroup();case 6:return this.rootGroup=e.sent,e.abrupt("return",this.rootGroup);case 8:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)},w=function(){return x.apply(this,arguments)},e.next=4,w.call(this);case 4:if(a=new Vg(t,r,n),o=this.genome,"all"!==t.toLowerCase()){e.next=8;break}return e.abrupt("return",[]);case 8:return a.bpPerPixel=i,e.next=11,w.call(this);case 11:return e.sent,s=aw(t,i,o),c=this.reader.chrAliasTable[t],h=this.reader.maxZoom,void 0===c&&(c=t),void 0===h&&(h=-1),u=s>h?"raw":this.windowFunction,e.next=20,this.reader.readDataset(c,u,s);case 20:if(null!=(l=e.sent)){e.next=23;break}return e.abrupt("return",[]);case 23:return f=l.tileWidth,p=Math.floor(r/f),d=Math.floor(n/f),e.next=29,this.reader.readTiles(l.tiles.slice(p,d+1),1);case 29:g=e.sent,v=[],m=fn(g),e.prev=32,m.s();case 34:if((y=m.n()).done){e.next=48;break}b=y.value,e.t0=b.type,e.next="bed"===e.t0?39:"variableStep"===e.t0?41:"fixedStep"===e.t0?43:45;break;case 39:return tw(b,t,r,n,0,v),e.abrupt("break",46);case 41:return rw(b,t,r,n,0,v),e.abrupt("break",46);case 43:return nw(b,t,r,n,0,v),e.abrupt("break",46);case 45:throw"Unknown tile type: "+b.type;case 46:e.next=34;break;case 48:e.next=53;break;case 50:e.prev=50,e.t1=e.catch(32),m.e(e.t1);case 53:return e.prev=53,m.f(),e.finish(53);case 56:return v.sort((function(e,t){return e.start-t.start})),e.abrupt("return",v);case 58:case"end":return e.stop()}}),e,this,[[32,50,53,56]])})));return function(t,r,n,i){return e.apply(this,arguments)}}(),ew.prototype.supportsWholeGenome=function(){return!1};var iw=Math.log(2);function aw(e,t,r){var n=r.getChromosome(e).bpLength;return Math.ceil(Math.log(Math.max(0,n/(700*t)))/iw)}function ow(e,t,r){var n,i,a,o,s,c,h,u={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};function l(e){return 0===e?"0":Math.abs(e)>=10?e.toFixed():Math.abs(e)>=1?e.toFixed(1):e.toFixed(2)}void 0!==this.dataRange&&void 0!==this.dataRange.max&&void 0!==this.dataRange.min&&(gm.fillRect(e,0,0,t,r,{fillStyle:"rgb(255, 255, 255)"}),n=(h=.95*t)-8,s={x:i=h,y:a=o=.01*r},gm.strokeLine(e,n,a,i,o,u),gm.fillText(e,l(this.dataRange.max),n+4,a+12,u),c={x:i,y:a=o=.99*r},gm.strokeLine(e,n,a,i,o,u),gm.fillText(e,l(this.dataRange.min),n+4,a-4,u),gm.strokeLine(e,s.x,s.y,c.x,c.y,u))}var sw=If.dataRangeMenuItem,cw=Dg(gy,(function(e,t){this.type="wig",this.featureType="numeric",void 0===e.color&&(e.color="rgb(150,150,150)"),void 0===e.height&&(e.height=50),gy.call(this,e,t);var r=e.format?e.format.toLowerCase():e.format;this.featureSource="bigwig"===r?new Ob(e,t.genome):"tdf"===r?new ew(e,t.genome):new yb(e,t.genome),this.autoscale=e.autoscale||void 0===e.max,this.autoscale||(this.dataRange={min:e.min||0,max:e.max}),this.windowFunction=e.windowFunction||"mean",this.paintAxis=ow,this.graphType=e.graphType||"bar"}));function hw(e){this.thresholds=e.thresholds,this.colors=e.colors}function uw(e){this.scale=e,this.lowColor="rgb("+e.lowR+","+e.lowG+","+e.lowB+")",this.highColor="rgb("+e.highR+","+e.highG+","+e.highB+")",this.diff=e.high-e.low}cw.prototype.postInit=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFileHeader();case 2:(t=e.sent)&&this.setTrackProperties(t);case 4:case"end":return e.stop()}}),e,this)}))),cw.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.featureSource.getFeatures(t,r,n,i,this.windowFunction));case 1:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i){return e.apply(this,arguments)}}(),cw.prototype.menuItemList=function(){var e=this,t=[];return t.push(sw(this.trackView)),t.push({object:Ff("Autoscale",e.autoscale),click:function(){e.autoscale=!e.autoscale,e.config.autoscale=e.autoscale,e.trackView.setDataRange(void 0,void 0,e.autoscale)}}),t},cw.prototype.getFileHeader=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof this.featureSource.getFileHeader){e.next=4;break}return e.next=3,this.featureSource.getFileHeader();case 3:this.header=e.sent;case 4:return e.abrupt("return",this.header);case 5:case"end":return e.stop()}}),e,this)}))),cw.prototype.draw=function(e){var t,r=this,n=e.features,i=e.context,a=e.bpPerPixel,o=e.bpStart,s=e.pixelWidth,c=e.pixelHeight,h=o+s*a+1,u=-1,l=-1;"string"==typeof r.color&&r.color.startsWith("rgb(")&&(t=kg.addAlpha(r.color,.1));var f,p=function(e){return(r.dataRange.max-e)/(r.dataRange.max-r.dataRange.min)*c},d=function(e,t){var r=Math.ceil((e.end-o)/a);return Math.max(1,r-t)};if(n&&n.length>0&&(void 0===r.dataRange.min&&(r.dataRange.min=0),r.dataRange.max>r.dataRange.min)){var g,v=0==r.dataRange.min?c:p(0),m=fn(n);try{for(m.s();!(g=m.n()).done;){var y=g.value;if(!(y.end<o)){if(y.start>h)break;var b=(f=y,Math.floor((f.start-o)/a));if(!isNaN(b)){var w=p(y.value),x=d(y,b),k=y.value<0&&r.altColor?r.altColor:r.color,S="function"==typeof k?k(y.value):k;if("points"===r.graphType){var _=r.config.pointSize||3,C=b+x/2;gm.fillCircle(i,C,w,_/2,{fillStyle:S,strokeStyle:S})}else{var A=w-v;Math.abs(A)<1&&(A=A<0?-1:1);var E=b+x;(E>u||y.value>=0&&y.value>l||y.value<0&&y.value<1)&&gm.fillRect(i,b,v,x,A,{fillStyle:S}),l=y.value,u=E}}}}}catch(e){m.e(e)}finally{m.f()}if(r.dataRange.min<0){var R=r.dataRange.max/(r.dataRange.max-r.dataRange.min)*e.pixelHeight;gm.strokeLine(i,0,R,e.pixelWidth,R,{strokeStyle:t})}}!function(e){if(r.config.hasOwnProperty("guideLines")){var t,n=fn(r.config.guideLines);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.hasOwnProperty("color")&&i.hasOwnProperty("y")&&i.hasOwnProperty("dotted")){var a=p(i.y),o={strokeStyle:i.color,strokeWidth:2};i.dotted?gm.dashedLine(e.context,0,a,e.pixelWidth,a,5,o):gm.strokeLine(e.context,0,a,e.pixelWidth,a,o)}}}catch(e){n.e(e)}finally{n.f()}}}(e)},cw.prototype.popupData=function(e,t){if(t||(t=this.clickedFeatures(e)),t&&t.length>0){var r=[],n=function(e,t,r){for(var n,i,a=0,o=e.length-1,s=a+o>>1;!c(e[s],t,r)&&a<o;)t<e[s].start?o=s-1:t>e[s].end&&(a=s+1),s=a+o>>1;if(c(e[s],t,r)){if(c(n=e[s],t,0))return n;for(i=s;i-- >=0&&(c(e[i]),!r);){if(c(e[i],t,0))return e[i];for(h(e[i],t)<h(n,t)&&(n=e[i]),i=s;i++<e.length&&(c(e[i]),!r);){if(c(e[i],t,0))return e[i];h(e[i],t)<h(n,t)&&(n=e[i])}}return n}return;function c(e,t,r){return t>=e.start-r&&t<=e.end+r}function h(e,t){return Math.min(Math.abs(e.start-t),Math.abs(e.end-t))}}(t,e.genomicLocation,2*e.viewport.genomicState.referenceFrame.bpPerPixel);if(n){var i=n.end-n.start==1?yg(n.start+1):yg(n.start+1)+"-"+yg(n.end);r.push({name:"Position:",value:i}),r.push({name:"Value:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",value:yg(n.value)})}return r}return[]},cw.prototype.dispose=function(){this.trackView=void 0},cw.prototype.getState=function(){var e=this.config;return e.autoscale=this.autoscale,!this.autoscale&&this.dataRange&&(e.min=this.dataRange.min,e.max=this.dataRange.max),e},cw.prototype.supportsWholeGenome=function(){return"function"==typeof this.featureSource.supportsWholeGenome&&this.featureSource.supportsWholeGenome()},hw.prototype.getColor=function(e){var t,r=fn(this.thresholds);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(e<n)return this.colors[this.thresholds.indexOf(n)]}}catch(e){r.e(e)}finally{r.f()}return this.colors[this.colors.length-1]},uw.prototype.getColor=function(e){var t,r=this.scale;return e<=r.low?this.lowColor:e>=r.high?this.highColor:(t=(e-r.low)/this.diff,"rgb("+Math.floor(r.lowR+t*(r.highR-r.lowR))+","+Math.floor(r.lowG+t*(r.highG-r.lowG))+","+Math.floor(r.lowB+t*(r.highB-r.lowB))+")")};var lw=function(){function e(t){Wr(this,e),this.color=t}return Yr(e,[{key:"getColor",value:function(){return this.color}}]),e}(),fw=Dg(gy,(function(e,t){if(gy.call(this,e,t),this.isLog=e.isLog,this.displayMode=e.displayMode||"SQUISHED",this.maxHeight=e.maxHeight||500,this.squishedRowHeight=e.sampleSquishHeight||e.squishedRowHeight||2,this.expandedRowHeight=e.sampleExpandHeight||e.expandedRowHeight||12,this.posColorScale=e.posColorScale||new uw({low:.1,lowR:255,lowG:255,lowB:255,high:1.5,highR:255,highG:0,highB:0}),this.negColorScale=e.negColorScale||new uw({low:-1.5,lowR:0,lowG:0,lowB:255,high:-.1,highR:255,highG:255,highB:255}),this.sampleKeys=[],this.featureSource=new yb(this.config,t.genome),e.sort){var r=e.sort;this.sortSamples(r.chr,r.start,r.end,r.direction)}}));fw.prototype.postInit=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof this.featureSource.getFileHeader){e.next=4;break}return e.next=3,this.featureSource.getFileHeader();case 3:this.header=e.sent;case 4:case"end":return e.stop()}}),e,this)}))),fw.prototype.menuItemList=function(){var e=this,t=[],r={SQUISHED:"Squish",EXPANDED:"Expand",FILL:"Fill"};return t.push("<hr/>"),t.push("Sample Height"),["SQUISHED","EXPANDED","FILL"].forEach((function(n){t.push({object:Ff(r[n],n===e.displayMode),click:function(){e.displayMode=n,e.config.displayMode=n,e.trackView.checkContentHeight(),e.trackView.repaintViews()}})})),t},fw.prototype.getFeatures=function(e,t,r){return this.featureSource.getFeatures(e,t,r)},fw.prototype.draw=function(e){var t=this,r=(Xf(2),e.context),n=e.pixelTop,i=e.pixelWidth,a=e.pixelHeight;gm.fillRect(r,0,e.pixelTop,i,a,{fillStyle:"rgb(255, 255, 255)"});var o=e.features;if(o&&o.length>0){void 0===t.isLog&&function(e){if(void 0===t.isLog){t.isLog=!1;var r,n=fn(e);try{for(n.s();!(r=n.n()).done;)if(r.value.value<0)return void(t.isLog=!0)}catch(e){n.e(e)}finally{n.f()}}}(o);var s=e.bpPerPixel,c=e.bpStart,h=c+i*s+1,u=s;this.updateSampleKeys(o);var l,f,p={};switch(this.sampleKeys.forEach((function(e,t){p[e]=t})),this.displayMode){case"FILL":l=e.pixelHeight/this.sampleKeys.length,f=0;break;case"SQUISHED":l=this.squishedRowHeight,f=0;break;default:l=this.expandedRowHeight,f=1}var d,g=e.pixelTop+e.pixelHeight,v=fn(o);try{for(v.s();!(d=v.n()).done;){var m=d.value;if(!(m.end<c)){if(m.start>h)break;var y=m.sampleKey||m.sample;m.row=p[y];var b=n+m.row*l+f;if(!(b+l<n||b>g)){var w=m.value;t.isLog||(w=Xf(w/2));var x=Math.max(m.start,c),k=Math.round((x-c)/u),S=Math.min(m.end,h),_=Math.round((S-c)/u),C=Math.max(1,_-k),A=void 0;A=w<-.1?t.negColorScale.getColor(w):w>.1?t.posColorScale.getColor(w):"white",r.fillStyle=A;var E=l;if(l<.25){var R=.1+2*Math.abs(w);E=Math.min(1,R*l)}m.pixelRect={x:k,y:b,w:C,h:E-2*f},r.fillRect(k,b,C,E-2*f)}}}}catch(e){v.e(e)}finally{v.f()}}},fw.prototype.computePixelHeight=function(e){if(!e)return 0;var t="SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight;return this.updateSampleKeys(e),this.sampleKeys.length*t},fw.prototype.sortSamples=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i){var a,o,s,c,h,u,l,f,p,d,g,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.featureSource.getFeatures(t,r,n);case 2:a=e.sent,this.updateSampleKeys(a),o={},s=n-r+1,c=fn(a),e.prev=7,c.s();case 9:if((h=c.n()).done){e.next=23;break}if(!((u=h.value).end<r)){e.next=13;break}return e.abrupt("continue",21);case 13:if(!(u.start>n)){e.next=15;break}return e.abrupt("break",23);case 15:l=Math.max(r,u.start),f=Math.min(n,u.end),p=(f-l)/s,d=u.sampleKey||u.sample,g=o[d]||0,o[d]=g+p*u.value;case 21:e.next=9;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(7),c.e(e.t0);case 28:return e.prev=28,c.f(),e.finish(28);case 31:v="ASC"===i?1:-1,this.sampleKeys.sort((function(e,t){var r=o[e],n=o[t];return r||(r=v*Number.MAX_VALUE),n||(n=v*Number.MAX_VALUE),r===n?0:r>n?v:-1*v})),this.trackView.repaintViews();case 34:case"end":return e.stop()}}),e,this,[[7,25,28,31]])})));return function(t,r,n,i){return e.apply(this,arguments)}}(),fw.prototype.clickedFeatures=function(e){var t,r,n=gy.prototype.clickedFeatures.call(this,e);return t=n,r=e.y,t.filter((function(e){var t=e.pixelRect;return t&&r>=t.y&&r<=t.y+t.h}))},fw.prototype.popupData=function(e,t){t||(t=this.clickedFeatures(e));var r,n=[],i=fn(t);try{for(i.s();!(r=i.n()).done;)r.value}catch(e){i.e(e)}finally{i.f()}return t.forEach((function(e){!function(e,t){var r,n=new Set(["row","color","sampleKey","uniqueSampleKey","uniquePatientKey"]);e.hasOwnProperty("realChr")?((r=Object.assign({},e)).chr=e.realChr,r.start=e.realStart,r.end=e.realEnd,delete r.realChr,delete r.realStart,delete r.realEnd):r=e;for(var i=0,a=Object.keys(r);i<a.length;i++){var o=a[i];!n.has(o)&&Bg(r[o])&&t.push({name:o,value:r[o]})}}(e,n)})),n},fw.prototype.contextMenuItemList=function(e){var t=this,r=e.viewport.genomicState.referenceFrame,n=e.genomicLocation,i=this.config.sort?"ASC"===this.config.sort.direction?"DESC":"ASC":"DESC",a=r.toBP(2.5);return[{label:"Sort by value",click:function(e){var o={direction:i,chr:r.chrName,start:n-a,end:n+a};!function(e){t.sortSamples(e.chr,e.start,e.end,e.direction)}(o),t.config.sort=o}}]},fw.prototype.supportsWholeGenome=function(){return this.featureSource.supportsWholeGenome()},fw.prototype.updateSampleKeys=function(e){var t,r=new Set(this.sampleKeys),n=fn(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,a=i.sampleKey||i.sample;r.has(a)||(r.add(a),this.sampleKeys.push(a))}}catch(e){n.e(e)}finally{n.f()}};var pw=Dg(gy,(function(e,t){var r=this;e.tracks&&(gy.call(this,e,t),this.tracks=[],e.tracks.forEach((function(e){e.type||Hm(e),e.isMergedTrack=!0;var n=t.createTrack(e);n?(n.autoscale=!1,r.tracks.push(n)):console.warn("Could not create track "+e)})),Object.defineProperty(this,"height",{get:function(){return this._height},set:function(e){this._height=e;var t,r=fn(this.tracks);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.height=e,n.config.height=e}}catch(e){r.e(e)}finally{r.f()}}}),this.height=e.height||100)}));pw.prototype.getFeatures=function(e,t,r,n){var i=this.tracks.map((function(i){return i.getFeatures(e,t,r,n)}));return Promise.all(i)},pw.prototype.draw=function(e){var t,r,n,i,a;for(n=e.features,a=function(e,t){var r=0,n=-Number.MAX_VALUE;return t.forEach((function(e,t){e.forEach((function(e){void 0===e.value||Number.isNaN(e.value)||(r=Math.min(r,e.value),n=Math.max(n,e.value))}))})),{min:r,max:n}}(e.genomicState.chromosome.name,n),t=0,r=this.tracks.length;t<r;t++)(i=Object.assign({},e)).features=n[t],this.tracks[t].dataRange=a,this.tracks[t].draw(i)},pw.prototype.paintAxis=function(e,t,r){var n,i,a;for(n=0,i=this.tracks.length;n<i;n++)if("function"==typeof(a=this.tracks[n]).paintAxis){a.paintAxis(e,t,r);break}},pw.prototype.popupData=function(e){for(var t=[],r=0,n=this.tracks.length;r<n;r++){var i=this.tracks[r].popupData(e);t.push.apply(t,on(i))}return t};var dw=function(e){this.paired=!0,this.firstAlignment=e,this.chr=e.chr,this.readName=e.readName,e.start<e.mate.position?(this.start=e.start,this.scStart=e.scStart,this.connectingStart=e.start+e.lengthOnRef,this.connectingEnd=e.mate.position):(this.start=e.mate.position,this.scStart=this.start,this.connectingStart=e.mate.position,this.connectingEnd=e.start),this.end=Math.max(e.mate.position,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start;var t=Math.max(this.end,e.scStart+e.scLengthOnRef);this.scLengthOnRef=t-this.scStart};function gw(e){return e.isPaired()&&e.mate&&e.isMateMapped()&&e.chr===e.mate.chr&&(e.isFirstOfPair()||e.isSecondOfPair())&&!(e.isSecondary()||e.isSupplementary())}dw.prototype.setSecondAlignment=function(e){this.secondAlignment=e;var t=this.firstAlignment;e.start>t.start?this.connectingEnd=e.start:this.connectingStart=e.start+e.lengthOnRef,this.start=Math.min(t.start,e.start),this.end=Math.max(t.start+t.lengthOnRef,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start,this.scStart=Math.min(t.scStart,e.scStart);var r=Math.max(t.scStart+t.scLengthOnRef,e.scStart+e.scLengthOnRef);this.scLengthOnRef=r-this.scStart},dw.prototype.popupData=function(e){var t=[];return t=t.concat(this.firstAlignment.popupData(e)),this.secondAlignment&&(t.push("-------------------------------"),t=t.concat(this.secondAlignment.popupData(e))),t},dw.prototype.isPaired=function(){return!0},dw.prototype.firstOfPairStrand=function(){return this.firstAlignment.isFirstOfPair()?this.firstAlignment.strand:this.secondAlignment&&this.secondAlignment.isFirstOfPair()?this.secondAlignment.strand:this.firstAlignment.mate.strand};var vw=function(e,t,r,n,i,a,o){this.chr=e,this.start=Math.floor(t),this.end=Math.ceil(r),this.length=r-t,this.alleleFreqThreshold=void 0===o?.2:o,this.coverageMap=new bw(e,t,r,this.alleleFreqThreshold),this.alignments=[],this.downsampledIntervals=[],this.samplingWindowSize=void 0===n?100:n,this.samplingDepth=void 0===i?1e3:i,this.pairsSupported=void 0===a||a,this.paired=!1,this.pairsCache={},this.downsampledReads=new Set,this.currentBucket=new yw(this.start,this.start+this.samplingWindowSize,this),this.filter=function(e){return e.isMapped()&&!e.isFailsVendorQualityCheck()},this.pairedEndStats=new kw};function mw(){this.alignments=this.alignments.concat(this.currentBucket.alignments),this.currentBucket.downsampledCount>0&&this.downsampledIntervals.push(new xw(this.currentBucket.start,this.currentBucket.end,this.currentBucket.downsampledCount)),this.paired=this.paired||this.currentBucket.paired}function yw(e,t,r){this.start=e,this.end=t,this.alignments=[],this.downsampledCount=0,this.samplingDepth=r.samplingDepth,this.pairsSupported=r.pairsSupported,this.downsampledReads=r.downsampledReads,this.pairsCache=r.pairsCache}function bw(e,t,r,n){this.chr=e,this.bpStart=t,this.length=r-t,this.coverage=new Array(this.length),this.maximum=0,this.threshold=n,this.qualityWeight=!0}function ww(e){this.posA=0,this.negA=0,this.posT=0,this.negT=0,this.posC=0,this.negC=0,this.posG=0,this.negG=0,this.posN=0,this.negN=0,this.pos=0,this.neg=0,this.qualA=0,this.qualT=0,this.qualC=0,this.qualG=0,this.qualN=0,this.qual=0,this.total=0,this.del=0,this.ins=0,this.threshold=e}function xw(e,t,r){this.start=e,this.end=t,this.counts=r}function kw(e,t){this.totalCount=0,this.frCount=0,this.rfCount=0,this.ffCount=0,this.sumF=0,this.sumF2=0}vw.prototype.push=function(e){!1!==this.filter(e)&&(e.isPaired()&&this.pairedEndStats.push(e),this.coverageMap.incCounts(e),this.pairsSupported&&this.downsampledReads.has(e.readName)||(e.start>=this.currentBucket.end&&(mw.call(this),this.currentBucket=new yw(e.start,e.start+this.samplingWindowSize,this)),this.currentBucket.addAlignment(e)))},vw.prototype.forEach=function(e){this.alignments.forEach(e)},vw.prototype.finish=function(){void 0!==this.currentBucket&&mw.call(this),this.alignments.sort((function(e,t){return e.start-t.start})),this.pairsCache=void 0,this.downsampledReads=void 0,this.pairedEndStats.compute()},vw.prototype.contains=function(e,t,r){return this.chr===e&&this.start<=t&&this.end>=r},vw.prototype.hasDownsampledIntervals=function(){return this.downsampledIntervals&&this.downsampledIntervals.length>0},yw.prototype.addAlignment=function(e){var t,r,n;if(this.pairsSupported&&gw(e)&&(n=this.pairsCache[e.readName]))return n.setSecondAlignment(e),void(this.pairsCache[e.readName]=void 0);this.alignments.length<this.samplingDepth?this.pairsSupported&&gw(e)?(n=new dw(e),this.paired=!0,this.pairsCache[e.readName]=n,this.alignments.push(n)):this.alignments.push(e):((t=Math.floor(Math.random()*(this.samplingDepth+this.downsampledCount-1)))<this.samplingDepth?(r=this.alignments[t],this.pairsSupported&&gw(e)?(void 0!==this.pairsCache[r.readName]&&(this.pairsCache[r.readName]=void 0),n=new dw(e),this.paired=!0,this.pairsCache[e.readName]=n,this.alignments[t]=n):this.alignments[t]=e,this.downsampledReads.add(r.readName)):this.downsampledReads.add(e.readName),this.downsampledCount++)},bw.prototype.incCounts=function(e){var t=this;if(void 0===e.blocks?u(e):e.blocks.forEach((function(e){u(e)})),e.gaps){var r,n=fn(e.gaps);try{for(n.s();!(r=n.n()).done;){var i=r.value;if("D"===i.type)for(var a=i.start-t.bpStart,o=a;o<a+i.len;o++)o<0||(this.coverage[o]||(this.coverage[o]=new ww(t.threshold)),this.coverage[o].del++)}}catch(e){n.e(e)}finally{n.f()}}if(e.insertions){var s,c=fn(e.insertions);try{for(c.s();!(s=c.n()).done;){var h=s.value.start-this.bpStart;h<0||(this.coverage[h]||(this.coverage[h]=new ww(t.threshold)),this.coverage[h].ins++)}}catch(e){c.e(e)}finally{c.f()}}function u(r){if("S"!==r.type)for(var n=e.seq,i=e.qual,a=r.seqOffset,o=r.start-t.bpStart,s=0;s<r.len;o++,s++){t.coverage[o]||(t.coverage[o]=new ww(t.threshold));var c=n.charAt(a+s),h=e.strand?"pos"+c:"neg"+c,u=i&&a+s<i.length?i[a+s]:30;t.coverage[o][h]+=1,t.coverage[o]["qual"+c]+=u,t.coverage[o].total+=1,t.coverage[o].qual+=u,t.maximum=Math.max(t.coverage[o].total,t.maximum)}}},ww.prototype.isMismatch=function(e){var t,r=this,n=this.threshold*(this.qual?this.qual:this.total);return t=0,["A","T","C","G"].forEach((function(n){n!==e&&(t+=r.qual?r["qual"+n]:r["pos"+n]+r["neg"+n])})),t>=n},xw.prototype.popupData=function(e){return[{name:"start",value:this.start+1},{name:"end",value:this.end},{name:"# downsampled:",value:this.counts}]},kw.prototype.push=function(e){if(e.isProperPair()){var t=Math.abs(e.fragmentLength);this.sumF+=t,this.sumF2+=t*t;var r=e.pairOrientation;if("string"==typeof r&&4===r.length)switch(""+r.charAt(0)+r.charAt(2)){case"FF":case"RR":this.ffCount++;break;case"FR":this.frCount++;break;case"RF":this.rfCount++}this.totalCount++}},kw.prototype.compute=function(){if(this.totalCount>100){this.ffCount/this.totalCount>.9?this.orienation="ff":this.frCount/this.totalCount>.9?this.orienation="fr":this.rfCount/this.totalCount>.9&&(this.orienation="rf");var e=this.sumF/this.totalCount,t=Math.sqrt((this.totalCount*this.sumF2-this.sumF*this.sumF)/(this.totalCount*this.totalCount));this.lowerFragmentLength=e-3*t,this.upperFragmentLength=e+3*t}};var Sw={c:1,C:1,s:2,S:2,i:4,I:4,f:4};function _w(){this.hidden=!1}function Cw(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t>=n.start&&t<n.start+n.len)return n}}function Aw(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Ew(e,t){return e[t+1]<<8|e[t]}function Rw(e,t){return new DataView(e.buffer).getFloat32(t,!0)}_w.prototype.isMapped=function(){return 0==(4&this.flags)},_w.prototype.isPaired=function(){return 0!=(1&this.flags)},_w.prototype.isProperPair=function(){return 0!=(2&this.flags)},_w.prototype.isFirstOfPair=function(){return 0!=(64&this.flags)},_w.prototype.isSecondOfPair=function(){return 0!=(128&this.flags)},_w.prototype.isSecondary=function(){return 0!=(256&this.flags)},_w.prototype.isSupplementary=function(){return 0!=(2048&this.flags)},_w.prototype.isFailsVendorQualityCheck=function(){return 0!=(512&this.flags)},_w.prototype.isDuplicate=function(){return 0!=(1024&this.flags)},_w.prototype.isMateMapped=function(){return 0==(8&this.flags)},_w.prototype.isNegativeStrand=function(){return 0!=(16&this.flags)},_w.prototype.isMateNegativeStrand=function(){return 0!=(32&this.flags)},_w.prototype.tags=function(){return this.tagDict||(this.tagBA?(this.tagDict=function(e){for(var t=0,r=e.length,n={};t<r;){var i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;var a=String.fromCharCode(e[t++]),o=void 0;if("A"===a)o=String.fromCharCode(e[t]),t++;else if("i"===a||"I"===a)o=Aw(e,t),t+=4;else if("c"===a||"C"===a)o=e[t],t++;else if("s"===a||"S"===a)o=Ew(e,t),t+=2;else if("f"===a)o=Rw(e,t),t+=4;else if("Z"===a)for(o="";;){var s=e[t++];if(0===s)break;o+=String.fromCharCode(s)}else{if("B"!==a){o="Error unknown type: "+a,n[i]=o;break}var c=String.fromCharCode(e[t++]),h=Sw[c];if(void 0===h){n[i]="Error: unknown element type '".concat(c,"'");break}var u=Aw(e,t);t+=4+u*h,o="[not shown]"}n[i]=o}return n}(this.tagBA),this.tagBA=void 0):this.tagDict={}),this.tagDict},_w.prototype.popupData=function(e){var t=[];if(e=Math.floor(e),this.insertions){var r,n=this.seq,i=fn(this.insertions);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=a.start;if(e===o||e===o-1)return t.push({name:"Insertion",value:n.substr(a.seqOffset,a.len)}),t.push({name:"Location",value:o}),t}}catch(e){i.e(e)}finally{i.f()}}t.push({name:"Read Name",value:this.readName}),t.push("<hr>"),t.push({name:"Alignment Start",value:yg(1+this.start),borderTop:!0}),t.push({name:"Read Strand",value:!0===this.strand?"(+)":"(-)",borderTop:!0}),t.push({name:"Cigar",value:this.cigar}),t.push({name:"Mapped",value:u(this.isMapped())}),t.push({name:"Mapping Quality",value:this.mq}),t.push({name:"Secondary",value:u(this.isSecondary())}),t.push({name:"Supplementary",value:u(this.isSupplementary())}),t.push({name:"Duplicate",value:u(this.isDuplicate())}),t.push({name:"Failed QC",value:u(this.isFailsVendorQualityCheck())}),this.isPaired()&&(t.push("<hr>"),t.push({name:"First in Pair",value:!this.isSecondOfPair(),borderTop:!0}),t.push({name:"Mate is Mapped",value:u(this.isMateMapped())}),this.pairOrientation&&t.push({name:"Pair Orientation",value:this.pairOrientation}),this.isMateMapped()&&(t.push({name:"Mate Chromosome",value:this.mate.chr}),t.push({name:"Mate Start",value:this.mate.position+1}),t.push({name:"Mate Strand",value:!0===this.mate.strand?"(+)":"(-)"}),t.push({name:"Insert Size",value:this.fragmentLength}))),t.push("<hr>");var s=this.tags(),c=!0;for(var h in s)s.hasOwnProperty(h)&&(c?(t.push({name:h,value:s[h],borderTop:!0}),c=!1):t.push({name:h,value:s[h]}));return t.push("<hr>"),t.push({name:"Genomic Location: ",value:yg(1+e)}),t.push({name:"Read Base:",value:this.readBaseAt(e)}),t.push({name:"Base Quality:",value:this.readBaseQualityAt(e)}),t;function u(e){return e?"Yes":"No"}},_w.prototype.readBaseAt=function(e){var t=Cw(this.blocks,e);if(t){if("*"===this.seq)return"*";var r=t.seqIndexAt(e);return this.seq[r]}},_w.prototype.readBaseQualityAt=function(e){var t=Cw(this.blocks,e);if(t){if("*"===this.qual)return 30;var r=t.seqIndexAt(e);return r>=0&&this.qual&&r<this.qual.length?this.qual[r]:30}},_w.prototype.gapSizeAt=function(e){if(this.gaps){var t,r=fn(this.gaps);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(e>=n.start&&e<n.start+n.len)return n.len}}catch(e){r.e(e)}finally{r.f()}}return 0};var Tw=function(e){e&&Object.assign(this,e)};function Iw(e){e||(e={}),this.vendorFailed=void 0===e.vendorFailed||e.vendorFailed,this.duplicates=void 0===e.duplicates||e.duplicates,this.secondary=e.secondary||!1,this.supplementary=e.supplementary||!1,this.mqThreshold=void 0===e.mqThreshold?0:e.mqThreshold,e.readgroups&&(this.readgroups=new Set(e.readgroups))}Tw.prototype.seqIndexAt=function(e){return Math.floor(e)-this.start+this.seqOffset},Iw.prototype.pass=function(e){if(this.vendorFailed&&e.isFailsVendorQualityCheck())return!1;if(this.duplicates&&e.isDuplicate())return!1;if(this.secondary&&e.isSecondary())return!1;if(this.supplementary&&e.isSupplementary())return!1;if(e.mq<this.mqThreshold)return!1;if(this.readgroups){var t=e.tags().RG;return this.readgroups.has(t)}return!0};var Lw=["=","A","C","x","G","x","x","x","T","x","x","x","x","x","x","N"],Mw=["M","I","D","N","S","H","P","=","X","?","?","?","?","?","?","?"],Pw=Nw(new Uint8Array([66,65,77,1]),0),Ow={readHeader:function(e,t,r){return Sv.loadArrayBuffer(e,t).then((function(e){var t;return t=tv(e),Ow.decodeBamHeader(t,r)}))},decodeBamHeader:function(e,t){var r,n,i,a,o;if((r=Nw(e,0))!==Pw)throw new Error("BAM header errror: bad magic number.  This could be caused by either a corrupt or missing file.");n=Nw(e,4);for(var s=0;s<n;++s)String.fromCharCode(e[s+8]);var c=Nw(e,n+8),h=n+12;for(i={},a=[],o={},s=0;s<c;++s){for(var u=Nw(e,h),l="",f=0;f<u-1;++f)l+=String.fromCharCode(e[h+4+f]);Nw(e,h+u+4),i[l]=s,a[s]=l,t&&(o[t.getChromosomeName(l)]=l),h=h+8+u}return{magicNumber:r,size:h,chrNames:a,chrToIndex:i,chrAliasTable:o}},bam_tag2cigar:function(e,t,r,n,i,a){function o(e){return"C"===e||"c"===e||"A"===e?1:"S"===e||"s"===e?2:"I"===e||"i"===e||"f"===e?4:0}if(1!==a.length||i.start<0)return!1;for(var s=r+(n+1>>1)+n;s+4<t&&"CG"!==String.fromCharCode(e[s])+String.fromCharCode(e[s+1]);){var c=String.fromCharCode(e[s+2]);if("B"===c)s+=8+o(c=String.fromCharCode(e[s+3]))*Nw(e,s+4);else if("Z"===c||"H"===c)for(s+=3;0!==e[s++];);else s+=3+o(c)}if(s>=t)return!1;if("B"!==String.fromCharCode(e[s+2])||"I"!==String.fromCharCode(e[s+3]))return!1;var h=Nw(e,s+4),u=s+8;if(u+4*h>t)return!1;var l="",f=0;a.length=0,s=u;for(var p=0;p<h;++p,s+=4){var d=Nw(e,s),g=d>>4,v=Mw[15&d];"M"!==v&&"EQ"!==v&&"X"!==v&&"D"!==v&&"N"!==v&&"="!==v||(f+=g),l=l+g+v,a.push({len:g,ltr:v})}return i.cigar=l,i.lengthOnRef=f,!0},decodeBamRecords:function(e,t,r,n,i,a,o,s){for(;t<e.length;){var c=t+Nw(e,t)+4,h=new _w,u=Nw(e,t+4),l=Nw(e,t+8);if(c>e.length)return;if(u<0)t=c;else{if(void 0!==i&&(u>i||l>o))return!0;if(void 0!==i&&u<i)t=c;else{for(var f=Nw(e,t+12),p=(65280&f)>>8,d=255&f,g=Nw(e,t+16),v=(4294901760&g)>>16,m=65535&g,y=Nw(e,t+20),b=Nw(e,t+24),w=Nw(e,t+28),x=Nw(e,t+32),k=[],S=0;S<d-1;++S)k.push(String.fromCharCode(e[t+36+S]));k=k.join("");for(var _=0,C="",A=t+36+d,E=[],R=void 0,T=0;T<m;++T){var I=Nw(e,A),L=I>>4,M=Mw[15&I];"M"!==M&&"EQ"!==M&&"X"!==M&&"D"!==M&&"N"!==M&&"="!==M||(_+=L),C=C+L+M,A+=4,R={len:L,ltr:M},E.push(R)}if(h.chr=n[u],h.start=l,h.flags=v,h.strand=!(16&v),h.readName=k,h.cigar=C,h.lengthOnRef=_,h.fragmentLength=x,h.mq=p,Ow.bam_tag2cigar(e,c,A,y,h,E),h.end=h.start+h.lengthOnRef,h.end<a)t=c;else{for(var P=[],O=y+1>>1,F=0;F<O;++F){var N=e[A+F];P.push(Lw[(240&N)>>4]),P.push(Lw[15&N])}P=P.slice(0,y).join(""),A+=O;for(var D=[],B=0;B<y;++B)D.push(e[A+B]);A+=y,b>=0&&(h.mate={chr:n[b],position:w,strand:!(32&v)}),h.seq=P,h.qual=D,h.tagBA=new Uint8Array(e.buffer.slice(A,c)),this.setPairOrientation(h),(void 0===s||s.pass(h))&&(Fw(h,E),r.push(h)),t=c}}}}},decodeSamRecords:function(e,t,r,n,i,a){var o,s,c,h,u,l,f,p,d,g;for(h=(o=bg(e)).length,s=0;s<h;s++)if(u=o[s].split("\t"),(d=new _w).chr=u[2],d.start=Number.parseInt(u[3])-1,d.flags=Number.parseInt(u[1]),d.readName=u[0],d.strand=!(16&d.flags),d.mq=Number.parseInt(u[4]),d.cigar=u[5],d.fragmentLength=Number.parseInt(u[8]),d.seq=u[9],"*"!==d.chr&&d.isMapped()&&d.chr===r){if(d.start>i)break;if(p=0,(g=Dw(d.cigar)).forEach((function(e){var t=e.len,r=e.ltr;"M"!==r&&"EQ"!==r&&"X"!==r&&"D"!==r&&"N"!==r&&"="!==r||(p+=t)})),d.lengthOnRef=p,!(d.start+p<n)){for(l=u[10],d.qual=[],c=0;c<l.length;c++)d.qual[c]=l.charCodeAt(c)-33;d.tagDict=u.length<11?{}:Bw(u.slice(11)),d.isMateMapped()&&(f=u[6],d.mate={chr:"="===f?d.chr:f,position:Number.parseInt(u[7]),strand:!(32&d.flags)}),this.setPairOrientation(d),(void 0===a||a.pass(d))&&(Fw(d,g),t.push(d))}}},setReaderDefaults:function(e,t){e.filter=new Iw(t.filter),t.readgroup&&(e.filter.readgroups=new Set([t.readgroup])),e.alleleFreqThreshold=void 0===t.alleleFreqThreshold?.2:t.alleleFreqThreshold,e.samplingWindowSize=void 0===t.samplingWindowSize?100:t.samplingWindowSize,e.samplingDepth=void 0===t.samplingDepth?500:t.samplingDepth,e.samplingDepth>1e4&&(e.samplingDepth=1e4),t.viewAsPairs?e.pairsSupported=!0:e.pairsSupported=void 0===t.pairsSupported||t.pairsSupported},setPairOrientation:function(e){if(e.isMapped()&&e.mate&&e.isMateMapped()&&e.mate.chr===e.chr){var t=e.strand?"F":"R",r=e.mate,n=r.strand?"F":"R",i=" ",a=" ";e.isFirstOfPair()?(i="1",a="2"):e.isSecondOfPair()&&(i="2",a="1");var o=[],s=e.fragmentLength,c=e.end-e.start;0===s&&(s=(e.start<r.position?r.position+c:r.position-c)-e.start),s>0?(o[0]=t,o[1]=i,o[2]=n,o[3]=a):(o[2]=t,o[3]=i,o[0]=n,o[1]=a),e.pairOrientation=o.join("")}}};function Fw(e,t){var r,n,i=[],a=0,o=e.start;e.scStart=e.start,e.scLengthOnRef=e.lengthOnRef;var s,c=fn(t);try{for(c.s();!(s=c.n()).done;){var h=s.value,u=void 0;switch(h.ltr){case"H":case"P":break;case"S":u=o,e.scLengthOnRef+=h.len,0===i.length&&(e.scStart-=h.len,u-=h.len),i.push(new Tw({start:u,seqOffset:a,len:h.len,type:"S"})),a+=h.len;break;case"N":case"D":void 0===n&&(n=[]),n.push({start:o,len:h.len,type:h.ltr}),o+=h.len;break;case"I":void 0===r&&(r=[]),r.push(new Tw({start:o,len:h.len,seqOffset:a,type:"I"})),a+=h.len;break;case"M":case"EQ":case"=":case"X":i.push(new Tw({start:o,seqOffset:a,len:h.len,type:"M"})),a+=h.len,o+=h.len}}}catch(e){c.e(e)}finally{c.f()}e.blocks=i,e.insertions=r,e.gaps=n}function Nw(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Dw(e){var t,r,n,i,a,o,s,c,h;for(t=[],r=[],a=null,i=e.length,n=0;n<i;n++)o=e.charAt(n),h=void 0,(h=o.charCodeAt(0))>=48&&h<=57?r.push(o):(s=o,c=Number.parseInt(r.join("")),r=[],null!==a&&a.ltr===s?a.len+=c:(a={len:c,ltr:s},t.push(a)));return t}function Bw(e){var t={};return e.forEach((function(e){var r=e.split(":");t[r[0]]=r[2]})),t}var zw=function(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.isDataUri=mg(e.url)&&e.url.startsWith("data:"),Ow.setReaderDefaults(this,e)};function Uw(e){var t=e.split(","),r=t[0].split(":")[1],n=t[1];n=r.indexOf("base64")>=0?atob(n):decodeURI(n);for(var i=new Uint8Array(n.length),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}zw.prototype.readAlignments=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u,l,f,p,d,g,v,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m=function(e,t,r){var n,i,a,o;i=(n=this.header).chrAliasTable.hasOwnProperty(e)?n.chrAliasTable[e]:e,a=this.alignmentCache.queryFeatures(i,t,r),o=new vw(e,t,r,this.samplingWindowSize,this.samplingDepth,this.pairsSupported);var s,c=fn(a);try{for(c.s();!(s=c.n()).done;){var h=s.value;o.push(h)}}catch(e){c.e(e)}finally{c.f()}return o.finish(),o},v=function(e){var t=[];this.header=Ow.decodeBamHeader(e),Ow.decodeBamRecords(e,this.header.size,t,this.header.chrNames),this.alignmentCache=new Gy(t,i)},i=this.genome,!this.alignmentCache){e.next=14;break}a=this.header,o=a.chrAliasTable.hasOwnProperty(t)?a.chrAliasTable[t]:t,s=this.alignmentCache.queryFeatures(o,r,n),c=new vw(t,r,n,this.samplingWindowSize,this.samplingDepth,this.pairsSupported,this.alleleFreqThreshold),h=fn(s);try{for(h.s();!(u=h.n()).done;)l=u.value,c.push(l)}catch(e){h.e(e)}finally{h.f()}return c.finish(),e.abrupt("return",c);case 14:if(!this.isDataUri){e.next=21;break}return f=Uw(this.bamPath),p=tv(f.buffer),v.call(this,p),e.abrupt("return",m.call(this,t,r,n));case 21:return e.next=23,Sv.loadArrayBuffer(this.bamPath,zg(this.config));case 23:return d=e.sent,g=tv(d),v.call(this,g),e.abrupt("return",m.call(this,t,r,n));case 27:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}();var Hw=function(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.baiPath=e.indexURL||function(e,t){var r;if(e instanceof File)throw new Error("Cannot infer an index path for a local File.  Please select explicitly");return e.includes("?")?(r=e.indexOf("?"),e.substring(0,r)+"."+t+e.substring(r)):e+"."+t}(this.bamPath,"bai"),Ow.setReaderDefaults(this,e)};function $w(){return jw.apply(this,arguments)}function jw(){return(jw=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.header){e.next=15;break}return t=this.genome,e.next=4,qw.call(this);case 4:return r=e.sent,n=zg(this.config,{range:{start:r.firstAlignmentBlock,size:26}}),e.next=8,Sv.loadArrayBuffer(this.bamPath,n);case 8:return i=e.sent,a=rv(i),o=r.firstAlignmentBlock+a,s=zg(this.config,{range:{start:0,size:o}}),e.next=14,Ow.readHeader(this.bamPath,s,t);case 14:this.header=e.sent;case 15:return e.abrupt("return",this.header);case 16:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function qw(){return Gw.apply(this,arguments)}function Gw(){return(Gw=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.genome,this.index){e.next=6;break}return e.next=4,Ey(this.baiPath,this.config,!1,t);case 4:return this.index=e.sent,e.abrupt("return",this.index);case 6:return e.abrupt("return",this.index);case 7:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}function Vw(){return Ww.apply(this,arguments)}function Ww(){return(Ww=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.chrToIndex){e.next=4;break}return e.abrupt("return",this.chrToIndex);case 4:return e.next=6,$w.call(this);case 6:return t=e.sent,this.chrToIndex=t.chrToIndex,this.indexToChr=t.chrNames,this.chrAliasTable=t.chrAliasTable,e.abrupt("return",this.chrToIndex);case 11:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}Hw.prototype.readAlignments=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Vw.call(this);case 2:if(i=e.sent,a=this.chrAliasTable.hasOwnProperty(t)?this.chrAliasTable[t]:t,o=i[a],s=new vw(t,r,n,this.config.samplingWindowSize,this.config.samplingDepth,this.config.pairsSupported,this.config.alleleFreqThreshold),void 0!==o){e.next=10;break}return e.abrupt("return",s);case 10:return e.next=12,qw.call(this);case 12:if(c=e.sent,(h=c.blocksForRange(o,r,n))&&0!==h.length){e.next=16;break}return e.abrupt("return",s);case 16:u=fn(h),e.prev=18,u.s();case 20:if((l=u.n()).done){e.next=45;break}if(f=l.value,p=void 0,0!==f.maxv.offset){e.next=27;break}p=0,e.next=32;break;case 27:return d=zg(this.config,{range:{start:f.maxv.block,size:26}}),e.next=30,Sv.loadArrayBuffer(this.bamPath,d);case 30:g=e.sent,p=rv(g);case 32:return v=f.minv.block,m=f.maxv.block+p,y={start:v,size:m-v+1},e.next=37,Sv.loadArrayBuffer(this.bamPath,zg(this.config,{range:y}));case 37:if(b=e.sent,w=tv(b),!Ow.decodeBamRecords(w,f.minv.offset,s,this.indexToChr,o,r,n,this.filter)){e.next=42;break}return e.abrupt("break",45);case 42:case 43:e.next=20;break;case 45:e.next=50;break;case 47:e.prev=47,e.t0=e.catch(18),u.e(e.t0);case 50:return e.prev=50,u.f(),e.finish(50);case 53:return s.finish(),e.abrupt("return",s);case 55:case"end":return e.stop()}}),e,this,[[18,47,50,53]])})));return function(t,r,n){return e.apply(this,arguments)}}();var Zw=function(e,t){this.config=e,this.genome=t;var r={},n={};e.sources.sequences.forEach((function(e){if(r[e]=null,t){var i=t.getChromosomeName(e);n[i]=e}})),this.chrAliasTable=n,this.bamReaders=r,Ow.setReaderDefaults(this,e)};Zw.prototype.readAlignments=function(e,t,r){this.genome;var n=this,i=n.chrAliasTable.hasOwnProperty(e)?n.chrAliasTable[e]:e;if(this.bamReaders.hasOwnProperty(i)&&"none"!==this.bamReaders[i]){var a,o=n.bamReaders[i];if(!o){a={url:n.config.sources.url.replace("$CHR",i)},n.config.sources.indexURL&&(a.indexURL=n.config.sources.indexURL.replace("$CHR",i));var s=Object.assign(n.config,a);o=new Hw(s),n.bamReaders[i]=o}return o.readAlignments(i,t,r).catch((function(o){return console.error(o),vv.presentAlert(a.url),n.bamReaders[i]="none",new vw(e,t,r)}))}return Promise.resolve(new vw(e,t,r))};var Yw=function(e,t){this.config=e,this.genome=t,Ow.setReaderDefaults(this,e)};function Xw(){var e=this,t=this.genome;if(this.header)return Promise.resolve(this.header);var r=this.config.url+"?file="+this.config.alignmentFile+"&options=-b,-H",n=zg(this.config);return Ow.readHeader(r,n,t).then((function(t){return e.header=t,t}))}Yw.prototype.readAlignments=function(e,t,r){var n=this;return Xw.call(n).then((function(i){var a,o;return a=i.chrAliasTable.hasOwnProperty(e)?i.chrAliasTable[e]:e,o=n.config.url+"?reference="+n.config.referenceFile+"&file="+n.config.alignmentFile+"&region="+a+":"+t+"-"+r,Sv.loadString(o,zg(n.config)).then((function(o){var s;return i.chrToIndex[a],s=new vw(e,t,r,n.samplingWindowSize,n.samplingDepth,n.pairsSupported,n.alleleFreqThreshold),Ow.decodeSamRecords(o,s,a,t,r,n.filter),s}))}))};var Kw=function(e,t){this.config=e,this.genome=t,Ow.setReaderDefaults(this,e)};function Qw(e){var t=[];return e.forEach((function(e){if(e.url.startsWith("data:"))t.push(Promise.resolve(function(e){var t=e.split(","),r=t[0].split(":")[1],n=t[1];n=r.indexOf("base64")>=0?atob(n):decodeURI(n);for(var i=new Uint8Array(n.length),a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}(e.url)));else{var r={};e.headers&&(r.headers=e.headers,r.headers.hasOwnProperty("referer")&&delete r.headers.referer),t.push(new Promise((function(t,n){Sv.loadArrayBuffer(e.url,r).then((function(e){t(new Uint8Array(e))}))})))}})),Promise.all(t)}function Jw(e){var t=0;e.forEach((function(e){t+=e.length}));var r=0,n=new Uint8Array(t);return e.forEach((function(e){n.set(e,r),r+=e.length})),n}Kw.prototype.readAlignments=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i){var a,o,s,c,h,u,l,f,p,d,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.format||"BAM"===this.config.format.toUpperCase()){e.next=2;break}throw Error("htsget format ".concat(this.config.format," is not supported"));case 2:return a=this.genome,o=this.header&&this.header.chrAliasTable.hasOwnProperty(t)?this.header.chrAliasTable[t]:t,s=this.config.url?this.config.url+this.config.endpoint:this.config.endpoint+"/reads/",c=s+this.config.id+"?format=BAM&referenceName="+o+"&start="+r+"&end="+n,e.next=8,Sv.loadJson(c,this.config);case 8:return h=e.sent,e.next=11,Qw(h.htsget.urls);case 11:if(u=e.sent,l=Jw(u),f=tv(l.buffer),p=f,this.header=Ow.decodeBamHeader(p,a),d=this.header.chrToIndex[t],g=new vw(t,r,n,this.samplingWindowSize,this.samplingDepth,this.pairsSupported,this.alleleFreqThreshold),Ow.decodeBamRecords(p,this.header.size,g,this.header.chrNames,d,r,n),g.finish(),0!==g.alignments.length){e.next=29;break}if(void 0!==d||!this.header.chrAliasTable.hasOwnProperty(t)||i){e.next=26;break}return o=this.header.chrAliasTable[t],e.abrupt("return",this.readAlignments(o,r,n,1));case 26:return e.abrupt("return",g);case 27:e.next=30;break;case 29:return e.abrupt("return",g);case 30:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i){return e.apply(this,arguments)}}(),_f("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Tf),bn("hasInstance"),bn("species"),bn("toStringTag");var ex=Ye.some,tx=ut("some"),rx=ot("some");Oe({target:"Array",proto:!0,forced:!tx||!rx},{some:function(e){return ex(this,e,arguments.length>1?arguments[1]:void 0)}}),fa("Array");var nx=td.ArrayBuffer,ix=o.ArrayBuffer;Oe({global:!0,forced:ix!==nx},{ArrayBuffer:nx}),fa("ArrayBuffer");var ax=qe("hasInstance"),ox=Function.prototype;ax in ox||L.f(ox,ax,{value:function(e){if("function"!=typeof this||!b(e))return!1;if(!b(this.prototype))return e instanceof this;for(;e=_i(e);)if(this.prototype===e)return!0;return!1}}),kn(o.JSON,"JSON",!0),kn(Math,"Math",!0),Oe({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991});var sx=Sf.onFreeze,cx=Object.freeze,hx=s((function(){cx(1)}));Oe({target:"Object",stat:!0,forced:hx,sham:!kf},{freeze:function(e){return cx&&b(e)?cx(sx(e)):e}});var ux=R.f,lx=s((function(){ux(1)}));Oe({target:"Object",stat:!0,forced:!c||lx,sham:!c},{getOwnPropertyDescriptor:function(e,t){return ux(y(e),t)}});var fx=/"/g;Oe({target:"String",proto:!0,forced:function(e){return s((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}("sub")},{sub:function(){return e="sub",t="",r="",n=String(m(this)),i="<"+e,""!==t&&(i+=" "+t+'="'+String(r).replace(fx,"&quot;")+'"'),i+">"+n+"</"+e+">";var e,t,r,n,i}}),ad("Float32",(function(e){return function(t,r,n){return e(this,t,r,n)}})),ad("Float64",(function(e){return function(t,r,n){return e(this,t,r,n)}})),ad("Int32",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var px=!o.setImmediate||!o.clearImmediate;Oe({global:!0,bind:!0,enumerable:!0,forced:px},{setImmediate:Qc.set,clearImmediate:Qc.clear});var dx=eval,gx=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==qr(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=35)}([function(e,t){var r=function(e){Xr(r,e);var t=nn(r);function r(){return Wr(this,r),t.apply(this,arguments)}return r}(tn(Error)),n=function(e){Xr(r,e);var t=nn(r);function r(){return Wr(this,r),t.apply(this,arguments)}return r}(r);e.exports={CramBufferOverrunError:function(e){Xr(r,e);var t=nn(r);function r(){return Wr(this,r),t.apply(this,arguments)}return r}(n),CramMalformedError:n,CramUnimplementedError:function(e){Xr(r,e);var t=nn(r);function r(){return Wr(this,r),t.apply(this,arguments)}return r}(tn(Error)),CramSizeLimitError:function(e){Xr(r,e);var t=nn(r);function r(){return Wr(this,r),t.apply(this,arguments)}return r}(r),CramArgumentError:function(e){Xr(r,e);var t=nn(r);function r(){return Wr(this,r),t.apply(this,arguments)}return r}(r)}},function(e,t,r){(function(e){
  /*!
  	     * The buffer module from node.js, for the browser.
  	     *
  	     * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  	     * @license  MIT
  	     */
  var n=r(37),i=r(38),a=r(19);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return h(this,e,t,r)}function h(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,r),i=(e=s(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|p(t.length);return 0===(e=s(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(u(t),e=s(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function f(e,t){var r=t.length<0?0:0|p(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function d(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){var a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function h(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=r;a<s;a++)if(h(e,a)===h(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===c)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+c>s&&(r=s-c),a=r;a>=0;a--){for(var l=!0,f=0;f<c;f++)if(h(e,a+f)!==h(t,f)){l=!1;break}if(l)return a}return-1}function y(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function b(e,t,r,n){return $(U(t,e.length-r),e,r,n)}function w(e,t,r,n){return $(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function x(e,t,r,n){return w(e,t,r,n)}function k(e,t,r,n){return $(H(t),e,r,n)}function S(e,t,r,n){return $(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function _(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,c,h=e[i],u=null,l=h>239?4:h>223?3:h>191?2:1;if(i+l<=r)switch(l){case 1:h<128&&(u=h);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&h)<<6|63&a)>127&&(u=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&h)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&h)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(u=c)}null===u?(u=65533,l=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=l}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return h(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,n){return u(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return l(null,e)},c.allocUnsafeSlow=function(e){return l(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):function(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return _(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),h=this.slice(n,i),u=e.slice(t,r),l=0;l<s;++l)if(h[l]!==u[l]){a=h[l],o=u[l];break}return a<o?-1:o<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function E(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function T(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=z(e[a]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function F(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,a){return a||F(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,a){return a||F(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var i=t-e;r=new c(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=c.isBuffer(e)?e:U(new c(e,n).toString()),s=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(2))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":qr(window))&&(r=window)}e.exports=r},function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var c,h=[],u=!1,l=-1;function f(){u&&c&&(u=!1,c.length?h=c.concat(h):l=-1,h.length&&p())}function p(){if(!u){var e=s(f);u=!0;for(var t=h.length;t;){for(c=h,h=[];++l<t;)c&&c[l].run();l=-1,t=h.length}c=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new d(e,t)),1!==h.length||u||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){var n=r(9),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var a=r(7);a.inherits=r(4);var o=r(21),s=r(16);a.inherits(l,o);for(var c=i(s.prototype),h=0;h<c.length;h++){var u=c[h];l.prototype[u]||(l.prototype[u]=s.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||n.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){var n=r(0).CramBufferOverrunError,i={int:!0,byte:!0,long:!0,byteArray:!0,byteArrayBlock:!0};e.exports=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(Wr(this,e),this.parameters=t,this.dataType=r,!r)throw new TypeError("must provide a data type to codec constructor");if(!i[r])throw new TypeError("invalid data type ".concat(r))}return Yr(e,[{key:"_getBits",value:function(e,t,r){var i=0;if(t.bytePosition+(7-t.bitPosition+r)/8>e.length)throw new n("read error during decoding. the file seems to be truncated.");for(var a=r;a;a-=1)i<<=1,i|=e[t.bytePosition]>>t.bitPosition&1,t.bitPosition-=1,t.bitPosition<0&&(t.bytePosition+=1),t.bitPosition&=7;return i}}]),e}()},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==qr(e)},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==qr(e)&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==qr(e)||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(1).Buffer)},function(e,t,r){var n=r(72),i=r(0).CramBufferOverrunError;e.exports={itf8Size:function(e){return-128&e?-16384&e?-2097152&e?-268435456&e?5:4:3:2:1},parseItf8:function(e,t){var r,n=t,a=e[n];if(a<128?(r=a,n+=1):a<192?(r=16383&(a<<8|e[n+1]),n+=2):a<224?(r=2097151&(a<<16|e[n+1]<<8|e[n+2]),n+=3):a<240?(r=268435455&(a<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),n+=4):(r=(15&a)<<28|e[n+1]<<20|e[n+2]<<12|e[n+3]<<4|15&e[n+4],n+=5),n>e.length)throw new i("Attempted to read beyond end of buffer; this file seems truncated.");return[r,n-t]},parseItem:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t.parse(e),a=i.offset,o=i.result;return o._endPosition=a+n,o._size=a-r,o},tinyMemoize:function(e,t){var r=e.prototype[t],n="_memo_".concat(t);e.prototype[t]=function(){return n in this||(this[n]=r.call(this)),this[n]}},sequenceMD5:function(e){return n(e.toUpperCase().replace(/[^\x21-\x7e]/g,""))}}},function(e,t,r){(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(a=new Array(s-1),o=0;o<a.length;)a[o++]=arguments[o];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,r(3))},function(e,t,r){var n=r(1),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=o),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=qr(r))throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,i),i+=a.length;return o}},o={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,a)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(n)},function(e,t,r){var n=r(0).CramMalformedError,i=r(13),a=function e(){Wr(this,e),this.F=void 0,this.C=void 0};function o(e,t,r,n){return r*(e>>n)+(e&(1<<n)-1)-t}var s={FC:a,AriDecoder:function e(){Wr(this,e),this.fc=new Array(256);for(var t=0;t<this.fc.length;t+=1)this.fc[t]=new a;this.R=null},Symbol:function e(){Wr(this,e),this.start=void 0,this.freq=void 0},symbolInit:function(e,t,r){if(!(t<=65536))throw new n("assertion failed: start <= 1<<16");if(!(r<=65536-t))throw new n("assertion failed: freq <= 1<<16");e.start=t,e.freq=r},advanceStep:o,advanceSymbolStep:function(e,t,r){return o(e,t.start,t.freq,r)},get:function(e,t){return e&(1<<t)-1},advanceSymbol:function(e,t,r,n){return function(e,t,r,n,a){if((e=n*(e>>a)+(e&(1<<a)-1)-r)<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}(e,t,r.start,r.freq,n)},renormalize:function(e,t){if(e<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}};e.exports=s},function(e,t){e.exports={TF_SHIFT:12,TOTFREQ:4096,RANS_BYTE_L:1<<23}},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==qr(e)&&null!==e}function a(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,o,s,c,h;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(a(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(i(r))for(s=Array.prototype.slice.call(arguments,1),o=(h=r.slice()).length,c=0;c<o;c++)h[c].apply(this,s);return!0},r.prototype.addListener=function(e,t){var o;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned&&(o=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var r,a,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(r=this._events[e]).length,a=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){a=s;break}if(a<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){(t=e.exports=r(21)).Stream=t,t.Readable=t,t.Writable=r(16),t.Duplex=r(5),t.Transform=r(25),t.PassThrough=r(46)},function(e,t,r){(function(t,n,i){var a=r(9);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:a.nextTick;y.WritableState=m;var h=r(7);h.inherits=r(4);var u,l={deprecate:r(45)},f=r(22),p=r(10).Buffer,d=i.Uint8Array||function(){},g=r(23);function v(){}function m(e,t){s=s||r(5),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,h=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(h||0===h)?h:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(a.nextTick(i,n),a.nextTick(_,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),_(e,t))}(e,r,n,t,i);else{var o=k(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),n?c(w,e,r,o,i):w(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(5),!(u.call(y,this)||this instanceof s))return new y(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),_(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,c=!0;r;)i[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,u=r.encoding,l=r.callback;if(b(e,t,!1,t.objectMode?1:h.length,h,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),_(e,t)}))}function _(e,t){var r=k(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}h.inherits(y,f),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!u.call(this,e)||this===y&&e&&e._writableState instanceof m}})):u=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,p.isBuffer(n)||n instanceof d);return s&&!p.isBuffer(e)&&(e=function(e){return p.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=v),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(n,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=p.from(t,r)),t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,n,i,a);return c}(this,i,s,e,t,r)),o},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||x(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,_(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=g.destroy,y.prototype._undestroy=g.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(3),r(43).setImmediate,r(2))},function(e,t){e.exports={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},function(e,t,r){var n=r(36);e.exports=n},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e){var n=r(1).Buffer,i=r(39).Transform,a=r(51),o=r(27),s=r(26).ok,c=r(1).kMaxLength,h="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16384,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var u=Object.keys(a),l=0;l<u.length;l++){var f=u[l];f.match(/^Z/)&&Object.defineProperty(t,f,{enumerable:!0,value:a[f],writable:!1})}for(var p={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},d=Object.keys(p),g=0;g<d.length;g++){var v=d[g];p[p[v]]=v}function m(e,t,r){var i=[],a=0;function o(){for(var t;null!==(t=e.read());)i.push(t),a+=t.length;e.once("readable",o)}function s(){var t,o=null;a>=c?o=new RangeError(h):t=n.concat(i,a),i=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);E.call(this,e,a.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);E.call(this,e,a.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);E.call(this,e,a.GZIP)}function k(e){if(!(this instanceof k))return new k(e);E.call(this,e,a.GUNZIP)}function S(e){if(!(this instanceof S))return new S(e);E.call(this,e,a.DEFLATERAW)}function _(e){if(!(this instanceof _))return new _(e);E.call(this,e,a.INFLATERAW)}function C(e){if(!(this instanceof C))return new C(e);E.call(this,e,a.UNZIP)}function A(e){return e===a.Z_NO_FLUSH||e===a.Z_PARTIAL_FLUSH||e===a.Z_SYNC_FLUSH||e===a.Z_FULL_FLUSH||e===a.Z_FINISH||e===a.Z_BLOCK}function E(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!A(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!A(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||a.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:a.Z_FINISH,e.chunkSize&&(e.chunkSize<t.Z_MIN_CHUNK||e.chunkSize>t.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<t.Z_MIN_WINDOWBITS||e.windowBits>t.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<t.Z_MIN_LEVEL||e.level>t.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<t.Z_MIN_MEMLEVEL||e.memLevel>t.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){R(s),s._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],s.emit("error",n)};var c=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(c=e.level);var h=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(h=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,c,e.memLevel||t.Z_DEFAULT_MEMLEVEL,h,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=c,this._strategy=h,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function R(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function T(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(p),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=k,t.DeflateRaw=S,t.InflateRaw=_,t.Unzip=C,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new S(e)},t.createInflateRaw=function(e){return new _(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new k(e)},t.createUnzip=function(e){return new C(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),m(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),m(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),m(new S(t),e,r)},t.deflateRawSync=function(e,t){return y(new S(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),m(new C(t),e,r)},t.unzipSync=function(e,t){return y(new C(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),m(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),m(new k(t),e,r)},t.gunzipSync=function(e,t){return y(new k(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),m(new _(t),e,r)},t.inflateRawSync=function(e,t){return y(new _(t),e)},o.inherits(E,i),E.prototype.params=function(r,n,i){if(r<t.Z_MIN_LEVEL||r>t.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(n!=t.Z_FILTERED&&n!=t.Z_HUFFMAN_ONLY&&n!=t.Z_RLE&&n!=t.Z_FIXED&&n!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==r||this._strategy!==n){var o=this;this.flush(a.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,n),o._hadError||(o._level=r,o._strategy=n,i&&i())}))}else e.nextTick(i)},E.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},E.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},E.prototype.flush=function(t,r){var i=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=a.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return i.flush(t,r)})):(this._flushFlag=t,this.write(n.alloc(0),"",r))},E.prototype.close=function(t){R(this,t),e.nextTick(T,this)},E.prototype._transform=function(e,t,r){var i,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||n.isBuffer(e)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},E.prototype._processChunk=function(e,t,r){var i=e&&e.length,a=this._chunkSize-this._offset,o=0,u=this,l="function"==typeof r;if(!l){var f,p=[],d=0;this.on("error",(function(e){f=e})),s(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(t,e,o,i,this._buffer,this._offset,a)}while(!this._hadError&&y(g[0],g[1]));if(this._hadError)throw f;if(d>=c)throw R(this),new RangeError(h);var v=n.concat(p,d);return R(this),v}s(this._handle,"zlib binding closed");var m=this._handle.write(t,e,o,i,this._buffer,this._offset,a);function y(c,h){if(this&&(this.buffer=null,this.callback=null),!u._hadError){var f=a-h;if(s(f>=0,"have should not go down"),f>0){var g=u._buffer.slice(u._offset,u._offset+f);u._offset+=f,l?u.push(g):(p.push(g),d+=g.length)}if((0===h||u._offset>=u._chunkSize)&&(a=u._chunkSize,u._offset=0,u._buffer=n.allocUnsafe(u._chunkSize)),0===h){if(o+=i-c,i=c,!l)return!0;var v=u._handle.write(t,e,o,i,u._buffer,u._offset,u._chunkSize);return v.callback=y,void(v.buffer=e)}if(!l)return!1;r()}}m.buffer=e,m.callback=y},o.inherits(b,E),o.inherits(w,E),o.inherits(x,E),o.inherits(k,E),o.inherits(S,E),o.inherits(_,E),o.inherits(C,E)}).call(this,r(3))},function(e,t,r){(function(t,n){var i=r(9);e.exports=b;var a,o=r(19);b.ReadableState=y,r(14).EventEmitter;var s=function(e,t){return e.listeners(t).length},c=r(22),h=r(10).Buffer,u=t.Uint8Array||function(){},l=r(7);l.inherits=r(4);var f=r(40),p=void 0;p=f&&f.debuglog?f.debuglog("stream"):function(){};var d,g=r(41),v=r(23);l.inherits(b,c);var m=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(a=a||r(5));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=r(24).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(a=a||r(5),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function w(e,t,r,n,i){var a,o=e._readableState;return null===t?(o.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,_(e)}}(e,o)):(i||(a=function(e,t){var r,n;return n=t,h.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===h.prototype||(t=function(e){return h.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):A(e,o)):x(e,o,t,!1))):n||(o.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&_(e)),A(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=v.destroy,b.prototype._undestroy=v.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=h.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},b.prototype.unshift=function(e){return w(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return d||(d=r(24).StringDecoder),this._readableState.decoder=new d(e),this._readableState.encoding=e,this};var k=8388608;function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(C,e):C(e))}function C(e){p("emit readable"),e.emit("readable"),I(e)}function A(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(E,e,t))}function E(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(p("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){p("readable nexttick read 0"),e.read(0)}function T(e,t){t.reading||(p("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(p("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0==(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=h.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0==(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function M(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function O(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}b.prototype.read=function(e){p("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):_(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return p("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&p("length less than watermark",i=!0),t.ended||t.reading?p("reading or ended",i=!1):i&&(p("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,p("pipe count=%d opts=%j",a.pipesCount,t);var c=t&&!1===t.end||e===n.stdout||e===n.stderr?y:h;function h(){p("onend"),e.end()}a.endEmitted?i.nextTick(c):r.once("end",c),e.on("unpipe",(function t(n,i){p("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,p("cleanup"),e.removeListener("close",v),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",g),e.removeListener("unpipe",t),r.removeListener("end",h),r.removeListener("end",y),r.removeListener("data",d),l=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,I(e))}}(r);e.on("drain",u);var l=!1,f=!1;function d(t){p("ondata"),f=!1,!1!==e.write(t)||f||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==O(a.pipes,e))&&!l&&(p("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function g(t){p("onerror",t),y(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",m),y()}function m(){p("onfinish"),e.removeListener("close",v),y()}function y(){p("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",v),e.once("finish",m),e.emit("pipe",r),a.flowing||(p("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,r);return this}var o=O(t.pipes,e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},b.prototype.on=function(e,t){var r=c.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&_(this):i.nextTick(R,this))}return r},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(p("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(T,e,t))}(this,e)),this},b.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(p("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){p("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<m.length;a++)e.on(m[a],this.emit.bind(this,m[a]));return this._read=function(t){p("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=L}).call(this,r(2),r(3))},function(e,t,r){e.exports=r(14).EventEmitter},function(e,t,r){var n=r(9);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){var n=r(10).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=h,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=l,t=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function h(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){e.exports=o;var n=r(5),i=r(7);function a(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){c(e,t,r)})):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(4),i.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){(function(t){
  /*!
  	     * The buffer module from node.js, for the browser.
  	     *
  	     * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  	     * @license  MIT
  	     */
  function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=r(27),o=Object.prototype.hasOwnProperty,s=Array.prototype.slice,c="foo"===function(){}.name;function h(e){return Object.prototype.toString.call(e)}function u(e){return!i(e)&&"function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer)))}var l=e.exports=m,f=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(a.isFunction(e)){if(c)return e.name;var t=e.toString().match(f);return t&&t[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(c||!a.isFunction(e))return a.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function v(e,t,r,n,i){throw new l.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function m(e,t){e||v(e,!0,t,"==",l.ok)}function y(e,t,r,o){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==qr(e)||null!==t&&"object"==qr(t)){if(u(e)&&u(t)&&h(e)===h(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var c=(o=o||{actual:[],expected:[]}).actual.indexOf(e);return-1!==c&&c===o.expected.indexOf(t)||(o.actual.push(e),o.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=b(e),o=b(t);if(i&&!o||!i&&o)return!1;if(i)return y(e=s.call(e),t=s.call(t),r);var c,h,u=k(e),l=k(t);if(u.length!==l.length)return!1;for(u.sort(),l.sort(),h=u.length-1;h>=0;h--)if(u[h]!==l[h])return!1;for(h=u.length-1;h>=0;h--)if(!y(e[c=u[h]],t[c],r,n))return!1;return!0}(e,t,r,o))}return r?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!e&&i&&!r;if((!e&&a.isError(i)&&o&&w(i,r)||s)&&v(i,r,"Got unwanted exception"+n),e&&i&&r&&!w(i,r)||!e&&i)throw i}l.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g(this.actual),128)+" "+this.operator+" "+d(g(this.expected),128),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},a.inherits(l.AssertionError,Error),l.fail=v,l.ok=m,l.equal=function(e,t,r){e!=t&&v(e,t,r,"==",l.equal)},l.notEqual=function(e,t,r){e==t&&v(e,t,r,"!=",l.notEqual)},l.deepEqual=function(e,t,r){y(e,t,!1)||v(e,t,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(e,t,r){y(e,t,!0)||v(e,t,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(e,t,r){y(e,t,!1)&&v(e,t,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function e(t,r,n){y(t,r,!0)&&v(t,r,n,"notDeepStrictEqual",e)},l.strictEqual=function(e,t,r){e!==t&&v(e,t,r,"===",l.strictEqual)},l.notStrictEqual=function(e,t,r){e===t&&v(e,t,r,"!==",l.notStrictEqual)},l.throws=function(e,t,r){x(!0,e,t,r)},l.doesNotThrow=function(e,t,r){x(!1,e,t,r)},l.ifError=function(e){if(e)throw e};var k=Object.keys||function(e){var t=[];for(var r in e)o.call(e,r)&&t.push(r);return t}}).call(this,r(2))},function(e,t,r){(function(e,n){var i=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,o=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r<a;c=n[++r])g(c)||!w(c)?o+=" "+c:o+=" "+s(c);return o},t.deprecate=function(r,i){if(y(e.process))return function(){return t.deprecate(r,i).apply(this,arguments)};if(!0===n.noDeprecation)return r;var a=!1;return function(){if(!a){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),a=!0}return r.apply(this,arguments)}};var a,o={};function s(e,r){var n={seen:[],stylize:h};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),u(n,e,n.depth)}function c(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function h(e,t){return e}function u(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return m(i)||(i=u(e,i,n)),i}var a=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return v(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),k(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(r);if(0===o.length){if(S(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(k(r))return l(r)}var h,w="",_=!1,A=["{","}"];return p(r)&&(_=!0,A=["[","]"]),S(r)&&(w=" [Function"+(r.name?": "+r.name:"")+"]"),b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),k(r)&&(w=" "+l(r)),0!==o.length||_&&0!=r.length?n<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),h=_?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)C(t,String(o))?a.push(f(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(f(e,t,r,n,i,!0))})),a}(e,r,n,s,o):o.map((function(t){return f(e,r,n,s,t,_)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n  ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(h,w,A)):A[0]+w+A[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,i,a){var o,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),C(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=g(r)?u(e,c.value,null):u(e,c.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return"  "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return"   "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function v(e){return"number"==typeof e}function m(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===_(e)}function w(e){return"object"==qr(e)&&null!==e}function x(e){return w(e)&&"[object Date]"===_(e)}function k(e){return w(e)&&("[object Error]"===_(e)||e instanceof Error)}function S(e){return"function"==typeof e}function _(e){return Object.prototype.toString.call(e)}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.debuglog=function(e){if(y(a)&&(a=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var r=n.pid;o[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else o[e]=function(){};return o[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=m,t.isSymbol=function(e){return"symbol"==qr(e)},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=k,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==qr(e)||void 0===e},t.isBuffer=r(52),t.log=function(){},t.inherits=r(4),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,r(2),r(3))},function(e,t,r){e.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},function(e,t,r){var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,i){var a=n,o=i+r;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}},function(e,t,r){e.exports=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Wr(this,e),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}return Yr(e,[{key:"_set",value:function(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}},{key:"get",value:function(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){var t=this.oldCache.get(e);return this._set(e,t),t}}},{key:"set",value:function(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}},{key:"has",value:function(e){return this.cache.has(e)||this.oldCache.has(e)}},{key:"peek",value:function(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}},{key:"delete",value:function(e){var t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}},{key:"clear",value:function(){this.cache.clear(),this.oldCache.clear(),this._size=0}},{key:"keys",value:regeneratorRuntime.mark((function e(){var t,r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=fn(this),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return n=an(r.value,1),i=n[0],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:"values",value:regeneratorRuntime.mark((function e(){var t,r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=fn(this),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return n=an(r.value,2),i=n[1],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=fn(this.cache),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return n=r.value,e.next=7,n;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:i=fn(this.oldCache),e.prev=18,i.s();case 20:if((a=i.n()).done){e.next=29;break}if(o=a.value,s=an(o,1),c=s[0],e.t1=this.cache.has(c),e.t1){e.next=27;break}return e.next=27,o;case 27:e.next=20;break;case 29:e.next=34;break;case 31:e.prev=31,e.t2=e.catch(18),i.e(e.t2);case 34:return e.prev=34,i.f(),e.finish(34);case 37:case"end":return e.stop()}}),e,this,[[1,11,14,17],[18,31,34,37]])}))},{key:"size",get:function(){var e,t=0,r=fn(this.oldCache.keys());try{for(r.s();!(e=r.n()).done;){var n=e.value;this.cache.has(n)||t++}}catch(e){r.e(e)}finally{r.f()}return this._size+t}}]),e}()},function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var a={},o={};function s(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=o[e])?n:(r=h(e,(0|e)<0?-1:0,!0),i&&(o[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=a[e])?n:(r=h(e,e<0?-1:0,!1),i&&(a[e]=r),r)}function c(e,t){if(isNaN(e))return t?y:m;if(t){if(e<0)return y;if(e>=d)return S}else{if(e<=-g)return _;if(e+1>=g)return k}return e<0?c(-e,t).neg():h(e%p|0,e/p|0,t)}function h(e,t,r){return new n(e,t,r)}n.fromInt=s,n.fromNumber=c,n.fromBits=h;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return m;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=c(u(r,8)),a=m,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),h=parseInt(e.substring(o,o+s),r);if(s<8){var f=c(u(r,s));a=a.mul(f).add(c(h))}else a=(a=a.mul(i)).add(c(h))}return a.unsigned=t,a}function f(e,t){return"number"==typeof e?c(e,t):"string"==typeof e?l(e,t):h(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=l,n.fromValue=f;var p=4294967296,d=p*p,g=d/2,v=s(1<<24),m=s(0);n.ZERO=m;var y=s(0,!0);n.UZERO=y;var b=s(1);n.ONE=b;var w=s(1,!0);n.UONE=w;var x=s(-1);n.NEG_ONE=x;var k=h(-1,2147483647,!1);n.MAX_VALUE=k;var S=h(-1,-1,!0);n.MAX_UNSIGNED_VALUE=S;var _=h(0,-2147483648,!1);n.MIN_VALUE=_;var C=n.prototype;C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},C.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(_)){var t=c(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=c(u(e,6),this.unsigned),a=this,o="";;){var s=a.div(i),h=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if((a=s).isZero())return h+o;for(;h.length<6;)h="0"+h;o=""+h+o}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},C.isZero=function(){return 0===this.high&&0===this.low},C.eqz=C.isZero,C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return 1==(1&this.low)},C.isEven=function(){return 0==(1&this.low)},C.equals=function(e){return i(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},C.eq=C.equals,C.notEquals=function(e){return!this.eq(e)},C.neq=C.notEquals,C.ne=C.notEquals,C.lessThan=function(e){return this.comp(e)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(e){return this.comp(e)<=0},C.lte=C.lessThanOrEqual,C.le=C.lessThanOrEqual,C.greaterThan=function(e){return this.comp(e)>0},C.gt=C.greaterThan,C.greaterThanOrEqual=function(e){return this.comp(e)>=0},C.gte=C.greaterThanOrEqual,C.ge=C.greaterThanOrEqual,C.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(b)},C.neg=C.negate,C.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,u=0,l=0,p=0,d=0;return p+=(d+=a+(65535&e.low))>>>16,l+=(p+=n+c)>>>16,u+=(l+=r+s)>>>16,u+=t+o,h((p&=65535)<<16|(d&=65535),(u&=65535)<<16|(l&=65535),this.unsigned)},C.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},C.sub=C.subtract,C.multiply=function(e){if(this.isZero())return m;if(i(e)||(e=f(e)),r)return h(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return m;if(this.eq(_))return e.isOdd()?_:m;if(e.eq(_))return this.isOdd()?_:m;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,a=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,l=e.low>>>16,p=65535&e.low,d=0,g=0,y=0,b=0;return y+=(b+=o*p)>>>16,g+=(y+=a*p)>>>16,y&=65535,g+=(y+=o*l)>>>16,d+=(g+=n*p)>>>16,g&=65535,d+=(g+=a*l)>>>16,g&=65535,d+=(g+=o*u)>>>16,d+=t*p+n*l+a*u+o*s,h((y&=65535)<<16|(b&=65535),(d&=65535)<<16|(g&=65535),this.unsigned)},C.mul=C.multiply,C.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error("division by zero");var t,n,a;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?h((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:m;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return w;a=y}else{if(this.eq(_))return e.eq(b)||e.eq(x)?_:e.eq(_)?b:(t=this.shr(1).div(e).shl(1)).eq(m)?e.isNegative()?b:x:(n=this.sub(e.mul(t)),a=t.add(n.div(e)));if(e.eq(_))return this.unsigned?y:m;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=m}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),s=o<=48?1:u(2,o-48),l=c(t),p=l.mul(e);p.isNegative()||p.gt(n);)p=(l=c(t-=s,this.unsigned)).mul(e);l.isZero()&&(l=b),a=a.add(l),n=n.sub(p)}return a},C.div=C.divide,C.modulo=function(e){return i(e)||(e=f(e)),r?h((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},C.mod=C.modulo,C.rem=C.modulo,C.not=function(){return h(~this.low,~this.high,this.unsigned)},C.and=function(e){return i(e)||(e=f(e)),h(this.low&e.low,this.high&e.high,this.unsigned)},C.or=function(e){return i(e)||(e=f(e)),h(this.low|e.low,this.high|e.high,this.unsigned)},C.xor=function(e){return i(e)||(e=f(e)),h(this.low^e.low,this.high^e.high,this.unsigned)},C.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?h(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):h(0,this.low<<e-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?h(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):h(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?h(this.low>>>e|t<<32-e,t>>>e,this.unsigned):h(32===e?t:t>>>e-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.shr_u=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?h(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:h(this.low,this.high,!0)},C.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},C.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t){var r={utf8:{stringToBytes:function(e){return r.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(r.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=r},function(e,t,r){var n=r(87),i=r(94),a=r(97);function o(e){var t=n.parse(e),r=t.protocol,o=t.pathname;return"file:"===r?new a(unescape(o)):new i(e)}e.exports={LocalFile:a,RemoteFile:i,fromUrl:o,open:function(e,t,r){if(r)return r;if(e)return o(e);if(t)return new a(t);throw new Error("no url, path, or filehandle provided, cannot open")}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__";function i(e){if("function"!=typeof e)throw new TypeError("Argument to promisify must be a function");var t=e[n],r=i.Promise||Promise;if("function"!=typeof r)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var n=this,i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return new r((function(r,i){a.push((function(e){if(e)return i(e);for(var n=arguments.length,a=Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];if(1===a.length||!t)return r(a[0]);var s={};a.forEach((function(e,r){var n=t[r];n&&(s[n]=e)})),r(s)})),e.call.apply(e,[n].concat(a))}))}}i.argumentNames=n,i.Promise=void 0,t.promisify=i},function(e,t,r){var n=r(18),i=r(99),a=r(100);e.exports={CramFile:n,IndexedCramFile:i,CraiIndex:a}},function(e,t,r){(function(t){var n=r(20),i=r(61),a=r(30),o=r(0),s=o.CramUnimplementedError,c=o.CramMalformedError,h=r(62),u=r(66),l=u.cramFileDefinition,f=u.getSectionParsers,p=r(71),d=r(33).open,g=r(8),v=g.parseItem,m=g.tinyMemoize,y=r(98).parseHeaderText,b=function(){function e(t){Wr(this,e),this.file=d(t.url,t.path,t.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=t.seqFetch,this.options={checkSequenceMD5:!1!==t.checkSequenceMD5,cacheSize:void 0!==t.cacheSize?t.cacheSize:2e4},this.featureCache=new a({maxSize:this.options.cacheSize})}var r,o,u,g,m,b,w,x,k;return Yr(e,[{key:"toString",value:function(){return this.file.filename?this.file.filename:this.file.url?this.file.url:"(cram file)"}},{key:"read",value:function(e,t,r,n){return this.file.read(e,t,r,n)}},{key:"stat",value:function(){return this.file.stat()}},{key:"getDefinition",value:(k=Vr(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.allocUnsafe(l.maxLength),e.next=3,this.file.read(r,0,l.maxLength,0);case 3:if(2===(n=l.parser.parse(r).result).majorVersion||3===n.majorVersion){e.next=6;break}throw new s("CRAM version ".concat(n.majorVersion," not supported"));case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(){return k.apply(this,arguments)})},{key:"getSamHeader",value:(x=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getContainerById(0);case 2:if(t=e.sent){e.next=5;break}throw new c("file contains no containers");case 5:return e.next=7,t.getFirstBlock();case 7:return r=e.sent,n=r.content,i=n.readInt32LE(0),a=n.toString("utf8",4,4+i),e.abrupt("return",y(a));case 12:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"getSectionParsers",value:(w=Vr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getDefinition();case 2:return t=e.sent,r=t.majorVersion,e.abrupt("return",f(r));case 5:case"end":return e.stop()}}),e,this)}))),function(){return w.apply(this,arguments)})},{key:"getContainerById",value:(b=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,h,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSectionParsers();case 2:return r=e.sent,n=r.cramFileDefinition.maxLength,e.next=6,this.file.stat();case 6:i=e.sent,a=i.size,o=r.cramContainerHeader1,h=0;case 10:if(!(h<=t)){e.next=35;break}if(!(n+o.maxLength+8>=a)){e.next=13;break}return e.abrupt("return");case 13:return s=this.getContainerAtPosition(n),e.next=16,s.getHeader();case 16:if(u=e.sent){e.next=19;break}throw new c("container ".concat(t," not found in file"));case 19:if(0!==h){e.next=31;break}n=u._endPosition,l=0;case 22:if(!(l<u.numBlocks)){e.next=29;break}return e.next=25,this.readBlock(n);case 25:n=e.sent._endPosition;case 26:l+=1,e.next=22;break;case 29:e.next=32;break;case 31:n+=u._size+u.length;case 32:h+=1,e.next=10;break;case 35:return e.abrupt("return",s);case 36:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"checkCrc32",value:(m=Vr(regeneratorRuntime.mark((function e(r,n,a,o){var s,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=t.allocUnsafe(n),e.next=3,this.file.read(s,0,n,r);case 3:if((h=i.unsigned(s))===a){e.next=6;break}throw new c("crc mismatch in ".concat(o,": recorded CRC32 = ").concat(a,", but calculated CRC32 = ").concat(h));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return m.apply(this,arguments)})},{key:"containerCount",value:(g=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSectionParsers();case 2:return t=e.sent,e.next=5,this.file.stat();case 5:r=e.sent,n=r.size,i=t.cramContainerHeader1,a=0,o=t.cramFileDefinition.maxLength;case 9:if(!(o+i.maxLength+8<n)){e.next=31;break}return e.next=12,this.getContainerAtPosition(o).getHeader();case 12:if(s=e.sent){e.next=15;break}return e.abrupt("break",31);case 15:if(0!==a){e.next=27;break}o=s._endPosition,c=0;case 18:if(!(c<s.numBlocks)){e.next=25;break}return e.next=21,this.readBlock(o);case 21:o=e.sent._endPosition;case 22:c+=1,e.next=18;break;case 25:e.next=28;break;case 27:o+=s._size+s.length;case 28:a+=1;case 29:e.next=9;break;case 31:return e.abrupt("return",a);case 32:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"getContainerAtPosition",value:function(e){return new p(this,e)}},{key:"readBlockHeader",value:(u=Vr(regeneratorRuntime.mark((function e(r){var n,i,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getSectionParsers();case 2:return n=e.sent,i=n.cramBlockHeader,e.next=6,this.file.stat();case 6:if(a=e.sent,o=a.size,!(r+i.maxLength>=o)){e.next=10;break}return e.abrupt("return");case 10:return s=t.allocUnsafe(i.maxLength),e.next=13,this.file.read(s,0,i.maxLength,r);case 13:return e.abrupt("return",v(s,i.parser,0,r));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"_parseSection",value:(o=Vr(regeneratorRuntime.mark((function e(r,n){var i,a,o,s,h,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>2&&void 0!==l[2]?l[2]:r.maxLength,!(a=l.length>3?l[3]:void 0)){e.next=6;break}o=a,e.next=15;break;case 6:return e.next=8,this.file.stat();case 8:if(s=e.sent,h=s.size,!(n+i>=h)){e.next=12;break}return e.abrupt("return");case 12:return o=t.allocUnsafe(i),e.next=15,this.file.read(o,0,i,n);case 15:if((u=v(o,r.parser,0,n))._size===i){e.next=18;break}throw new c("section read error: requested size ".concat(i," does not equal parsed size ").concat(u._size));case 18:return e.abrupt("return",u);case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"_uncompress",value:function(e,t,r){if("gzip"===e)n.gunzipSync(t).copy(r);else{if("rans"!==e)throw new s("".concat(e," decompression not yet implemented"));h.uncompress(t,r)}}},{key:"readBlock",value:(r=Vr(regeneratorRuntime.mark((function e(r){var n,i,a,o,s,c,h,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getDefinition();case 2:return n=e.sent,i=n.majorVersion,e.next=6,this.getSectionParsers();case 6:return a=e.sent,e.next=9,this.readBlockHeader(r);case 9:if(o=e.sent,s=o._endPosition,o.contentPosition=o._endPosition,c=t.allocUnsafe(o.uncompressedSize),"raw"===o.compressionMethod){e.next=20;break}return h=t.allocUnsafe(o.compressedSize),e.next=17,this.read(h,0,o.compressedSize,s);case 17:this._uncompress(o.compressionMethod,h,c),e.next=22;break;case 20:return e.next=22,this.read(c,0,o.uncompressedSize,s);case 22:if(o.content=c,!(i>=3)){e.next=35;break}return e.next=25,this._parseSection(a.cramBlockCrc32,s+o.compressedSize);case 25:if(u=e.sent,o.crc32=u.crc32,e.t0=this.validateChecksums,!e.t0){e.next=31;break}return e.next=31,this.checkCrc32(r,o._size+o.compressedSize,o.crc32,"block data");case 31:o._endPosition=u._endPosition,o._size=o.compressedSize+a.cramBlockCrc32.maxLength,e.next=36;break;case 35:o._endPosition=s+o.compressedSize,o._size=o.compressedSize;case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]),e}();"getDefinition getSectionParsers getSamHeader".split(" ").forEach((function(e){return m(b,e)})),e.exports=b}).call(this,r(1).Buffer)},function(e,t,r){t.byteLength=function(e){var t=h(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=h(e),n=r[0],o=r[1],s=new a(function(e,t,r){return 3*(t+r)/4-r}(0,n,o)),c=0,u=o>0?n-4:n,l=0;l<u;l+=4)t=i[e.charCodeAt(l)]<<18|i[e.charCodeAt(l+1)]<<12|i[e.charCodeAt(l+2)]<<6|i[e.charCodeAt(l+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=255&t;return 2===o&&(t=i[e.charCodeAt(l)]<<2|i[e.charCodeAt(l+1)]>>4,s[c++]=255&t),1===o&&(t=i[e.charCodeAt(l)]<<10|i[e.charCodeAt(l+1)]<<4|i[e.charCodeAt(l+2)]>>2,s[c++]=t>>8&255,s[c++]=255&t),s},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;o<s;o+=16383)a.push(u(e,o,o+16383>s?s:o+16383));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s<c;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function h(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var i,a,o=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<<s)-1,h=c>>1,u=-7,l=r?i-1:0,f=r?-1:1,p=e[t+l];for(l+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+l],l+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+l],l+=f,u-=8);if(0===a)a=1-h;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=h}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,c,h=8*a-i-1,u=(1<<h)-1,l=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=u?(s=0,o=u):o+l>=1?(s=(t*c-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,h+=i;h>0;e[r+p]=255&o,p+=d,o/=256,h-=8);e[r+p-d]|=128*g}},function(e,t,r){e.exports=i;var n=r(14).EventEmitter;function i(){n.call(this)}r(4)(i,n),i.Readable=r(15),i.Writable=r(47),i.Duplex=r(48),i.Transform=r(49),i.PassThrough=r(50),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",c));var o=!1;function s(){o||(o=!0,e.end())}function c(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function h(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",h),e.removeListener("error",h),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",h),e.on("error",h),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){var n=r(10).Buffer,i=r(42);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i=n.allocUnsafe(e>>>0),a=this.head,o=0;a;)t=i,r=o,a.data.copy(t,r),o+=a.data.length,a=a.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(44),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(2))},function(e,t,r){(function(e,t){!function(e,r){if(!e.setImmediate){var n,i,a,o,s,c=1,h={},u=!1,l=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&d(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){d(e.data)},n=function(e){a.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(d,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return h[c]=i,n(c),c++},f.clearImmediate=p}function p(e){delete h[e]}function d(e){if(u)setTimeout(d,0,e);else{var t=h[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{p(e),u=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(2),r(3))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(2))},function(e,t,r){e.exports=a;var n=r(25),i=r(7);function a(e){if(!(this instanceof a))return new a(e);n.call(this,e)}i.inherits=r(4),i.inherits(a,n),a.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(16)},function(e,t,r){e.exports=r(5)},function(e,t,r){e.exports=r(15).Transform},function(e,t,r){e.exports=r(15).PassThrough},function(e,t,r){(function(e,n){var i=r(26),a=r(53),o=r(54),s=r(57),c=r(60);for(var h in c)t[h]=c[h];function u(e){if("number"!=typeof e||e<t.DEFLATE||e>t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,u.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},u.prototype.write=function(e,t,r,n,i,a,o){return this._write(!0,e,t,r,n,i,a,o)},u.prototype.writeSync=function(e,t,r,n,i,a,o){return this._write(!1,e,t,r,n,i,a,o)},u.prototype._write=function(r,a,o,s,c,h,u,l){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==t.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===a,"must provide flush value"),this.write_in_progress=!0,a!==t.Z_NO_FLUSH&&a!==t.Z_PARTIAL_FLUSH&&a!==t.Z_SYNC_FLUSH&&a!==t.Z_FULL_FLUSH&&a!==t.Z_FINISH&&a!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),c=0,s=0),this.strm.avail_in=c,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=l,this.strm.output=h,this.strm.next_out=u,this.flush=a,!r)return this._process(),this._checkError()?this._afterSync():void 0;var f=this;return n.nextTick((function(){f._process(),f._after()})),this},u.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},u.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},u.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},u.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},u.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},u.prototype.init=function(e,r,n,a,o){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(r>=-1&&r<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(a===t.Z_FILTERED||a===t.Z_HUFFMAN_ONLY||a===t.Z_RLE||a===t.Z_FIXED||a===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,a,o),this._setDictionary()},u.prototype.params=function(){throw new Error("deflateParams Not supported")},u.prototype.reset=function(){this._reset(),this._setDictionary()},u.prototype._init=function(e,r,n,i,c){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=c,this.write_in_progress=!1,this.init_done=!0},u.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},u.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=u}).call(this,r(1).Buffer,r(3))},function(e,t){e.exports=function(e){return e&&"object"==qr(e)&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,r){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,r){var n,i=r(11),a=r(55),o=r(28),s=r(29),c=r(56),h=-2,u=258,l=262,f=103,p=113,d=666;function g(e,t){return e.msg=c[t],t}function v(e){return(e<<1)-(e>4?9:0)}function m(e){for(var t=e.length;--t>=0;)e[t]=0}function y(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function b(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,y(e.strm)}function w(e,t){e.pending_buf[e.pending++]=t}function x(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function k(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-l?e.strstart-(e.w_size-l):0,h=e.window,f=e.w_mask,p=e.prev,d=e.strstart+u,g=h[a+o-1],v=h[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(h[(r=t)+o]===v&&h[r+o-1]===g&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do{}while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&a<d);if(n=u-(d-a),a=d-u,n>o){if(e.match_start=t,o=n,n>=s)break;g=h[a+o-1],v=h[a+o]}}}while((t=p[t&f])>c&&0!=--i);return o<=e.lookahead?o:e.lookahead}function S(e){var t,r,n,a,c,h,u,f,p,d,g=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=g+(g-l)){i.arraySet(e.window,e.window,g,g,0),e.match_start-=g,e.strstart-=g,e.block_start-=g,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=g?n-g:0}while(--r);t=r=g;do{n=e.prev[--t],e.prev[t]=n>=g?n-g:0}while(--r);a+=g}if(0===e.strm.avail_in)break;if(h=e.strm,u=e.window,f=e.strstart+e.lookahead,p=a,d=void 0,(d=h.avail_in)>p&&(d=p),r=0===d?0:(h.avail_in-=d,i.arraySet(u,h.input,h.next_in,d,f),1===h.state.wrap?h.adler=o(h.adler,u,d,f):2===h.state.wrap&&(h.adler=s(h.adler,u,d,f)),h.next_in+=d,h.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+3-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<l&&0!==e.strm.avail_in)}function _(e,t){for(var r,n;;){if(e.lookahead<l){if(S(e),e.lookahead<l&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-l&&(e.match_length=k(e,r)),e.match_length>=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function C(e,t){for(var r,n,i;;){if(e.lookahead<l){if(S(e),e.lookahead<l&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-l&&(e.match_length=k(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(b(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=a._tr_tally(e,0,e.window[e.strstart-1]))&&b(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function A(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function E(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(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),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),m(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 R(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:p,e.adler=2===t.wrap?0:1,t.last_flush=0,a._tr_init(t),0):g(e,h)}function T(e){var t,r=R(e);return 0===r&&((t=e.state).window_size=2*t.w_size,m(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function I(e,t,r,n,a,o){if(!e)return h;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return g(e,h);8===n&&(n=9);var c=new E;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new i.Buf8(2*c.w_size),c.head=new i.Buf16(c.hash_size),c.prev=new i.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new i.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=r,T(e)}n=[new A(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(S(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,b(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-l&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(b(e,!1),e.strm.avail_out),1)})),new A(4,4,8,4,_),new A(4,5,16,8,_),new A(4,6,32,32,_),new A(4,4,16,16,C),new A(8,16,32,32,C),new A(8,16,128,128,C),new A(8,32,128,256,C),new A(32,128,258,1024,C),new A(32,258,258,4096,C)],t.deflateInit=function(e,t){return I(e,t,8,15,8,0)},t.deflateInit2=I,t.deflateReset=T,t.deflateResetKeep=R,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,0):h},t.deflate=function(e,t){var r,i,o,c;if(!e||!e.state||t>5||t<0)return e?g(e,h):h;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===d&&4!==t)return g(e,0===e.avail_out?-5:h);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,w(i,31),w(i,139),w(i,8),i.gzhead?(w(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)),w(i,255&i.gzhead.time),w(i,i.gzhead.time>>8&255),w(i,i.gzhead.time>>16&255),w(i,i.gzhead.time>>24&255),w(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),w(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(w(i,255&i.gzhead.extra.length),w(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(w(i,0),w(i,0),w(i,0),w(i,0),w(i,0),w(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),w(i,3),i.status=p);else{var l=8+(i.w_bits-8<<4)<<8;l|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=p,x(i,l),0!==i.strstart&&(x(i,e.adler>>>16),x(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending!==i.pending_buf_size));)w(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,w(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===c&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),y(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,w(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===c&&(i.status=f)}else i.status=f;if(i.status===f&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&y(e),i.pending+2<=i.pending_buf_size&&(w(i,255&e.adler),w(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(y(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&v(t)<=v(r)&&4!==t)return g(e,-5);if(i.status===d&&0!==e.avail_in)return g(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==d){var k=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(S(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=u){if(S(e),e.lookahead<=u&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+u;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=u-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==k&&4!==k||(i.status=d),1===k||3===k)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===k&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),y(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(w(i,255&e.adler),w(i,e.adler>>8&255),w(i,e.adler>>16&255),w(i,e.adler>>24&255),w(i,255&e.total_in),w(i,e.total_in>>8&255),w(i,e.total_in>>16&255),w(i,e.total_in>>24&255)):(x(i,e.adler>>>16),x(i,65535&e.adler)),y(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==f&&t!==p&&t!==d?g(e,h):(e.state=null,t===p?g(e,-3):0):h},t.deflateSetDictionary=function(e,t){var r,n,a,s,c,u,l,f,p=t.length;if(!e||!e.state)return h;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return h;for(1===s&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,t,p-r.w_size,r.w_size,0),t=f,p=r.w_size),c=e.avail_in,u=e.next_in,l=e.input,e.avail_in=p,e.next_in=0,e.input=t,S(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--a);r.strstart=n,r.lookahead=2,S(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=u,e.input=l,e.avail_in=c,r.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},function(e,t,r){var n=r(11);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=256,o=286,s=30,c=15,h=[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],u=[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],l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var d=new Array(60);i(d);var g=new Array(512);i(g);var v=new Array(256);i(v);var m=new Array(29);i(m);var y,b,w,x=new Array(s);function k(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function S(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function _(e){return e<256?g[e]:g[256+(e>>>7)]}function C(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function A(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,C(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function E(e,t,r){A(e,r[2*t],r[2*t+1])}function R(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function T(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=c;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=R(a[s]++,s))}}function I(e){var t;for(t=0;t<o;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function L(e){e.bi_valid>8?C(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function M(e,t,r,n){var i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function P(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&M(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!M(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function O(e,t,r){var n,i,o,s,c=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],i=e.pending_buf[e.l_buf+c],c++,0===n?E(e,i,t):(E(e,(o=v[i])+a+1,t),0!==(s=h[o])&&A(e,i-=m[o],s),E(e,o=_(--n),r),0!==(s=u[o])&&A(e,n-=x[o],s))}while(c<e.last_lit);E(e,256,t)}function F(e,t){var r,n,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,h=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<h;r++)0!==a[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)P(e,a,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],P(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,P(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,g=t.stat_desc.max_length,v=0;for(a=0;a<=c;a++)e.bl_count[a]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=h[2*h[2*(n=e.heap[r])+1]+1]+1)>g&&(a=g,v++),h[2*n+1]=a,n>u||(e.bl_count[a]++,o=0,n>=d&&(o=p[n-d]),s=h[2*n],e.opt_len+=s*(a+o),f&&(e.static_len+=s*(l[2*n+1]+o)));if(0!==v){do{for(a=g-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[g]--,v-=2}while(v>0);for(a=g;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>u||(h[2*i+1]!==a&&(e.opt_len+=(a-h[2*i+1])*h[2*i],h[2*i+1]=a),n--)}}(e,t),T(a,u,e.bl_count)}function N(e,t,r){var n,i,a=-1,o=t[1],s=0,c=7,h=4;for(0===o&&(c=138,h=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s<c&&i===o||(s<h?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=i,0===o?(c=138,h=3):i===o?(c=6,h=3):(c=7,h=4))}function D(e,t,r){var n,i,a=-1,o=t[1],s=0,c=7,h=4;for(0===o&&(c=138,h=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++s<c&&i===o)){if(s<h)do{E(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==a&&(E(e,i,e.bl_tree),s--),E(e,16,e.bl_tree),A(e,s-3,2)):s<=10?(E(e,17,e.bl_tree),A(e,s-3,3)):(E(e,18,e.bl_tree),A(e,s-11,7));s=0,a=i,0===o?(c=138,h=3):i===o?(c=6,h=3):(c=7,h=4)}}i(x);var B=!1;function z(e,t,r,i){A(e,0+(i?1:0),3),function(e,t,r,i){L(e),C(e,r),C(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}t._tr_init=function(e){B||(function(){var e,t,r,n,i,a=new Array(16);for(r=0,n=0;n<28;n++)for(m[n]=r,e=0;e<1<<h[n];e++)v[r++]=n;for(v[r-1]=n,i=0,n=0;n<16;n++)for(x[n]=i,e=0;e<1<<u[n];e++)g[i++]=n;for(i>>=7;n<s;n++)for(x[n]=i<<7,e=0;e<1<<u[n]-7;e++)g[256+i++]=n;for(t=0;t<=c;t++)a[t]=0;for(e=0;e<=143;)p[2*e+1]=8,e++,a[8]++;for(;e<=255;)p[2*e+1]=9,e++,a[9]++;for(;e<=279;)p[2*e+1]=7,e++,a[7]++;for(;e<=287;)p[2*e+1]=8,e++,a[8]++;for(T(p,287,a),e=0;e<s;e++)d[2*e+1]=5,d[2*e]=R(e,5);y=new k(p,h,257,o,c),b=new k(d,u,0,s,c),w=new k(new Array(0),l,0,19,7)}(),B=!0),e.l_desc=new S(e.dyn_ltree,y),e.d_desc=new S(e.dyn_dtree,b),e.bl_desc=new S(e.bl_tree,w),e.bi_buf=0,e.bi_valid=0,I(e)},t._tr_stored_block=z,t._tr_flush_block=function(e,t,r,n){var i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<a;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),F(e,e.l_desc),F(e,e.d_desc),s=function(e){var t;for(N(e,e.dyn_ltree,e.l_desc.max_code),N(e,e.dyn_dtree,e.d_desc.max_code),F(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*f[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?z(e,t,r,n):4===e.strategy||o===i?(A(e,2+(n?1:0),3),O(e,p,d)):(A(e,4+(n?1:0),3),function(e,t,r,n){var i;for(A(e,t-257,5),A(e,r-1,5),A(e,n-4,4),i=0;i<n;i++)A(e,e.bl_tree[2*f[i]+1],3);D(e,e.dyn_ltree,t-1),D(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),O(e,e.dyn_ltree,e.dyn_dtree)),I(e),n&&L(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(v[r]+a+1)]++,e.dyn_dtree[2*_(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){A(e,2,3),E(e,256,p),function(e){16===e.bi_valid?(C(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,r){var n=r(11),i=r(28),a=r(29),o=r(58),s=r(59),c=-2,h=12,u=30;function l(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):c}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):c}function g(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?c:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):c}function v(e,t){var r,n;return e?(n=new f,e.state=n,n.window=null,0!==(r=g(e,t))&&(e.state=null),r):c}var m,y,b=!0;function w(e){if(b){var t;for(m=new n.Buf32(512),y=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,y,0,e.work,{bits:5}),b=!1}e.lencode=m,e.lenbits=9,e.distcode=y,e.distbits=5}function x(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),i>=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}t.inflateReset=d,t.inflateReset2=g,t.inflateResetKeep=p,t.inflateInit=function(e){return v(e,15)},t.inflateInit2=v,t.inflate=function(e,t){var r,f,p,d,g,v,m,y,b,k,S,_,C,A,E,R,T,I,L,M,P,O,F,N,D=0,B=new n.Buf8(4),z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;(r=e.state).mode===h&&(r.mode=13),g=e.next_out,p=e.output,m=e.avail_out,d=e.next_in,f=e.input,v=e.avail_in,y=r.hold,b=r.bits,k=v,S=m,O=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(2&r.wrap&&35615===y){r.check=0,B[0]=255&y,B[1]=y>>>8&255,r.check=a(r.check,B,2,0),y=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",r.mode=u;break}if(8!=(15&y)){e.msg="unknown compression method",r.mode=u;break}if(b-=4,P=8+(15&(y>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){e.msg="invalid window size",r.mode=u;break}r.dmax=1<<P,e.adler=r.check=1,r.mode=512&y?10:h,y=0,b=0;break;case 2:for(;b<16;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(r.flags=y,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=u;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=u;break}r.head&&(r.head.text=y>>8&1),512&r.flags&&(B[0]=255&y,B[1]=y>>>8&255,r.check=a(r.check,B,2,0)),y=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}r.head&&(r.head.time=y),512&r.flags&&(B[0]=255&y,B[1]=y>>>8&255,B[2]=y>>>16&255,B[3]=y>>>24&255,r.check=a(r.check,B,4,0)),y=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(B[0]=255&y,B[1]=y>>>8&255,r.check=a(r.check,B,2,0)),y=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(B[0]=255&y,B[1]=y>>>8&255,r.check=a(r.check,B,2,0)),y=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((_=r.length)>v&&(_=v),_&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,f,d,_,P)),512&r.flags&&(r.check=a(r.check,f,_,d)),v-=_,d+=_,r.length-=_),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;_=0;do{P=f[d+_++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P))}while(P&&_<v);if(512&r.flags&&(r.check=a(r.check,f,_,d)),v-=_,d+=_,P)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;_=0;do{P=f[d+_++],r.head&&P&&r.length<65536&&(r.head.comment+=String.fromCharCode(P))}while(P&&_<v);if(512&r.flags&&(r.check=a(r.check,f,_,d)),v-=_,d+=_,P)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(y!==(65535&r.check)){e.msg="header crc mismatch",r.mode=u;break}y=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=h;break;case 10:for(;b<32;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}e.adler=r.check=l(y),y=0,b=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=g,e.avail_out=m,e.next_in=d,e.avail_in=v,r.hold=y,r.bits=b,2;e.adler=r.check=1,r.mode=h;case h:if(5===t||6===t)break e;case 13:if(r.last){y>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}switch(r.last=1&y,b-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===t){y>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=u}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if((65535&y)!=(y>>>16^65535)){e.msg="invalid stored block lengths",r.mode=u;break}if(r.length=65535&y,y=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(_=r.length){if(_>v&&(_=v),_>m&&(_=m),0===_)break e;n.arraySet(p,f,d,_,g),v-=_,d+=_,m-=_,g+=_,r.length-=_;break}r.mode=h;break;case 17:for(;b<14;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(r.nlen=257+(31&y),y>>>=5,b-=5,r.ndist=1+(31&y),y>>>=5,b-=5,r.ncode=4+(15&y),y>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=u;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}r.lens[z[r.have++]]=7&y,y>>>=3,b-=3}for(;r.have<19;)r.lens[z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},O=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,O){e.msg="invalid code lengths set",r.mode=u;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;R=(D=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,T=65535&D,!((E=D>>>24)<=b);){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(T<16)y>>>=E,b-=E,r.lens[r.have++]=T;else{if(16===T){for(N=E+2;b<N;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(y>>>=E,b-=E,0===r.have){e.msg="invalid bit length repeat",r.mode=u;break}P=r.lens[r.have-1],_=3+(3&y),y>>>=2,b-=2}else if(17===T){for(N=E+3;b<N;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}b-=E,P=0,_=3+(7&(y>>>=E)),y>>>=3,b-=3}else{for(N=E+7;b<N;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}b-=E,P=0,_=11+(127&(y>>>=E)),y>>>=7,b-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=u;break}for(;_--;)r.lens[r.have++]=P}}if(r.mode===u)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=u;break}if(r.lenbits=9,F={bits:r.lenbits},O=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,O){e.msg="invalid literal/lengths set",r.mode=u;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},O=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,O){e.msg="invalid distances set",r.mode=u;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&m>=258){e.next_out=g,e.avail_out=m,e.next_in=d,e.avail_in=v,r.hold=y,r.bits=b,o(e,S),g=e.next_out,p=e.output,m=e.avail_out,d=e.next_in,f=e.input,v=e.avail_in,y=r.hold,b=r.bits,r.mode===h&&(r.back=-1);break}for(r.back=0;R=(D=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,T=65535&D,!((E=D>>>24)<=b);){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(R&&0==(240&R)){for(I=E,L=R,M=T;R=(D=r.lencode[M+((y&(1<<I+L)-1)>>I)])>>>16&255,T=65535&D,!(I+(E=D>>>24)<=b);){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}y>>>=I,b-=I,r.back+=I}if(y>>>=E,b-=E,r.back+=E,r.length=T,0===R){r.mode=26;break}if(32&R){r.back=-1,r.mode=h;break}if(64&R){e.msg="invalid literal/length code",r.mode=u;break}r.extra=15&R,r.mode=22;case 22:if(r.extra){for(N=r.extra;b<N;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}r.length+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;R=(D=r.distcode[y&(1<<r.distbits)-1])>>>16&255,T=65535&D,!((E=D>>>24)<=b);){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(0==(240&R)){for(I=E,L=R,M=T;R=(D=r.distcode[M+((y&(1<<I+L)-1)>>I)])>>>16&255,T=65535&D,!(I+(E=D>>>24)<=b);){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}y>>>=I,b-=I,r.back+=I}if(y>>>=E,b-=E,r.back+=E,64&R){e.msg="invalid distance code",r.mode=u;break}r.offset=T,r.extra=15&R,r.mode=24;case 24:if(r.extra){for(N=r.extra;b<N;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}r.offset+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=u;break}r.mode=25;case 25:if(0===m)break e;if(_=S-m,r.offset>_){if((_=r.offset-_)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=u;break}_>r.wnext?(_-=r.wnext,C=r.wsize-_):C=r.wnext-_,_>r.length&&(_=r.length),A=r.window}else A=p,C=g-r.offset,_=r.length;_>m&&(_=m),m-=_,r.length-=_;do{p[g++]=A[C++]}while(--_);0===r.length&&(r.mode=21);break;case 26:if(0===m)break e;p[g++]=r.length,m--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===v)break e;v--,y|=f[d++]<<b,b+=8}if(S-=m,e.total_out+=S,r.total+=S,S&&(e.adler=r.check=r.flags?a(r.check,p,S,g-S):i(r.check,p,S,g-S)),S=m,(r.flags?y:l(y))!==r.check){e.msg="incorrect data check",r.mode=u;break}y=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===v)break e;v--,y+=f[d++]<<b,b+=8}if(y!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=u;break}y=0,b=0}r.mode=29;case 29:O=1;break e;case u:O=-3;break e;case 31:return-4;case 32:default:return c}return e.next_out=g,e.avail_out=m,e.next_in=d,e.avail_in=v,r.hold=y,r.bits=b,(r.wsize||S!==e.avail_out&&r.mode<u&&(r.mode<27||4!==t))&&x(e,e.output,e.next_out,S-e.avail_out)?(r.mode=31,-4):(k-=e.avail_in,S-=e.avail_out,e.total_in+=k,e.total_out+=S,r.total+=S,r.wrap&&S&&(e.adler=r.check=r.flags?a(r.check,p,S,e.next_out-S):i(r.check,p,S,e.next_out-S)),e.data_type=r.bits+(r.last?64:0)+(r.mode===h?128:0)+(20===r.mode||15===r.mode?256:0),(0===k&&0===S||4===t)&&0===O&&(O=-5),O)},t.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?c:(r.head=t,t.done=!1,0):c},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?c:11===r.mode&&i(1,t,n,0)!==r.check?-3:x(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):c},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){e.exports=function(e,t){var r,n,i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w,x,k,S,_,C,A;r=e.state,n=e.next_in,C=e.input,i=n+(e.avail_in-5),a=e.next_out,A=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=r.dmax,h=r.wsize,u=r.whave,l=r.wnext,f=r.window,p=r.hold,d=r.bits,g=r.lencode,v=r.distcode,m=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;e:do{d<15&&(p+=C[n++]<<d,d+=8,p+=C[n++]<<d,d+=8),b=g[p&m];t:for(;;){if(p>>>=w=b>>>24,d-=w,0==(w=b>>>16&255))A[a++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=g[(65535&b)+(p&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}x=65535&b,(w&=15)&&(d<w&&(p+=C[n++]<<d,d+=8),x+=p&(1<<w)-1,p>>>=w,d-=w),d<15&&(p+=C[n++]<<d,d+=8,p+=C[n++]<<d,d+=8),b=v[p&y];r:for(;;){if(p>>>=w=b>>>24,d-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(p&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&b,d<(w&=15)&&(p+=C[n++]<<d,(d+=8)<w&&(p+=C[n++]<<d,d+=8)),(k+=p&(1<<w)-1)>c){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=w,d-=w,k>(w=a-o)){if((w=k-w)>u&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,_=f,0===l){if(S+=h-w,w<x){x-=w;do{A[a++]=f[S++]}while(--w);S=a-k,_=A}}else if(l<w){if(S+=h+l-w,(w-=l)<x){x-=w;do{A[a++]=f[S++]}while(--w);if(S=0,l<x){x-=w=l;do{A[a++]=f[S++]}while(--w);S=a-k,_=A}}}else if(S+=l-w,w<x){x-=w;do{A[a++]=f[S++]}while(--w);S=a-k,_=A}for(;x>2;)A[a++]=_[S++],A[a++]=_[S++],A[a++]=_[S++],x-=3;x&&(A[a++]=_[S++],x>1&&(A[a++]=_[S++]))}else{S=a-k;do{A[a++]=A[S++],A[a++]=A[S++],A[a++]=A[S++],x-=3}while(x>2);x&&(A[a++]=A[S++],x>1&&(A[a++]=A[S++]))}break}}break}}while(n<i&&a<s);n-=x=d>>3,p&=(1<<(d-=x<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<s?s-a+257:257-(a-s),r.hold=p,r.bits=d}},function(e,t,r){var n=r(11),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],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],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,c,h,u,l,f){var p,d,g,v,m,y,b,w,x,k=f.bits,S=0,_=0,C=0,A=0,E=0,R=0,T=0,I=0,L=0,M=0,P=null,O=0,F=new n.Buf16(16),N=new n.Buf16(16),D=null,B=0;for(S=0;S<=15;S++)F[S]=0;for(_=0;_<c;_++)F[t[r+_]]++;for(E=k,A=15;A>=1&&0===F[A];A--);if(E>A&&(E=A),0===A)return h[u++]=20971520,h[u++]=20971520,f.bits=1,0;for(C=1;C<A&&0===F[C];C++);for(E<C&&(E=C),I=1,S=1;S<=15;S++)if(I<<=1,(I-=F[S])<0)return-1;if(I>0&&(0===e||1!==A))return-1;for(N[1]=0,S=1;S<15;S++)N[S+1]=N[S]+F[S];for(_=0;_<c;_++)0!==t[r+_]&&(l[N[t[r+_]]++]=_);if(0===e?(P=D=l,y=19):1===e?(P=i,O-=257,D=a,B-=257,y=256):(P=o,D=s,y=-1),M=0,_=0,S=C,m=u,R=E,T=0,g=-1,v=(L=1<<E)-1,1===e&&L>852||2===e&&L>592)return 1;for(;;){b=S-T,l[_]<y?(w=0,x=l[_]):l[_]>y?(w=D[B+l[_]],x=P[O+l[_]]):(w=96,x=0),p=1<<S-T,C=d=1<<R;do{h[m+(M>>T)+(d-=p)]=b<<24|w<<16|x|0}while(0!==d);for(p=1<<S-1;M&p;)p>>=1;if(0!==p?(M&=p-1,M+=p):M=0,_++,0==--F[S]){if(S===A)break;S=t[r+l[_]]}if(S>E&&(M&v)!==g){for(0===T&&(T=E),m+=C,I=1<<(R=S-T);R+T<A&&!((I-=F[R+T])<=0);)R++,I<<=1;if(L+=1<<R,1===e&&L>852||2===e&&L>592)return 1;h[g=M&v]=E<<24|R<<16|m-u|0}}return 0!==M&&(h[m+M]=S-T<<24|64<<16|0),f.bits=E,0}},function(e,t,r){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,r){var n=r(1).Buffer,i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function a(e){if(n.isBuffer(e))return e;var t="function"==typeof n.alloc&&"function"==typeof n.from;if("number"==typeof e)return t?n.alloc(e):new n(e);if("string"==typeof e)return t?n.from(e):new n(e);throw new Error("input must be buffer, number, or string, received "+qr(e))}function o(e,t){e=a(e),n.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=-1^~~t,o=0;o<e.length;o++)r=i[255&(r^e[o])]^r>>>8;return-1^r}function s(){return e=o.apply(null,arguments),(t=a(4)).writeInt32BE(e,0),t;var e,t}"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),s.signed=function(){return o.apply(null,arguments)},s.unsigned=function(){return o.apply(null,arguments)>>>0},e.exports=s},function(e,t,r){(function(t){var n=r(0).CramMalformedError,i=r(12),a=r(63),o=r(64),s=r(65),c=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Wr(this,e),this._buffer=t,this._position=r,this.length=t.length}return Yr(e,[{key:"get",value:function(){var e=this._buffer[this._position];return this._position+=1,e}},{key:"getByte",value:function(){return this.get()}},{key:"getByteAt",value:function(e){return this._buffer[e]}},{key:"position",value:function(){return this._position}},{key:"put",value:function(e){return this._buffer[this._position]=e,this._position+=1,e}},{key:"putAt",value:function(e,t){return this._buffer[e]=t,t}},{key:"setPosition",value:function(e){return this._position=e,e}},{key:"getInt",value:function(){var e=this._buffer.readInt32LE(this._position);return this._position+=4,e}},{key:"remaining",value:function(){return this._buffer.length-this._position}}]),e}();e.exports={uncompress:function(e,r){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0===e.length)return r.fill(0),r;var u=new c(e,h),l=u.get();if(0!==l&&1!==l)throw new n("Invalid rANS order ".concat(l));if(u.getInt()!==u.remaining()-4)throw new n("Incorrect input length.");var f=u.getInt(),p=new c(r||t.allocUnsafe(f));if(p.length<f)throw new n("Output buffer too small to fit ".concat(f," bytes."));switch(l){case 0:return function(e,t){for(var r=new i.AriDecoder,n=new Array(256),s=0;s<n.length;s+=1)n[s]=new i.Symbol;return a.readStatsO0(e,r,n),o.uncompress(e,r,n,t),t}(u,p);case 1:return function(e,t){for(var r=new Array(256),n=0;n<r.length;n+=1)r[n]=new i.AriDecoder;for(var o=new Array(256),c=0;c<o.length;c+=1){o[c]=new Array(256);for(var h=0;h<o[c].length;h+=1)o[c][h]=new i.Symbol}return a.readStatsO1(e,r,o),s.uncompress(e,t,r,o),t}(u,p);default:throw new n("Invalid rANS order: ".concat(l))}}}}).call(this,r(1).Buffer)},function(e,t,r){var n=r(0).CramMalformedError,i=r(13),a=r(12);function o(e){if(!e)throw new n("assertion failed")}e.exports={readStatsO0:function(e,t,r){var n=0,s=0,c=255&e.get();do{null==t.fc[c]&&(t.fc[c]=new a.FC),t.fc[c].F=255&e.get(),t.fc[c].F>=128&&(t.fc[c].F&=-129,t.fc[c].F=(127&t.fc[c].F)<<8|255&e.get()),t.fc[c].C=s,a.symbolInit(r[c],t.fc[c].C,t.fc[c].F),t.R||(t.R=new Array(i.TOTFREQ)),t.R.fill(c,s,s+t.fc[c].F),s+=t.fc[c].F,0===n&&c+1===(255&e.getByteAt(e.position()))?(c=255&e.get(),n=255&e.get()):0!==n?(n-=1,c+=1):c=255&e.get()}while(0!==c);o(s<i.TOTFREQ)},readStatsO1:function(e,t,r){var n=0,s=255&e.get();do{var c=0,h=0,u=255&e.get();null==t[s]&&(t[s]=new a.AriDecoder);do{null==t[s].fc[u]&&(t[s].fc[u]=new a.FC),t[s].fc[u].F=255&e.get(),t[s].fc[u].F>=128&&(t[s].fc[u].F&=-129,t[s].fc[u].F=(127&t[s].fc[u].F)<<8|255&e.get()),t[s].fc[u].C=h,0===t[s].fc[u].F&&(t[s].fc[u].F=i.TOTFREQ),null==r[s][u]&&(r[s][u]=new a.RansDecSymbol),a.symbolInit(r[s][u],t[s].fc[u].C,t[s].fc[u].F),null==t[s].R&&(t[s].R=new Array(i.TOTFREQ)),t[s].R.fill(u,h,h+t[s].fc[u].F),o((h+=t[s].fc[u].F)<=i.TOTFREQ),0===c&&u+1===(255&e.getByteAt(e.position()))?(u=255&e.get(),c=255&e.get()):0!==c?(c-=1,u+=1):u=255&e.get()}while(0!==u);0===n&&s+1===(255&e.getByteAt(e.position()))?(s=255&e.get(),n=255&e.get()):0!==n?(n-=1,s+=1):s=255&e.get()}while(0!==s)}}},function(e,t,r){var n=r(0).CramMalformedError,i=r(13),a=r(12);e.exports={uncompress:function(e,t,r,o){for(var s,c=e.getInt(),h=e.getInt(),u=e.getInt(),l=e.getInt(),f=o.remaining(),p=-4&f,d=0;d<p;d+=4){var g=t.R[a.get(c,i.TF_SHIFT)],v=t.R[a.get(h,i.TF_SHIFT)],m=t.R[a.get(u,i.TF_SHIFT)],y=t.R[a.get(l,i.TF_SHIFT)];o.putAt(d,g),o.putAt(d+1,v),o.putAt(d+2,m),o.putAt(d+3,y),c=a.advanceSymbolStep(c,r[255&g],i.TF_SHIFT),h=a.advanceSymbolStep(h,r[255&v],i.TF_SHIFT),u=a.advanceSymbolStep(u,r[255&m],i.TF_SHIFT),l=a.advanceSymbolStep(l,r[255&y],i.TF_SHIFT),c=a.renormalize(c,e),h=a.renormalize(h,e),u=a.renormalize(u,e),l=a.renormalize(l,e)}switch(o.setPosition(p),3&f){case 0:break;case 1:s=t.R[a.get(c,i.TF_SHIFT)],a.advanceSymbol(c,e,r[255&s],i.TF_SHIFT),o.put(s);break;case 2:s=t.R[a.get(c,i.TF_SHIFT)],a.advanceSymbol(c,e,r[255&s],i.TF_SHIFT),o.put(s),s=t.R[a.get(h,i.TF_SHIFT)],a.advanceSymbol(h,e,r[255&s],i.TF_SHIFT),o.put(s);break;case 3:s=t.R[a.get(c,i.TF_SHIFT)],a.advanceSymbol(c,e,r[255&s],i.TF_SHIFT),o.put(s),s=t.R[a.get(h,i.TF_SHIFT)],a.advanceSymbol(h,e,r[255&s],i.TF_SHIFT),o.put(s),s=t.R[a.get(u,i.TF_SHIFT)],a.advanceSymbol(u,e,r[255&s],i.TF_SHIFT),o.put(s);break;default:throw new n("invalid output size encountered during rANS decoding")}o.setPosition(0)}}},function(e,t,r){var n=r(13),i=r(12);e.exports={uncompress:function(e,t,r,a){for(var o=t.remaining(),s=e.getInt(),c=e.getInt(),h=e.getInt(),u=e.getInt(),l=o>>2,f=0,p=l,d=2*l,g=3*l,v=0,m=0,y=0,b=0;f<l;f+=1,p+=1,d+=1,g+=1){var w=255&r[v].R[i.get(s,n.TF_SHIFT)],x=255&r[m].R[i.get(c,n.TF_SHIFT)],k=255&r[y].R[i.get(h,n.TF_SHIFT)],S=255&r[b].R[i.get(u,n.TF_SHIFT)];t.putAt(f,w),t.putAt(p,x),t.putAt(d,k),t.putAt(g,S),s=i.advanceSymbolStep(s,a[v][w],n.TF_SHIFT),c=i.advanceSymbolStep(c,a[m][x],n.TF_SHIFT),h=i.advanceSymbolStep(h,a[y][k],n.TF_SHIFT),u=i.advanceSymbolStep(u,a[b][S],n.TF_SHIFT),s=i.renormalize(s,e),c=i.renormalize(c,e),h=i.renormalize(h,e),u=i.renormalize(u,e),v=w,m=x,y=k,b=S}for(;g<o;g+=1){var _=255&r[b].R[i.get(u,n.TF_SHIFT)];t.putAt(g,_),u=i.advanceSymbol(u,e,a[b][_],n.TF_SHIFT),b=_}}}},function(e,t,r){var n=r(67).Parser,i=(new n).itf8(),a={parser:(new n).string("magic",{length:4}).uint8("majorVersion").uint8("minorVersion").string("fileId",{length:20,stripNull:!0}),maxLength:26},o={parser:(new n).uint8("compressionMethod",{formatter:function(e){var t=["raw","gzip","bzip2","lzma","rans"][e];if(!t)throw new Error("compression method number ".concat(e," not implemented"));return t}}).uint8("contentType",{formatter:function(e){var t=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][e];if(!t)throw new Error("invalid block content type id ".concat(e));return t}}).itf8("contentId").itf8("compressedSize").itf8("uncompressedSize"),maxLength:17},s={parser:(new n).uint32("crc32"),maxLength:4},c=(new n).itf8("size").buffer("entries",{length:"size",formatter:function(e){function t(t,r){for(var n=e.toString("utf8",t,r),i=[],a=0;a<n.length;a+=3)i.push(n.substr(a,3));return i}var r,n=[],i=0;for(r=0;r<e.length;r+=1)e[r]||(n.push(t(i,r)),i=r+1);return r>i&&n.push(t(i,r)),n}}),h=(new n).uint8(null,{formatter:function(e){return!!e}}),u=(new n).itf8("mapSize").itf8("mapCount").array("entries",{length:"mapCount",type:(new n).string("key",{length:2,stripNull:!1}).choice("value",{tag:"key",choices:{MI:h,UI:h,PI:h,RN:h,AP:h,RR:h,SM:(new n).array(null,{type:"uint8",length:5}),TD:(new n).nest(null,{type:c,formatter:function(e){return e.entries}})}})});function l(e){var t={};return e.entries.forEach((function(e){var r=e.key,n=e.value;t[r]&&console.warn("duplicate key ".concat(r," in map")),t[r]=n})),t}var f={cramFileDefinition:a,cramBlockHeader:o,cramBlockCrc32:s},p={cramUnmappedSliceHeader:function(e){var t=0,r=(new n).itf8("numRecords");return t+=5,e>=3?(r=r.ltf8("recordCounter"),t+=9):2===e&&(r=r.itf8("recordCounter"),t+=5),r=r.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}),t+=10,e>=2&&(r=r.array("md5",{type:"uint8",length:16}),t+=16),{parser:r,maxLength:function(e){return t+5*e}}},cramMappedSliceHeader:function(e){var t=(new n).itf8("refSeqId").itf8("refSeqStart").itf8("refSeqSpan").itf8("numRecords"),r=20;return e>=3?(t=t.ltf8("recordCounter"),r+=9):2===e&&(t=t.itf8("recordCounter"),r+=5),t=t.itf8("numBlocks").itf8("numContentIds").array("contentIds",{type:i,length:"numContentIds"}).itf8("refBaseBlockId"),r+=15,e>=2&&(t=t.array("md5",{type:"uint8",length:16}),r+=16),{parser:t,maxLength:function(e){return r+5*e}}},cramEncoding:function(e){return{parser:(new n).namely("cramEncoding").itf8("codecId").itf8("parametersBytes").choice("parameters",{tag:"codecId",choices:{0:new n,1:(new n).itf8("blockContentId"),2:(new n).itf8("offset").itf8("M"),3:n.start().itf8("numCodes").array("symbols",{length:"numCodes",type:i}).itf8("numLengths").array("bitLengths",{length:"numLengths",type:i}),4:n.start().nest("lengthsEncoding",{type:"cramEncoding"}).nest("valuesEncoding",{type:"cramEncoding"}),5:(new n).uint8("stopByte")[e>1?"itf8":"int"]("blockContentId"),6:(new n).itf8("offset").itf8("length"),7:(new n).itf8("offset").itf8("K"),8:(new n).itf8("offset").itf8("log2m"),9:(new n).itf8("offset")}})}},cramDataSeriesEncodingMap:function(e){return(new n).itf8("mapSize").itf8("mapCount").array("entries",{length:"mapCount",type:(new n).string("key",{length:2,stripNull:!1}).nest("value",{type:this.cramEncoding(e).parser})})},cramTagEncodingMap:function(e){return(new n).itf8("mapSize").itf8("mapCount").array("entries",{length:"mapCount",type:(new n).itf8("key",{formatter:function(e){return String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)}}).nest("value",{type:this.cramEncoding(e).parser})})},cramCompressionHeader:function(e){var t=new n;return{parser:t=t.nest("preservation",{type:u,formatter:l}).nest("dataSeriesEncoding",{type:this.cramDataSeriesEncodingMap(e),formatter:l}).nest("tagEncoding",{type:this.cramTagEncodingMap(e),formatter:l})}},cramContainerHeader1:function(e){var t=(new n).int32("length").itf8("refSeqId").itf8("refSeqStart").itf8("alignmentSpan").itf8("numRecords"),r=24;return e>=3?(t=t.ltf8("recordCounter"),r+=9):2===e&&(t=t.itf8("recordCounter"),r+=5),e>1&&(t=t.ltf8("numBases"),r+=9),{parser:t=t.itf8("numBlocks").itf8("numLandmarks"),maxLength:r+=10}},cramContainerHeader2:function(e){var t=(new n).itf8("numLandmarks").array("landmarks",{type:(new n).itf8(),length:"numLandmarks"}),r=0;return e>=3&&(t=t.uint32("crc32"),r=4),{parser:t,maxLength:function(e){return 5+5*e+r}}}};e.exports={cramFileDefinition:a,getSectionParsers:function(e){var t=Object.assign({},f);return Object.keys(p).forEach((function(r){t[r]=p[r](e)})),t}}},function(e,t,r){(function(e){var n=r(68),i=r(70).Context,a=r(31);"undefined"!=typeof window&&(window.Buffer=e);var o={UInt8:1,UInt16LE:2,UInt16BE:2,UInt32LE:4,UInt32BE:4,Int8:1,Int16LE:2,Int16BE:2,Int32LE:4,Int32BE:4,FloatLE:4,FloatBE:4,DoubleLE:8,DoubleBE:8},s={},c=[];!function(){var e;for(e=1;e<=32;e++)c.push(e)}();var h={};Object.keys(o).concat(Object.keys({String:null,Buffer:null,Array:null,Skip:null,Choice:null,Nest:null,Bit:null,Itf8:null,Ltf8:null})).forEach((function(e){h[e.toLowerCase()]=e}));var u=function(){this.varName="",this.type="",this.options={},this.next=null,this.head=null,this.compiled=null,this.endian="le",this.constructorFn=null,this.alias=null};u.start=function(){return new u},Object.keys(o).forEach((function(e){u.prototype[e.toLowerCase()]=function(t,r){return this.setNextParser(e.toLowerCase(),t,r)};var t=e.replace(/BE|LE/,"").toLowerCase();t in u.prototype||(u.prototype[t]=function(e,r){return this[t+this.endian](e,r)})})),c.forEach((function(e){u.prototype["bit"+e.toString()]=function(t,r){return r||(r={}),r.length=e,this.setNextParser("bit",t,r)}})),u.prototype.namely=function(e){return s[e]=this,this.alias=e,this},u.prototype.skip=function(e,t){if(t&&t.assert)throw new Error("assert option on skip is not allowed.");return this.setNextParser("skip","",{length:e})},u.prototype.string=function(e,t){if(!t.zeroTerminated&&!t.length&&!t.greedy)throw new Error("Neither length, zeroTerminated, nor greedy is defined for string.");if((t.zeroTerminated||t.length)&&t.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(t.stripNull&&!t.length&&!t.greedy)throw new Error("Length or greedy must be defined if stripNull is defined.");return t.encoding=t.encoding||"utf8",this.setNextParser("string",e,t)},u.prototype.buffer=function(e,t){if(!t.length&&!t.readUntil)throw new Error("Length nor readUntil is defined in buffer parser");return this.setNextParser("buffer",e,t)},u.prototype.array=function(e,t){if(!t.readUntil&&!t.length&&!t.lengthInBytes)throw new Error("Length option of array is not defined.");if(!t.type)throw new Error("Type option of array is not defined.");if("string"==typeof t.type&&!s[t.type]&&Object.keys(o).indexOf(h[t.type])<0)throw new Error('Specified primitive type "'+t.type+'" is not supported.');return this.setNextParser("array",e,t)},u.prototype.choice=function(e,t){if(1==arguments.length&&"object"==qr(e)&&(t=e,e=null),!t.tag)throw new Error("Tag option of array is not defined.");if(!t.choices)throw new Error("Choices option of array is not defined.");return Object.keys(t.choices).forEach((function(r){if(!t.choices[r])throw new Error("Choice Case "+r+" of "+e+" is not valid.");if("string"==typeof t.choices[r]&&!s[t.choices[r]]&&Object.keys(o).indexOf(h[t.choices[r]])<0)throw new Error('Specified primitive type "'+t.choices[r]+'" is not supported.')}),this),this.setNextParser("choice",e,t)},u.prototype.nest=function(e,t){if(1==arguments.length&&"object"==qr(e)&&(t=e,e=null),!t.type)throw new Error("Type option of nest is not defined.");if(!(t.type instanceof u||s[t.type]))throw new Error("Type option of nest must be a Parser object.");if(!(t.type instanceof u||e))throw new Error("options.type must be a object if variable name is omitted.");return this.setNextParser("nest",e,t)},u.prototype.endianess=function(e){switch(e.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error("Invalid endianess: "+e)}return this},u.prototype.create=function(e){if(!(e instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=e,this},u.prototype.getCode=function(){var e=new i;return e.pushCode("if (!Buffer.isBuffer(buffer)) {"),e.generateError('"argument buffer is not a Buffer object"'),e.pushCode("}"),this.alias?this.addAliasedCode(e):this.addRawCode(e),this.alias?e.pushCode("return {0}(0)","___parser_"+this.alias):e.pushCode("return { offset: offset, result: vars };"),e.code},u.prototype.addRawCode=function(e){e.pushCode("var offset = 0;"),this.constructorFn?e.pushCode("var vars = new constructorFn();"):e.pushCode("var vars = {};"),this.generate(e),this.resolveReferences(e),e.pushCode("return { offset: offset, result: vars };")},u.prototype.addAliasedCode=function(e){return e.pushCode("function {0}(offset) {","___parser_"+this.alias),this.constructorFn?e.pushCode("var vars = new constructorFn();"):e.pushCode("var vars = {};"),this.generate(e),e.markResolved(this.alias),this.resolveReferences(e),e.pushCode("return { offset: offset, result: vars };"),e.pushCode("}"),e},u.prototype.resolveReferences=function(e){var t=e.getUnresolvedReferences();e.markRequested(t),t.forEach((function(t){s[t].addAliasedCode(e)}))},u.prototype.compile=function(){var e="(function(buffer, constructorFn, Long) { "+this.getCode()+" })";this.compiled=n.runInThisContext(e)},u.prototype.sizeOf=function(){var e=NaN;if(Object.keys(o).indexOf(this.type)>=0)e=o[this.type];else if("String"===this.type&&"number"==typeof this.options.length)e=this.options.length;else if("Buffer"===this.type&&"number"==typeof this.options.length)e=this.options.length;else if("Array"===this.type&&"number"==typeof this.options.length){var t=NaN;"string"==typeof this.options.type?t=o[h[this.options.type]]:this.options.type instanceof u&&(t=this.options.type.sizeOf()),e=this.options.length*t}else"Skip"===this.type?e=this.options.length:"Nest"===this.type?e=this.options.type.sizeOf():this.type||(e=0);return this.next&&(e+=this.next.sizeOf()),e},u.prototype.parse=function(e){return this.compiled||this.compile(),this.compiled(e,this.constructorFn,a)},u.prototype.setNextParser=function(e,t,r){var n=new u;return n.type=h[e],n.varName=t,n.options=r||n.options,n.endian=this.endian,this.head?this.head.next=n:this.next=n,this.head=n,this},u.prototype.generate=function(e){this.type&&(this["generate"+this.type](e),this.generateAssert(e));var t=e.generateVariable(this.varName);return this.options.formatter&&this.generateFormatter(e,t,this.options.formatter),this.generateNext(e)},u.prototype.generateAssert=function(e){if(this.options.assert){var t=e.generateVariable(this.varName);switch(qr(this.options.assert)){case"function":e.pushCode("if (!({0}).call(vars, {1})) {",this.options.assert,t);break;case"number":e.pushCode("if ({0} !== {1}) {",this.options.assert,t);break;case"string":e.pushCode('if ("{0}" !== {1}) {',this.options.assert,t);break;default:throw new Error("Assert option supports only strings, numbers and assert functions.")}e.generateError('"Assert error: {0} is " + {0}',t),e.pushCode("}")}},u.prototype.generateNext=function(e){return this.next&&(e=this.next.generate(e)),e},Object.keys(o).forEach((function(e){u.prototype["generate"+e]=function(t){t.pushCode("{0} = buffer.read{1}(offset);",t.generateVariable(this.varName),e),t.pushCode("offset += {0};",o[e])}})),u.prototype.generateBit=function(e){var t=JSON.parse(JSON.stringify(this));if(t.varName=e.generateVariable(t.varName),e.bitFields.push(t),!this.next||this.next&&["Bit","Nest"].indexOf(this.next.type)<0){var r=0;e.bitFields.forEach((function(e){r+=e.options.length}));var n=e.generateTmpVariable();if(r<=8)e.pushCode("var {0} = buffer.readUInt8(offset);",n),r=8;else if(r<=16)e.pushCode("var {0} = buffer.readUInt16BE(offset);",n),r=16;else if(r<=24){var i=e.generateTmpVariable(),a=e.generateTmpVariable();e.pushCode("var {0} = buffer.readUInt16BE(offset);",i),e.pushCode("var {0} = buffer.readUInt8(offset + 2);",a),e.pushCode("var {2} = ({0} << 8) | {1};",i,a,n),r=24}else{if(!(r<=32))throw new Error("Currently, bit field sequence longer than 4-bytes is not supported.");e.pushCode("var {0} = buffer.readUInt32BE(offset);",n),r=32}e.pushCode("offset += {0};",r/8);var o=0,s="be"===this.endian;e.bitFields.forEach((function(t){e.pushCode("{0} = {1} >> {2} & {3};",t.varName,n,s?r-o-t.options.length:o,(1<<t.options.length)-1),o+=t.options.length})),e.bitFields=[]}},u.prototype.generateSkip=function(e){var t=e.generateOption(this.options.length);e.pushCode("offset += {0};",t)},u.prototype.generateString=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();this.options.length&&this.options.zeroTerminated?(e.pushCode("var {0} = offset;",r),e.pushCode("while(buffer.readUInt8(offset++) !== 0 && offset - {0}  < {1});",r,this.options.length),e.pushCode("{0} = buffer.toString('{1}', {2}, offset - {2} < {3} ? offset - 1 : offset);",t,this.options.encoding,r,this.options.length)):this.options.length?(e.pushCode("{0} = buffer.toString('{1}', offset, offset + {2});",t,this.options.encoding,e.generateOption(this.options.length)),e.pushCode("offset += {0};",e.generateOption(this.options.length))):this.options.zeroTerminated?(e.pushCode("var {0} = offset;",r),e.pushCode("while(buffer.readUInt8(offset++) !== 0);"),e.pushCode("{0} = buffer.toString('{1}', {2}, offset - 1);",t,this.options.encoding,r)):this.options.greedy&&(e.pushCode("var {0} = offset;",r),e.pushCode("while(buffer.length > offset++);"),e.pushCode("{0} = buffer.toString('{1}', {2}, offset);",t,this.options.encoding,r)),this.options.stripNull&&e.pushCode("{0} = {0}.replace(/\\x00+$/g, '')",t)},u.prototype.generateBuffer=function(e){"eof"===this.options.readUntil?e.pushCode("{0} = buffer.slice(offset);",e.generateVariable(this.varName)):(e.pushCode("{0} = buffer.slice(offset, offset + {1});",e.generateVariable(this.varName),e.generateOption(this.options.length)),e.pushCode("offset += {0};",e.generateOption(this.options.length))),this.options.clone&&e.pushCode("{0} = Buffer.from({0});",e.generateVariable(this.varName))},u.prototype.generateArray=function(e){var t=e.generateOption(this.options.length),r=e.generateOption(this.options.lengthInBytes),n=this.options.type,i=e.generateTmpVariable(),a=e.generateVariable(this.varName),c=e.generateTmpVariable(),l=this.options.key,f="string"==typeof l;if(f?e.pushCode("{0} = {};",a):e.pushCode("{0} = [];",a),"function"==typeof this.options.readUntil?e.pushCode("do {"):"eof"===this.options.readUntil?e.pushCode("for (var {0} = 0; offset < buffer.length; {0}++) {",i):void 0!==r?e.pushCode("for (var {0} = offset; offset - {0} < {1}; ) {",i,r):e.pushCode("for (var {0} = 0; {0} < {1}; {0}++) {",i,t),"string"==typeof n)if(s[n]){var p=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",p,"___parser_"+n),e.pushCode("var {0} = {1}.result; offset = {1}.offset;",c,p),n!==this.alias&&e.addReference(n)}else e.pushCode("var {0} = buffer.read{1}(offset);",c,h[n]),e.pushCode("offset += {0};",o[h[n]]);else n instanceof u&&(e.pushCode("var {0} = {};",c),e.pushScope(c),n.generate(e),e.popScope());f?e.pushCode("{0}[{2}.{1}] = {2};",a,l,c):e.pushCode("{0}.push({1});",a,c),e.pushCode("}"),"function"==typeof this.options.readUntil&&e.pushCode(" while (!({0}).call(this, {1}, buffer.slice(offset)));",this.options.readUntil,c)},u.prototype.generateChoiceCase=function(e,t,r){if("string"==typeof r)if(s[r]){var n=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",n,"___parser_"+r),e.pushCode("{0} = {1}.result; offset = {1}.offset;",e.generateVariable(this.varName),n),r!==this.alias&&e.addReference(r)}else e.pushCode("{0} = buffer.read{1}(offset);",e.generateVariable(this.varName),h[r]),e.pushCode("offset += {0};",o[h[r]]);else r instanceof u&&(e.pushPath(t),r.generate(e),e.popPath(t))},u.prototype.generateChoice=function(e){var t=e.generateOption(this.options.tag);this.varName&&e.pushCode("{0} = {};",e.generateVariable(this.varName)),e.pushCode("switch({0}) {",t),Object.keys(this.options.choices).forEach((function(t){var r=this.options.choices[t];isNaN(parseInt(t,10))?e.pushCode("case '{0}':",t):e.pushCode("case {0}:",t),this.generateChoiceCase(e,this.varName,r),e.pushCode("break;")}),this),e.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(e,this.varName,this.options.defaultChoice):e.generateError('"Met undefined tag value " + {0} + " at choice"',t),e.pushCode("}")},u.prototype.generateNest=function(e){var t=e.generateVariable(this.varName);if(this.options.type instanceof u)this.varName&&e.pushCode("{0} = {};",t),e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName);else if(s[this.options.type]){var r=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",r,"___parser_"+this.options.type),e.pushCode("{0} = {1}.result; offset = {1}.offset;",t,r),this.options.type!==this.alias&&e.addReference(this.options.type)}},u.prototype.generateFormatter=function(e,t,r){"function"==typeof r&&e.pushCode("{0} = ({1}).call(this, {0});",t,r)},u.prototype.isInteger=function(){return!!this.type.match(/U?Int[8|16|32][BE|LE]?|Bit\d+/)},u.prototype.itf8=function(e,t){return this.setNextParser("itf8",e,t)},u.prototype.generateItf8=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();e.pushCode("\n    var ".concat(r," = buffer[offset];\n    if (").concat(r," < 0x80) {\n      ").concat(t," = ").concat(r,";\n      offset += 1;\n    } else if (").concat(r," < 0xc0) {\n      ").concat(t," = ((").concat(r,"<<8) | buffer[offset+1]) & 0x3fff;\n      offset += 2;\n    } else if (").concat(r," < 0xe0) {\n      ").concat(t," = ((").concat(r,"<<16) | (buffer[offset+1]<< 8) |  buffer[offset+2]) & 0x1fffff;\n      offset += 3;\n    } else if (").concat(r," < 0xf0) {\n      ").concat(t," = ((").concat(r,"<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n      offset += 4\n    } else {\n      ").concat(t," = ((").concat(r," & 0x0f)<<28) | (buffer[offset+1]<<20) | (buffer[offset+2]<<12) | (buffer[offset+3]<<4) | (buffer[offset+4] & 0x0f);\n      // x=((0xff & 0x0f)<<28) | (0xff<<20) | (0xff<<12) | (0xff<<4) | (0x0f & 0x0f);\n      // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n      offset += 5\n    }\n  "))},u.prototype.ltf8=function(e,t){return this.setNextParser("ltf8",e,t)},u.prototype.generateLtf8=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();e.pushCode("\n  var ".concat(r," = buffer[offset];\n  if (").concat(r," < 0x80) {\n    ").concat(t," = ").concat(r,";\n    offset += 1;\n  } else if (").concat(r," < 0xc0) {\n    ").concat(t," = ((buffer[offset]<<8) | buffer[offset+1]) & 0x3fff;\n    offset += 2;\n  } else if (").concat(r," < 0xe0) {\n    ").concat(t," = ((buffer[offset]<<16) | (buffer[offset+1]<<8) | buffer[offset+2]) & 0x1fffff;\n    ").concat(t," = (((").concat(r," & 63) << 16) | buffer.readUInt16LE(offset + 1));\n    offset += 3;\n  } else if (").concat(r," < 0xf0) {\n    ").concat(t," = ((buffer[offset]<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n    offset += 4;\n  } else if (").concat(r," < 0xf8) {\n    ").concat(t," = (((buffer[offset] & 15) * Math.pow(2,32))) +\n      (buffer[offset+1]<<24) | (buffer[offset+2]<<16 | buffer[offset+3]<<8 | buffer[offset+4])\n    // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n    offset += 5;\n  } else if (").concat(r," < 0xfc) {\n    ").concat(t," = ((((buffer[offset] & 7) << 8) | buffer[offset+1] )) * Math.pow(2,32) +\n      (buffer[offset+2]<<24) | (buffer[offset+3]<<16 | buffer[offset+4]<<8 | buffer[offset+5])\n    offset += 6;\n  } else if (").concat(r," < 0xfe) {\n    ").concat(t," = ((((buffer[offset] & 3) << 16) | buffer[offset+1]<<8 | buffer[offset+2])) * Math.pow(2,32) +\n      (buffer[offset+3]<<24) | (buffer[offset+4]<<16 | buffer[offset+5]<<8 | buffer[offset+6])\n    offset += 7;\n  } else if (").concat(r," < 0xff) {\n    ").concat(t," = Long.fromBytesBE(buffer.slice(offset+1,offset+8));\n    if (").concat(t,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(t,".lessThan(Number.MIN_SAFE_INTEGER))\n      throw new Error('integer overflow')\n    ").concat(t," = ").concat(t,".toNumber()\n    offset += 8;\n  } else {\n    ").concat(t," = Long.fromBytesBE(buffer.slice(offset+1,offset+9));\n    if (").concat(t,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(t,".lessThan(Number.MIN_SAFE_INTEGER))\n      throw new Error('integer overflow')\n    ").concat(t," = ").concat(t,".toNumber()\n    offset += 9;\n  }\n  "))},t.Parser=u}).call(this,r(1).Buffer)},function(e,t,r){var n=r(69),i=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},a=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},o=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),s=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval2","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function c(){}c.prototype={};var h=t.Script=function(e){if(!(this instanceof h))return new h(e);this.code=e};h.prototype.runInContext=function(e){if(!(e instanceof c))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,h=r.eval2,u=r.execScript;!h&&u&&(u.call(r,"null"),h=r.eval2),a(i(e),(function(t){r[t]=e[t]})),a(s,(function(t){e[t]&&(r[t]=e[t])}));var l=i(r),f=h.call(r,this.code);return a(i(r),(function(t){(t in e||-1===n(l,t))&&(e[t]=r[t])})),a(s,(function(t){t in e||o(e,t,r[t])})),document.body.removeChild(t),f},h.prototype.runInThisContext=function(){return dx(this.code)},h.prototype.runInNewContext=function(e){var t=h.createContext(e),r=this.runInContext(t);return a(i(t),(function(r){e[r]=t[r]})),r},a(i(h.prototype),(function(e){t[e]=h[e]=function(t){var r=h(t);return r[e].apply(r,[].slice.call(arguments,1))}})),t.createScript=function(e){return t.Script(e)},t.createContext=h.createContext=function(e){var t=new c;return"object"==qr(e)&&a(i(e),(function(r){t[r]=e[r]})),t}},function(e,t){var r=[].indexOf;e.exports=function(e,t){if(r)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},function(e,t){var r=function(){this.code="",this.scopes=[["vars"]],this.isAsync=!1,this.bitFields=[],this.tmpVariableCount=0,this.references={}};r.prototype.generateVariable=function(e){var t=[];for(Array.prototype.push.apply(t,this.scopes[this.scopes.length-1]);/^\$parent\./.test(e);)t.pop(),e=e.replace(/^\$parent\./,"");return e&&t.push(e),t.join(".")},r.prototype.generateOption=function(e){switch(qr(e)){case"number":return e.toString();case"string":return this.generateVariable(e);case"function":return"("+e+").call("+this.generateVariable()+", vars)"}},r.prototype.generateError=function(){var e=Array.prototype.slice.call(arguments),t=r.interpolate.apply(this,e);this.isAsync?this.pushCode("return process.nextTick(function() { callback(new Error("+t+"), vars); });"):this.pushCode("throw new Error("+t+");")},r.prototype.generateTmpVariable=function(){return"$tmp"+this.tmpVariableCount++},r.prototype.pushCode=function(){var e=Array.prototype.slice.call(arguments);this.code+=r.interpolate.apply(this,e)+"\n"},r.prototype.pushPath=function(e){e&&this.scopes[this.scopes.length-1].push(e)},r.prototype.popPath=function(e){e&&this.scopes[this.scopes.length-1].pop()},r.prototype.pushScope=function(e){this.scopes.push([e])},r.prototype.popScope=function(){this.scopes.pop()},r.prototype.addReference=function(e){this.references[e]||(this.references[e]={resolved:!1,requested:!1})},r.prototype.markResolved=function(e){this.references[e].resolved=!0},r.prototype.markRequested=function(e){e.forEach(function(e){this.references[e].requested=!0}.bind(this))},r.prototype.getUnresolvedReferences=function(){var e=this.references;return Object.keys(this.references).filter((function(t){return!e[t].resolved&&!e[t].requested}))},r.interpolate=function(e){var t=e.match(/{\d+}/g),r=Array.prototype.slice.call(arguments,1);return t&&t.forEach((function(t){var n=parseInt(t.substr(1,t.length-2),10);e=e.replace(t,r[n].toString())})),e},t.Context=r},function(e,t,r){(function(t){var n=r(0).CramMalformedError,i=r(8),a=i.itf8Size,o=i.parseItem,s=i.tinyMemoize,c=r(75),h=r(78),u=function(){function e(t,r){Wr(this,e),this.file=t,this.filePosition=r}var r,i,s,u;return Yr(e,[{key:"getHeader",value:function(){return this._readContainerHeader(this.filePosition)}},{key:"getCompressionHeaderBlock",value:(u=Vr(regeneratorRuntime.mark((function e(){var t,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getHeader();case 2:if(e.sent.numRecords){e.next=4;break}return e.abrupt("return",null);case 4:return e.next=6,this.file.getSectionParsers();case 6:return t=e.sent,e.next=9,this.getFirstBlock();case 9:if("COMPRESSION_HEADER"===(r=e.sent).contentType){e.next=12;break}throw new n("invalid content type ".concat(r.contentType," in what is supposed to be the compression header block"));case 12:return i=o(r.content,t.cramCompressionHeader.parser,0,r.contentPosition),e.abrupt("return",(r.content=i,r));case 14:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"getFirstBlock",value:(s=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getHeader();case 2:return t=e.sent,e.abrupt("return",this.file.readBlock(t._endPosition));case 4:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getCompressionScheme",value:(i=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCompressionHeaderBlock();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",new h(t.content));case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"getSlice",value:function(e,t){return new c(this,e,t)}},{key:"_readContainerHeader",value:(r=Vr(regeneratorRuntime.mark((function e(r){var n,i,s,c,h,u,l,f,p,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.file.getSectionParsers();case 2:return n=e.sent,i=n.cramContainerHeader1,s=n.cramContainerHeader2,e.next=7,this.file.stat();case 7:if(c=e.sent,h=c.size,!(r>=h)){e.next=11;break}return e.abrupt("return");case 11:return u=t.allocUnsafe(i.maxLength),e.next=14,this.file.read(u,0,i.maxLength,r);case 14:if(l=o(u,i.parser),f=a(l.numLandmarks),!(r+l.length>=h)){e.next=17;break}return e.abrupt("return",void console.warn("".concat(this.file,": container header at ").concat(r," indicates that the container has length ").concat(l.length,", which extends beyond the length of the file. Skipping this container.")));case 17:return p=t.allocUnsafe(s.maxLength(l.numLandmarks)),e.next=20,this.file.read(p,0,s.maxLength(l.numLandmarks),r+l._size-f);case 20:if(d=o(p,s.parser),e.t0=this.file.validateChecksums&&void 0!==d.crc32,!e.t0){e.next=25;break}return e.next=25,this.file.checkCrc32(r,l._size+d._size-f-4,d.crc32,"container header beginning at position ".concat(r));case 25:return e.abrupt("return",Object.assign(l,d,{_size:l._size+d._size-f,_endPosition:l._size+d._size-f+r}));case 26:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})}]),e}();"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((function(e){return s(u,e)})),e.exports=u}).call(this,r(1).Buffer)},function(e,t,r){var n,i,a,o,s;n=r(73),i=r(32).utf8,a=r(74),o=r(32).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):i.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=n.bytesToWords(e),c=8*e.length,h=1732584193,u=-271733879,l=-1732584194,f=271733878,p=0;p<r.length;p++)r[p]=16711935&(r[p]<<8|r[p]>>>24)|4278255360&(r[p]<<24|r[p]>>>8);r[c>>>5]|=128<<c%32,r[14+(c+64>>>9<<4)]=c;var d=s._ff,g=s._gg,v=s._hh,m=s._ii;for(p=0;p<r.length;p+=16){var y=h,b=u,w=l,x=f;h=d(h,u,l,f,r[p+0],7,-680876936),f=d(f,h,u,l,r[p+1],12,-389564586),l=d(l,f,h,u,r[p+2],17,606105819),u=d(u,l,f,h,r[p+3],22,-1044525330),h=d(h,u,l,f,r[p+4],7,-176418897),f=d(f,h,u,l,r[p+5],12,1200080426),l=d(l,f,h,u,r[p+6],17,-1473231341),u=d(u,l,f,h,r[p+7],22,-45705983),h=d(h,u,l,f,r[p+8],7,1770035416),f=d(f,h,u,l,r[p+9],12,-1958414417),l=d(l,f,h,u,r[p+10],17,-42063),u=d(u,l,f,h,r[p+11],22,-1990404162),h=d(h,u,l,f,r[p+12],7,1804603682),f=d(f,h,u,l,r[p+13],12,-40341101),l=d(l,f,h,u,r[p+14],17,-1502002290),h=g(h,u=d(u,l,f,h,r[p+15],22,1236535329),l,f,r[p+1],5,-165796510),f=g(f,h,u,l,r[p+6],9,-1069501632),l=g(l,f,h,u,r[p+11],14,643717713),u=g(u,l,f,h,r[p+0],20,-373897302),h=g(h,u,l,f,r[p+5],5,-701558691),f=g(f,h,u,l,r[p+10],9,38016083),l=g(l,f,h,u,r[p+15],14,-660478335),u=g(u,l,f,h,r[p+4],20,-405537848),h=g(h,u,l,f,r[p+9],5,568446438),f=g(f,h,u,l,r[p+14],9,-1019803690),l=g(l,f,h,u,r[p+3],14,-187363961),u=g(u,l,f,h,r[p+8],20,1163531501),h=g(h,u,l,f,r[p+13],5,-1444681467),f=g(f,h,u,l,r[p+2],9,-51403784),l=g(l,f,h,u,r[p+7],14,1735328473),h=v(h,u=g(u,l,f,h,r[p+12],20,-1926607734),l,f,r[p+5],4,-378558),f=v(f,h,u,l,r[p+8],11,-2022574463),l=v(l,f,h,u,r[p+11],16,1839030562),u=v(u,l,f,h,r[p+14],23,-35309556),h=v(h,u,l,f,r[p+1],4,-1530992060),f=v(f,h,u,l,r[p+4],11,1272893353),l=v(l,f,h,u,r[p+7],16,-155497632),u=v(u,l,f,h,r[p+10],23,-1094730640),h=v(h,u,l,f,r[p+13],4,681279174),f=v(f,h,u,l,r[p+0],11,-358537222),l=v(l,f,h,u,r[p+3],16,-722521979),u=v(u,l,f,h,r[p+6],23,76029189),h=v(h,u,l,f,r[p+9],4,-640364487),f=v(f,h,u,l,r[p+12],11,-421815835),l=v(l,f,h,u,r[p+15],16,530742520),h=m(h,u=v(u,l,f,h,r[p+2],23,-995338651),l,f,r[p+0],6,-198630844),f=m(f,h,u,l,r[p+7],10,1126891415),l=m(l,f,h,u,r[p+14],15,-1416354905),u=m(u,l,f,h,r[p+5],21,-57434055),h=m(h,u,l,f,r[p+12],6,1700485571),f=m(f,h,u,l,r[p+3],10,-1894986606),l=m(l,f,h,u,r[p+10],15,-1051523),u=m(u,l,f,h,r[p+1],21,-2054922799),h=m(h,u,l,f,r[p+8],6,1873313359),f=m(f,h,u,l,r[p+15],10,-30611744),l=m(l,f,h,u,r[p+6],15,-1560198380),u=m(u,l,f,h,r[p+13],21,1309151649),h=m(h,u,l,f,r[p+4],6,-145523070),f=m(f,h,u,l,r[p+11],10,-1120210379),l=m(l,f,h,u,r[p+2],15,718787259),u=m(u,l,f,h,r[p+9],21,-343485551),h=h+y>>>0,u=u+b>>>0,l=l+w>>>0,f=f+x>>>0}return n.endian([h,u,l,f])})._ff=function(e,t,r,n,i,a,o){var s=e+(t&r|~t&n)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._gg=function(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._hh=function(e,t,r,n,i,a,o){var s=e+(t^r^n)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._ii=function(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):n.bytesToHex(r)}},function(e,t){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var i=e[n]<<16|e[n+1]<<8|e[n+2],a=0;a<4;a++)8*n+6*a<=8*e.length?t.push(r.charAt(i>>>6*(3-a)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,i=0;n<e.length;i=++n%4)0!=i&&t.push((r.indexOf(e.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(e.charAt(n))>>>6-2*i);return t}},e.exports=n},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
  /*!
  	   * Determine if an object is a Buffer
  	   *
  	   * @author   Feross Aboukhadijeh <https://feross.org>
  	   * @license  MIT
  	   */e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){var n=r(0),i=n.CramMalformedError,a=n.CramBufferOverrunError,o=n.CramArgumentError,s=r(8),c=s.parseItem,h=s.tinyMemoize,u=s.sequenceMD5,l=r(17),f=r(76);function p(e,t,r,n){if(!n)throw new i("could not resolve intra-slice mate pairs, file seems truncated or malformed");var a=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==t);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=l.BAM_FPAIRED,n.flags&l.BAM_FUNMAP&&(r.flags|=l.BAM_FMUNMAP),r.flags&l.BAM_FUNMAP&&(n.flags|=l.BAM_FMUNMAP),n.flags&l.BAM_FREVERSE&&(r.flags|=l.BAM_FMREVERSE),r.flags&l.BAM_FREVERSE&&(n.flags|=l.BAM_FMREVERSE),void 0===r.templateLength&&(a?function(e,t,r){var n=function t(r){var n=[r];if(r.mateRecordNumber>=0){var a=e[r.mateRecordNumber];if(!a)throw new i("intra-slice mate record not found, this file seems malformed");n.push.apply(n,on(t(a)))}return n}(r),a=n.map((function(e){return e.alignmentStart})),o=n.map((function(e){return e.alignmentStart+e.readLength-1})),s=Math.max.apply(Math,on(o))-Math.min.apply(Math,on(a))+1;s>=0&&n.forEach((function(e){if(void 0!==e.templateLength)throw new i("mate pair group has some members that have template lengths already, this file seems malformed");e.templateLength=s}))}(e,0,r):function(e,t){var r=Math.min(e.alignmentStart,t.alignmentStart),n=Math.max(e.alignmentStart+e.readLength-1,t.alignmentStart+t.readLength-1)-r+1;e.templateLength=n,t.templateLength=n}(r,n)),delete r.mateRecordNumber}var d=function(){function e(t,r){Wr(this,e),this.container=t,this.file=t.file,this.containerPosition=r}var t,r,n,s,h,l,d;return Yr(e,[{key:"getHeader",value:function(){var e=Vr(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.file.getSectionParsers();case 2:return t=e.sent,e.next=5,this.container.getHeader();case 5:return r=e.sent,e.next=8,this.file.readBlock(r._endPosition+this.containerPosition);case 8:if("MAPPED_SLICE_HEADER"!==(n=e.sent).contentType){e.next=13;break}n.content=c(n.content,t.cramMappedSliceHeader.parser,0,r._endPosition),e.next=16;break;case 13:if("UNMAPPED_SLICE_HEADER"===n.contentType){e.next=15;break}throw new i("error reading slice header block, invalid content type ".concat(n._contentType));case 15:n.content=c(n.content,t.cramUnmappedSliceHeader.parser,0,r._endPosition);case 16:return e.abrupt("return",n);case 17:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBlocks",value:(d=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getHeader();case 2:t=e.sent,r=t._endPosition,n=new Array(t.content.numBlocks),i=0;case 6:if(!(i<n.length)){e.next=14;break}return e.next=9,this.file.readBlock(r);case 9:n[i]=e.sent,r=n[i]._endPosition;case 11:i+=1,e.next=6;break;case 14:return e.abrupt("return",n);case 15:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"getCoreDataBlock",value:(l=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBlocks();case 2:return e.abrupt("return",e.sent[0]);case 3:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"_getBlocksContentIdIndex",value:(h=Vr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getBlocks();case 2:return t=e.sent,r={},e.abrupt("return",(t.forEach((function(e){"EXTERNAL_DATA"===e.contentType&&(r[e.contentId]=e)})),r));case 5:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getBlockByContentId",value:(s=Vr(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._getBlocksContentIdIndex();case 2:return e.t0=t,e.abrupt("return",e.sent[e.t0]);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"getReferenceRegion",value:(n=Vr(regeneratorRuntime.mark((function e(){var t,r,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getHeader();case 2:if(!((t=e.sent.content).refSeqId<0)){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,this.container.getCompressionScheme();case 7:if(r=e.sent,!(t.refBaseBlockId>=0)){e.next=15;break}if(n=this.getBlockByContentId(t.refBaseBlockId)){e.next=12;break}throw new i("embedded reference specified, but reference block does not exist");case 12:if(!(t.span>n.uncompressedSize)){e.next=14;break}throw new i("Embedded reference is too small");case 14:return e.abrupt("return",{seq:n.data.toString("utf8"),start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan});case 15:if(!r.referenceRequired&&!this.file.fetchReferenceSequenceCallback){e.next=24;break}if(this.file.fetchReferenceSequenceCallback){e.next=18;break}throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");case 18:return e.next=20,this.file.fetchReferenceSequenceCallback(t.refSeqId,t.refSeqStart,t.refSeqStart+t.refSeqSpan-1);case 20:if((a=e.sent).length===t.refSeqSpan){e.next=23;break}throw new o("seqFetch callback returned a reference sequence of the wrong length");case 23:return e.abrupt("return",{seq:a,start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan});case 24:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getAllRecords",value:function(){return this.getRecords((function(){return!0}))}},{key:"_fetchRecords",value:(r=Vr(regeneratorRuntime.mark((function e(){var t,r,n,o,s,c,h,l,d,g,v,m,y,b,w,x,k,S,_=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.file.getDefinition();case 2:return t=e.sent,r=t.majorVersion,e.next=6,this.container.getCompressionScheme();case 6:return n=e.sent,e.next=9,this.getHeader();case 9:return o=e.sent,e.next=12,this._getBlocksContentIdIndex();case 12:if(s=e.sent,!(r>1&&this.file.options.checkSequenceMD5&&o.content.refSeqId>=0&&"0000000000000000"!==o.content.md5.join(""))){e.next=21;break}return e.next=16,this.getReferenceRegion();case 16:if(!(c=e.sent)){e.next=21;break}if(h=c.seq,l=c.start,d=c.end,g=u(h),v=o.content.md5.map((function(e){return(e<16?"0":"")+e.toString(16)})).join(""),g===v){e.next=21;break}throw new i("MD5 checksum reference mismatch for ref ".concat(o.content.refSeqId," pos ").concat(l,"..").concat(d,". recorded MD5: ").concat(v,", calculated MD5: ").concat(g));case 21:return e.next=23,this.getCoreDataBlock();case 23:m=e.sent,y={lastAlignmentStart:o.content.refSeqStart||0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{getCursor:function(e){return this[e]||(this[e]={bitPosition:7,bytePosition:0}),this[e]}}},b=function(e){var t=n.getCodecForDataSeries(e);if(!t)throw new i("no codec defined for ".concat(e," data series"));return t.decode(_,m,s,y)},w=new Array(o.content.numRecords),x=0;case 28:if(!(x<w.length)){e.next=42;break}e.prev=29,w[x]=f(this,b,n,o,m,s,y,r,x),w[x].uniqueId=o.contentPosition+o.content.recordCounter+x+1,e.next=39;break;case 33:if(e.prev=33,e.t0=e.catch(29),!(e.t0 instanceof a)){e.next=38;break}return console.warn("read attempted beyond end of buffer, file seems truncated."),w=w.filter((function(e){return!!e})),e.abrupt("break",42);case 38:throw e.t0;case 39:x+=1,e.next=28;break;case 42:for(k=0;k<w.length;k+=1)(S=w[k].mateRecordNumber)>=0&&p(w,k,w[k],w[S]);return e.abrupt("return",w);case 44:case"end":return e.stop()}}),e,this,[[29,33]])}))),function(){return r.apply(this,arguments)})},{key:"getRecords",value:(t=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,h,u,l,f,p,d,g=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.container.filePosition+this.containerPosition,(n=this.file.featureCache.get(r))||(n=this._fetchRecords(),this.file.featureCache.set(r,n)),e.next=5,n;case 5:if(!(i=e.sent.filter(t)).length||!this.file.fetchReferenceSequenceCallback){e.next=20;break}return e.next=9,this.getHeader();case 9:if(!((a=e.sent).content.refSeqId>=0||-2===a.content.refSeqId)){e.next=20;break}return o=a.content.refSeqId>=0?a.content.refSeqId:void 0,e.next=14,this.container.getCompressionScheme();case 14:for(s=e.sent,c={},h=0;h<i.length;h+=1)u=void 0!==o?o:i[h].sequenceId,(l=c[u])||(l={id:u,start:i[h].alignmentStart,end:-1/0},c[u]=l),(f=i[h].alignmentStart+(i[h].lengthOnRef||i[h].readLength)-1)>l.end&&(l.end=f),i[h].alignmentStart<l.start&&(l.start=i[h].alignmentStart);return e.next=19,Promise.all(Object.values(c).map(function(){var e=Vr(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=-1!==t.id&&t.start<=t.end,!e.t0){e.next=5;break}return e.next=4,g.file.fetchReferenceSequenceCallback(t.id,t.start,t.end);case 4:t.seq=e.sent;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 19:for(p=0;p<i.length;p+=1)(d=c[void 0!==o?o:i[p].sequenceId])&&d.seq&&i[p].addReferenceSequence(d,s);case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((function(e){return h(d,e)})),e.exports=d},function(e,t,r){(function(t){var n=r(0),i=n.CramMalformedError,a=n.CramUnimplementedError,o=r(31),s=r(77),c=r(17);function h(e){var t=e.indexOf(0);return-1===t?e.toString("utf8"):e.toString("utf8",0,t)}function u(e,r){if(r.readInt32LE||(r=t.from(r)),"Z"===e)return h(r);if("A"===e)return String.fromCharCode(r[0]);if("I"===e){var n=o.fromBytesLE(r);if(n.greaterThan(Number.MAX_SAFE_INTEGER)||n.lessThan(Number.MIN_SAFE_INTEGER))throw new a("integer overflow");return n.toNumber()}if("i"===e)return r.readInt32LE(0);if("s"===e)return r.readInt16LE(0);if("S"===e)return r.readUInt16LE(0);if("c"===e)return r.readInt8(0);if("C"===e)return r.readUInt8(0);if("f"===e)return r.readFloatLE(0);if("H"===e){var s=h(r);return Number.parseInt(s.replace(/^0x/,""),16)}if("B"===e)return function(e){var t=String.fromCharCode(e[0]),r=e.readInt32LE(1),n={c:["readInt8",1],C:["readUInt8",1],s:["readInt16LE",2],S:["readUInt16LE",2],i:["readInt32LE",4],I:["readUInt32LE",4],f:["readFloatLE",4]}[t];if(!n)throw new i("invalid tag value array type '".concat(t,"'"));for(var a=an(n,2),o=a[0],s=a[1],c=new Array(r),h=5,u=0;u<r;u+=1)c[u]=e[o](h),h+=s;return c}(r);throw new i("Unrecognized tag type ".concat(e))}function l(e){if(e instanceof t)return h(e);if(e.length&&e.indexOf){if(!e[e.length-1]){var r=e.indexOf(0);return String.fromCharCode.apply(String,on(e.slice(0,r)))}return String.fromCharCode.apply(String,on(e))}return String(e)}e.exports=function(e,t,r,n,a,o,h,f,p){var d=new s;if(d.flags=t("BF"),d.cramFlags=t("CF"),f>1&&-2===n.content.refSeqId?d.sequenceId=t("RI"):d.sequenceId=n.content.refSeqId,d.readLength=t("RL"),d.alignmentStart=t("AP"),r.APdelta&&(d.alignmentStart+=h.lastAlignmentStart),h.lastAlignmentStart=d.alignmentStart,d.readGroupId=t("RG"),r.readNamesIncluded&&(d.readName=l(t("RN"))),d.isDetached()){var g={};g.flags=t("MF"),r.readNamesIncluded||(g.readName=l(t("RN")),d.readName=g.readName),g.sequenceId=t("NS"),g.alignmentStart=t("NP"),(g.flags||g.sequenceId>-1)&&(d.mate=g),d.templateSize=t("TS"),g.flags&c.CRAM_M_UNMAP&&(d.flags|=c.BAM_FMUNMAP),g.flags&c.CRAM_M_REVERSE&&(d.flags|=c.BAM_FMREVERSE)}else d.hasMateDownStream()&&(d.mateRecordNumber=t("NF")+p+1);var v=t("TL");if(v<0)throw new i("invalid TL index");for(var m=r.getTagNames(v),y=m.length,b=0;b<y;b+=1){var w=m[b],x=w.substr(0,2),k=w.substr(2,1),S=r.getCodecForTag(w);if(!S)throw new i("no codec defined for auxiliary tag ".concat(w));var _=S.decode(e,a,o,h);d.tags[x]=u(k,_)}if(d.isSegmentUnmapped())if(d.isUnknownBases())d.readBases=null,d.qualityScores=null;else{for(var C=new Array(d.readLength),A=0;A<C.length;A+=1)C[A]=t("BA");if(d.readBases=String.fromCharCode.apply(String,C),d.isPreservingQualityScores()){for(var E=0;E<C.length;E+=1)C[E]=t("QS");d.qualityScores=C}}else{var R=t("FN");R&&(d.readFeatures=function(e,t,r,n,a){var o=0,s=e.alignmentStart-1,c=new Array(t);function h(e){var t=an(e,2),n=t[0],i=t[1],a=r(i);return"character"===n?String.fromCharCode(a):"string"===n?a.toString("utf8"):"numArray"===n?a.toArray():a}for(var u=0;u<t;u+=1){var l=String.fromCharCode(r("FC")),f=r("FP"),p={code:l},d={B:["character","BA"],S:["string",a>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[l];if(!d)throw new i('invalid read feature code "'.concat(l,'"'));p.data=h(d);var g={B:["number","QS"]}[l];g&&(p.data=[p.data,h(g)]),o+=f,p.pos=o,s+=f,p.refPos=s,"D"===l||"N"===l?s+=p.data:"H"===l?s-=p.data:"I"===l||"S"===l?s-=p.data.length:"i"===l&&(s-=1),c[u]=p}return c}(d,R,t,0,f));var T=d.readLength;if(d.readFeatures&&d.readFeatures.forEach((function(e){var t=e.code,r=e.data;"D"===t||"N"===t?T+=r:"I"===t||"S"===t?T-=r.length:"i"===t&&(T-=1)})),Number.isNaN(T)&&(console.warn("".concat(d.readName||"".concat(d.sequenceId,":").concat(d.alignmentStart)," record has invalid read features")),T=d.readLength),d.lengthOnRef=T,d.mappingQuality=t("MQ"),d.isPreservingQualityScores()){for(var I=new Array(d.readLength),L=0;L<I.length;L+=1)I[L]=t("QS");d.qualityScores=I}}return d}}).call(this,r(1).Buffer)},function(e,t,r){var n=r(17),i={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};e.exports=function(){function e(){Wr(this,e),this.tags={}}return Yr(e,[{key:"isPaired",value:function(){return!!(this.flags&n.BAM_FPAIRED)}},{key:"isProperlyPaired",value:function(){return!!(this.flags&n.BAM_FPROPER_PAIR)}},{key:"isSegmentUnmapped",value:function(){return!!(this.flags&n.BAM_FUNMAP)}},{key:"isMateUnmapped",value:function(){return!!(this.flags&n.BAM_FMUNMAP)}},{key:"isReverseComplemented",value:function(){return!!(this.flags&n.BAM_FREVERSE)}},{key:"isMateReverseComplemented",value:function(){return!!(this.flags&n.BAM_FMREVERSE)}},{key:"isRead1",value:function(){return!!(this.flags&n.BAM_FREAD1)}},{key:"isRead2",value:function(){return!!(this.flags&n.BAM_FREAD2)}},{key:"isSecondary",value:function(){return!!(this.flags&n.BAM_FSECONDARY)}},{key:"isFailedQc",value:function(){return!!(this.flags&n.BAM_FQCFAIL)}},{key:"isDuplicate",value:function(){return!!(this.flags&n.BAM_FDUP)}},{key:"isSupplementary",value:function(){return!!(this.flags&n.BAM_FSUPPLEMENTARY)}},{key:"isDetached",value:function(){return!!(this.cramFlags&n.CRAM_FLAG_DETACHED)}},{key:"hasMateDownStream",value:function(){return!!(this.cramFlags&n.CRAM_FLAG_MATE_DOWNSTREAM)}},{key:"isPreservingQualityScores",value:function(){return!!(this.cramFlags&n.CRAM_FLAG_PRESERVE_QUAL_SCORES)}},{key:"isUnknownBases",value:function(){return!!(this.cramFlags&n.CRAM_FLAG_NO_SEQ)}},{key:"getReadBases",value:function(){return!this.readBases&&this._refRegion&&(this.readBases=function(e,t){if((e.lengthOnRef||e.readLength)&&!e.isUnknownBases()){var r=e.alignmentStart-t.start;if(!e.readFeatures)return t.seq.substr(r,e.lengthOnRef).toUpperCase();for(var n="",i=r,a=0;n.length<e.readLength;)if(a<e.readFeatures.length&&e.readFeatures[a].pos===n.length+1){var o=e.readFeatures[a];a+=1,"b"===o.code?(n+=o.data,i+=1):"B"===o.code?(n+=o.data[0],i+=1):"X"===o.code?(n+=o.sub,i+=1):"I"===o.code?n+=o.data:"D"===o.code?i+=o.data:"i"===o.code?n+=o.data:"N"===o.code?i+=o.data:"S"===o.code?n+=o.data:"P"===o.code||o.code}else if(a<e.readFeatures.length){var s=t.seq.substr(i,e.readFeatures[a].pos-n.length-1);n+=s,i+=s.length}else{var c=t.seq.substr(i,e.readLength-n.length);n+=c,i+=c.length}return n.toUpperCase()}}(this,this._refRegion)),this.readBases}},{key:"getPairOrientation",value:function(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.sequenceId===this.mate.sequenceId){var e=this.isReverseComplemented()?"R":"F",t=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var i=[],a=this.templateLength||this.templateSize;return this.alignmentStart>this.mate.alignmentStart&&a>0&&(a=-a),a>0?(i[0]=e,i[1]=r,i[2]=t,i[3]=n):(i[2]=e,i[3]=r,i[0]=t,i[1]=n),i.join("")}return null}},{key:"addReferenceSequence",value:function(e,t){this.readFeatures&&this.readFeatures.forEach((function(r){"X"===r.code&&function(e,t,r,n){if(t){var a=n.refPos-t.start,o=t.seq.charAt(a);o&&(n.ref=o);var s=i[o];void 0===s&&(s=4);var c=r.substitutionMatrix[s][n.data];c&&(n.sub=c)}}(0,e,t,r)})),!this.readBases&&e.start<=this.alignmentStart&&e.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=e)}},{key:"toJSON",value:function(){var e=this,t={};return Object.keys(this).forEach((function(r){"_"!==r.charAt(0)&&(t[r]=e[r])})),t.readBases=this.getReadBases(),t}}]),e}()},function(e,t,r){var n=r(0).CramMalformedError,i=r(79).instantiateCodec,a={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int",TM:"ignore",TV:"ignore"};e.exports=function(){function e(t){Wr(this,e),Object.assign(this,t),this.readNamesIncluded=t.preservation.RN,this.APdelta=t.preservation.AP,this.referenceRequired=!!t.preservation.RR,this.tagIdsDictionary=t.preservation.TD,this.substitutionMatrix=function(e){for(var t=new Array(5),r=0;r<5;r+=1)t[r]=new Array(4);return t[0][e[0]>>6&3]="C",t[0][e[0]>>4&3]="G",t[0][e[0]>>2&3]="T",t[0][e[0]>>0&3]="N",t[1][e[1]>>6&3]="A",t[1][e[1]>>4&3]="G",t[1][e[1]>>2&3]="T",t[1][e[1]>>0&3]="N",t[2][e[2]>>6&3]="A",t[2][e[2]>>4&3]="C",t[2][e[2]>>2&3]="T",t[2][e[2]>>0&3]="N",t[3][e[3]>>6&3]="A",t[3][e[3]>>4&3]="C",t[3][e[3]>>2&3]="G",t[3][e[3]>>0&3]="N",t[4][e[4]>>6&3]="A",t[4][e[4]>>4&3]="C",t[4][e[4]>>2&3]="G",t[4][e[4]>>0&3]="T",t}(t.preservation.SM),this.dataSeriesCodecCache={},this.tagCodecCache={}}return Yr(e,[{key:"getCodecForTag",value:function(e){if(!this.tagCodecCache[e]){var t=this.tagEncoding[e];t&&(this.tagCodecCache[e]=i(t,"byteArray"))}return this.tagCodecCache[e]}},{key:"getTagNames",value:function(e){return this.tagIdsDictionary[e]}},{key:"getCodecForDataSeries",value:function(e){if(!this.dataSeriesCodecCache[e]){var t=this.dataSeriesEncoding[e];if(t){var r=a[e];if(!r)throw new n("data series name ".concat(e," not defined in file compression header"));this.dataSeriesCodecCache[e]=i(t,r)}}return this.dataSeriesCodecCache[e]}},{key:"toJSON",value:function(){var e=this,t={};return Object.keys(this).forEach((function(r){/Cache$/.test(r)||(t[r]=e[r])})),t}}]),e}()},function(e,t,r){var n=r(0).CramUnimplementedError,i=r(80),a=r(81),o=r(82),s=r(83),c=r(84),h=r(85),u={1:a,3:i,4:s,5:o,6:c,7:r(86),9:h};function l(e){return u[e]}e.exports={getCodecClassWithId:l,instantiateCodec:function e(t,r){var i=l("ignore"===r?0:t.codecId);if(!i)throw new n("no codec implemented for codec ID ".concat(t.codecId));return new i(t.parameters,r,e)}}},function(e,t,r){var n=r(0).CramMalformedError,i=r(6);e.exports=function(e){Xr(r,e);var t=nn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Wr(this,r),e=t.call(this,n,i),!["byte","int"].includes(e.dataType))throw new TypeError("".concat(e.dataType," decoding not yet implemented by HUFFMAN_INT codec"));return e.buildCodeBook(),e.buildCodes(),e.buildCaches(),0===e.sortedCodes[0].bitLength&&(e._decode=e._decodeZeroLengthCode),rn(e)}return Yr(r,[{key:"buildCodeBook",value:function(){for(var e=this,t=new Array(this.parameters.numCodes),r=0;r<this.parameters.numCodes;r+=1)t[r]={symbol:this.parameters.symbols[r],bitLength:this.parameters.bitLengths[r]};t=t.sort((function(e,t){return e.bitLength-t.bitLength||e.symbol-t.symbol})),this.codeBook={},t.forEach((function(t){e.codeBook[t.bitLength]||(e.codeBook[t.bitLength]=[]),e.codeBook[t.bitLength].push(t.symbol)}))}},{key:"buildCodes",value:function(){var e=this;this.codes={};var t=0,r=-1;Object.entries(this.codeBook).forEach((function(i){var a=an(i,2),o=a[0],s=a[1];o=parseInt(o,10),s.forEach((function(i){var a={bitLength:o,value:i};r+=1;var s=o-t;if(r<<=s,a.bitCode=r,t+=s,function(e){var t=e-(e>>1)&1431655765;return 16843009*((t=(858993459&t)+(t>>2&858993459))+(t>>4)&252645135)>>24}(r)>o)throw new n("Symbol out of range");e.codes[i]=a}))}))}},{key:"buildCaches",value:function(){this.sortedCodes=Object.values(this.codes).sort((function(e,t){return e.bitLength-t.bitLength||e.bitCode-t.bitCode})),this.sortedByValue=Object.values(this.codes).sort((function(e,t){return e.value-t.value})),this.sortedValuesByBitCode=this.sortedCodes.map((function(e){return e.value})),this.sortedBitCodes=this.sortedCodes.map((function(e){return e.bitCode})),this.sortedBitLengthsByBitCode=this.sortedCodes.map((function(e){return e.bitLength}));var e=Math.max.apply(Math,on(this.sortedBitCodes));this.bitCodeToValue=new Array(e+1).fill(-1);for(var t=0;t<this.sortedBitCodes.length;t+=1)this.bitCodeToValue[this.sortedCodes[t].bitCode]=t}},{key:"decode",value:function(e,t,r,n){return this._decode(e,t,n.coreBlock)}},{key:"_decodeZeroLengthCode",value:function(){return this.sortedCodes[0].value}},{key:"_decode",value:function(e,t,r){for(var i=t.content,a=0,o=0,s=0;s<this.sortedCodes.length;s+=1){var c=this.sortedCodes[s].bitLength;o<<=c-a,o|=this._getBits(i,r,c-a),a=c;var h=this.bitCodeToValue[o];if(h>-1&&this.sortedBitLengthsByBitCode[h]===c)return this.sortedValuesByBitCode[h];for(var u=s;this.sortedCodes[u+1].bitLength===c&&u<this.sortedCodes.length;u+=1)s+=1}throw new n("Huffman symbol not found.")}}]),r}(i)},function(e,t,r){var n=r(0),i=n.CramUnimplementedError,a=n.CramMalformedError,o=n.CramBufferOverrunError,s=r(6),c=r(8).parseItf8;e.exports=function(e){Xr(r,e);var t=nn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Wr(this,r),"int"===(e=t.call(this,n,a)).dataType)e._decodeData=e._decodeInt;else{if("byte"!==e.dataType)throw new i("".concat(e.dataType," decoding not yet implemented by EXTERNAL codec"));e._decodeData=e._decodeByte}return rn(e)}return Yr(r,[{key:"decode",value:function(e,t,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decodeData(o,s)}},{key:"_decodeInt",value:function(e,t){var r=an(c(e.content,t.bytePosition),2),n=r[0],i=r[1];return t.bytePosition+=i,n}},{key:"_decodeByte",value:function(e,t){if(t.bytePosition>=e.content.length)throw new o("attempted to read beyond end of block. this file seems truncated.");var r=e.content[t.bytePosition];return t.bytePosition+=1,r}}]),r}(s)},function(e,t,r){var n=r(0),i=n.CramBufferOverrunError,a=n.CramMalformedError,o=r(6);e.exports=function(e){Xr(r,e);var t=nn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Wr(this,r),e=t.call(this,n,i),"byteArray"!==i)throw new TypeError("byteArrayStop codec does not support data type ".concat(i));return e._decode=e._decodeByteArray,rn(e)}return Yr(r,[{key:"decode",value:function(e,t,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decode(o,s)}},{key:"_decodeByteArray",value:function(e,t){for(var r=e.content,n=this.parameters.stopByte,a=t.bytePosition,o=t.bytePosition;r[o]!==n&&o<r.length;){if(o===r.length)throw new i("byteArrayStop reading beyond length of data buffer?");o+=1}return t.bytePosition=o+1,r.slice(a,o)}}]),r}(o)},function(e,t,r){var n=r(8).tinyMemoize,i=function(e){Xr(r,e);var t=nn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;if(Wr(this,r),(e=t.call(this,n,i)).instantiateCodec=a,"byteArray"!==i)throw new TypeError("byteArrayLength does not support data type ".concat(i));return rn(e)}return Yr(r,[{key:"decode",value:function(e,t,r,n){for(var i=this._getLengthCodec().decode(e,t,r,n),a=this._getDataCodec(),o=new Array(i),s=0;s<i;s+=1)o[s]=a.decode(e,t,r,n);return o}},{key:"_getLengthCodec",value:function(){var e=this.parameters.lengthsEncoding;return this.instantiateCodec(e,"int")}},{key:"_getDataCodec",value:function(){var e=this.parameters.valuesEncoding;return this.instantiateCodec(e,"byte")}}]),r}(r(6));"_getLengthCodec _getDataCodec".split(" ").forEach((function(e){return n(i,e)})),e.exports=i},function(e,t,r){var n=r(0).CramUnimplementedError,i=r(6);e.exports=function(e){Xr(r,e);var t=nn(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Wr(this,r),"int"!==(e=t.call(this,i,a)).dataType)throw new n("".concat(e.dataType," decoding not yet implemented by BETA codec"));return rn(e)}return Yr(r,[{key:"decode",value:function(e,t,r,n){return this._getBits(t.content,n.coreBlock,this.parameters.length)-this.parameters.offset}}]),r}(i)},function(e,t,r){var n=r(0).CramUnimplementedError,i=r(6);e.exports=function(e){Xr(r,e);var t=nn(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Wr(this,r),"int"!==(e=t.call(this,i,a)).dataType)throw new n("".concat(e.dataType," decoding not yet implemented by GAMMA codec"));return rn(e)}return Yr(r,[{key:"decode",value:function(e,t,r,n){for(var i=1;0===this._getBits(t.content,n.coreBlock,1);)i+=1;return(this._getBits(t.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset}}]),r}(i)},function(e,t,r){var n=r(0).CramUnimplementedError,i=r(6);e.exports=function(e){Xr(r,e);var t=nn(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Wr(this,r),"int"!==(e=t.call(this,i,a)).dataType)throw new n("".concat(e.dataType," decoding not yet implemented by SUBEXP codec"));return rn(e)}return Yr(r,[{key:"decode",value:function(e,t,r,n){for(var i,a,o=0;this._getBits(t.content,n.coreBlock,1);)o+=1;return 0===o?(i=this.parameters.K,a=this._getBits(t.content,n.coreBlock,i)):a=1<<(i=o+this.parameters.K-1)|this._getBits(t.content,n.coreBlock,i),a-this.parameters.offset}}]),r}(i)},function(e,t,r){var n=r(88),i=r(90);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){return i.isString(e)&&(e=b(e)),e instanceof a?e.format():a.prototype.format.call(e)},t.Url=a;var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,h=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(h),l=["%","/","?",";","#"].concat(u),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(91);function b(e,t,r){if(e&&i.isObject(e)&&e instanceof a)return e;var n=new a;return n.parse(e,t,r),n}a.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+qr(e));var a=e.indexOf("?"),s=-1!==a&&a<e.indexOf("#")?"?":"#",h=e.split(s);h[0]=h[0].replace(/\\/g,"/");var b=e=h.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var w=c.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=o.exec(b);if(x){var k=(x=x[0]).toLowerCase();this.protocol=k,b=b.substr(x.length)}if(r||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===b.substr(0,2);!S||x&&v[x]||(b=b.substr(2),this.slashes=!0)}if(!v[x]&&(S||x&&!m[x])){for(var _,C,A=-1,E=0;E<f.length;E++)-1!==(R=b.indexOf(f[E]))&&(-1===A||R<A)&&(A=R);for(-1!==(C=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(_=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(_)),A=-1,E=0;E<l.length;E++){var R;-1!==(R=b.indexOf(l[E]))&&(-1===A||R<A)&&(A=R)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var I=this.hostname.split(/\./),L=(E=0,I.length);E<L;E++){var M=I[E];if(M&&!M.match(p)){for(var P="",O=0,F=M.length;O<F;O++)M.charCodeAt(O)>127?P+="x":P+=M[O];if(!P.match(p)){var N=I.slice(0,E),D=I.slice(E+1),B=M.match(d);B&&(N.push(B[1]),D.unshift(B[2])),D.length&&(b="/"+D.join(".")+b),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+z,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[k])for(E=0,L=u.length;E<L;E++){var H=u[E];if(-1!==b.indexOf(H)){var $=encodeURIComponent(H);$===H&&($=escape(H)),b=b.split(H).join($)}}var j=b.indexOf("#");-1!==j&&(this.hash=b.substr(j),b=b.slice(0,j));var q=b.indexOf("?");if(-1!==q?(this.search=b.substr(q),this.query=b.substr(q+1),t&&(this.query=y.parse(this.query)),b=b.slice(0,q)):t&&(this.search="",this.query={}),b&&(this.pathname=b),m[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var G=this.search||"";this.path=z+G}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",a=!1,o="";this.host?a=e+this.host:this.hostname&&(a=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(o=y.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||m[t])&&!1!==a?(a="//"+(a||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):a||(a=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+a+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},a.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(i.isString(e)){var t=new a;t.parse(e,!1,!0),e=t}for(var r=new a,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),h=0;h<c.length;h++){var u=c[h];"protocol"!==u&&(r[u]=e[u])}return m[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!m[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var p=l[f];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||v[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",y=r.search||"";r.path=g+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||b||r.host&&e.pathname,k=x,S=r.pathname&&r.pathname.split("/")||[],_=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!m[r.protocol]);if(_&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),x=x&&(""===d[0]||""===S[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=d;else if(d.length)S||(S=[]),S.pop(),S=S.concat(d),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search))return _&&(r.hostname=r.host=S.shift(),(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=S.slice(-1)[0],A=(r.host||e.host||S.length>1)&&("."===C||".."===C)||""===C,E=0,R=S.length;R>=0;R--)"."===(C=S[R])?S.splice(R,1):".."===C?(S.splice(R,1),E++):E&&(S.splice(R,1),E--);if(!x&&!k)for(;E--;E)S.unshift("..");!x||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var T,I=""===S[0]||S[0]&&"/"===S[0].charAt(0);return _&&(r.hostname=r.host=I?"":S.length?S.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift())),(x=x||r.host&&S.length)&&!I&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},a.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){(function(e,n){var i;
  /*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){t&&t.nodeType,e&&e.nodeType;var o="object"==qr(n)&&n;o.global!==o&&o.window!==o&&o.self;var s,c=2147483647,h=36,u=/^xn--/,l=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(p[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function y(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(f,".")).split("."),t).join(".")}function b(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function w(e){return m(e,(function(e){var t="";return e>65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+g(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=h)e=d(e/35);return d(n+36*e/(e+38))}function S(e){var t,r,n,i,a,o,s,u,l,f,p,g=[],m=e.length,y=0,b=128,x=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&v("not-basic"),g.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(a=y,o=1,s=h;i>=m&&v("invalid-input"),((u=(p=e.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:h)>=h||u>d((c-y)/o))&&v("overflow"),y+=u*o,!(u<(l=s<=x?1:s>=x+26?26:s-x));s+=h)o>d(c/(f=h-l))&&v("overflow"),o*=f;x=k(y-a,t=g.length+1,0==a),d(y/t)>c-b&&v("overflow"),b+=d(y/t),y%=t,g.splice(y++,0,b)}return w(g)}function _(e){var t,r,n,i,a,o,s,u,l,f,p,m,y,w,S,_=[];for(m=(e=b(e)).length,t=128,r=0,a=72,o=0;o<m;++o)(p=e[o])<128&&_.push(g(p));for(n=i=_.length,i&&_.push("-");n<m;){for(s=c,o=0;o<m;++o)(p=e[o])>=t&&p<s&&(s=p);for(s-t>d((c-r)/(y=n+1))&&v("overflow"),r+=(s-t)*y,t=s,o=0;o<m;++o)if((p=e[o])<t&&++r>c&&v("overflow"),p==t){for(u=r,l=h;!(u<(f=l<=a?1:l>=a+26?26:l-a));l+=h)S=u-f,w=h-f,_.push(g(x(f+S%w,0))),u=d(S/w);_.push(g(x(u,0))),a=k(r,y,n==i),r=0,++n}++r,++t}return _.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:w},decode:S,encode:_,toASCII:function(e){return y(e,(function(e){return l.test(e)?"xn--"+_(e):e}))},toUnicode:function(e){return y(e,(function(e){return u.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(89)(e),r(2))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==qr(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){t.decode=t.parse=r(92),t.encode=t.stringify=r(93)},function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,a){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var c=1e3;a&&"number"==typeof a.maxKeys&&(c=a.maxKeys);var h=e.length;c>0&&h>c&&(h=c);for(var u=0;u<h;++u){var l,f,p,d,g=e[u].replace(s,"%20"),v=g.indexOf(r);v>=0?(l=g.substr(0,v),f=g.substr(v+1)):(l=g,f=""),p=decodeURIComponent(l),d=decodeURIComponent(f),n(o,p)?i(o[p])?o[p].push(d):o[p]=[o[p],d]:o[p]=d}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){var n=function(e){switch(qr(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==qr(e)?a(o(e),(function(o){var s=encodeURIComponent(n(o))+r;return i(e[o])?a(e[o],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[o]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){(function(t){var n=r(95),i=r(96);e.exports=function(){function e(t){var r=this;Wr(this,e),this.position=0,this.url=t,this.cache=new i({fetch:function(e,t){return r._fetch(e,t)}})}var r,a,o;return Yr(e,[{key:"_fetch",value:(o=Vr(regeneratorRuntime.mark((function e(r,i){var a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={},i<1/0?a.range="bytes=".concat(r,"-").concat(r+i):i===1/0&&0!==r&&(a.range="bytes=".concat(r,"-")),e.next=4,n(this.url,{method:"GET",headers:a,redirect:"follow",mode:"cors"});case 4:if((200!==(o=e.sent).status||0!==r)&&206!==o.status){e.next=13;break}return e.t0=t,e.next=9,o.arrayBuffer();case 9:return e.t1=e.sent,s=e.t0.from.call(e.t0,e.t1),c=/\/(\d+)$/.exec(o.headers.get("content-range")),e.abrupt("return",(c&&c[1]?this._stat={size:parseInt(c[1],10)}:this._stat={size:void 0},s));case 13:throw new Error("HTTP ".concat(o.status," fetching ").concat(this.url));case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"read",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return null===n&&(this.position,this.position+=r),this.cache.get(e,t,r,n)}},{key:"readFile",value:(a=Vr(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(this.url,{method:"GET",redirect:"follow",mode:"cors"});case 2:return r=e.sent,e.t0=t,e.next=6,r.arrayBuffer();case 6:return e.t1=e.sent,e.abrupt("return",e.t0.from.call(e.t0,e.t1));case 8:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"stat",value:(r=Vr(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._stat){e.next=6;break}return r=t.allocUnsafe(10),e.next=4,this.read(r,0,10,0);case 4:if(this._stat){e.next=6;break}throw new Error("unable to determine size of file at ".concat(this.url));case 6:return e.abrupt("return",this._stat);case 7:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}]),e}()}).call(this,r(1).Buffer)},function(e,t){var r=function(e){function t(){this.fetch=!1}return t.prototype=e,new t}("undefined"!=typeof self?self:this);!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function h(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=d(t);return t.readAsArrayBuffer(e),r}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=d(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=h(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[h(e)]},f.prototype.get=function(e){return e=h(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(h(e))},f.prototype.set=function(e,t){this.map[h(e)]=u(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),l(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),l(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),l(e)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),y.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];x.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,r){return new Promise((function(n,a){var o=new b(e,r);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new x(i,r))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",c)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=f,e.Request=b,e.Response=x),t.Headers=f,t.Request=b,t.Response=x,t.fetch=S}({})}(r),delete r.fetch.polyfill,e.exports=t=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,t.default=r.fetch},function(e,t,r){var n=r(30);e.exports=function(){function e(t){var r=t.fetch,i=t.size,a=void 0===i?1e7:i,o=t.chunkSize,s=void 0===o?32768:o;if(Wr(this,e),!r)throw new Error("fetch function required");this.fetch=r,this.chunkSize=s,this.lruCache=new n({maxSize:Math.floor(a/s)})}var t;return Yr(e,[{key:"get",value:(t=Vr(regeneratorRuntime.mark((function e(t,r,n,i){var a,o,s,c,h,u,l,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length<r+n)){e.next=2;break}throw new Error("output buffer not big enough for request");case 2:for(a=Math.floor(i/this.chunkSize),o=Math.floor((i+n)/this.chunkSize),s=new Array(o-a+1),c=function(e){s[e-a]=f._getChunk(e).then((function(t){return{data:t,chunkNumber:e}}))},h=a;h<=o;h+=1)c(h);return e.next=7,Promise.all(s);case 7:u=e.sent,l=i-u[0].chunkNumber*this.chunkSize,u.forEach((function(e){var s=e.data,c=e.chunkNumber,h=c*f.chunkSize,u=0,p=f.chunkSize,d=r+(c-a)*f.chunkSize-l;c===a&&(d=r,u=l),c===o&&(p=i+n-h),s.copy(t,d,u,p)}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i){return t.apply(this,arguments)})},{key:"_getChunk",value:function(e){var t=this.lruCache.get(e);if(t)return t;var r=this.fetch(e*this.chunkSize,this.chunkSize);return this.lruCache.set(e,r),r}}]),e}()},function(e,t,r){r(34).promisify;var n=null,i=n;e.exports=function(){function e(t){Wr(this,e),this.position=0,this.filename=t,this.fd=i(this.filename,"r")}var t,r,n;return Yr(e,[{key:"read",value:(n=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:0,n=a.length>2?a[2]:void 0,null===(i=a.length>3?a[3]:void 0)&&(this.position,this.position+=n),e.t0=null,e.next=8,this.fd;case 8:return e.t1=e.sent,e.t2=t,e.t3=r,e.t4=n,e.t5=i,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t3,e.t4,e.t5));case 14:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"readFile",value:(r=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=null,e.next=3,this.fd;case 3:return e.t1=e.sent,e.abrupt("return",(0,e.t0)(e.t1));case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"stat",value:(t=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this._stat,e.t0){e.next=9;break}return e.t1=null,e.next=5,this.fd;case 5:return e.t2=e.sent,e.next=8,(0,e.t1)(e.t2);case 8:this._stat=e.sent;case 9:return e.abrupt("return",this._stat);case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}()},function(e,t){e.exports={parseHeaderText:function(e){var t=e.split(/\r?\n/),r=[];return t.forEach((function(e){var t=function(e){return sn(e)||cn(e)||hn(e)||ln()}(e.split(/\t/)),n=t[0],i=t.slice(1).map((function(e){var t=an(e.split(":",2),2);return{tag:t[0],value:t[1]}}));n&&r.push({tag:n.substr(1),data:i})})),r}}},function(e,t,r){var n=r(0),i=n.CramUnimplementedError,a=n.CramSizeLimitError,o=r(18);e.exports=function(){function e(t){if(Wr(this,e),t.cram?this.cram=t.cram:this.cram=new o({url:t.cramUrl,path:t.cramPath,filehandle:t.cramFilehandle,seqFetch:t.seqFetch,checkSequenceMD5:t.checkSequenceMD5,cacheSize:t.cacheSize}),!(this.cram instanceof o))throw new Error("invalid arguments: no cramfile");if(this.index=t.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index");this.fetchSizeLimit=t.fetchSizeLimit||3e6}var t;return Yr(e,[{key:"getRecordsForRange",value:(t=Vr(regeneratorRuntime.mark((function e(t,r,n){var o,s,c,h,u,l,f,p,d,g,v,m,y,b,w,x,k,S,_,C,A,E,R,T,I,L,M,P=this,O=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((s=O.length>3&&void 0!==O[3]?O[3]:{}).viewAsPairs=s.viewAsPairs||!1,s.pairAcrossChr=s.pairAcrossChr||!1,s.maxInsertSize=s.maxInsertSize||2e5,"string"!=typeof t){e.next=3;break}throw new i("string sequence names not yet supported");case 3:return c=t,e.next=6,this.index.getEntriesForRange(c,r,n);case 6:if(h=e.sent,!((u=h.map((function(e){return e.sliceBytes})).reduce((function(e,t){return e+t}),0))>this.fetchSizeLimit)){e.next=10;break}throw new a("data size of ".concat(u.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));case 10:return l=function(e){return e.sequenceId===t&&e.alignmentStart<=n&&e.alignmentStart+e.lengthOnRef>=r},e.next=13,Promise.all(h.map((function(e){return P.getRecordsInSlice(e,l)})));case 13:if(f=e.sent,p=(o=Array.prototype).concat.apply(o,on(f)),!s.viewAsPairs){e.next=36;break}for(d={},g={},v=0;v<p.length;v+=1)m=p[v].readName,y=p[v].uniqueId,d[m]||(d[m]=0),d[m]+=1,g[y]=1;for(b={},Object.entries(d).forEach((function(e){var t=an(e,2),r=t[0];1===t[1]&&(b[r]=!0)})),w=[],x=0;x<p.length;x+=1)k=p[x].readName,b[k]&&p[x].mate&&(p[x].mate.sequenceId===c||s.pairAcrossChr)&&Math.abs(p[x].alignmentStart-p[x].mate.alignmentStart)<s.maxInsertSize&&(S=this.index.getEntriesForRange(p[x].mate.sequenceId,p[x].mate.alignmentStart,p[x].mate.alignmentStart+1),w.push(S));return e.next=24,Promise.all(w);case 24:for(_=e.sent,C=[],A=0;A<_.length;A+=1)(E=C).push.apply(E,on(_[A]));if(C=C.sort((function(e,t){return e.toString().localeCompare(t.toString())})).filter((function(e,t,r){return!t||e.toString()!==r[t-1].toString()})),R=[],T=[],!((I=C.map((function(e){return e.sliceBytes})).reduce((function(e,t){return e+t}),0))>this.fetchSizeLimit)){e.next=31;break}throw new Error("mate data size of ".concat(I.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));case 31:return C.forEach((function(e){var t=P.cram.featureCache.get(e.toString());t||(t=P.getRecordsInSlice(e,(function(){return!0})),P.cram.featureCache.set(e.toString(),t)),R.push(t);var r=t.then((function(e){for(var t=[],r=0;r<e.length;r+=1){var n=e[r];b[n.readName]&&!g[n.uniqueId]&&t.push(n)}return t}));T.push(r)})),e.next=34,Promise.all(T);case 34:(L=e.sent).length&&(M=L.reduce((function(e,t){return e.concat(t)})),p=p.concat(M));case 36:return e.abrupt("return",p);case 37:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"getRecordsInSlice",value:function(e,t){var r=e.containerStart,n=e.sliceStart,i=e.sliceBytes;return this.cram.getContainerAtPosition(r).getSlice(n,i).getRecords(t)}},{key:"hasDataForReferenceSequence",value:function(e){return this.index.hasDataForReferenceSequence(e)}}]),e}()},function(e,t,r){var n=(0,r(34).promisify)(r(20).gunzip),i=r(33).open,a=r(0).CramMalformedError,o=function(){function e(t){Wr(this,e),Object.assign(this,t)}return Yr(e,[{key:"toString",value:function(){return"".concat(this.start,":").concat(this.span,":").concat(this.containerStart,":").concat(this.sliceStart,":").concat(this.sliceBytes)}}]),e}();function s(e,t){if(t.some((function(e){return void 0===e})))throw new a("invalid .crai index file");var r=an(t,6),n=r[0],i=r[1],s=r[2],c=r[3],h=r[4],u=r[5];e[n]||(e[n]=[]),e[n].push(new o({start:i,span:s,containerStart:c,sliceStart:h,sliceBytes:u}))}e.exports=function(){function e(t){Wr(this,e);var r=i(t.url,t.path,t.filehandle);this.readFile=r.readFile.bind(r),this.index=this.parseIndex()}var t,r;return Yr(e,[{key:"parseIndex",value:function(){var e={};return this.readFile().then((function(e){return 31===e[0]&&139===e[1]?n(e):e})).then((function(t){for(var r=[],n="",i=0;i<t.length;i+=1){var o=t[i];if(o>=48&&o<=57||!n&&45===o)n+=String.fromCharCode(o);else if(9===o)r.push(Number.parseInt(n,10)),n="";else if(10===o)r.push(Number.parseInt(n,10)),n="",s(e,r),r=[];else if(13!==o&&32!==o)throw new a("invalid .crai index file")}return n&&r.push(Number.parseInt(n,10)),6===r.length&&s(e,r),Object.entries(e).forEach((function(t){var r=an(t,2),n=r[0],i=r[1];e[n]=i.sort((function(e,t){return e.start-t.start||e.span-t.span}))})),e}))}},{key:"getIndex",value:function(){return this.index}},{key:"hasDataForReferenceSequence",value:(r=Vr(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.index;case 2:return e.t0=t,e.abrupt("return",!!e.sent[e.t0]);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"getEntriesForRange",value:(t=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u,l,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.index;case 2:if(e.t0=t,i=e.sent[e.t0]){e.next=6;break}return e.abrupt("return",[]);case 6:a=i.length,o=function(e){var t=e.start,i=e.start+e.span;return t>=n?-1:i<=r?1:0},c=0,h=a-1;case 8:if(!(c<=h)){e.next=19;break}if(!((u=o(i[s=Math.round((h+c)/2)]))>0)){e.next=14;break}c=s+1,e.next=17;break;case 14:if(u<0){e.next=16;break}return e.abrupt("break",19);case 16:h=s-1;case 17:e.next=8;break;case 19:for(l=s;l&&!o(i[l-1]);)l-=1;for(f=s;f<a-1&&!o(i[f+1]);)f+=1;return p=i[l].start,e.abrupt("return",i[f].start+i[f].span>=r&&n>=p?i.slice(l,f+1):[]);case 25:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}()}]),vx=function(e,t,r){this.config=e,this.browser=r,this.genome=t,this.cramFile=new gx.CramFile({filehandle:new yx(e.url,e),seqFetch:e.seqFetch||mx.bind(this),checkSequenceMD5:void 0===e.checkSequenceMD5||e.checkSequenceMD5});var n=new yx(e.indexURL,e);this.indexedCramFile=new gx.IndexedCramFile({cram:this.cramFile,index:new gx.CraiIndex({filehandle:n}),fetchSizeLimit:3e7}),Ow.setReaderDefaults(this,e)};function mx(e,t,r){var n=this.genome.sequence,i=this.genome;return this.getHeader().then((function(a){var o=i.getChromosomeName(a.chrNames[e]);return n.getSequence(o,t-1,r)}))}vx.prototype.getHeader=function(){if(this.header)return Promise.resolve(this.header);var e=this,t=this.genome;return this.cramFile.getSamHeader().then((function(r){var n,i={},a=[],o={},s=[],c=fn(r);try{for(c.s();!(n=c.n()).done;){var h=n.value;if("SQ"===h.tag){var u,l=fn(h.data);try{for(l.s();!(u=l.n()).done;){var f=u.value;if("SN"===f.tag){var p=f.value;i[p]=a.length,a.push(p),t&&(o[t.getChromosomeName(p)]=p);break}}}catch(e){l.e(e)}finally{l.f()}}else"RG"===h.tag&&s.push(h.data)}}catch(e){c.e(e)}finally{c.f()}return e.header={chrNames:a,chrToIndex:i,chrAliasTable:o,readGroups:s},e.header}))},vx.prototype.readAlignments=function(e,t,r){var n=this,i=this.browser;return this.getHeader().then((function(a){var o=a.chrAliasTable.hasOwnProperty(e)?a.chrAliasTable[e]:e,s=a.chrToIndex[o],c=new vw(e,t,r,n.samplingWindowSize,n.samplingDepth,n.pairsSupported,n.alleleFreqThreshold);return void 0===s?Promise.resolve(c):n.indexedCramFile.getRecordsForRange(s,t,r).then((function(e){var n,i=fn(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,u=o.sequenceId,l=o.alignmentStart,f=l+o.lengthOnRef;if(!(u<0)){if(u>s||l>r)return;if(!(u<s||f<t)){var p=h(o,a.chrNames);c.push(p)}}}}catch(e){i.e(e)}finally{i.f()}return c.finish(),c})).catch((function(e){var t=e.message;throw t&&t.indexOf("MD5")>=0&&(t="Sequence mismatch. Is this the correct genome for the loaded CRAM?"),i.presentAlert(t),e}));function h(e,t){var r=new _w;if(r.chr=t[e.sequenceId],r.start=e.alignmentStart-1,r.lengthOnRef=e.lengthOnRef,r.flags=e.flags,r.strand=!(16&e.flags),r.fragmentLength=e.templateLength||e.templateSize,r.mq=e.mappingQuality,r.end=e.alignmentStart+e.lengthOnRef,r.readGroupId=e.readGroupId,e.mate&&void 0!==e.mate.sequenceId){var n=void 0!==e.mate.flags?!(1&e.mate.flags):!(32&e.flags);r.mate={chr:t[e.mate.sequenceId],position:e.mate.alignmentStart,strand:n}}return r.seq=e.getReadBases(),r.qual=e.qualityScores,r.tagDict=e.tags,r.readName=e.readName,function(e,t){var r,n,i=[],a=0,o="";if(t.scStart=t.start,t.scLengthOnRef=t.lengthOnRef,e.readFeatures){var s,c=fn(e.readFeatures);try{for(c.s();!(s=c.n()).done;){var h=s.value,u=h.code,l=h.data,f=h.pos-1,p=h.refPos-1;switch(u){case"S":case"I":case"i":case"N":case"D":if(f>a){var d=f-a;i.push(new Tw({start:p-d,seqOffset:a,len:d,type:"M"})),a+=d,o+=d+"M"}if("S"===u){var g=p;t.scLengthOnRef+=l.length,0===f&&(t.scStart-=l.length,g-=l.length);var v=l.length;i.push(new Tw({start:g,seqOffset:a,len:v,type:"S"})),a+=v,o+=v+u}else if("I"===u||"i"===u){void 0===r&&(r=[]);var m="i"===u?1:l.length;r.push(new Tw({start:p-1,len:m,seqOffset:a,type:"I"})),a+=m,o+=m+u}else"D"!==u&&"N"!==u||(n||(n=[]),n.push({start:p,len:l,type:u}),o+=l+u);break;case"H":case"P":o+=l+u}}}catch(e){c.e(e)}finally{c.f()}}var y=e.readLength-a;y>0&&(i.push(new Tw({start:e.alignmentStart+e.lengthOnRef-y-1,seqOffset:a,len:y,type:"M"})),o+=y+"M"),t.blocks=i,t.insertions=r,t.gaps=n,t.cigar=o}(e,r),r.mate&&r.start>r.mate.position&&r.fragmentLength>0&&(r.fragmentLength=-r.fragmentLength),Ow.setPairOrientation(r),r}}))};var yx=function(){function e(t,r){var n=this;Wr(this,e),this.position=0,this.url=t,this.config=r,this.cache=new bx({fetch:function(e,t){return n._fetch(e,t)}})}var t,r,i,a;return Yr(e,[{key:"_fetch",value:(a=Vr(regeneratorRuntime.mark((function e(t,r){var i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={start:t,size:r},this._stat={size:void 0},e.next=4,Sv.loadArrayBuffer(this.url,zg(this.config,{range:i}));case 4:return a=e.sent,e.abrupt("return",n.from(a));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"read",value:(i=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:0,n=a.length>2&&void 0!==a[2]?a[2]:1/0,null===(i=a.length>3&&void 0!==a[3]?a[3]:0)&&(this.position,this.position+=n),e.abrupt("return",this.cache.get(t,r,n,i));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"readFile",value:(r=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sv.loadArrayBuffer(this.url,zg(this.config));case 2:return t=e.sent,e.abrupt("return",n.from(t));case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"stat",value:(t=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._stat){e.next=6;break}return t=n.allocUnsafe(10),e.next=4,this.read(t,0,10,0);case 4:if(this._stat){e.next=6;break}throw new Error("unable to determine size of file at ".concat(this.url));case 6:return e.abrupt("return",this._stat);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),bx=function(){function e(t){var r=t.fetch,n=t.size,i=void 0===n?1e7:n,a=t.chunkSize,o=void 0===a?32768:a;Wr(this,e),this.fetch=r,this.chunkSize=o,this.lruCache=new wx({maxSize:Math.floor(i/o)})}var t;return Yr(e,[{key:"get",value:(t=Vr(regeneratorRuntime.mark((function e(t,r,n,i){var a,o,s,c,h,u,l,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length<r+n)){e.next=2;break}throw new Error("output buffer not big enough for request");case 2:for(a=Math.floor(i/this.chunkSize),o=Math.floor((i+n)/this.chunkSize),s=new Array(o-a+1),c=function(e){s[e-a]=f._getChunk(e).then((function(t){return{data:t,chunkNumber:e}}))},h=a;h<=o;h+=1)c(h);return e.next=9,Promise.all(s);case 9:u=e.sent,l=i-u[0].chunkNumber*this.chunkSize,u.forEach((function(e){var s=e.data,c=e.chunkNumber,h=c*f.chunkSize,u=0,p=f.chunkSize,d=r+(c-a)*f.chunkSize-l;c===a&&(d=r,u=l),c===o&&(p=i+n-h),s.copy(t,d,u,p)}));case 12:case"end":return e.stop()}}),e,this)}))),function(e,r,n,i){return t.apply(this,arguments)})},{key:"_getChunk",value:function(e){var t=this.lruCache.get(e);if(t)return t;var r=this.fetch(e*this.chunkSize,this.chunkSize);return this.lruCache.set(e,r),r}}]),e}(),wx=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Wr(this,e),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}return Yr(e,[{key:"_set",value:function(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}},{key:"get",value:function(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){var t=this.oldCache.get(e);return this._set(e,t),t}}},{key:"set",value:function(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}},{key:"has",value:function(e){return this.cache.has(e)||this.oldCache.has(e)}},{key:"peek",value:function(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}},{key:"delete",value:function(e){var t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}},{key:"clear",value:function(){this.cache.clear(),this.oldCache.clear(),this._size=0}},{key:"keys",value:regeneratorRuntime.mark((function e(){var t,r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=fn(this),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return n=an(r.value,1),i=n[0],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:"values",value:regeneratorRuntime.mark((function e(){var t,r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=fn(this),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return n=an(r.value,2),i=n[1],e.next=7,i;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])}))},{key:Symbol.iterator,value:regeneratorRuntime.mark((function e(){var t,r,n,i,a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=fn(this.cache),e.prev=1,t.s();case 3:if((r=t.n()).done){e.next=9;break}return n=r.value,e.next=7,n;case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.e(e.t0);case 14:return e.prev=14,t.f(),e.finish(14);case 17:i=fn(this.oldCache),e.prev=18,i.s();case 20:if((a=i.n()).done){e.next=28;break}if(o=a.value,s=an(o,1),c=s[0],this.cache.has(c)){e.next=26;break}return e.next=26,o;case 26:e.next=20;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(18),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:case"end":return e.stop()}}),e,this,[[1,11,14,17],[18,30,33,36]])}))},{key:"size",get:function(){var e,t=0,r=fn(this.oldCache.keys());try{for(r.s();!(e=r.n()).done;){var n=e.value;this.cache.has(n)||t++}}catch(e){r.e(e)}finally{r.f()}return this._size+t}}]),e}(),xx={ALIGNMENT_MATCH:"M",INSERT:"I",DELETE:"D",SKIP:"N",CLIP_SOFT:"S",CLIP_HARD:"H",PAD:"P",SEQUENCE_MATCH:"=",SEQUENCE_MISMATCH:"X"},kx=function(e,t){this.config=e,this.genome=t,this.url=e.url,this.filter=new Iw(e.filter),this.readGroupSetIds=e.readGroupSetIds,this.authKey=e.authKey,this.samplingWindowSize=void 0===e.samplingWindowSize?100:e.samplingWindowSize,this.samplingDepth=void 0===e.samplingDepth?1e3:e.samplingDepth,e.viewAsPairs?this.pairsSupported=!0:this.pairsSupported=void 0===e.pairsSupported||e.pairsSupported};kx.prototype.readAlignments=function(e,t,r){var n=this.genome,i=this;return(i.chrAliasTable?Promise.resolve(i.chrAliasTable):i.readMetadata().then((function(e){if(i.chrAliasTable={},n&&e.readGroups&&e.readGroups.length>0){var t=e.readGroups[0].referenceSetId;return t?fb({url:i.url+"/references/search",body:{referenceSetId:t},decode:function(e){return e.references}}).then((function(e){return e.forEach((function(e){var t=e.name,r=n.getChromosomeName(t);i.chrAliasTable[r]=t})),i.chrAliasTable})):(function(e,t){var r;if("461916304629"===t||"337315832689"===t){for(r=1;r<23;r++)e["chr"+r]=r;e.chrX="X",e.chrY="Y",e.chrM="MT"}}(i.chrAliasTable,i.config.datasetId),i.chrAliasTable)}return i.chrAliasTable}))).then((function(n){var o=n.hasOwnProperty(e)?n[e]:e;return fb({url:i.url+"/reads/search",body:{readGroupSetIds:[i.readGroupSetIds],referenceName:o,start:t,end:r,pageSize:"10000"},decode:a,results:new vw(e,t,r,i.samplingWindowSize,i.samplingDepth,i.pairsSupported,i.alleleFreqThreshold)})}));function a(e){var t,r,a,o,s,c=e.alignments,h=c.length,u=[];for(t=0;t<h;t++){var l=c[t];(r=new _w).readName=l.fragmentName,r.properPlacement=l.properPlacement,r.duplicateFragment=l.duplicateFragment,r.numberReads=l.numberReads,r.fragmentLength=l.fragmentLength,r.readNumber=l.readNumber,r.failedVendorQualityChecks=l.failedVendorQualityChecks,r.secondaryAlignment=l.secondaryAlignment,r.supplementaryAlignment=l.supplementaryAlignment,r.seq=l.alignedSequence,r.qual=l.alignedQuality,r.matePos=l.nextMatePosition,r.tagDict=l.info,r.flags=0,l.alignment?(r.mapped=!0,r.chr=l.alignment.position.referenceName,n&&(r.chr=n.getChromosomeName(r.chr)),r.start=parseInt(l.alignment.position.position),r.strand=!l.alignment.position.reverseStrand,r.mq=l.alignment.mappingQuality,r.cigar=f(l.alignment.cigar),a=p(l.alignment.cigar),r.lengthOnRef=a.lengthOnRef,s=d(r,a.array),r.blocks=s.blocks,r.insertions=s.insertions):r.mapped=!1,(o=l.nextMatePosition)&&(r.mate={chr:o.referenceFrame,position:parseInt(o.position),strand:!o.reverseStrand}),i.filter.pass(r)&&u.push(r)}return u;function f(e){var t="";return e.forEach((function(e){var r=xx[e.operation],n=e.operationLength;t+=n+r})),t}function p(e){var t,r,n,i,a=0,o=[];for(i=0;i<e.length;i++)t=e[i],n=xx[t.operation],r=parseInt(t.operationLength),"M"!==n&&"EQ"!==n&&"X"!==n&&"D"!==n&&"N"!==n&&"="!==n||(a+=r),o.push({len:r,ltr:n});return{lengthOnRef:a,array:o}}function d(e,t){for(var r,n,i,a=[],o=0,s=e.start,c=t.length,h=0;h<c;h++){var u=t[h];switch(u.ltr){case"H":case"P":break;case"S":o+=u.len,i="S";break;case"N":case"D":void 0===r&&(r=[]),r.push({start:s,len:u.len,type:u.ltr}),s+=u.len;break;case"I":void 0===n&&(n=[]),n.push(new Tw({start:s,len:u.len,seqOffset:o})),o+=u.len;break;case"M":case"EQ":case"=":case"X":a.push(new Tw({start:s,len:u.len,seqOffset:o,gapType:i})),o+=u.len,s+=u.len}}return{blocks:a,insertions:n,gaps:r}}}},kx.prototype.readMetadata=function(){return lb({url:this.url,entity:"readgroupsets",entityId:this.readGroupSetIds})};var Sx=function(){this.alignments=[],this.score=void 0};Sx.prototype.findAlignment=function(e){var t,r,n;for(n=0;n<this.alignments.length;n++)if(i(r=this.alignments[n],e)){r.paired?r.firstAlignment&&i(r.firstAlignment,e)?t=r.firstAlignment:r.secondAlignment&&i(r.secondAlignment,e)&&(t=r.secondAlignment):t=r;break}return t;function i(e,t){return t>=e.start&&t<e.start+e.lengthOnRef}},Sx.prototype.updateScore=function(e,t){this.score=this.calculateScore(e,t)},Sx.prototype.calculateScore=function(e,t){var r,n=Math.floor(e.position),i=e.sortOption,a=e.direction,o=this.findAlignment(n);if(void 0===o)return a?Number.MAX_VALUE:-Number.MAX_VALUE;switch(i){case"NUCLEOTIDE":var s=o.readBaseAt(n),c=o.readBaseQualityAt(n);return s?function(e,t,r,n){var i,a,o;if((i=Math.floor(n)-r.start)<r.sequence.length&&(a=r.sequence.charAt(i)),a)return void 0===e?Number.MAX_VALUE:"N"===e?2:a===e||"="===e?4-t/1e3:"X"===e||a!==e?(i=Math.floor(n)-r.coverageMap.bpStart)>0&&i<r.coverageMap.coverage.length?-((o=r.coverageMap.coverage[i])["pos"+e]+o["neg"+e]+t/1e3):-(1+t/1e3):0}(s,c,t,n):a?Number.MAX_VALUE:-Number.MAX_VALUE;case"STRAND":return o.strand?1:-1;case"START":return o.start;case"TAG":var h=e.tag,u=o.tags()[h];return void 0!==u?mg(u)?xg(u):u:Number.MAX_VALUE;case"INSERT_SIZE":return-Math.abs(o.fragmentLength);case"GAP_SIZE":return-o.gapSizeAt(n);case"MATE_CHR":return(r=o.mate)?r.chr===o.chr?Number.MAX_VALUE-1:xg(r.chr):Number.MAX_VALUE;case"MQ":return void 0===o.mq?Number.MAX_VALUE:-o.mq;default:return Number.MAX_VALUE}};var _x=function(e,t){var r=t.genome;if(this.config=e,this.genome=r,this.alignmentContainer=void 0,mg(e.url)&&e.url.startsWith("data:")){if("cram"===e.format)throw"CRAM data uris are not supported";this.config.indexed=!1}"ga4gh"===e.sourceType?this.bamReader=new kx(e,r):"pysam"===e.sourceType?this.bamReader=new Yw(e,r):"htsget"===e.sourceType?this.bamReader=new Kw(e,r):"shardedBam"===e.sourceType?this.bamReader=new Zw(e,r):"cram"===e.format?this.bamReader=new vx(e,r,t):!1===this.config.indexed?this.bamReader=new zw(e,r):this.bamReader=new Hw(e,r),this.viewAsPairs=e.viewAsPairs,this.showSoftClips=e.showSoftClips};function Cx(e){var t,r=[],n=fn(e);try{for(n.s();!(t=n.n()).done;){var i,a=fn(t.value.alignments);try{for(a.s();!(i=a.n()).done;){var o=i.value;o instanceof dw?(o.firstAlignment&&r.push(o.firstAlignment),o.secondAlignment&&r.push(o.secondAlignment)):r.push(o)}}catch(e){a.e(e)}finally{a.f()}}}catch(e){n.e(e)}finally{n.f()}return r}function Ax(e){return e.isPaired()&&e.isMateMapped()&&e.chr===e.mate.chr&&(e.isFirstOfPair()||e.isSecondOfPair())&&!(e.isSecondary()||e.isSupplementary())}function Ex(e,t,r,n){if(e){if(0===e.length)return[];e.sort((function(e,t){return n?e.scStart-t.scStart:e.start-t.start}));var i,a=e[0],o=Math.max(t,n?a.scStart:a.start),s=o,c=[],h=fn(e);try{for(h.s();!(i=h.n()).done;){var u=i.value,l=n?u.scStart:u.start,f=Math.max(0,l-o);void 0===c[f]&&(c[f]=[]),c[f].push(u)}}catch(e){h.e(e)}finally{h.f()}var p=0,d=0,g=[];try{for(;p<e.length;){for(var v=new Sx;s<=r;){for(var m=void 0,y=void 0;!m&&s<=r;)void 0===c[y=s-o]?++s:m=c[y];if(!m)break;var b=m.pop();0===m.length&&(c[y]=void 0),v.alignments.push(b),s=n?b.scStart+b.scLengthOnRef+2:b.start+b.lengthOnRef+2,++p}if(v.alignments.length>0&&g.push(v),s=o,p===d)break;d=p}}catch(e){throw console.error(e),e}return g}}_x.prototype.setViewAsPairs=function(e){if(this.viewAsPairs!==e&&(this.viewAsPairs=e,this.alignmentContainer)){var t,r=this.alignmentContainer;t=e?function(e){var t,r={},n=[],i=fn(e);try{for(i.s();!(t=i.n()).done;){var a,o=fn(t.value.alignments);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(Ax(s)){var c=r[s.readName];c?(c.setSecondAlignment(s),r[s.readName]=void 0):(c=new dw(s),r[s.readName]=c,n.push(c))}else n.push(s)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){i.e(e)}finally{i.f()}return n}(r.packedAlignmentRows):Cx(r.packedAlignmentRows),r.packedAlignmentRows=Ex(t,r.start,r.end)}},_x.prototype.setShowSoftClips=function(e){if(this.showSoftClips!==e&&(this.showSoftClips=e,this.alignmentContainer)){var t=function(e){var t,r=[],n=fn(e);try{for(n.s();!(t=n.n()).done;){var i,a=fn(t.value.alignments);try{for(a.s();!(i=a.n()).done;){var o=i.value;r.push(o)}}catch(e){a.e(e)}finally{a.f()}}}catch(e){n.e(e)}finally{n.f()}return r}(this.alignmentContainer.packedAlignmentRows),r=this.alignmentContainer;r.packedAlignmentRows=Ex(t,r.start,r.end,e)}},_x.prototype.getAlignments=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=this.genome,a=this.showSoftClips,!this.alignmentContainer||!this.alignmentContainer.contains(t,r,n)){e.next=7;break}return e.abrupt("return",this.alignmentContainer);case 7:return e.next=9,this.bamReader.readAlignments(t,r,n);case 9:if(o=e.sent,s=o.alignments,this.viewAsPairs||(s=Cx([{alignments:s}])),c=s.length>0,o.packedAlignmentRows=Ex(s,o.start,o.end,a),o.alignments=void 0,this.alignmentContainer=o,c){e.next=20;break}return e.abrupt("return",o);case 20:return e.next=22,i.sequence.getSequence(t,o.start,o.end);case 22:if(!(h=e.sent)){e.next=29;break}return o.coverageMap.refSeq=h,o.sequence=h,e.abrupt("return",o);case 29:console.error("No sequence for: "+t+":"+o.start+"-"+o.end);case 30:e.next=36;break;case 32:throw e.prev=32,e.t0=e.catch(0),console.error(e.t0),e.t0;case 36:case"end":return e.stop()}}),e,this,[[0,32]])})));return function(t,r,n){return e.apply(this,arguments)}}();var Rx=Dg(gy,(function(e,t){if(this.type="alignment",void 0===e.height&&(e.height=300),gy.call(this,e,t),void 0===e.coverageTrackHeight&&(e.coverageTrackHeight=50),void 0===e.alleleFreqThreshold&&(e.alleleFreqThreshold=.2),this.featureSource=new _x(e,t),this.coverageTrack=new Ix(e,this),this.alignmentTrack=new Lx(e,this),this.visibilityWindow=e.visibilityWindow||3e4,this.viewAsPairs=e.viewAsPairs,this.pairsSupported=!1!==e.pairsSupported,this.showSoftClips=e.showSoftClips,this.showAllBases=e.showAllBases,this.showMismatches=!1!==e.showMismatches,this.color=e.color||"rgb(185, 185, 185)",this.coverageColor=e.coverageColor||"rgb(150, 150, 150)",this.minFragmentLength=e.minFragmentLength,this.maxFragmentLength=e.maxFragmentLength,this.sortObjects={},e.sort){if(Array.isArray(e.sort)){var r,n=fn(e.sort);try{for(n.s();!(r=n.n()).done;){var i=r.value;a(this.sortObjects,i)}}catch(e){n.e(e)}finally{n.f()}}else a(this.sortObjects,e.sort);e.sort=void 0}function a(e,r){var n=function(e){var t=e.split(":"),r=t[1].split("-"),n={chr:t[0],start:Number.parseInt(r[0].replace(/,/g,""))-1};return r.length>1?n.end=Number.parseInt(r[1].replace(/,/g,"")):n.end=n.start+1,n}(r.locus);t&&t.genome&&(n.chr=t.genome.getChromosomeName(n.chr));var i,a=fn(t.genomicStateList);try{for(a.s();!(i=a.n()).done;){var o=i.value;if(o.chromosome.name===n.chr&&n.start>=o.start&&n.start<=o.end){e[o.id]={chr:n.chr,position:n.start,sortOption:r.option||"NUCLEOTIDE",direction:void 0===r.direction||"ASC"===r.direction,tag:r.tag?r.tag.toUpperCase():void 0};break}}}catch(e){a.e(e)}finally{a.f()}}}));function Tx(e,t){var r,n;if(r=e<5?.1:Math.max(.1,Math.min(1,.1+.9*(e-5)/15)),(r=Math.round(10*r)/10)>=1)n=Hf[t];else{var i=Uf[t];if(!i)return;n="rgba("+i[0]+","+i[1]+","+i[2]+","+r+")"}return n}Rx.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i,a){var o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this,e.next=3,this.featureSource.getAlignments(t,r,n);case 3:return(s=e.sent).alignments&&s.alignments.length>99&&(void 0===o.minFragmentLength&&(o.minFragmentLength=s.pairedEndStats.lowerFragmentLength),void 0===o.maxFragmentLength&&(o.maxFragmentLength=s.pairedEndStats.upperFragmentLength)),(c=o.sortObjects[a.genomicState.id])&&(c.chr===t&&c.position>=r&&c.position<=n?(o.alignmentTrack.sortAlignmentRows(c,s),o.trackView.repaintViews()):delete o.sortObjects[a.genomicState.id]),e.abrupt("return",s);case 8:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,a){return e.apply(this,arguments)}}(),Rx.filters={noop:function(){return function(e){return!1}},strand:function(e){return function(t){return t.strand===e}},mappingQuality:function(e,t){return function(r){return!!(e&&r.mq<e)||!!(t&&r.mq>t)}}},Rx.prototype.computePixelHeight=function(e){return this.coverageTrack.computePixelHeight(e)+this.alignmentTrack.computePixelHeight(e)+15},Rx.prototype.draw=function(e){gm.fillRect(e.context,0,e.pixelTop,e.pixelWidth,e.pixelHeight,{fillStyle:"rgb(255, 255, 255)"}),this.coverageTrack.height>0&&this.coverageTrack.draw(e),this.alignmentTrack.draw(e)},Rx.prototype.paintAxis=function(e,t,r){this.browser.isMultiLocusMode()?e.clearRect(0,0,t,r):this.coverageTrack.paintAxis(e,t,this.coverageTrack.height)},Rx.prototype.contextMenuItemList=function(e){return this.alignmentTrack.contextMenuItemList(e)},Rx.prototype.popupData=function(e){return e.y>=this.coverageTrack.top&&e.y<this.coverageTrack.height?this.coverageTrack.popupData(e):this.alignmentTrack.popupData(e)},Rx.prototype.menuItemList=function(){var e=this,t=[],r=oc('<div class="igv-track-menu-category igv-track-menu-border-top">');r.text("Color by"),t.push({name:void 0,object:r,click:void 0,init:void 0});var n=[{key:"strand",label:"read strand"}];e.alignmentTrack.hasPairs&&(n.push({key:"firstOfPairStrand",label:"first-of-pair strand"}),n.push({key:"pairOrientation",label:"pair orientation"}),n.push({key:"fragmentLength",label:"insert size (TLEN)"}));var i="tag"+(e.alignmentTrack.colorByTag?" ("+e.alignmentTrack.colorByTag+")":"");return n.push({key:"tag",label:i}),n.forEach((function(r){var n=e.alignmentTrack.colorBy===r.key;t.push(function(t,r){var n=Ff(t.label,r);return{name:void 0,object:n,click:function(){if(t.key===e.alignmentTrack.colorBy)e.alignmentTrack.colorBy="none",e.config.colorBy="none",e.trackView.repaintViews();else if("tag"===t.key){var r={label:"Tag Name",input:e.alignmentTrack.colorByTag?e.alignmentTrack.colorByTag:"",click:function(){e.alignmentTrack.colorBy="tag",e.config.colorBy="tag";var t=e.browser.inputDialog.$input.val().trim();t!==e.alignmentTrack.colorByTag&&(e.alignmentTrack.colorByTag=t,e.config.colorByTag=t,e.alignmentTrack.tagColors=new jf("Set1"),oc("#color-by-tag").text(e.alignmentTrack.colorByTag)),e.trackView.repaintViews()}};e.browser.inputDialog.configure(r),e.browser.inputDialog.present(oc(e.trackView.trackDiv))}else e.alignmentTrack.colorBy=t.key,e.config.colorBy=t.key,e.trackView.repaintViews()},init:void 0}}(r,n))})),t.push({object:oc('<div class="igv-track-menu-border-top">')}),t.push({object:Ff("Show all bases",e.showAllBases),click:function(){e.showAllBases=!e.showAllBases,e.config.showAllBases=e.showAllBases,e.trackView.updateViews(!0)}}),t.push({object:oc('<div class="igv-track-menu-border-top">')}),e.pairsSupported&&e.alignmentTrack.hasPairs&&t.push({object:Ff("View as pairs",e.viewAsPairs),click:function(){e.viewAsPairs=!e.viewAsPairs,e.config.viewAsPairs=e.viewAsPairs,e.featureSource.setViewAsPairs(e.viewAsPairs),e.trackView.updateViews(!0)}}),t.push({object:Ff("Show soft clips",e.showSoftClips),click:function(){e.showSoftClips=!e.showSoftClips,e.config.showSoftClips=e.showSoftClips,e.featureSource.setShowSoftClips(e.showSoftClips),e.trackView.updateViews(!0)}}),t},Rx.prototype.dispose=function(){this.trackView=void 0},Rx.prototype.getState=function(){var e=Object.assign({},this.config);e.sort=void 0;var t,r=fn(this.browser.genomicStateList);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=this.sortObjects[n.id];i&&(e.sort=e.sort||[],e.sort.push({locus:i.chr+":"+(i.position+1),option:i.sortOption,direction:i.direction?"ASC":"DESC",tag:i.tag}))}}catch(e){r.e(e)}finally{r.f()}return e};var Ix=function(e,t){this.parent=t,this.featureSource=t.featureSource,this.height=e.coverageTrackHeight,this.dataRange={min:0},this.paintAxis=ow,this.top=0};Ix.prototype.computePixelHeight=function(e){return this.height},Ix.prototype.draw=function(e){var t=e.pixelTop;if(e.pixelHeight,!(t>this.height)){var r,n=e.context,i=e.features.coverageMap;this.dataRange.max=i.maximum,i.refSeq&&(r=i.refSeq.toUpperCase());var a=e.bpPerPixel,o=e.bpStart,s=o+e.pixelWidth*a+1,c=this.parent.coverageColor;"rgb(185, 185, 185)"!==this.parent.color&&(c=kg.darkenLighten(this.parent.color,-35)),gm.setProperties(n,{fillStyle:c,strokeStyle:c});for(var h=Math.max(1,Math.ceil(1/a)),u=0,l=i.coverage.length;u<l;u++){var f=i.bpStart+u;if(!(f<o)){if(f>s)break;var p=i.coverage[u];if(p){var d=Math.round(p.total/this.dataRange.max*this.height),g=this.height-d,v=Math.floor((f-o)/a);gm.fillRect(n,v,g,h,d)}}}if(r)for(var m=0,y=i.coverage.length;m<y;m++){var b=i.bpStart+m;if(!(b<o)){if(b>s)break;var w=i.coverage[m];if(w){var x=w.total/this.dataRange.max*this.height,k=this.height-x,S=Math.floor((b-o)/a),_=r[m];if(w.isMismatch(_)){gm.setProperties(n,{fillStyle:Hf[_]}),gm.fillRect(n,S,k,h,x);for(var C=0,A=0,E=["A","C","T","G"];A<E.length;A++){var R=E[A],T=(w["pos"+R]+w["neg"+R])/this.dataRange.max*this.height;k=this.height-T-C,C+=T,gm.setProperties(n,{fillStyle:Hf[R]}),gm.fillRect(n,S,k,h,T)}}}}}}},Ix.prototype.popupData=function(e){var t=e.viewport.getCachedFeatures();if(t&&0!==t.length){var r=Math.floor(e.genomicLocation),n=e.viewport.genomicState.referenceFrame,i=t.coverageMap,a=[],o=Math.floor(r-i.bpStart),s=i.coverage[o];if(s){a.push(n.chrName+":"+yg(1+r)),a.push({name:"Total Count",value:s.total});var c=s.posA+s.negA;c>0&&(c=c.toString()+" ("+Math.round(c/s.total*100)+"%, "+s.posA+"+, "+s.negA+"- )"),a.push({name:"A",value:c}),(c=s.posC+s.negC)>0&&(c=c.toString()+" ("+Math.round(c/s.total*100)+"%, "+s.posC+"+, "+s.negC+"- )"),a.push({name:"C",value:c}),(c=s.posG+s.negG)>0&&(c=c.toString()+" ("+Math.round(c/s.total*100)+"%, "+s.posG+"+, "+s.negG+"- )"),a.push({name:"G",value:c}),(c=s.posT+s.negT)>0&&(c=c.toString()+" ("+Math.round(c/s.total*100)+"%, "+s.posT+"+, "+s.negT+"- )"),a.push({name:"T",value:c}),(c=s.posN+s.negN)>0&&(c=c.toString()+" ("+Math.round(c/s.total*100)+"%, "+s.posN+"+, "+s.negN+"- )"),a.push({name:"N",value:c}),a.push("<HR/>"),a.push({name:"DEL",value:s.del.toString()}),a.push({name:"INS",value:s.ins.toString()})}return a}};var Lx=function(e,t){this.parent=t,this.browser=t.browser,this.featureSource=t.featureSource,this.top=0===e.coverageTrackHeight?0:e.coverageTrackHeight+5,this.alignmentRowHeight=e.alignmentRowHeight||14,this.negStrandColor=e.negStrandColor||"rgba(150, 150, 230, 0.75)",this.posStrandColor=e.posStrandColor||"rgba(230, 150, 150, 0.75)",this.insertionColor=e.insertionColor||"rgb(138, 94, 161)",this.deletionColor=e.deletionColor||"black",this.skippedColor=e.skippedColor||"rgb(150, 170, 170)",this.pairConnectorColor=e.pairConnectorColor,this.smallFragmentLengthColor=e.smallFragmentLengthColor||"rgb(0, 0, 150)",this.largeFragmentLengthColor=e.largeFragmentLengthColor||"rgb(200, 0, 0)",this.pairOrientation=e.pairOrienation||"fr",this.pairColors={},this.pairColors.RL=e.rlColor||"rgb(0, 150, 0)",this.pairColors.RR=e.rrColor||"rgb(20, 50, 200)",this.pairColors.LL=e.llColor||"rgb(0, 150, 150)",this.colorBy=e.colorBy||"pairOrientation",this.colorByTag=e.colorByTag?e.colorByTag.toUpperCase():void 0,this.bamColorTag=void 0===e.bamColorTag?"YC":e.bamColorTag,this.hideSmallIndels=e.hideSmallIndels,this.indelSizeThreshold=e.indelSizeThreshold||1,this.hasPairs=!1};Lx.prototype.computePixelHeight=function(e){if(e.packedAlignmentRows){var t=0;return e.hasDownsampledIntervals()&&(t+=10),t+this.alignmentRowHeight*e.packedAlignmentRows.length+5}return this.height},Lx.prototype.draw=function(e){var t=e.features,r=e.context,n=e.bpPerPixel,i=e.bpStart,a=e.pixelWidth,o=i+a*n+1,s=t.packedAlignmentRows,c=this.parent.showSoftClips,h=this.parent.showAllBases,u=t.sequence;u&&(u=u.toUpperCase());var l=0,f=e.pixelTop;r.save(),this.top&&r.translate(0,this.top);var p=f+e.pixelHeight;if(t.hasDownsampledIntervals()?(l=10,t.downsampledIntervals.forEach((function(e){var t=(e.start-i)/n,a=(e.end-i)/n;a-t>5&&(t+=1,a-=1),gm.fillRect(r,t,2,a-t,3,{fillStyle:"black"})}))):l=0,this.alignmentsYOffset=l,s)for(var d=s.length,g=0;g<d;g++){var v=s[g],m=l+this.alignmentRowHeight*g,y=this.alignmentRowHeight<=4?this.alignmentRowHeight:this.alignmentRowHeight-2;if(m>p)break;if(!(m+y<f)){var b,w=fn(v.alignments);try{for(w.s();!(b=w.n()).done;){var x=b.value;if(this.hasPairs=this.hasPairs||x.isPaired(),!(x.start+x.lengthOnRef<i)){if(x.start>o)break;!0!==x.hidden&&(x instanceof dw?(k.call(this,x,m,y),S.call(this,x.firstAlignment,m,y),x.secondAlignment&&S.call(this,x.secondAlignment,m,y)):S.call(this,x,m,y))}}}catch(e){w.e(e)}finally{w.f()}}}function k(e,t,a){var s=this.getConnectorColor(e.firstAlignment),c=(e.connectingStart-i)/n,h=(e.connectingEnd-i)/n,u=t+a/2;e.connectingEnd<i||e.connectingStart>o||(e.mq<=0&&(s=kg.addAlpha(s,.15)),gm.setProperties(r,{fillStyle:s,strokeStyle:s}),gm.strokeLine(r,c,u,h,u))}function S(e,a,s){if(!(e.start+e.lengthOnRef<i||e.start>o)){var l=c?e.blocks:e.blocks.filter((function(e){return"S"!==e.type})),f=this.getAlignmentColor(e),p=f;e.mq<=0&&(f=kg.addAlpha(f,.15)),gm.setProperties(r,{fillStyle:f,strokeStyle:p});for(var d=0;d<l.length;d++){var g=l[d];if(!(d!==l.length-1&&l[d+1].start<i)&&(R.call(this,g,d),g.start+g.len>o))break}if(e.insertions){var v,m=-1,y=fn(e.insertions);try{for(y.s();!(v=y.n()).done;){var b=v.value;if(!(this.hideSmallIndels&&b.len<=this.indelSizeThreshold||b.start<i)){if(b.start>o)break;var w=(b.start-i)/n-1;w-m>2&&(gm.fillRect(r,w,a-1,3,s+2,{fillStyle:this.insertionColor}),m=w)}}}catch(e){y.e(e)}finally{y.f()}}if(e.gaps){var x,k=a+s/2,S=fn(e.gaps);try{for(S.s();!(x=S.n()).done;){var _=x.value,C=(_.start-i)/n,A=(_.start+_.len-i)/n,E="D"===_.type?this.deletionColor:this.skippedColor;gm.strokeLine(r,C,k,A,k,{strokeStyle:E})}}catch(e){S.e(e)}finally{S.f()}}}function R(o,c){var d=o.start-t.start,g=(o.start-i)/n,v=(o.start+o.len-i)/n,m=Math.max(1,v-g),y=this.alignmentRowHeight/2,b="S"===o.type,w=e.mq<=0||this.highlightedAlignmentReadNamed===e.readName||b,x=p;this.highlightedAlignmentReadNamed===e.readName?x="red":b&&(x="rgb(50,50,50)");var k,S,_=!0===e.strand&&c===l.length-1,C=!1===e.strand&&0===c;if(_|C?(_?(k=[g,v,v+y,v,g,g],S=[a,a,a+s/2,a+s,a+s,a]):C&&(k=[v,g,g-y,g,v,v],S=[a,a,a+s/2,a+s,a+s,a]),gm.fillPolygon(r,k,S,{fillStyle:f}),w&&gm.strokePolygon(r,k,S,{strokeStyle:x})):(gm.fillRect(r,g,a,m,s,{fillStyle:f}),w&&(r.save(),r.strokeStyle=x,r.strokeRect(g,a,m,s),r.restore())),this.parent.showMismatches&&(b||h||u&&e.seq&&"*"!==e.seq))for(var A=e.seq?e.seq.toUpperCase():void 0,E=e.qual,R=o.seqOffset,I=0,L=o.len;I<L;I++)if(!(d+I<0)){var M=A?A.charAt(R+I):"",P=u.charAt(d+I);if("="===M&&(M=P),"X"===M||P!==M||b||h){var O=void 0;if(O=!b&&void 0!==E&&E.length>R+I?Tx(E[R+I],M,o.start):Hf[M]){var F=(o.start+I-i)/n,N=Math.max(1,1/n);T(r,n,{x:F,y:a,width:N,height:s},O,M)}}}}function T(e,t,r,n,i){var a;if(t<=.1&&r.height>=8){var o=Math.min(10,r.height);e.font=o+"px sans-serif",a=r.x+r.width/2,gm.strokeText(e,i,a-e.measureText(i).width/2,o-1+r.y,{strokeStyle:n})}else gm.fillRect(e,r.x,r.y,r.width,r.height,{fillStyle:n})}}r.restore()},Lx.prototype.sortAlignmentRows=function(e,t){var r=e.direction;null===t&&(t=this.featureSource.alignmentContainer);var n,i=fn(t.packedAlignmentRows);try{for(i.s();!(n=i.n()).done;)n.value.updateScore(e,t)}catch(e){i.e(e)}finally{i.f()}t.packedAlignmentRows.sort((function(e,t){var n=e.score>t.score?1:e.score<t.score?-1:0;return!0===r?n:-n}))},Lx.prototype.popupData=function(e){var t=this.getClickedObject(e.viewport,e.y,e.genomicLocation);return t?t.popupData(e.genomicLocation):void 0},Lx.prototype.contextMenuItemList=function(e){var t=this,r=e.viewport,n=e.viewport.genomicState,i=this.getClickedObject(e.viewport,e.y,e.genomicLocation),a=i&&!i.paired&&"function"==typeof i.isPaired,o=[];return o.push("<b>Sort by...</b>"),o.push({label:"&nbsp; base",click:function(){return s("NUCLEOTIDE")}}),o.push({label:"&nbsp; read strand",click:function(){return s("STRAND")}}),o.push({label:"&nbsp; insert size",click:function(){return s("INSERT_SIZE")}}),o.push({label:"&nbsp; gap size",click:function(){return s("GAP_SIZE")}}),o.push({label:"&nbsp; chromosome of mate",click:function(){return s("MATE_CHR")}}),o.push({label:"&nbsp; mapping quality",click:function(){return s("MQ")}}),o.push({label:"&nbsp; tag",click:function(){var r={label:"Tag Name",input:t.sortByTag?t.sortByTag:"",click:function(){var r=t.browser.inputDialog.$input.val().trim();t.sortByTag=r,c({chr:n.referenceFrame.chrName,position:Math.floor(e.genomicLocation),sortOption:"TAG",tag:r})}};t.browser.inputDialog.configure(r),t.browser.inputDialog.present(oc(t.parent.trackView.trackDiv))}}),o.push("<hr/>"),a&&i.isMateMapped()&&o.push({label:"View mate in split screen",click:function(){i.mate&&(t.highlightedAlignmentReadNamed=i.readName,t.browser.presentSplitScreenMultiLocusPanel(i,e.viewport.genomicState))},init:void 0}),o.push({label:"View read sequence",click:function(){var e=i;if(e){var r=e.seq;r&&"*"!==r?t.browser.presentAlert(r):t.browser.presentAlert("Read sequence: *")}}}),o.push("<hr/>"),o;function s(t){c({chr:n.referenceFrame.chrName,position:Math.floor(e.genomicLocation),sortOption:t})}function c(n){if(e.viewport.tile){var i=t.parent.sortObjects,a=i[r.genomicState.id];n.direction=!a||!a.direction,t.sortAlignmentRows(n,e.viewport.getCachedFeatures()),t.parent.trackView.repaintViews(),i[r.genomicState.id]=n}}},Lx.prototype.getClickedObject=function(e,t,r){var n=this.parent.showSoftClips,i=e.getCachedFeatures();if(i&&0!==i.length){var a=i.packedAlignmentRows,o=i.downsampledIntervals,s=Math.floor((t-this.top-this.alignmentsYOffset)/this.alignmentRowHeight);if(s<0){for(var c=0;c<o.length;c++)if(o[c].start<=r&&o[c].end>=r)return o[c]}else if(s<a.length){var h=a[s].alignments.filter((function(e){var t=n?e.scStart:e.start,i=n?e.scLengthOnRef:e.lengthOnRef;return r>=t&&r<=t+i}));if(h.length>0)return h[0]}}},Lx.prototype.getConnectorColor=function(e){if(this.pairConnectorColor)return this.pairConnectorColor;switch(this.colorBy){case"strand":case"firstOfPairStrand":case"pairOrientation":case"tag":return this.parent.color||"rgb(200, 200, 200)";default:return this.getAlignmentColor(e)}},Lx.prototype.getAlignmentColor=function(e){var t,r=this.parent.color;switch(this.colorBy){case"strand":r=e.strand?this.posStrandColor:this.negStrandColor;break;case"firstOfPairStrand":e instanceof dw?r=e.firstOfPairStrand()?this.posStrandColor:this.negStrandColor:e.isPaired()&&(e.isFirstOfPair()?r=e.strand?this.posStrandColor:this.negStrandColor:e.isSecondOfPair()?r=e.strand?this.negStrandColor:this.posStrandColor:console.error("ERROR. Paired alignments are either first or second."));break;case"pairOrientation":if(e.mate&&e.isMateMapped()&&e.mate.chr!==e.chr)r=Px(e.mate.chr);else if(this.pairOrientation&&e.pairOrientation){var n=Mx[this.pairOrientation];if(n){var i=this.pairColors[n[e.pairOrientation]];i&&(r=i)}}break;case"fragmentLength":e.mate&&e.isMateMapped()&&e.mate.chr!==e.chr?r=Px(e.mate.chr):this.parent.minFragmentLength&&Math.abs(e.fragmentLength)<this.parent.minFragmentLength?r=this.smallFragmentLengthColor:this.parent.maxFragmentLength&&Math.abs(e.fragmentLength)>this.parent.maxFragmentLength&&(r=this.largeFragmentLengthColor);break;case"tag":void 0!==(t=e.tags()[this.colorByTag])&&(this.bamColorTag===this.colorByTag?r="rgb("+t+")":(this.tagColors||(this.tagColors=new jf("Set1")),r=this.tagColors.getColor(t)));break;default:r=this.parent.color}return r};var Mx={fr:{F1R2:"LR",F2R1:"LR",F1F2:"LL",F2F1:"LL",R1R2:"RR",R2R1:"RR",R1F2:"RL",R2F1:"RL"},rf:{R1F2:"LR",R2F1:"LR",R1R2:"LL",R2R1:"LL",F1F2:"RR",F2F1:"RR",F1R2:"RL",F2R1:"RL"},ff:{F2F1:"LR",R1R2:"LR",F2R1:"LL",R1F2:"LL",R2F1:"RR",F1R2:"RR",R2R1:"RL",F1F2:"RL"}};function Px(e){if(Ox[e])return Ox[e];if(Ox["chr"+e]){var t=Ox["chr"+e];return Ox[e]=t,t}var r=kg.randomRGB();return Ox[e]=r,r}var Ox={chrX:"rgb(204, 153, 0)",chrY:"rgb(153, 204, 0",chrUn:"rgb(50, 50, 50)",chr1:"rgb(80, 80, 255)",chrI:"rgb(139, 155, 187)",chr2:"rgb(206, 61, 50)",chrII:"rgb(206, 61, 50)",chr2a:"rgb(216, 71, 60)",chr2b:"rgb(226, 81, 70)",chr3:"rgb(116, 155, 88)",chrIII:"rgb(116, 155, 88)",chr4:"rgb(240, 230, 133)",chrIV:"rgb(240, 230, 133)",chr5:"rgb(70, 105, 131)",chr6:"rgb(186, 99, 56)",chr7:"rgb(93, 177, 221)",chr8:"rgb(128, 34, 104)",chr9:"rgb(107, 215, 107)",chr10:"rgb(213, 149, 167)",chr11:"rgb(146, 72, 34)",chr12:"rgb(131, 123, 141)",chr13:"rgb(199, 81, 39)",chr14:"rgb(213, 143, 92)",chr15:"rgb(122, 101, 165)",chr16:"rgb(228, 175, 105)",chr17:"rgb(59, 27, 83)",chr18:"rgb(205, 222, 183)",chr19:"rgb(97, 42, 121)",chr20:"rgb(174, 31, 99)",chr21:"rgb(231, 199, 111)",chr22:"rgb(90, 101, 94)",chr23:"rgb(204, 153, 0)",chr24:"rgb(153, 204, 0)",chr25:"rgb(51, 204, 0)",chr26:"rgb(0, 204, 51)",chr27:"rgb(0, 204, 153)",chr28:"rgb(0, 153, 204)",chr29:"rgb(10, 71, 255)",chr30:"rgb(71, 117, 255)",chr31:"rgb(255, 194, 10)",chr32:"rgb(255, 209, 71)",chr33:"rgb(153, 0, 51)",chr34:"rgb(153, 26, 0)",chr35:"rgb(153, 102, 0)",chr36:"rgb(128, 153, 0)",chr37:"rgb(51, 153, 0)",chr38:"rgb(0, 153, 26)",chr39:"rgb(0, 153, 102)",chr40:"rgb(0, 128, 153)",chr41:"rgb(0, 51, 153)",chr42:"rgb(26, 0, 153)",chr43:"rgb(102, 0, 153)",chr44:"rgb(153, 0, 128)",chr45:"rgb(214, 0, 71)",chr46:"rgb(255, 20, 99)",chr47:"rgb(0, 214, 143)",chr48:"rgb(20, 255, 177)"},Fx=Dg(gy,(function(e,t){gy.call(this,e,t),this.theta=e.theta||Math.PI/4,this.sinTheta=Math.sin(this.theta),this.cosTheta=Math.cos(this.theta),this.height=e.height||250,this.arcOrientation=void 0===e.arcOrientation||e.arcOrientation,this.thickness=e.thickness||2,this.color=e.color||"rgb(180,25,137)",this.visibilityWindow=-1,this.colorAlphaCache={}}));function Nx(e,t){var r=this.colorAlphaCache[e];return r||(r=kg.addAlpha(e,t),this.colorAlphaCache[e]=r),r}Fx.prototype.supportsWholeGenome=function(){return!0},Fx.prototype.getState=function(){var e=this.config||{};return e.arcOrientation=this.arcOrientation,e.thickness=this.thickness,e.color=this.color,e},Fx.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.browser.genome,this.featureCache){e.next=11;break}return a=zg(this.config),e.next=5,Sv.loadString(this.config.url,a);case 5:o=e.sent,(s=new Gm("bedpe")).parseHeader(o),c=s.parseFeatures(o),this.wgFeatures=this.getWGFeatures(c),this.featureCache=new Gy(c,i);case 11:return e.abrupt("return","all"===t.toLowerCase()?this.wgFeatures:this.featureCache.queryFeatures(t,r,n));case 12:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}(),Fx.prototype.draw=function(e){var t=this,r=e.context,n=e.pixelWidth,i=e.pixelHeight,a=e.viewportWidth,o=e.bpPerPixel,s=e.bpStart,c=o;gm.fillRect(r,0,e.pixelTop,n,i,{fillStyle:"rgb(255, 255, 255)"});var h=e.features;h&&(function(){var e=0;h.forEach((function(t){var r=(t.start-s)/c,i=(t.end-s)/c;i>=0&&r<=n&&(e=Math.max(e,i-r))}));var r=Math.min(a,e)/2;if(e>0){var o=i/r;t.theta=function(e){var t,r=[.01570925532366355,.15838444032453644,.3249196962329063,.5095254494944288,.7265425280053609,.9999999999999999],n=[.031415926535897934,.3141592653589793,.6283185307179586,.9424777960769379,1.2566370614359172,1.5707963267948966];for(t=0;t<r.length&&!(r[t]>e);t++);var i=0===t?0:r[t-1],a=(e-i)/((t<r.length?r[t]:1)-i),o=0===t?0:n[t-1],s=t<n.length?n[t]:Math.PI/2;return o+a*(s-o)}(o),t.sinTheta=Math.sin(t.theta),t.cosTheta=Math.cos(t.theta)}}(),h.forEach((function(e){var n=Math.round((e.m1-s)/c),i=Math.round((e.m2-s)/c),o=t.arcOrientation,h=i-n;h<3&&(h=3,n--);var u,l,f,p=h/2,d=p/t.sinTheta,g=t.cosTheta*d,v=n+p;o?(u=t.height+g,l=Math.PI+Math.PI/2-t.theta,f=Math.PI+Math.PI/2+t.theta):(u=-g,l=Math.PI/2-t.theta,f=Math.PI/2+t.theta);var m=e.color||t.color;m&&h>a&&(m=Nx.call(t,m,"0.1")),r.strokeStyle=m,r.lineWidth=e.thickness||t.thicknewss||1,r.beginPath(),r.arc(v,u,d,l,f,!1),r.stroke()})))},Fx.prototype.menuItemList=function(){var e=this;return[{name:"Toggle arc direction",click:function(){e.arcOrientation=!e.arcOrientation,e.trackView.repaintViews()}},{name:"Set track color",click:function(){e.trackView.presentColorPicker()}}]},Fx.prototype.getWGFeatures=function(e){var t,r=this.browser.genome,n=new Set(r.wgChromosomeNames),i=[],a=r.getGenomeLength()/1e3,o=fn(r.wgChromosomeNames);try{for(o.s();!(t=o.n()).done;){t.value;var s,c=fn(e);try{for(c.s();!(s=c.n()).done;){var h=s.value,u=r.getChromosomeName(h.chr);if(n.has(u)){var l=r.getGenomeCoordinate(h.chr1,h.m1),f=r.getGenomeCoordinate(h.chr2,h.m2);if(Math.abs(f-l)<a)continue;var p=Object.create(Object.getPrototypeOf(h));Object.assign(p,h),p.chr="all",p.m1=l,p.m2=f,i.push(p)}}}catch(e){c.e(e)}finally{c.f()}}}catch(e){o.e(e)}finally{o.f()}return i.sort((function(e,t){return e.m1-t.m2})),i};var Dx=Dg(gy,(function(e,t){this.type="variant",this.visibilityWindow=e.visibilityWindow,gy.call(this,e,t),this.displayMode=e.displayMode||"EXPANDED",this.labelDisplayMode=e.labelDisplayMode,this.variantHeight=e.variantHeight||10,this.squishedCallHeight=e.squishedCallHeight||1,this.expandedCallHeight=e.expandedCallHeight||10,this.expandedVGap=void 0!==e.expandedVGap?e.expandedVGap:2,this.squishedVGap=void 0!==e.squishedVGap?e.squishedVGap:1,this.expandedGroupGap=e.expandedGroupGap||10,this.squishedGroupGap=e.squishedGroupGap||5,this.featureHeight=e.featureHeight||14,this.visibilityWindow=e.visibilityWindow,this.featureSource=new yb(e,t.genome),this.noCallColor=e.noCallColor||"rgb(245, 245, 245)",this.nonRefColor=e.nonRefColor||"rgb(200, 200, 215)",this.mixedColor=e.mixedColor||"rgb(200, 220, 200)",this.homrefColor=e.homrefColor||"rgb(200, 200, 200)",this.homvarColor=e.homvarColor||"rgb(17,248,254)",this.hetvarColor=e.hetvarColor||"rgb(34,12,253)",this.sortDirection="ASC",this.nRows=1}));function Bx(e,t,r,n){var i,a="",o=t.alternateBases.split(","),s=fn(e.genotype);try{for(s.s();!(i=s.n()).done;){var c=i.value;if("."===c){a+="No Call";break}a+=0===c?t.referenceBases:o[c-1].replace("<","&lt;")}}catch(e){s.e(e)}finally{s.f()}var h=[];if(void 0!==e.callSetName&&h.push({name:"Name",value:e.callSetName}),h.push({name:"Genotype",value:a}),void 0!==e.phaseset&&h.push({name:"Phase set",value:e.phaseset}),void 0!==e.genotypeLikelihood&&h.push({name:"genotypeLikelihood",value:e.genotypeLikelihood.toString()}),n){var u=n.getAttributes(e.callSetName);u&&Object.keys(u).forEach((function(e){var t=e.replace(/([A-Z])/g," $1");t=t.charAt(0).toUpperCase()+t.slice(1),h.push({name:t,value:u[e]})}))}var l=Object.keys(e.info);l.length&&h.push("<hr>"),l.forEach((function(t){h.push({name:t,value:e.info[t]})}));var f=[];return f.length>0&&(h.push("<HR/>"),h=h.concat(f)),h}Dx.prototype.postInit=Vr(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFileHeader();case 2:return e.sent,void 0===this.visibilityWindow&&(mg(t=this.config.url instanceof File?this.config.url.name:this.config.url)&&t.toLowerCase().includes("gnomad")?this.visibilityWindow=1e3:this.callSets?(r=this.callSets.length,this.visibilityWindow=Math.max(1e3,1e6-1e4*r)):this.visibilityWindow=1e6),e.abrupt("return",this);case 5:case"end":return e.stop()}}),e,this)}))),Dx.prototype.getFileHeader=Vr(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.header){e.next=4;break}return e.abrupt("return",this.header);case 4:if("function"!=typeof this.featureSource.getFileHeader){e.next=13;break}return e.next=7,this.featureSource.getFileHeader();case 7:return(t=e.sent)&&(t.name&&!this.config.name&&(this.name=t.name),t.color&&!this.config.color&&(this.color="rgb("+t.color+")"),this.callSets=t.callSets||[]),this.header=t,e.abrupt("return",t);case 13:return this.callSets=[],e.abrupt("return",void 0);case 15:case"end":return e.stop()}}),e,this)}))),Dx.prototype.getCallsetsLength=function(){return this.callSets.length},Dx.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n,i){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this.header){e.next=4;break}return e.next=3,this.getFileHeader();case 3:this.header=e.sent;case 4:return e.abrupt("return",this.featureSource.getFeatures(t,r,n,i,this.visibilityWindow));case 5:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i){return e.apply(this,arguments)}}(),Dx.prototype.computePixelHeight=function(e){if("COLLAPSED"===this.displayMode)return this.nRows=1,10+this.variantHeight;var t=0;if(e){var r,n=fn(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;i.row&&i.row>t&&(t=i.row)}}catch(e){n.e(e)}finally{n.f()}}var a="EXPANDED"===this.displayMode?this.expandedVGap:this.squishedVGap;this.nRows=t+1;var o=10+this.nRows*(this.variantHeight+a);this.variantBandHeight=o;var s="EXPANDED"===this.displayMode?this.expandedCallHeight:this.squishedCallHeight;return o+a+(this.getCallsetsLength()*this.nRows+1)*(s+a)},Dx.prototype.draw=function(e){var t=e.context,r=this.callSets,n=this.getCallsetsLength(),i=e.pixelWidth,a=e.pixelHeight,o="EXPANDED"===this.displayMode?this.expandedCallHeight:this.squishedCallHeight,s=e.bpPerPixel,c=e.bpStart,h=c+i*s+1;gm.fillRect(t,0,e.pixelTop,i,a,{fillStyle:"rgb(255, 255, 255)"});var u="EXPANDED"===this.displayMode?this.expandedVGap:this.squishedVGap;r&&n>0&&"COLLAPSED"!==this.displayMode&&gm.strokeLine(t,0,this.variantBandHeight,i,this.variantBandHeight,{strokeStyle:"rgb(224,224,224) "});var l=e.features;if(l){var f,p=fn(l);try{for(p.s();!(f=p.n()).done;){var d=f.value;if(!(d.end<c)){if(d.start>h)break;var g=10+("COLLAPSED"===this.displayMode?0:d.row*(this.variantHeight+u)),v=this.variantHeight,m=Math.round((d.start-c)/s),y=Math.round((d.end-c)/s),b=Math.max(1,y-m);if(b<3?(b=3,m-=1):b>5&&(m+=1,b-=2),"NONVARIANT"===d.type?t.fillStyle=this.nonRefColor:"MIXED"===d.type?t.fillStyle=this.mixedColor:t.fillStyle=this.color,t.fillRect(m,g,b,v),n>0&&d.calls&&"COLLAPSED"!==this.displayMode){var w,x=0,k=fn(r);try{for(k.s();!(w=k.n()).done;){var S=w.value,_=d.calls[S.id];if(_){var C,A=this.variantBandHeight+u+(x+d.row)*(o+u),E=!0,R=!0,T=!1,I=fn(_.genotype);try{for(I.s();!(C=I.n()).done;){var L=C.value;if("."===L){T=!0;break}0!==L&&(R=!1),0===L&&(E=!1)}}catch(e){I.e(e)}finally{I.f()}t.fillStyle=T?this.noCallColor:R?this.homrefColor:E?this.homvarColor:this.hetvarColor,t.fillRect(m,A,b,o)}x++}}catch(e){k.e(e)}finally{k.f()}}}}}catch(e){p.e(e)}finally{p.f()}}},Dx.prototype.popupData=function(e,t){t||(t=this.clickedFeatures(e));var r,n=e.genomicLocation,i=this.browser.genome.id,a=[],o=this.browser.sampleInformation,s=fn(t);try{for(s.s();!(r=s.n()).done;){var c=r.value;if(a.length>0&&a.push("<HR>"),"COLLAPSED"===this.displayMode)Array.prototype.push.apply(a,c.popupData(n,this.type));else{var h=e.y,u="EXPANDED"===this.displayMode?this.expandedVGap:this.squishedVGap;if(h<=this.variantBandHeight){var l=Math.floor((h-10)/(this.variantHeight+u));c.row===l&&Array.prototype.push.apply(a,c.popupData(n,i),this.type)}else{var f=this.callSets;if(f&&c.calls){var p=this.nRows*("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight),d=Math.floor((h-this.variantBandHeight)/(p+u));if(d>=0&&d<f.length){var g=f[d],v=c.calls[g.id];Array.prototype.push.apply(a,Bx(v,c,0,o))}}}}}}catch(e){s.e(e)}finally{s.f()}return a},Dx.prototype.menuItemList=function(){var e=this,t=[];return t.push({object:oc('<div class="igv-track-menu-border-top">')}),["COLLAPSED","SQUISHED","EXPANDED"].forEach((function(r){t.push({object:Ff({COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"}[r],r===e.displayMode),click:function(){e.displayMode=r,e.trackView.checkContentHeight(),e.trackView.repaintViews()}})})),t};var zx=If.dataRangeMenuItem,Ux=Dg(gy,(function(e,t){var r=e.url,n=e.name;this.config=e,this.url=r,this.name=n,this.pValueField=e.pValueField||"pValue",this.geneField=e.geneField||"geneSymbol",this.snpField=e.snpField||"snp";var i=e.minLogP||e.min,a=e.maxLogP||e.max;this.dataRange={min:i||3.5,max:a||25},this.autoscale=!a||e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||2,this.height=e.height||100,this.autoHeight=!1,this.disableButtons=e.disableButtons,this.visibilityWindow=void 0===e.visibilityWindow?2e6:e.visibilityWindow>=0?Math.min(2e6,e.visibilityWindow):2e6,this.featureSource=new yb(e,t.genome),Fb.gtexLoaded=!0}));Ux.prototype.paintAxis=function(e,t,r){var n=(this.dataRange.max-this.dataRange.min)/r,i={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};gm.fillRect(e,0,0,t,r,{fillStyle:"rgb(255, 255, 255)"});for(var a=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/r),o=4;o<=this.dataRange.max;o+=a){var s,c,h,u,l;s=(l=.85*t)-5,c=l,h=u=r-Math.round((o-this.dataRange.min)/n),gm.strokeLine(e,s,h,c,u,i),h>8&&gm.fillText(e,o,s-1,h+2,i)}i.textAlign="center",gm.fillText(e,"-log10(pvalue)",t/4,r/2,i,{rotate:{angle:-90}})},Ux.prototype.getFeatures=function(e,t,r){var n=this.pValueField;return this.featureSource.getFeatures(e,t,r).then((function(e){return e.forEach((function(e){e.value=e[n]})),e}))},Ux.prototype.draw=function(e){var t=this,r=e.features,n=e.context,i=e.bpPerPixel,a=e.bpStart,o=e.pixelWidth,s=e.pixelHeight,c=(t.dataRange.max-t.dataRange.min)/s,h=e.genomicState.selection;if(this.background&&gm.fillRect(n,0,0,o,s,{fillStyle:this.background}),gm.strokeLine(n,0,s-1,o,s-1,{strokeStyle:this.divider}),n){var u=r.length;n.save(),l(!1),l(!0),n.restore()}function l(e){var l,f,p,d,g,v,m,y,b,w=e?2*t.dotSize:t.dotSize;for(f=0;f<u;f++)if(l=r[f],!((p=Math.round(l.position-a+.5)/i)<0)){if(p>o)break;if(m=l.snp.toUpperCase(),y=l[t.geneField].toUpperCase(),v=h&&(h.snp===m||h.gene===y),!e||v){h&&h.snp===m&&h.addGene(y);var x=-Math.log(l[t.pValueField])/Math.LN10;x>=t.dataRange.min&&(x>t.dataRange.max?(x=t.dataRange.max,b=!0):b=!1,d=Math.max(0+w,s-Math.round((x-t.dataRange.min)/c)),l.px=p,l.py=d,e&&h?(g=h.colorForGene(y),gm.setProperties(n,{fillStyle:g,strokeStyle:"black"})):(g=b?"rgb(150, 150, 150)":"rgb(180, 180, 180)",gm.setProperties(n,{fillStyle:g,strokeStyle:g})),gm.fillCircle(n,p,d,w),gm.strokeCircle(n,p,d,w))}}}},Ux.prototype.popupData=function(e){var t=e.viewport.getCachedFeatures();if(!t||0===t.length)return[];var r=e.genomicLocation,n=(e.x,e.y),i=e.viewport.genomicState.referenceFrame,a=2*this.dotSize*i.bpPerPixel,o=this.dotSize,s=this.name,c=[];return t.forEach((function(e){e.end>=r-a&&e.start<=r+a&&e.py-n<2*o&&(c.length>0&&c.push("<hr>"),c.push({name:"snp id",value:e.snp},{name:"gene id",value:e.geneId},{name:"gene name",value:e.geneName},{name:"p value",value:e.pValue},{name:"tissue",value:s}))})),c},Ux.prototype.menuItemList=function(){var e=this,t=[];return t.push(zx(this.trackView)),t.push({object:Ff("Autoscale",e.autoscale),click:function(){e.autoscale=!e.autoscale,e.config.autoscale=e.autoscale,e.trackView.setDataRange(void 0,void 0,e.autoscale)}}),t},Ux.prototype.doAutoscale=function(e){if(e.length>0){var t=e.map((function(e){return-Math.log(e.value)/Math.LN10}));this.dataRange.max=Zf(t,this.autoscalePercentile)}else{var r=this.config.maxLogP||this.config.max;this.dataRange.max=r||25}return this.dataRange};for(var Hx={X:"rgb(204, 153, 0)",Y:"rgb(153, 204, 0)",Un:"darkGray)",1:"rgb(80, 80, 255)",I:"rgb(139, 155, 187)",2:"rgb(206, 61, 50)",II:"rgb(206, 61, 50)","2a":"rgb(210, 65, 55)","2b":"rgb(215, 70, 60)",3:"rgb(116, 155, 88)",III:"rgb(116, 155, 88)",4:"rgb(240, 230, 133)",IV:"rgb(240, 230, 133)",5:"rgb(70, 105, 131)",6:"rgb(186, 99, 56)",7:"rgb(93, 177, 221)",8:"rgb(128, 34, 104)",9:"rgb(107, 215, 107)",10:"rgb(213, 149, 167)",11:"rgb(146, 72, 34)",12:"rgb(131, 123, 141)",13:"rgb(199, 81, 39)",14:"rgb(213, 143, 92)",15:"rgb(122, 101, 165)",16:"rgb(228, 175, 105)",17:"rgb(59, 27, 83)",18:"rgb(205, 222, 183)",19:"rgb(97, 42, 121)",20:"rgb(174, 31, 99)",21:"rgb(231, 199, 111)",22:"rgb(90, 101, 94)",23:"rgb(204, 153, 0)",24:"rgb(153, 204, 0)",25:"rgb(51, 204, 0)",26:"rgb(0, 204, 51)",27:"rgb(0, 204, 153)",28:"rgb(0, 153, 204)",29:"rgb(10, 71, 255)",30:"rgb(71, 117, 255)",31:"rgb(255, 194, 10)",32:"rgb(255, 209, 71)",33:"rgb(153, 0, 51)",34:"rgb(153, 26, 0)",35:"rgb(153, 102, 0)",36:"rgb(128, 153, 0)",37:"rgb(51, 153, 0)",38:"rgb(0, 153, 26)",39:"rgb(0, 153, 102)",40:"rgb(0, 128, 153)",41:"rgb(0, 51, 153)",42:"rgb(26, 0, 153)",43:"rgb(102, 0, 153)",44:"rgb(153, 0, 128)",45:"rgb(214, 0, 71)",46:"rgb(255, 20, 99)",47:"rgb(0, 214, 143)",48:"rgb(20, 255, 177)"},$x=0,jx=Object.keys(Hx);$x<jx.length;$x++){var qx=jx[$x];Hx["chr"+qx]=Hx[qx]}var Gx=Dg(gy,(function(e,t){gy.call(this,e,t),this.useChrColors=void 0===e.useChrColors||e.useChrColors,this.trait=e.trait,this.posteriorProbability=e.posteriorProbability,this.height=e.height||100,e.autoscale||(e.posteriorProbability?this.dataRange={min:void 0===e.min?0:e.min,max:void 0===e.max?1:e.max}:this.dataRange={min:void 0===e.min?0:e.min,max:void 0===e.max?25:e.max}),this.autoscale=e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||3,this.popoverWindow=void 0===e.popoverWindow?1e8:e.popoverWindow,this.description=e.description,this.colorScales=e.color?new lw(e.color):{"*":new hw(e.colorScale||{thresholds:[5e-8,5e-4,.5],colors:["rgb(255,50,50)","rgb(251,100,100)","rgb(251,170,170)","rgb(227,238,249)"]})},this.featureSource=new yb(e,t.genome)}));Gx.prototype.supportsWholeGenome=function(){return!0},Gx.prototype.getFeatures=function(e,t,r){return this.featureSource.getFeatures(e,t,r)},Gx.prototype.draw=function(e){var t=e.features,r=e.context,n=e.pixelWidth,i=e.pixelHeight;if(this.background&&gm.fillRect(r,0,0,n,i,{fillStyle:this.background}),gm.strokeLine(r,0,i-1,n,i-1,{strokeStyle:this.divider}),t){var a,o=e.bpPerPixel,s=e.bpStart,c=s+n*o+1,h=fn(t);try{for(h.s();!(a=h.n()).done;){var u=a.value,l=u.start;if(!(l<s)){if(l>c)break;var f=this.getColorScale(u.realChr||u.chr),p=void 0,d=void 0;if(this.posteriorProbability)d=u.value,p=f.getColor(d);else{var g=u.value||u.score;if(!g)continue;d=-Math.log10(g),p=f.getColor(d)}var v=(this.dataRange.max-this.dataRange.min)/i,m=Math.round((l-s)/o),y=Math.max(this.dotSize,i-Math.round((d-this.dataRange.min)/v));p&&gm.setProperties(r,{fillStyle:p,strokeStyle:"black"}),gm.fillCircle(r,m,y,this.dotSize),u.px=m,u.py=y}}}catch(e){h.e(e)}finally{h.f()}}},Gx.prototype.getColorScale=function(e){if(this.useChrColors){var t=this.colorScales[e];if(!t){var r=Hx[e]||Gf.get();t=new lw(r),this.colorScales[e]=t}return t}return this.colorScales("*")},Gx.prototype.paintAxis=function(e,t,r){gm.fillRect(e,0,0,t,r,{fillStyle:"rgb(255, 255, 255)"});var n={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"},i=(this.dataRange.max-this.dataRange.min)/r;if(this.posteriorProbability)for(var a=this.dataRange.min;a<this.dataRange.max;a+=.1){var o=r-Math.round((a-this.dataRange.min)/i);gm.strokeLine(e,45,o-2,50,o-2,n),gm.fillText(e,a.toFixed(1),44,o+2,n)}else for(var s=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/r),c=this.dataRange.min;c<this.dataRange.max;c+=s){var h=r-Math.round((c-this.dataRange.min)/i);gm.strokeLine(e,45,h-2,50,h-2,n),gm.fillText(e,Math.floor(c),44,h+2,n)}n.textAlign="center",this.posteriorProbability?gm.fillText(e,"PPA",t/2,r/2,n,{rotate:{angle:-90}}):gm.fillText(e,"-log10(pvalue)",t/2,r/2,n,{rotate:{angle:-90}})},Gx.prototype.popupData=function(e){var t=[],r=e.viewport.trackView.track,n=e.viewport.getCachedFeatures();if(n){var i,a=0,o=fn(n);try{for(o.s();!(i=o.n()).done;){var s=i.value,c=Math.abs(e.canvasX-s.px),h=Math.abs(e.canvasY-s.py),u=s.value||s.score;if(c<this.dotSize&&h<this.dotSize){if(a>0&&t.push("<HR/>"),5==a){t.push("...");break}if("function"==typeof s.popupData)t=t.concat(s.popupData());else{var l=s.realChr||s.chr,f=(s.realStart||s.start)+1;t.push({name:"chromosome",value:l}),t.push({name:"position",value:f}),t.push({name:"name",value:s.name}),r.posteriorProbability?t.push({name:"posterior probability",value:u}):t.push({name:"pValue",value:u})}a++}}}catch(e){o.e(e)}finally{o.f()}}return t},Gx.prototype.menuItemList=function(){var e=If.dataRangeMenuItem,t=this,r=[];return r.push(e(this.trackView)),r.push({object:Ff("Autoscale",t.autoscale),click:function(){t.autoscale=!t.autoscale,t.config.autoscale=t.autoscale,t.trackView.setDataRange(void 0,void 0,t.autoscale)}}),r},Gx.prototype.doAutoscale=function(e){if(e.length>0){var t=this.posteriorProbability?e:e.map((function(e){var t=void 0!==e.value?e.value:e.score;return{value:-Math.log(t)/Math.LN10}})),r=Hg(t);this.dataRange.max=r.max,this.dataRange.min=r.min!==r.max?r.min:0}else this.posteriorProbability?(this.dataRange.min=this.config.min||0,this.dataRange.max=this.config.max||1):(this.dataRange.max=this.config.max||25,this.dataRange.min=this.config.min||0);return this.dataRange};var Vx=If.dataRangeMenuItem,Wx=Dg(gy,(function(e,t){gy.call(this,e,t),this.autoscale=e.autoscale||void 0===e.max,this.dataRange={min:e.min||0,max:e.max},this.windowFunction=e.windowFunction||"mean",this.paintAxis=ow,this.graphType=e.graphType||"bar",this.featureSource=new yb(this.config,t.genome)}));Wx.prototype.postInit=Vr(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.featureSource.getFileHeader();case 2:this.header=e.sent;case 3:case"end":return e.stop()}}),e,this)}))),Wx.prototype.menuItemList=function(){var e=this,t=[];return t.push(Vx(this.trackView)),t.push({object:Ff("Autoscale",e.autoscale),click:function(){e.autoscale=!e.autoscale,e.config.autoscale=e.autoscale,e.trackView.setDataRange(void 0,void 0,e.autoscale)}}),t},Wx.prototype.getFeatures=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.featureSource.getFeatures(t,0,Number.MAX_VALUE);case 2:i=e.sent,a=void 0,o=void 0,s=1;case 6:if(!(s<i.length-1)){e.next=14;break}if(void 0===a&&i[s].end>r&&(a=s-1),!(void 0===o&&i[s].start>n)){e.next=11;break}return o=s+1,e.abrupt("break",14);case 11:s++,e.next=6;break;case 14:return void 0===a&&(a=0),void 0===o&&(o=i.length),e.abrupt("return",i.slice(a,o));case 17:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}(),Wx.prototype.draw=function(e){var t=this,r=e.features,n=e.context,i=e.bpPerPixel,a=e.bpStart,o=(e.pixelWidth,e.pixelHeight),s=function(e){return(t.dataRange.max-e)/(t.dataRange.max-t.dataRange.min)*o},c=function(e){var t=Math.floor((e-a)/i);return isNaN(t)&&console.warn("isNaN(x). feature start "+yg(e)+" bp start "+yg(a)),t};if(r&&r.length>0&&(void 0===t.dataRange.min&&(t.dataRange.min=0),t.dataRange.max>t.dataRange.min)){var h=this.config.highlightSamples,u=this.config.onlyHandleClicksForHighlightedSamples,l=-1,f={},p=[],d=[];this.clickDetectorCache={};var g,v=fn(r);try{for(v.s();!(g=v.n()).done;){var m=g.value,y=c(m.start),b=c(m.end),w=l>=0?c(l):y;if(!(isNaN(y)||isNaN(b)||y-w<1&&b-y<1)){this.clickDetectorCache[y]=[],this.clickDetectorCache[b]=[];for(var x=0;x<m.values.length;x++){var k=t.header[x],S=m.values[x],_=s(S);if(y-w>=1){var C=f[k],A=s(C),E=h&&h[k];E?p.push([w,A,y,_,E]):gm.strokeLine(n,w,A,y,_,{strokeStyle:"#D9D9D9"}),(!u||k in h)&&this.clickDetectorCache[y].push([w,A,y,_,k,E||"gray"])}if(b-y>=1){var R=h&&h[k];R?d.push([y,_,b,_,R]):gm.strokeLine(n,y,_,b,_,{strokeStyle:"gray"}),(!u||k in h)&&this.clickDetectorCache[b].push([y,_,b,_,k,R||"gray"])}f[k]=S}l=m.end}}}catch(e){v.e(e)}finally{v.f()}for(var T=0,I=p;T<I.length;T++){var L=I[T];gm.strokeLine(n,L[0],L[1],L[2],L[3],{strokeStyle:L[4],lineWidth:1.3})}for(var M=0,P=d;M<P.length;M++){var O=P[M];gm.strokeLine(n,O[0],O[1],O[2],O[3],{strokeStyle:O[4],lineWidth:2})}}!function(e){if(t.config.hasOwnProperty("guideLines")){var r,n=fn(t.config.guideLines);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.hasOwnProperty("color")&&i.hasOwnProperty("y")&&i.hasOwnProperty("dotted")){var a=s(i.y),o={strokeStyle:i.color,strokeWidth:2};i.dotted?gm.dashedLine(e.context,0,a,e.pixelWidth,a,5,o):gm.strokeLine(e.context,0,a,e.pixelWidth,a,o)}}}catch(e){n.e(e)}finally{n.f()}}}(e)},Wx.prototype.doAutoscale=function(e){var t,r;return e.length>0?(t=Number.MAX_VALUE,r=-Number.MAX_VALUE,e.forEach((function(e){t=Math.min.apply(Math,[t].concat(on(e.values))),r=Math.max.apply(Math,[r].concat(on(e.values)))})),t-=.01,r+=.01):(t=0,r=100),{min:t,max:r}},Wx.prototype.clickedFeatures=function(e){for(var t,r,n,i,a,o,s,c,h=e.canvasX,u=e.canvasY,l=null,f=0,p=Object.keys(this.clickDetectorCache);f<p.length&&(l=p[f],!((l=parseInt(l))>=h));f++);if(l){var d,g=Number.MAX_VALUE,v=[],m=fn(this.clickDetectorCache[l]);try{for(m.s();!(d=m.n()).done;){var y=d.value,b=y[0],w=y[2];if(h<b||h>w)return[];var x=y[1],k=y[3];if(!(u<Math.min(x,k)-10||u>Math.max(x,k)+10)){var S=(t=h,r=u,a=void 0,o=void 0,s=void 0,c=void 0,a=w-(n=b),o=k-(i=x),s=Math.abs(a*(i-r)-(n-t)*o),(c=Math.sqrt(a*a+o*o))>0?s/c:0);S<g&&(v=[{name:y[4],color:y[5]}],g=S)}}}catch(e){m.e(e)}finally{m.f()}if(g<5)return v}return[]},Wx.prototype.popupData=function(e,t){t||(t=this.clickedFeatures(e));var r=[];return t.forEach((function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var i=n[t];Bg(e[i])&&r.push({name:i,value:e[i]})}})),r},Wx.prototype.contextMenuItemList=function(e){return e.viewport.genomicState.referenceFrame,e.genomicLocation,[]},Wx.prototype.getState=function(){var e=this.config;return e.autoscale=this.autoscale,!this.autoscale&&this.dataRange&&(e.min=this.dataRange.min,e.max=this.dataRange.max),e},Wx.prototype.supportsWholeGenome=function(){return!1};var Zx=Dg(gy,(function(e,t){gy.call(this,e,t),e.height||(this.height=300),this.arcOrientation=!1,this.theta=Math.PI/2,e.format,this.featureSource=new Xx(e,t.genome)}));function Yx(e,t){e.sort((function(e,r){var n=void 0===e.score?-Number.MAX_VALUE:e.score,i=void 0===r.score?-Number.MAX_VALUE:r.score;return(void 0===t?1:t)*(n-i)}))}function Xx(e,t){this.config=e,this.genome=t}Zx.prototype.getFeatures=function(e,t,r){return this.featureSource.getFeatures(e,t,r)},Zx.prototype.draw=function(e){var t=this,r=Math.PI/2,n=e.context,i=e.pixelWidth,a=e.pixelHeight,o=(e.viewportWidth,e.bpPerPixel),s=e.bpStart,c=o,h=t.arcOrientation;gm.fillRect(n,0,e.pixelTop,i,a,{fillStyle:"rgb(255, 255, 255)"});var u=e.features;u&&(Yx(u,1),u.forEach((function(e){if(e.startLeft){var i=Math.round((e.startLeft-s)/c),a=Math.round((e.startRight-s)/c),o=Math.round((e.endLeft-s)/c),u=Math.round((e.endRight-s)/c);n.fillStyle=e.color,n.strokeStyle=e.color,n.beginPath();var l=(i+u)/2,f=(u-i)/2,p=t.height,d=Math.PI+(Math.PI/2-r),g=2*Math.PI-(Math.PI/2-r);h?(p=0,n.arc(l,p,f,g,d),n.lineTo(u,p)):(n.arc(l,p,f,d,g),n.lineTo(o,p));var v=(a+o)/2,m=(o-a)/2,y=p;h?(n.arc(v,y,m,d,g,!0),n.lineTo(o,y)):(n.arc(v,y,m,g,d,!0),n.lineTo(i,y)),n.stroke(),n.fill(),e.drawState={x1:l,y1:p,r1:f,x2:v,y2:y,r2:m,sa:d,ea:g}}else{var b=Math.round((e.start-s)/c),w=Math.round((e.end-s)/c);n.strokeStyle=e.color,n.beginPath();var x=(b+w)/2,k=(w-b)/2,S=t.height,_=Math.PI+(Math.PI/2-r),C=2*Math.PI-(Math.PI/2-r);h?(S=0,n.arc(x,S,k,C,_)):n.arc(x,S,k,_,C),n.stroke(),e.drawState={x1:x,y1:S,r1:k,sa:_,ea:C}}})))},Zx.prototype.clickedFeatures=function(e){var t=gy.prototype.clickedFeatures.call(this,e),r=[];Yx(t,-1);var n,i=fn(t);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.drawState,s=e.canvasX-o.x1,c=e.canvasY-o.y1,h=Math.sqrt(s*s+c*c),u=o.r1+3,l=void 0,f=void 0;if(void 0===o.x2)l=h,f=o.r1-3;else{var p=e.canvasX-o.x2,d=e.canvasY-o.y2;l=Math.sqrt(p*p+d*d),f=o.r2-3}if(h<u&&l>f){r.push(a);break}}}catch(e){i.e(e)}finally{i.f()}return r},Zx.prototype.popupData=function(e,t){if(t||(t=this.clickedFeatures(e)),t&&t.length>0)return gy.extractPopupData(t[0],this.getGenomeId())},Zx.prototype.menuItemList=function(){var e=this;return[{name:"Toggle arc direction",click:function(){e.arcOrientation=!e.arcOrientation,e.trackView.repaintViews()}}]},Zx.prototype.getState=function(){var e=this._super.getState.call(this);return e.arcOrientation=this.arcOrientation,e.thickness=this.thickness,e.color=this.color,e},Xx.prototype.getFeatures=function(e,t,r){var n=this,i=this.genome;if(this.featureCache)return Promise.resolve(n.featureCache.queryFeatures(e,t,r));var a=zg(this.config);return Sv.loadString(n.config.url,a).then((function(a){return n.featureCache=new Gy(function(e){if(!e)return null;for(var t,r=Nm(e),n=!0,i=[],a=[],o=[];t=r.nextLine();){var s=t.split("\t");if(n&&t.startsWith("color:")){var c="rgb("+s[1]+","+s[2]+","+s[3]+")";i.push(c),s.length>4&&a.push(s[4])}else{n=!1;var h=s[0],u=Number.parseInt(s[1])-1,l=Number.parseInt(s[2])-1,f=Number.parseInt(s[3]),p=Number.parseInt(s[4]),d=Number.parseInt(s[5]),g=i[d],v=void 0;(v=u<=p?{chr:h,startLeft:Math.min(u,l),startRight:Math.max(u,l),endLeft:Math.min(f,p),endRight:Math.max(f,p),color:g,score:d}:{chr:h,startLeft:Math.min(f,p),startRight:Math.max(f,p),endLeft:Math.min(u,l),endRight:Math.max(u,l),color:g,score:d}).start=v.startLeft,v.end=v.endRight,a.length>d&&(v.description=a[d]),o.push(v)}}return o}(a),i),n.featureCache.queryFeatures(e,t,r)}))};var Kx={sequence:function(e,t){return new Zb(e,t)},feature:function(e,t){return new Db(e,t)},seg:function(e,t){return new fw(e,t)},wig:function(e,t){return new cw(e,t)},merged:function(e,t){return new pw(e,t)},alignment:function(e,t){return new Rx(e,t)},interaction:function(e,t){return new Fx(e,t)},variant:function(e,t){return new Dx(e,t)},eqtl:function(e,t){return new Ux(e,t)},gwas:function(e,t){return new Gx(e,t)},arc:function(e,t){return new Zx(e,t)},gcnv:function(e,t){return new Wx(e,t)}},Qx=function(e,t){this.config=e,this.name=e.name,this.roiSource=new yb(e,t),this.color=e.color||"rgba(68, 134, 247, 0.25)"};function Jx(e,t,r){var n,i;return n=Math.round((e.start-t)/r),(i=Math.round((e.end-t)/r)-n)<3&&(i=3,n-=1),{x:n,width:i}}Qx.prototype.getFeatures=function(e,t,r){return this.roiSource.getFeatures(e,t,r)},Qx.prototype.draw=function(e){var t,r,n,i;if(i=e.features){t=e.bpStart+(e.pixelWidth*e.bpPerPixel+1);for(var a=0,o=i.length;a<o;a++)if(!((r=i[a]).end<e.bpStart)){if(r.start>t)break;n=Jx(r,e.bpStart,e.bpPerPixel),gm.fillRect(e.context,n.x,e.pixelTop,n.width,e.pixelHeight,{fillStyle:this.color})}}};var ek=function(e,t){this.geneColors={},this.gene=null,this.snp=null,this.genesCount=0,e&&(this.gene=e.toUpperCase(),this.geneColors[this.gene]=tk[this.genesCount++]),t&&(this.snp=t.toUpperCase())};ek.prototype.addGene=function(e){this.geneColors[e.toUpperCase()]||(this.geneColors[e.toUpperCase()]=tk[this.genesCount++])},ek.prototype.colorForGene=function(e){return this.geneColors[e.toUpperCase()]};var tk=new Array;tk.push("rgb(228,26,28)"),tk.push("rgb(55,126,184)"),tk.push("rgb(77,175,74)"),tk.push("rgb(166,86,40)"),tk.push("rgb(152,78,163)"),tk.push("rgb(255,127,0)"),tk.push("rgb(247,129,191)"),tk.push("rgb(153,153,153)"),tk.push("rgb(255,255,51)"),tk.push("rgb(102, 194, 165"),tk.push("rgb(252, 141, 98"),tk.push("rgb(141, 160, 203"),tk.push("rgb(231, 138, 195"),tk.push("rgb(166, 216, 84"),tk.push("rgb(255, 217, 47"),tk.push("rgb(229, 196, 148"),tk.push("rgb(179, 179, 179"),tk.push("rgb( 141, 211, 199"),tk.push("rgb(255, 255, 179"),tk.push("rgb(190, 186, 218"),tk.push("rgb(251, 128, 114"),tk.push("rgb(128, 177, 211"),tk.push("rgb(253, 180, 98"),tk.push("rgb(179, 222, 105"),tk.push("rgb(252, 205, 229"),tk.push("rgb(217, 217, 217"),tk.push("rgb(188, 128, 189"),tk.push("rgb(204, 235, 197"),tk.push("rgb(255, 237, 111");var rk=!Ic((function(e){Array.from(e)}));Oe({target:"Array",stat:!0,forced:rk},{from:Xh});var nk=function(e,t){var r,n,i,a=this;r=new DOMParser,n=r.parseFromString(e,"text/xml"),function(){var e,r,i,o,s;!(e=n.getElementsByTagName("Session"))||e.length,r=e.item(0),i=r.getAttribute("genome"),o=r.getAttribute("locus"),s=r.getAttribute("ucscID"),t&&t.hasOwnProperty(i)?a.genome=i:(a.reference={fastaURL:i},s&&(a.reference.id=s)),o&&(a.locus=o)}(),i=n.getElementsByTagName("Resource"),a.tracks=[];var o={};function s(e,t){var r,n,i,a,o,s,c,h,u,l;t.name=e.getAttribute("name"),(r=e.getAttribute("color"))&&(t.color="rgb("+r+")"),a=e.getAttribute("altColor"),r&&(t.altColor="rgb("+a+")"),(n=e.getAttribute("height"))&&(t.height=parseInt(n)),(i=e.getAttribute("autoScale"))&&(t.autoScale="true"===i),(l=e.getAttribute("autoscaleGroup"))&&(t.autoscaleGroup=l),(c=e.getAttribute("windowFunction"))&&(t.windowFunction=c),(h=e.getAttribute("visibilityWindow")||e.getAttribute("featureVisibilityWindow"))&&(t.visibilityWindow=h),(u=e.getAttribute("indexed"))&&(t.indexed="true"===u),(s=e.getElementsByTagName("DataRange")).length>0&&(o=s.item(0),i||(t.min=parseInt(o.getAttribute("minimum")),t.max=parseInt(o.getAttribute("maximum"))),t.logScale="LOG"===o.getAttribute("type"))}Array.from(i).forEach((function(e,t){var r={url:e.getAttribute("path"),indexURL:e.getAttribute("index"),order:t};a.tracks.push(r),o[r.url]=r})),(i=n.getElementsByTagName("Track"))&&i.length>0&&(a.tracks=[],Array.from(i).forEach((function(e){var t,r,n,i;(n=e.getElementsByTagName("Track"))&&n.length>0?(s(e,i={type:"merged",tracks:[]}),a.tracks.push(i),Array.from(n).forEach((function(e){var t,r;e.processed=!0,t=e.getAttribute("id"),(r=o[t])&&(i.tracks.push(r),s(e,r),r.autoscale=!1,i.height=r.height)}))):e.processed||(t=e.getAttribute("id"),(r=o[t])&&(a.tracks.push(r),s(e,r)))})))},ik=function(){this.attributes={},this.plinkLoaded=!1};function ak(e,t){return(new ik).loadPlinkFile(e,t)}ik.prototype.loadPlinkFile=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r){var n,i,a,o,s,c,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r||(r={}),n=zg(r),e.next=4,Sv.loadString(t,n);case 4:i=e.sent,a=bg(i),o=fn(a);try{for(o.s();!(s=o.n()).done;)c=s.value,h=c.split(" "),this.attributes[h[1]]={familyId:h[0],fatherId:h[2],motherId:h[3],sex:h[4],phenotype:h[5]}}catch(e){o.e(e)}finally{o.f()}return this.plinkLoaded=!0,e.abrupt("return",this);case 10:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),ik.prototype.getAttributes=function(e){return this.attributes[e]},ik.prototype.getAttributeNames=function(){return this.hasAttributes()?Object.keys(this.attributes[Object.keys(this.attributes)[0]]):[]},ik.prototype.hasAttributes=function(){return Object.keys(this.attributes).length>0};var ok=function(e,t,r){this.browser=r,this.$parent=e,this.buildPanels(e,t)};function sk(e,t,r){var n,i=this.browser;return(n={}).genomicState=t,n.$ideogram=oc('<div class="igv-ideogram-content"></div>'),e.append(n.$ideogram),function(e,t,r){t<r&&1+t!==r?e.addClass("igv-ideogram-content-border-right"):e.removeClass("igv-ideogram-content-border-right")}(n.$ideogram,i.genomicStateList.indexOf(t),i.genomicStateList.length),n.$ideogram.outerWidth(r),n.$canvas=oc('<canvas class ="igv-canvas">'),n.$ideogram.append(n.$canvas),lk(n),n.ideograms={},n.$ideogram.on("click",(function(e){!function(e,t,r){var n=Ag(r,t.$ideogram.get(0)),i=t.genomicState.referenceFrame,a=i.bpPerPixel*t.$ideogram.width(),o=e.genome.getChromosome(i.chrName),s=a/o.bpLength,c=n.x/t.$ideogram.width();c-s/2<0&&(c=s/2),c+s/2>1&&(c=1-s/2);var h=Math.round((c-s/2)*o.bpLength),u=Math.round((c+s/2)*o.bpLength);i.start=Math.round((c-s/2)*o.bpLength),i.bpPerPixel=(u-h)/t.$ideogram.width(),e.updateLocusSearchWidget(t.genomicState),e.updateViews()}(i,n,e)})),n}function ck(e){e.forEach((function(t,r){1===e.length||1+r===e.length?t.$ideogram.removeClass("igv-ideogram-content-border-right"):t.$ideogram.addClass("igv-ideogram-content-border-right")}))}function hk(e){var t=e.ctx,r=e.width,n=e.height,i=e.genome,a=e.referenceFrame,o=e.ideogramWidth;if(r>0&&n>0&&i&&a&&i.getChromosome(a.chrName)&&n>0&&(gm.fillRect(t,0,0,r,n,{fillStyle:kg.greyScale(255)}),"all"!==a.chrName.toLowerCase())){!function(e){var t,r,n,i,a,o,s,c,h,u,l=e.ctx,f=e.referenceFrame,p=e.genome,d=e.width,g=e.height,v=e.stainColors;if(void 0!==p){if(gm.fillRect(l,0,0,d,g,{fillStyle:kg.greyScale(255)}),t=p.getCytobands(f.chrName)){if(n=0+g/2,i=[],a=[],0===t.length)return;for(o=t[t.length-1].end,s=d/o,l.beginPath(),gm.roundRect(l,.5,.5,d-1,g-1,(g-1)/2,0,1),l.clip(),u=0;u<t.length;u++)r=t[u],c=s*r.start,h=s*r.end,"c"===r.type?("p"===r.name.charAt(0)?(i[0]=c,a[0]=g+0,i[1]=c,a[1]=0,i[2]=h,a[2]=n):(i[0]=h,a[0]=g+0,i[1]=h,a[1]=0,i[2]=c,a[2]=n),l.fillStyle="rgb(150, 0, 0)",l.strokeStyle="rgb(150, 0, 0)",gm.polygon(l,i,a,1,0)):(l.fillStyle=uk(v,r),gm.fillRect(l,c,1,h-c,g-2))}l.strokeStyle=kg.greyScale(41),gm.roundRect(l,.5,.5,d-1,g-1,(g-1)/2,0,1)}}({ctx:t,referenceFrame:a,genome:i,width:r,height:n,stainColors:[]});var s=i.getChromosome(a.chrName),c=Math.round(a.bpPerPixel*o),h=a.start,u=s.bpLength,l=i.getCytobands(a.chrName);if(l&&l.length>0&&(u=Math.max(u,l[l.length-1].end)),c<u){var f=c/u,p=h/u,d=Math.floor(p*r),g=Math.floor(f*r);d=Math.max(0,d),d=Math.min(r-g,d),t.save(),t.strokeStyle="red",t.lineWidth=g<2?1:2;var v=d+t.lineWidth/2;g=g<2?1:g-t.lineWidth;var m=t.lineWidth/2,y=n-t.lineWidth;t.strokeRect(v,m,g,y),t.restore()}}}function uk(e,t){if("c"===t.type)return"rgb(150, 10, 10)";var r=t.stain,n=230;"p"===t.type&&(n=Math.floor(230-r/100*230));var i=e[n];return i||(i="rgb("+n+","+n+","+n+")",e[n]=i),i}function lk(e){var t=e.$canvas.get(0),r=+e.$ideogram.width(),n=+e.$ideogram.height();t.style.width=r+"px",t.style.height=n+"px",t.width=window.devicePixelRatio*r,t.height=window.devicePixelRatio*n,e.ctx=t.getContext("2d"),e.ctx.scale(window.devicePixelRatio,window.devicePixelRatio)}ok.prototype.renderSVGContext=function(e,t){var r=this;this.panels.forEach((function(n,i){var a=n.$ideogram.get(0).getBoundingClientRect(),o=t.deltaX+i*(n.$canvas.width()+e.multiLocusGap),s=t.deltaY;e.addTrackGroupWithTranslationAndClipRect("ideogram",o,s,a.width,a.height,0),e.save(),hk({ctx:e,width:n.$canvas.width(),height:n.$canvas.height(),genome:r.browser.genome,referenceFrame:n.genomicState.referenceFrame,ideogramWidth:n.$ideogram.width()}),e.restore()}))},ok.prototype.buildPanels=function(e,t){var r=this;e.append(oc('<div class="igv-ideogram-shim"></div>')),this.panels=this.browser.genomicStateList.map((function(n){return sk.call(r,e,n,t)}))},ok.prototype.setWidth=function(e,t){this.panels.forEach((function(t){t.$ideogram.outerWidth(e),lk(t),t.ideograms={}})),!0===t&&this.repaint()},ok.prototype.resize=function(){this.setWidth(this.browser.viewportContainerWidth()/this.browser.genomicStateList.length,!0)},ok.prototype.repaint=function(){var e=this;this.panels.forEach((function(t){hk({ctx:t.ctx,width:t.$canvas.width(),height:t.$canvas.height(),genome:e.browser.genome,referenceFrame:t.genomicState.referenceFrame,ideogramWidth:t.$ideogram.width()})}))},ok.prototype.discardPanels=function(){this.panels.forEach((function(e){e.$ideogram.remove()})),this.panels=void 0},ok.prototype.addPanelWithGenomicStateAtIndex=function(e,t,r){var n;n=sk.call(this,this.$parent,e,r),t===this.panels.length?this.panels.push(n):(this.panels.splice(t,0,n),n.$ideogram.detach().insertAfter(this.panels[t-1].$ideogram)),ck(this.panels)},ok.prototype.removePanelWithLocusIndex=function(e){this.panels[e].$ideogram.remove(),this.panels.splice(e,1),ck(this.panels)},ok.prototype.repaintPanelWithGenomicState=function(e){var t=this.panels[this.browser.genomicStateList.indexOf(e)];hk({ctx:t.ctx,width:t.$canvas.width(),height:t.$canvas.height(),genome:this.browser.genome,referenceFrame:t.genomicState.referenceFrame,ideogramWidth:t.$ideogram.width()})};var fk=function(e,t,r,n,i){this.genome=e,this.chrName=t,this.start=r,this.initialEnd=n,this.bpPerPixel=i};fk.prototype.calculateEnd=function(e){return this.start+this.bpPerPixel*e},fk.prototype.calculateBPP=function(e,t){return(e-this.start)/t},fk.prototype.set=function(e){this.chrName=e.chrName,this.start=e.start,this.bpPerPixel=e.bpPerPixel},fk.prototype.toPixels=function(e){return e/this.bpPerPixel},fk.prototype.toBP=function(e){return this.bpPerPixel*e},fk.prototype.shiftPixels=function(e,t){var r=this.start;return this.start+=e*this.bpPerPixel,this.clamp(t),r!==this.start},fk.prototype.clamp=function(e){var t=this.genome.getChromosome(this.chrName).bpStart||0;if(this.start=Math.max(t,this.start),e){var r=this.genome.getChromosome(this.chrName).bpLength-e*this.bpPerPixel;this.start>r&&(this.start=r)}},fk.prototype.getChromosome=function(){return this.genome.getChromosome(this.chrName)},fk.prototype.showLocus=function(e){if("all"===this.chrName.toLowerCase())return this.chrName.toLowerCase();var t=yg(Math.floor(this.start)+1),r=yg(Math.round(this.start+this.bpPerPixel*e));return this.chrName+":"+t+"-"+r},fk.prototype.description=function(){return"ReferenceFrame "+this.chrName+" "+yg(Math.floor(this.start))+" bpp "+this.bpPerPixel};var pk=function(e,t){this.guid=Eg(),this.namespace=".browser_"+this.guid,this.config=e,this.parent=t,this.$root=oc('<div class="igv-root-div">'),oc(t).append(this.$root),this.$content=oc('<div class="igv-content-div">'),this.$root.append(this.$content),this.$contentHeader=oc("<div>",{class:"igv-content-header"}),this.$content.append(this.$contentHeader);var r=oc('<div class="igv-track-container-div">');this.$content.append(r),this.trackContainerDiv=r.get(0),dk.call(this,e),this.trackViews=[],this.trackLabelsVisible=!0,this.isCenterGuideVisible=!1,this.cursorGuideVisible=!1,this.featureDB={},this.constants={dragThreshold:3,scrollThreshold:5,defaultColor:"rgb(0,0,150)",doubleClickDelay:e.doubleClickDelay||500},this.eventHandlers={},this.$spinner=oc('<div class="igv-track-container-spinner">'),r.append(this.$spinner),this.$spinner.append(Nf("spinner")),this.stopSpinner(),vk.call(this)};function dk(e){e.gtex&&(Fb.gtexLoaded=!0),this.flanking=e.flanking,this.crossDomainProxy=e.crossDomainProxy,this.formats=e.formats,this.trackDefaults=e.trackDefaults,e.search?this.searchConfig={type:"json",url:e.search.url,coords:void 0===e.search.coords?1:e.search.coords,chromosomeField:e.search.chromosomeField||"chromosome",startField:e.search.startField||"start",endField:e.search.endField||"end",geneField:e.search.geneField||"gene",snpField:e.search.snpField||"snp",resultsField:e.search.resultsField}:(e.reference&&e.reference.id?e.reference.id:e.genome&&e.genome,this.searchConfig={type:"plain",url:"https://igv.org/genomes/locus.php?genome=$GENOME$&name=$FEATURE$",coords:0,chromosomeField:"chromosome",startField:"start",endField:"end",geneField:"gene",snpField:"snp"})}function gk(e,t){var r,n=fn(e);try{for(n.s();!(r=n.n()).done;){var i,a=r.value,o=fn(a.viewports);try{for(o.s();!(i=o.n()).done;){var s=i.value;s.$trackLabel&&(0===a.viewports.indexOf(s)&&!0===t?s.$trackLabel.show():s.$trackLabel.hide())}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}function vk(){var e=this;function t(t){var r,n,i,a;if(t.preventDefault(),!e.loadInProgress()&&(r=Cg(t),e.vpMouseDown)){var o=Math.abs(r.x-e.vpMouseDown.mouseDownX)>Math.abs(r.y-e.vpMouseDown.mouseDownY);if(i=(n=e.vpMouseDown.viewport).$viewport.width(),a=n.genomicState.referenceFrame,!e.dragObject&&!e.isScrolling)if(o)e.vpMouseDown.mouseDownX&&Math.abs(r.x-e.vpMouseDown.mouseDownX)>e.constants.dragThreshold&&(e.dragObject={viewport:n,start:a.start});else if(e.vpMouseDown.mouseDownY&&Math.abs(r.y-e.vpMouseDown.mouseDownY)>e.constants.scrollThreshold){e.isScrolling=!0;var s=n.trackView,c=s.$viewportContainer.height(),h=s.maxContentHeight();e.vpMouseDown.r=c/h}if(e.dragObject&&(a.shiftPixels(e.vpMouseDown.lastMouseX-r.x,i)&&(e.updateLocusSearchWidget(e.vpMouseDown.genomicState),e.updateViews()),e.fireEvent("trackdrag")),e.isScrolling){var u=e.vpMouseDown.r*(e.vpMouseDown.lastMouseY-r.y);e.vpMouseDown.viewport.trackView.scrollBy(u)}e.vpMouseDown.lastMouseX=r.x,e.vpMouseDown.lastMouseY=r.y}}function r(t){e.cancelTrackPan(),e.endTrackDrag()}oc(window).on("resize"+this.namespace,(function(){e.resize()})),oc(this.root).on("mouseup",r),oc(this.root).on("mouseleave",r),oc(this.trackContainerDiv).on("mousemove",t),oc(this.trackContainerDiv).on("touchmove",t),oc(this.trackContainerDiv).on("mouseleave",r),oc(this.trackContainerDiv).on("mouseup",r),oc(this.trackContainerDiv).on("touchend",r)}pk.prototype.startSpinner=function(){var e=this.$spinner;e&&(e.addClass("igv-fa5-spin"),e.show())},pk.prototype.stopSpinner=function(){var e=this.$spinner;e&&(e.hide(),e.removeClass("igv-fa5-spin"))},pk.prototype.isMultiLocusMode=function(){return this.genomicStateList&&this.genomicStateList.length>1},pk.prototype.isMultiLocusWholeGenomeView=function(){if(void 0===this.genomicStateList||1===this.genomicStateList.length)return!1;var e,t=fn(this.genomicStateList);try{for(t.s();!(e=t.n()).done;)if("all"===e.value.referenceFrame.chrName.toLowerCase())return!0}catch(e){t.e(e)}finally{t.f()}return!1},pk.prototype.toSVG=function(){var e=this.trackContainerDiv.getBoundingClientRect(),t=this.trackViews[0].$viewportContainer.get(0).getBoundingClientRect(),r=this.ideoPanel?this.ideoPanel.panels[0].$ideogram.get(0).getBoundingClientRect():{height:0,width:0},n=e.width+8*(this.genomicStateList.length-1),i=e.height+r.height,a=new pf({width:n,height:8e3,backdropColor:"white",multiLocusGap:8,viewbox:{x:0,y:0,width:n,height:8e3}}),o=t.x-e.x;this.ideoPanel&&this.ideoPanel.renderSVGContext(a,{deltaX:o,deltaY:0});var s,c=fn(this.trackViews);try{for(c.s();!(s=c.n()).done;)s.value.renderSVGContext(a,{deltaX:o,deltaY:r.height-e.y})}catch(e){c.e(e)}finally{c.f()}return a.setHeight(i),a.getSerializedSvg(!0)},pk.prototype.saveSVGtoFile=function(e){var t=this.toSVG();if(e.$container){var r=this.trackContainerDiv.getBoundingClientRect();e.$container.empty(),e.$container.width(r.width),e.$container.append(t)}Ug(e.filename||"igv.svg",URL.createObjectURL(new Blob([t],{type:"application/octet-stream"})))},pk.prototype.loadSession=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=function(){return(i=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.url||t.file,!t.url||!t.url.startsWith("blob:")&&!t.url.startsWith("data:")){e.next=6;break}return n=pk.uncompressSession(t.url),e.abrupt("return",JSON.parse(n));case 6:if((i=t.filename)||(i=t.url?ov(t.url):t.file.name),!i.endsWith(".xml")){e.next=18;break}return e.next=11,qv.getKnownGenomes();case 11:return a=e.sent,e.next=14,Sv.loadString(r);case 14:return o=e.sent,e.abrupt("return",new nk(o,a));case 18:if(!i.endsWith(".json")){e.next=22;break}return e.abrupt("return",Sv.loadJson(r));case 22:return e.abrupt("return",void 0);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)},n=function(e){return i.apply(this,arguments)},this.roi=[],!t.url&&!t.file){e.next=9;break}return e.next=6,n(t);case 6:r=e.sent,e.next=10;break;case 9:r=t;case 10:return e.abrupt("return",this.loadSessionObject(r));case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),pk.prototype.loadSessionObject=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c,h,u,l,f,p,d,g,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.removeAllTracks(!0),e.next=3,this.loadGenome(t.reference||t.genome,t.locus);case 3:if(r=e.sent,t.gtexSelections){n={},i=fn(this.genomicStateList);try{for(i.s();!(a=i.n()).done;)o=a.value,n[o.locusSearchString]=o}catch(e){i.e(e)}finally{i.f()}s=fn(Object.getOwnPropertyNames(t.gtexSelections));try{for(s.s();!(c=s.n()).done;)h=c.value,(u=n[h])&&(l=t.gtexSelections[h].gene,f=t.gtexSelections[h].snp,u.selection=new ek(l,f))}catch(e){s.e(e)}finally{s.f()}}if(t.roi){this.roi=[],p=fn(t.roi);try{for(p.s();!(d=p.n()).done;)g=d.value,this.roi.push(new Qx(g,r))}catch(e){p.e(e)}finally{p.f()}}return t.tracks||(t.tracks=[]),0===t.tracks.filter((function(e){return"sequence"===e.type})).length&&t.tracks.push({type:"sequence",order:-Number.MAX_SAFE_INTEGER}),e.next=10,this.loadTrackList(t.tracks);case 10:!1===t.showIdeogram||this.ideoPanel||(v=this.viewportContainerWidth()/this.genomicStateList.length,this.ideoPanel=new ok(this.$contentHeader,v,this),this.ideoPanel.repaint()),this.updateLocusSearchWidget(this.genomicStateList[0]),this.windowSizePanel.updateWithGenomicState(this.genomicStateList[0]),this.resize();case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),pk.prototype.loadGenome=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r){var n,i,a,o,s,c,h,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=function(e,t){return e?Array.isArray(e)?e.join(" "):e:t.getHomeChromosomeName()},h=function(){return(h=Vr(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(mg(t)?r=t:t.genome?r=t.genome:void 0!==t.id&&void 0===t.fastaURL&&(r=t.id),!r){e.next=10;break}return e.next=4,qv.getKnownGenomes();case 4:return n=e.sent,(i=n[r])||this.presentAlert("Unknown genome id: "+r,void 0),e.abrupt("return",i);case 10:return e.abrupt("return",t);case 11:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)},c=function(e){return h.apply(this,arguments)},mg(t)&&t.startsWith("{"))try{t=JSON.parse(t)}catch(e){}return e.next=6,c.call(this,t);case 6:return n=e.sent,e.next=9,qv.loadGenome(n);case 9:return i=e.sent,a=this.genome&&this.genome.id!==i.id,this.genome=i,this.$current_genome.text(i.id||""),this.$current_genome.attr("title",i.id||""),this.chromosomeSelectWidget.update(i),a&&this.removeAllTracks(),this.genome=i,e.prev=17,e.next=20,this.search(u(r,i),!0);case 20:o=e.sent,e.next=29;break;case 23:return e.prev=23,e.t0=e.catch(17),console.error(e.t0),e.next=28,this.search(this.genome.getHomeChromosomeName());case 28:o=e.sent;case 29:if(this.genomicStateList=o,this.genomicStateList.length>0?this.rulerTrack||!1===this.config.showRuler||(this.rulerTrack=new mm(this),this.addTrack(this.rulerTrack)):(s="Unrecognized locus "+this.config.locus,this.presentAlert(s,void 0)),!n.tracks){e.next=34;break}return e.next=34,this.loadTrackList(n.tracks);case 34:return this.resize(),e.abrupt("return",this.genome);case 36:case"end":return e.stop()}}),e,this,[[17,23]])})));return function(t,r){return e.apply(this,arguments)}}(),pk.prototype.updateUIWithGenomicStateListChange=function(e){var t=this.isMultiLocusWholeGenomeView()||qv.isWholeGenomeView(e[0].referenceFrame);t||this.isMultiLocusMode()?this.centerGuide.forcedHide():this.centerGuide.forcedShow(),this.navbarManager.navbarDidResize(this.$navigation.width(),t),gk(this.trackViews,this.trackLabelsVisible)},pk.prototype.setTrackLabelName=function(e,t){e.viewports.forEach((function(e){e.setTrackLabel(t)}))},pk.prototype.hideTrackLabels=function(){this.trackLabelsVisible=!1,gk(this.trackViews,this.trackLabelsVisible)},pk.prototype.showTrackLabels=function(){this.trackLabelsVisible=!0,gk(this.trackViews,this.trackLabelsVisible)},pk.prototype.hideCursorGuide=function(){this.cursorGuide.$guide.hide(),this.cursorGuideVisible=!1},pk.prototype.showCursorGuide=function(){this.cursorGuide.$guide.show(),this.cursorGuideVisible=!0},pk.prototype.setCustomCursorGuideMouseHandler=function(e){this.cursorGuide.customMouseHandler=e},pk.prototype.hideCenterGuide=function(){this.centerGuide.$container.hide(),this.isCenterGuideVisible=!1},pk.prototype.showCenterGuide=function(){this.centerGuide.$container.show(),this.centerGuide.resize(),this.isCenterGuideVisible=!0},pk.prototype.loadTrackList=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this,e.prev=1,this.startSpinner(),n=[],t.forEach((function(e){e.noSpinner=!0,n.push(r.loadTrack(e))})),e.next=7,Promise.all(n);case 7:return i=e.sent,(a=r.trackViews.filter((function(e){return e.track.autoscaleGroup}))).length>0&&r.updateViews(r.genomicStateList[0],a),e.abrupt("return",i);case 11:return e.prev=11,this.stopSpinner(),e.finish(11);case 14:case"end":return e.stop()}}),e,this,[[1,,11,14]])})));return function(t){return e.apply(this,arguments)}}(),pk.prototype.loadROI=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roi||(this.roi=[]),Array.isArray(t)){r=fn(t);try{for(r.s();!(n=r.n()).done;)i=n.value,this.roi.push(new Qx(i,this.genome))}catch(e){r.e(e)}finally{r.f()}}else this.roi.push(new Qx(t,this.genome));return e.next=4,this.updateViews(void 0,void 0,!0);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),pk.prototype.removeROI=function(e){for(var t=0;t<this.roi.length;t++)if(this.roi[t].name===e.name){this.roi.splice(t,1);break}var r,n=fn(this.trackViews);try{for(n.s();!(r=n.n()).done;)r.value.updateViews(!0)}catch(e){n.e(e)}finally{n.f()}},pk.prototype.clearROIs=function(){this.roi=[];var e,t=fn(this.trackViews);try{for(t.s();!(e=t.n()).done;)e.value.updateViews(!0)}catch(e){t.e(e)}finally{t.f()}},pk.prototype.loadTrack=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r,n,i,a,o,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return mg(t)&&(t=JSON.parse(t)),e.next=3,lv(t.url);case 3:if(mg(r=e.sent)&&(r=r.trim()),!mg(r)||!r.startsWith("https://drive.google.com")){e.next=14;break}return e.next=8,Kg.getDriveFileInfo(r);case 8:n=e.sent,r="https://www.googleapis.com/drive/v3/files/"+n.id+"?alt=media",t.filename||(t.filename=n.originalFileName||n.name),t.format||(t.format=$m(t.filename)),e.next=15;break;case 14:r&&!t.filename&&(t.filename=ov(r));case 15:if(Hm(t),this.trackDefaults&&t.type&&(i=this.trackDefaults[t.type]))for(a in i)i.hasOwnProperty(a)&&void 0===t[a]&&(t[a]=i[a]);if(e.prev=17,t.noSpinner||this.startSpinner(),void 0!==(o=this.createTrack(t))){e.next=23;break}return this.presentAlert("Unknown file type: "+r,void 0),e.abrupt("return",o);case 23:if(void 0===o.order&&(o.order=this.trackViews.length),"function"!=typeof o.postInit){e.next=27;break}return e.next=27,o.postInit();case 27:if(!t.sync){e.next=32;break}return e.next=30,this.addTrack(o);case 30:e.next=33;break;case 32:this.addTrack(o);case 33:return e.abrupt("return",o);case 36:e.prev=36,e.t0=e.catch(17),s={401:"Access unauthorized",403:"Access forbidden",404:"Not found"},console.error(e.t0),c=e.t0.message||e.t0.toString(),s.hasOwnProperty(c)&&(c=s[c]+": "+t.url),this.presentAlert(c,void 0);case 43:return e.prev=43,t.noSpinner||this.stopSpinner(),e.finish(43);case 46:case"end":return e.stop()}}),e,this,[[17,36,43,46]])})));return function(t){return e.apply(this,arguments)}}(),pk.prototype.createTrack=function(e){e.format&&(e.format=e.format.toLowerCase());var t=void 0===e.type?"unknown_type":e.type.toLowerCase();"data"===t&&(t="wig");var r,n=Object.assign({},e);switch(n.browser=this,t){case"annotation":case"genes":case"fusionjuncspan":case"junctions":case"splicejunctions":case"snp":r=Kx.feature(n,this);break;default:r=Kx.hasOwnProperty(t)?Kx[t](n,this):void 0}if(e.roi&&r){r.roi=[];var i,a=fn(e.roi);try{for(a.s();!(i=a.n()).done;){var o=i.value;r.roi.push(new Qx(o,this.genome))}}catch(e){a.e(e)}finally{a.f()}}return r},pk.prototype.addTrack=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new _m(this,oc(this.trackContainerDiv),t),this.trackViews.push(r),gk(this.trackViews,this.trackLabelsVisible),this.reorderTracks(),t.autoscaleGroup){e.next=6;break}return e.abrupt("return",r.updateViews());case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),pk.prototype.reorderTracks=function(){var e=this;this.trackViews.sort((function(e,t){return(e.track.order||0)-(t.track.order||0)})),oc(this.trackContainerDiv).children("igv-track-div").detach(),this.trackViews.forEach((function(t){e.trackContainerDiv.appendChild(t.trackDiv)}))},pk.prototype.removeTrackByName=function(e){var t,r=fn(this.trackViews.slice());try{for(r.s();!(t=r.n()).done;){var n=t.value;e===n.track.name&&this.removeTrack(n.track)}}catch(e){r.e(e)}finally{r.f()}},pk.prototype.removeTrack=function(e){for(var t,r=0;r<this.trackViews.length;r++)if(e===this.trackViews[r].track){t=this.trackViews[r];break}t&&(this.trackViews.splice(r,1),oc(t.trackDiv).remove(),this.fireEvent("trackremoved",[t.track]),t.dispose())},pk.prototype.removeAllTracks=function(e){var t,r=[],n=fn(this.trackViews);try{for(n.s();!(t=n.n()).done;){var i=t.value;!e&&"sequence"===i.track.id||"ruler"===i.track.id?r.push(i):(this.trackContainerDiv.removeChild(i.trackDiv),this.fireEvent("trackremoved",[i.track]),i.dispose())}}catch(e){n.e(e)}finally{n.f()}this.trackViews=r},pk.prototype.findTracks=function(e,t){var r=[];return this.trackViews.forEach((function(n){t===n.track[e]&&r.push(n.track)})),r},pk.prototype.setTrackHeight=function(e){this.trackHeight=e,this.trackViews.forEach((function(t){t.setTrackHeight(e)}))},pk.prototype.visibilityChange=function(){this.resize()},pk.prototype.resize=Vr(regeneratorRuntime.mark((function e(){var t,r,n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=function(e){return t.viewportContainerWidth()*e.referenceFrame.bpPerPixel>e.chromosome.bpLength},t=this,0!==(r=this.viewportWidth())){e.next=5;break}return e.abrupt("return");case 5:return this.genomicStateList&&r>0&&((n=this.isMultiLocusWholeGenomeView()||qv.isWholeGenomeView(this.genomicStateList[0].referenceFrame))||this.isMultiLocusMode()?this.centerGuide.forcedHide():this.centerGuide.forcedShow(),this.navbarManager.navbarDidResize(this.$navigation.width(),n),this.genomicStateList.forEach((function(e){var t=e.referenceFrame;isFinite(t.bpPerPixel)||void 0===t.initialEnd||(t.bpPerPixel=(t.initialEnd-t.start)/r)}))),this.genomicStateList&&1===this.genomicStateList.length&&i(this.genomicStateList[0])?this.search(this.genomicStateList[0].chromosome.name):(this.ideoPanel&&this.ideoPanel.resize(),this.centerGuide&&this.centerGuide.resize(),this.trackViews.forEach((function(e){e.resize()}))),this.genomicStateList&&this.genomicStateList.length>0&&(this.updateLocusSearchWidget(this.genomicStateList[0]),this.windowSizePanel.updateWithGenomicState(this.genomicStateList[0])),e.next=10,this.updateViews();case 10:case"end":return e.stop()}}),e,this)}))),pk.prototype.updateViews=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r,n){var i,a,o,s,c,h,u,l,f,p,d,g,v,m,y,b,w,x,k,S,_,C,A,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,r||(r=this.trackViews),!t&&this.genomicStateList&&1==this.genomicStateList.length&&(t=this.genomicStateList[0]),t&&(this.updateLocusSearchWidget(t),this.windowSizePanel.updateWithGenomicState(t)),this.ideoPanel&&this.ideoPanel.repaint(),this.centerGuide&&this.centerGuide.repaint(),!i.dragObject){e.next=26;break}s=fn(r),e.prev=8,s.s();case 10:if((c=s.n()).done){e.next=16;break}return h=c.value,e.next=14,h.updateViews();case 14:e.next=10;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(8),s.e(e.t0);case 21:return e.prev=21,s.f(),e.finish(21);case 24:e.next=82;break;case 26:a={},o=[],r.forEach((function(e){var t=e.track.autoscaleGroup;if(t){var r=a[t];r||(r=[],a[t]=r),r.push(e)}else o.push(e)})),u=Object.keys(a),l=0,f=u;case 31:if(!(l<f.length)){e.next=65;break}return p=f[l],d=a[p],g=[],d.forEach((function(e){g.push(e.getInViewFeatures())})),e.next=38,Promise.all(g);case 38:v=e.sent,m=[],b=fn(v);try{for(b.s();!(w=b.n()).done;)x=w.value,m=m.concat(x)}catch(e){b.e(e)}finally{b.f()}y=Hg(m),k=fn(d),e.prev=44,k.s();case 46:if((S=k.n()).done){e.next=54;break}return(_=S.value).track.dataRange=y,_.track.autoscale=!1,e.next=52,_.updateViews();case 52:e.next=46;break;case 54:e.next=59;break;case 56:e.prev=56,e.t1=e.catch(44),k.e(e.t1);case 59:return e.prev=59,k.f(),e.finish(59);case 62:l++,e.next=31;break;case 65:C=fn(o),e.prev=66,C.s();case 68:if((A=C.n()).done){e.next=74;break}return E=A.value,e.next=72,E.updateViews(n);case 72:e.next=68;break;case 74:e.next=79;break;case 76:e.prev=76,e.t2=e.catch(66),C.e(e.t2);case 79:return e.prev=79,C.f(),e.finish(79);case 82:case"end":return e.stop()}}),e,this,[[8,18,21,24],[44,56,59,62],[66,76,79,82]])})));return function(t,r,n){return e.apply(this,arguments)}}(),pk.prototype.loadInProgress=function(){var e;for(e=0;e<this.trackViews.length;e++)if(this.trackViews[e].isLoading())return!0;return!1},pk.prototype.updateLocusSearchWidget=function(e){var t,r,n,i,a,o;this.rulerTrack&&this.rulerTrack.updateLocusLabel(),0===this.genomicStateList.indexOf(e)&&1===this.genomicStateList.length?e.locusSearchString&&"all"===e.locusSearchString.toLowerCase()?(this.$searchInput.val(e.locusSearchString),this.chromosomeSelectWidget.$select.val("all")):(t=e.referenceFrame,this.chromosomeSelectWidget.$select.val(t.chrName),this.$searchInput&&(a=t.start+t.bpPerPixel*(this.viewportContainerWidth()/this.genomicStateList.length),this.genome&&(o=this.genome.getChromosome(t.chrName))&&(a=Math.min(a,o.bpLength)),r=yg(Math.floor(t.start+1)),n=yg(Math.floor(a)),i=t.chrName+":"+r+"-"+n,this.$searchInput.val(i)),this.fireEvent("locuschange",[{chr:t.chrName,start:r,end:n,label:i}])):(this.$searchInput.val(""),this.chromosomeSelectWidget.$select.val(""))},pk.prototype.viewportContainerWidth=function(){return this.trackViews&&this.trackViews.length>0?this.trackViews[0].$viewportContainer.width():function(){var e,t,r;return e=oc('<div class="igv-track-div">'),oc(this.trackContainerDiv).append(e),t=oc('<div class="igv-viewport-container">'),e.append(t),r=t.width(),e.remove(),r}.call(this)},pk.prototype.viewportWidth=function(){var e;return e=this.viewportContainerWidth(),void 0===this.genomicStateList||1===this.genomicStateList.length?e:Math.round(e/this.genomicStateList.length)},pk.prototype.minimumBases=function(){return this.config.minimumBases},pk.prototype.updateZoomSlider=function(e){var t=this.trackViews[0].viewports[0],r=t.genomicState.referenceFrame,n=t.$viewport.width()*r.bpPerPixel,i=r.getChromosome().bpLength,a=(i-n)/(i-this.minimumBases()),o=Math.round(100*a);e.val(o)},pk.prototype.zoom=function(e){this.zoomWithScaleFactor(e)},pk.prototype.zoomIn=function(){this.zoomWithScaleFactor(.5)},pk.prototype.zoomOut=function(){this.zoomWithScaleFactor(2)},pk.prototype.zoomWithRangePercentage=function(e){if(!this.loadInProgress()){var t,r=fn(this.trackViews[0].viewports);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=n.genomicState.referenceFrame,a=i.start+i.toBP(n.$viewport.width()/2),o=i.getChromosome(),s=h((o.bpLength-o.bpStart)/n.$viewport.width(),this.minimumBases()/n.$viewport.width(),e),c=s*n.$viewport.width();function h(e,t,r){return(1-r)*e+r*t}i.start=a-c/2,i.bpPerPixel=s,i.clamp(n.$viewport.width()),this.updateViews(n.genomicState)}}catch(e){r.e(e)}finally{r.f()}}},pk.prototype.zoomWithScaleFactor=function(e,t,r){var n,i=fn(r?[r]:this.trackViews[0].viewports);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.genomicState.referenceFrame,s=o.getChromosome(),c=o.start,h=o.bpPerPixel,u=s.bpLength-s.bpStart,l=e<1?this.minimumBases()/a.$viewport.width():u/a.$viewport.width(),f=void 0===t?o.start+o.toBP(a.$viewport.width()/2):t,p=void 0,d=(p=e<1?Math.max(o.bpPerPixel*e,l):Math.min(o.bpPerPixel*e,l))*a.$viewport.width();o.start=f-d/2,o.bpPerPixel=p,o.clamp(a.$viewport.width()),(c!==o.start||h!==o.bpPerPixel)&&this.updateViews(a.genomicState)}}catch(e){i.e(e)}finally{i.f()}},pk.prototype.presentSplitScreenMultiLocusPanel=function(e,t){var r,n,i,a,o=this.genome;n=this.viewportContainerWidth()/(1+this.genomicStateList.length),r=(i=t).referenceFrame;var s=o.getChromosomeName(e.chr);i.referenceFrame=h(s,r.bpPerPixel,n,e.start,e.lengthOnRef);var c=o.getChromosomeName(e.mate.chr);function h(e,t,r,n,i){var a;return new fk(o,e,a=(n+(n+i))/2-t*(r/2),a+t*r,t)}(a={}).chromosome=i.chromosome,a.referenceFrame=h(c,r.bpPerPixel,n,e.mate.position,e.lengthOnRef),this.addMultiLocusPanelWithGenomicStateAtIndex(a,1+this.genomicStateList.indexOf(i),n)},pk.prototype.selectMultiLocusPanelWithGenomicState=function(e){var t=this;this.genomicStateList.filter((function(t){return e!==t})).forEach((function(e){t.removeMultiLocusPanelWithGenomicState(e,!1)})),this.resize()},pk.prototype.removeMultiLocusPanelWithGenomicState=function(e,t){var r,n,i,a=this.genome,o=this;r=this.genomicStateList.indexOf(e),this.ideoPanel&&this.ideoPanel.removePanelWithLocusIndex(r),this.trackViews.forEach((function(e){e.removeViewportWithLocusIndex(r)})),n=this.viewportContainerWidth(),i=this.genomicStateList.length,this.genomicStateList.splice(r,1),this.genomicStateList.forEach((function(e,t){var r=e.referenceFrame.calculateEnd(n/i),s=e.referenceFrame.calculateBPP(r,n/o.genomicStateList.length);o.genomicStateList[t].referenceFrame=new fk(a,e.chromosome.name,e.referenceFrame.start,r,s)})),this.updateUIWithGenomicStateListChange(this.genomicStateList),!0===t&&this.resize()},pk.prototype.addMultiLocusPanelWithGenomicStateAtIndex=function(e,t,r){t===this.genomicStateList.length?(this.genomicStateList.push(e),this.ideoPanel&&this.ideoPanel.addPanelWithGenomicStateAtIndex(e,t,r),this.trackViews.forEach((function(t){var n;n=new Yv(t,t.$viewportContainer,e,r),t.viewports.push(n),t.decorateViewports(),t.configureViewportContainer(t.$viewportContainer,t.viewports)}))):(this.genomicStateList.splice(t,0,e),this.ideoPanel&&this.ideoPanel.addPanelWithGenomicStateAtIndex(e,t,r),this.trackViews.forEach((function(n){var i;i=new Yv(n,n.$viewportContainer,e,r),n.viewports.splice(t,0,i),i.$viewport.detach().insertAfter(n.viewports[t-1].$viewport),n.decorateViewports(),n.configureViewportContainer(n.$viewportContainer,n.viewports)}))),this.rulerTrack&&this.rulerTrack.updateLocusLabel(),this.updateUIWithGenomicStateListChange(this.genomicStateList),this.resize()},pk.prototype.emptyViewportContainers=function(){var e,t=fn(this.trackViews);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.scrollbar&&(r.scrollbar.$outerScroll.remove(),r.scrollbar=null,r.scrollbar=void 0);var n,i=fn(r.viewports);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.rulerSweeper&&a.rulerSweeper.$rulerSweeper.remove(),a.popover&&(a.popover.$popover.off(),a.popover.$popover.empty(),a.popover.$popover.remove()),a.$viewport.remove()}}catch(e){i.e(e)}finally{i.f()}delete r.viewports,r.viewports=[],delete r.scrollbar}}catch(e){t.e(e)}finally{t.f()}this.$contentHeader.empty()},pk.prototype.buildViewportsWithGenomicStateList=function(e){var t;t=this.viewportContainerWidth()/this.genomicStateList.length,this.trackViews.forEach((function(r){e.forEach((function(e){var n;n=new Yv(r,r.$viewportContainer,e,t),r.viewports.push(n)})),r.decorateViewports(),r.configureViewportContainer(r.$viewportContainer,r.viewports)}))},pk.prototype.getViewportWithGUID=function(e){var t,r=void 0,n=fn(this.trackViews);try{for(n.s();!(t=n.n()).done;){var i,a=fn(t.value.viewports);try{for(a.s();!(i=a.n()).done;){var o=i.value;e===o.guid&&(r=o)}}catch(e){a.e(e)}finally{a.f()}}}catch(e){n.e(e)}finally{n.f()}return r},pk.prototype.goto=function(e,t,r){return this.search(e+":"+t+"-"+r)},pk.prototype.search=function(){var e=Vr(regeneratorRuntime.mark((function e(t,r){var n,i,a,o,s,c,h,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=function(){return(l=Vr(regeneratorRuntime.mark((function e(t){var r,a,o,s,c,h,u,l,f,p,d,g,v,m,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y=function(e,t){var r,i,a,o,s,c;if(c={},o=(r=e.split(":"))[0],s=t.getChromosome(o)){if(c.chromosome=s,c.start=0,c.end=s.bpLength,1===r.length)return c;if(!((i=r[1].split("-")).length>2||(c.start=c.end=void 0,a=i[0].replace(/,/g,""),isNaN(a)||(c.start=parseInt(a,10)-1,isNaN(c.start))))){if(2===i.length){if(a=i[1].replace(/,/g,""),isNaN(a))return!1;c.end=parseInt(a,10)}return $g(c.chromosome.bpLength,c,n.minimumBases()),c}}},m=function(e,t){var i;if(i="plain"===r.type?function(e){var t=[],r=[];return bg(e).forEach((function(e){""===e||t.push(e)})),t.forEach((function(e){var t,i,a,o,s=e.split("\t");s.length>=3&&(a=(i=s[1].split(":"))[1].split("-"),t=s[2].trim(),o={gene:s[0],chromosome:n.genome.getChromosomeName(i[0].trim()),start:parseInt(a[0].replace(/,/g,"")),end:parseInt(a[1].replace(/,/g,"")),type:"gtex"===t?"snp":"gene"},r.push(o))})),r}(e):JSON.parse(e),r.resultsField&&(i=i[r.resultsField]),i&&0!==i.length){var a=i[0];if(!a.hasOwnProperty(r.chromosomeField)||!a.hasOwnProperty(r.startField))return;var o=a[r.chromosomeField],s=a[r.startField]-r.coords,c=a[r.endField];void 0===c&&(c=s+1),n.flanking&&(s=Math.max(0,s-n.flanking),c+=n.flanking);var h=Object.assign({},a);return h.chromosome=n.genome.getChromosome(o),h.start=s,h.end=c,h.locusSearchString=t,h.selection=new ek(a[r.geneField],a[r.snpField]),h}},v=function(){return(v=Vr(regeneratorRuntime.mark((function e(t){var i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(i=r.url.replace("$FEATURE$",t.toUpperCase())).indexOf("$GENOME$")>-1&&(i=i.replace("$GENOME$",n.genome.id?n.genome.id:"hg19")),e.next=4,Sv.loadString(i);case 4:return a=e.sent,e.abrupt("return",{result:a,locusSearchString:t});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},g=function(e){return v.apply(this,arguments)},d=function(e){var t=n.viewportContainerWidth()/e.length;return e.forEach((function(e){e.referenceFrame=new fk(i,e.chromosome.name,e.start,e.end,(e.end-e.start)/t)})),e},r=n.searchConfig,a=[],o=fn(t),e.prev=8,o.s();case 10:if((s=o.n()).done){e.next=32;break}if(c=s.value,!(h=y(c,n.genome))){e.next=18;break}h.locusSearchString=c,a.push(h),e.next=29;break;case 18:if(!(u=n.featureDB[c.toUpperCase()])){e.next=24;break}(l=n.genome.getChromosome(u.chr))&&(h={chromosome:l,start:u.start,end:u.end,locusSearchString:c},$g(h.chromosome.bpLength,h,n.minimumBases()),a.push(h)),e.next=29;break;case 24:return e.next=26,g(c);case 26:f=e.sent,(p=m(f.result,f.locusSearchString))&&a.push(p);case 29:d(a);case 30:e.next=10;break;case 32:e.next=37;break;case 34:e.prev=34,e.t0=e.catch(8),o.e(e.t0);case 37:return e.prev=37,o.f(),e.finish(37);case 40:return e.abrupt("return",a);case 41:case"end":return e.stop()}}),e,null,[[8,34,37,40]])})))).apply(this,arguments)},u=function(e){return l.apply(this,arguments)},n=this,i=this.genome,(t&&"all"===t.trim().toLowerCase()||"*"===t)&&(t="all"),a=t.split(" "),e.next=8,u(a);case 8:if((o=e.sent)&&0!==o.length){e.next=13;break}return e.next=12,u([t]);case 12:o=e.sent;case 13:if(!(o.length>0)){e.next=21;break}this.emptyViewportContainers(),this.genomicStateList=o,this.buildViewportsWithGenomicStateList(o),s=fn(o);try{for(s.s();!(c=s.n()).done;)c.value.id=Eg()}catch(e){s.e(e)}finally{s.f()}e.next=22;break;case 21:throw new Error("Unrecognized locus "+t);case 22:return this.ideoPanel&&(this.ideoPanel.discardPanels(),h=n.viewportContainerWidth()/o.length,this.ideoPanel.buildPanels(this.$contentHeader,h)),this.updateUIWithGenomicStateListChange(o),r||this.updateViews(),e.abrupt("return",o);case 26:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}(),pk.prototype.loadSampleInformation=function(){var e=Vr(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t,t instanceof File&&(r=t.name),"fam"!==r.substr(r.lastIndexOf(".")+1)){e.next=7;break}return e.next=6,ak(t);case 6:this.sampleInformation=e.sent;case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),pk.prototype.on=function(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)},pk.prototype.un=function(e,t){if(this.eventHandlers[e]){var r=this.eventHandlers[e].indexOf(t);-1!==r&&this.eventHandlers[e].splice(r,1)}},pk.prototype.off=function(e,t){if(e)if(t){var r=this.eventHandlers[e].indexOf(t);-1!==r&&this.eventHandlers[e].splice(r,1)}else this.eventHandlers[e]=[];else this.eventHandlers={}},pk.prototype.fireEvent=function(e,t,r){var n,i=this.eventHandlers[e];if(void 0!==i&&0!==i.length)return n=r||window,i.map((function(e){return e.apply(n,t)}))[0]},pk.prototype.dispose=function(){oc(window).off(this.namespace),oc(document).off(this.namespace),this.eventHandlers=void 0,this.trackViews.forEach((function(e){e.dispose()}))},pk.prototype.toJSON=function(){var e,t;e={reference:this.genome.toJSON()};var r=[],n={};return this.trackViews[0].viewports.forEach((function(e){var t=e.genomicState,i=e.$viewport[0].clientWidth,a=t.referenceFrame.showLocus(i);if(r.push(a),t.selection){var o={gene:t.selection.gene,snp:t.selection.snp};n[a]=o}})),e.locus=r,Object.getOwnPropertyNames(n).length>0&&(e.gtexSelections=n),t=[],this.trackViews.forEach((function(e){var r,n;(n="function"==typeof(r=e.track).getState?r.getState():r.config)&&(n.browser&&delete n.browser,n.order=r.order,t.push(n))})),e.tracks=t,e},pk.prototype.compressedSession=function(){return function(e){for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));var n=new gg.RawDeflate(t).compress(),i=String.fromCharCode.apply(null,n);return btoa(i).replace(/\+/g,".").replace(/\//g,"_").replace(/=/g,"-")}(JSON.stringify(this.toJSON()))},pk.uncompressSession=function(e){if(e.indexOf("/gzip;base64")>0){var t,r="",n=fn(cv(e));try{for(n.s();!(t=n.n()).done;){var i=t.value;r+=String.fromCharCode(i)}}catch(e){n.e(e)}finally{n.f()}return r}return function(e){e=e.replace(/\./g,"+").replace(/_/g,"/").replace(/-/g,"=");for(var t=atob(e),r=[],n=0;n<t.length;n++)r.push(t.charCodeAt(n));var i,a="",o=fn(new gg.RawInflate(r).decompress());try{for(o.s();!(i=o.n()).done;){var s=i.value;a+=String.fromCharCode(s)}}catch(e){o.e(e)}finally{o.f()}return a}(e.substring(5))},pk.prototype.sessionURL=function(){var e,t;return((t=(e=window.location.href.slice()).indexOf("?"))>0?e.substring(0,t):e)+"?sessionURL=data:"+this.compressedSession()},pk.prototype.currentLoci=function(){var e,t=[],r=fn(this.trackViews[0].viewports);try{for(r.s();!(e=r.n()).done;){var n=e.value,i=n.genomicState,a=n.$viewport[0].clientWidth,o=i.referenceFrame.showLocus(a);t.push(o)}}catch(e){r.e(e)}finally{r.f()}return t},pk.prototype.presentAlert=function(e){this.alertDialog.present(e)},pk.prototype.mouseDownOnViewport=function(e,t){var r;r=Cg(e),this.vpMouseDown={viewport:t,lastMouseX:r.x,mouseDownX:r.x,lastMouseY:r.y,mouseDownY:r.y,genomicState:t.genomicState,referenceFrame:t.genomicState.referenceFrame}},pk.prototype.cancelTrackPan=function(){var e=this.dragObject;this.dragObject=void 0,this.isScrolling=!1,this.vpMouseDown=void 0,e&&e.viewport.genomicState.referenceFrame.start!==e.start&&(this.updateViews(),this.fireEvent("trackdragend"))},pk.prototype.startTrackDrag=function(e){this.dragTrack=e},pk.prototype.updateTrackDrag=function(e){if(e&&this.dragTrack){var t=this.dragTrack,r=this.trackViews.indexOf(e),n=this.trackViews.indexOf(t),i=this.trackViews;i[r]=t,i[n]=e;var a=this.trackViews[r].track.order;this.trackViews[n].track.order=a;var o=i.length,s=a;if(r<n)for(var c=r+1;c<o;c++){var h=i[c].track;if(!(h.order<=s))break;h.order=Math.min(Number.MAX_SAFE_INTEGER,s+1),s=h.order}else for(var u=r-1;u>0;u--){var l=i[u].track;if(!(l.order>=s))break;l.order=Math.max(-Number.MAX_SAFE_INTEGER,s-1),s=l.order}this.reorderTracks()}},pk.prototype.endTrackDrag=function(){this.dragTrack&&this.dragTrack.$trackDragScrim.hide(),this.dragTrack=void 0};var mk=function(e,t){this.$content=oc('<div class="igv-windowsizepanel-content-div">'),e.append(this.$content),this.browser=t};mk.prototype.show=function(){this.$content.show()},mk.prototype.hide=function(){this.$content.hide()},mk.prototype.updateWithGenomicState=function(e){var t,r,n;this.$content.text((t=Math.round(this.browser.viewportWidth()*e.referenceFrame.bpPerPixel))>1e7?(r=" mb",n=t/1e6,Math.floor(n).toString()+r):t>1e4?(r=" kb",n=t/1e3,yg(Math.floor(n))+r):yg(t)+" bp")};var yk=function(e){var t,r,n=this;this.$container=oc("<div>",{class:"igv-generic-dialog-container"}),e.append(this.$container),this.$container.offset({left:0,top:0}),t=oc("<div>",{class:"igv-generic-dialog-header"}),this.$container.append(t),Sg(t,(function(){n.$input.val(void 0),n.$container.offset({left:0,top:0}),n.$container.hide()})),this.$label=oc("<div>",{class:"igv-generic-dialog-one-liner"}),this.$container.append(this.$label),this.$label.text("Unlabeled"),this.$input_container=oc("<div>",{class:"igv-generic-dialog-input"}),this.$container.append(this.$input_container),this.$input=oc("<input>"),this.$input_container.append(this.$input),r=oc("<div>",{class:"igv-generic-dialog-ok-cancel"}),this.$container.append(r),this.$ok=oc("<div>"),r.append(this.$ok),this.$ok.text("OK"),this.$cancel=oc("<div>"),r.append(this.$cancel),this.$cancel.text("Cancel"),this.$cancel.on("click",(function(){n.$input.val(void 0),n.$container.offset({left:0,top:0}),n.$container.hide()})),df(this.$container.get(0),t.get(0)),this.$container.hide()};yk.prototype.configure=function(e){var t=this;this.$label.text(e.label),this.$input.val(e.input),this.$input.unbind(),this.$input.on("keyup",(function(r){13===r.keyCode&&(e.click(),t.$input.val(void 0),t.$container.offset({left:0,top:0}),t.$container.hide())})),this.$ok.unbind(),this.$ok.on("click",(function(){e.click(),t.$input.val(void 0),t.$container.offset({left:0,top:0}),t.$container.hide()}))},yk.prototype.present=function(e){var t,r;t=e.offset().top,r=oc("body").scrollTop(),this.$container.offset({left:e.width()-this.$container.width(),top:t+r}),this.$container.show()};var bk=function(e,t){var r,n,i,a=this;this.browser=t,this.$container=oc("<div>",{class:"igv-generic-dialog-container"}),e.append(this.$container),this.$container.offset({left:0,top:0}),r=oc("<div>",{class:"igv-generic-dialog-header"}),this.$container.append(r),Sg(r,(function(){a.$minimum_input.val(void 0),a.$maximum_input.val(void 0),a.$container.offset({left:0,top:0}),a.$container.hide()})),this.$minimum=oc("<div>",{class:"igv-generic-dialog-label-input"}),this.$container.append(this.$minimum),(i=oc("<div>")).text("Minimum"),this.$minimum.append(i),this.$minimum_input=oc("<input>"),this.$minimum.append(this.$minimum_input),this.$maximum=oc("<div>",{class:"igv-generic-dialog-label-input"}),this.$container.append(this.$maximum),(i=oc("<div>")).text("Maximum"),this.$maximum.append(i),this.$maximum_input=oc("<input>"),this.$maximum.append(this.$maximum_input),n=oc("<div>",{class:"igv-generic-dialog-ok-cancel"}),this.$container.append(n),this.$ok=oc("<div>"),n.append(this.$ok),this.$ok.text("OK"),this.$cancel=oc("<div>"),n.append(this.$cancel),this.$cancel.text("Cancel"),this.$cancel.on("click",(function(){a.$minimum_input.val(void 0),a.$maximum_input.val(void 0),a.$container.offset({left:0,top:0}),a.$container.hide()})),df(this.$container.get(0),r.get(0)),this.$container.hide()};function wk(e){var t,r;t=parseFloat(this.$minimum_input.val()),r=parseFloat(this.$maximum_input.val()),isNaN(t)||isNaN(r)?this.browser.presentAlert("Must input numeric values",void 0):(!0===e.trackView.track.autoscale&&oc("#datarange-autoscale").trigger("click"),e.trackView.setDataRange(t,r,!1)),this.$minimum_input.val(void 0),this.$maximum_input.val(void 0),this.$container.offset({left:0,top:0}),this.$container.hide()}bk.prototype.configure=function(e){var t,r,n,i=this;(t=e.trackView.dataRange())?(r=t.min,n=t.max):(r=0,n=100),this.$minimum_input.val(r),this.$maximum_input.val(n),this.$minimum_input.unbind(),this.$minimum_input.on("keyup",(function(t){13===t.keyCode&&wk.call(i,e)})),this.$maximum_input.unbind(),this.$maximum_input.on("keyup",(function(t){13===t.keyCode&&wk.call(i,e)})),this.$ok.unbind(),this.$ok.on("click",(function(){wk.call(i,e)}))},bk.prototype.present=function(e){var t,r;t=e.offset().top,r=oc("body").scrollTop(),this.$container.offset({left:e.width()-this.$container.width(),top:t+r}),this.$container.show()};var xk=function(e){var t,r,n=this;this.$container=oc("<div>",{class:"igv-generic-dialog-container"}),e.append(this.$container),this.$container.offset({left:0,top:0}),t=oc("<div>",{class:"igv-generic-dialog-header"}),this.$container.append(t),Sg(t,(function(){n.$track_name.text(void 0),n.$container.offset({left:0,top:0}),n.$container.hide()})),this.$label=oc("<div>",{class:"igv-generic-dialog-one-liner"}),this.$container.append(this.$label),this.$label.text("Remove track:"),this.$track_name=oc("<div>",{class:"igv-generic-dialog-one-liner igv-ellipsis"}),this.$container.append(this.$track_name),r=oc("<div>",{class:"igv-generic-dialog-ok-cancel"}),this.$container.append(r),this.$ok=oc("<div>"),r.append(this.$ok),this.$ok.text("OK"),this.$cancel=oc("<div>"),r.append(this.$cancel),this.$cancel.text("Cancel"),this.$cancel.on("click",(function(){n.$track_name.text(void 0),n.$container.offset({left:0,top:0}),n.$container.hide()})),df(this.$container.get(0),t.get(0)),this.$container.hide()};xk.prototype.configure=function(e){var t=this;this.$track_name.text(e.name||"unnamed"),this.$ok.unbind(),this.$ok.on("click",(function(){e.click(),t.$track_name.text(void 0),t.$container.offset({left:0,top:0}),t.$container.hide()}))},xk.prototype.present=function(e){var t,r;t=e.offset().top,r=oc("body").scrollTop(),this.$container.offset({left:e.width()-this.$container.width(),top:t+r}),this.$container.show()};var kk=function(e){this.$container=oc('<div class="igv-user-feedback">'),e.append(this.$container);var t=oc("<div>");this.$container.append(t);var r=oc("<div>");t.append(r);var n=Nf("exclamation-triangle","red");r.append(n);var i=oc("<div>");t.append(i);var a=Nf("times-circle","grey");i.append(a);var o=oc("<div>");this.$container.append(o);var s=oc("<div>");o.append(s),s.text("i am user feedback"),i.click((function(){s.html(""),(void 0).$container.hide()}))};kk.prototype.show=function(){this.$container.show()},kk.prototype.hide=function(){this.$container.hide()};var Sk=function(e,t){var r=oc('<div class="igv-nav-bar-button">');e.append(r),r.text("Save SVG"),r.on("click.svg-save-control",(function(){t.saveSVGtoFile({})}))},_k=function(e,t){var r;this.$zoomContainer=oc('<div class="igv-zoom-widget">'),t.append(this.$zoomContainer),r=oc("<div>"),this.$zoomContainer.append(r),r.append(Nf("minus-circle")),r.on("click",(function(){e.zoomOut()})),r=oc("<div>"),this.$zoomContainer.append(r),this.$slider=oc('<input type="range"/>'),r.append(this.$slider),this.$slider.on("change",(function(t){e.zoomWithRangePercentage(t.target.value/100)})),r=oc("<div>"),this.$zoomContainer.append(r),r.append(Nf("plus-circle")),r.on("click",(function(){e.zoomIn()})),this.currentChr=void 0;var n=this;e.on("locuschange",(function(){e.updateZoomSlider(n.$slider)}))};_k.prototype.hide=function(){this.$zoomContainer.hide()},_k.prototype.show=function(){this.$zoomContainer.show()},_k.prototype.hideSlider=function(){this.$slider.hide()},_k.prototype.showSlider=function(){this.$slider.show()};var Ck=function(e,t){this.showAllChromosomes=!1!==e.config.showAllChromosomes,this.$container=oc("<div>",{class:"igv-chromosome-select-widget-container"}),t.append(this.$container),this.$select=oc("<select>",{name:"chromosome-select-widget"}),this.$container.append(this.$select),this.$select.on("change",(function(){""!==oc(this).val()&&(e.search(oc(this).val()),oc(this).blur())}))};Ck.prototype.update=function(e){this.$select.empty();var t=this.showAllChromosomes?e.chromosomeNames.slice():e.wgChromosomeNames.slice();e.showWholeGenomeView()&&(t.unshift("all"),t.unshift(""));var r,n=fn(t);try{for(n.s();!(r=n.n()).done;){var i,a=r.value;i=oc("<option>",{value:a}),this.$select.append(i),i.text(a)}}catch(e){n.e(e)}finally{n.f()}};var Ak=function(e,t){var r=this;this.browser=t,this.$button=oc('<div class="igv-nav-bar-button">'),e.append(this.$button),this.$button.text("track labels"),this.$button.on("click",(function(){!0===t.trackLabelsVisible?r.doHide():r.doShow()}))};Ak.prototype.doHide=function(){this.$button.removeClass("igv-nav-bar-button-clicked"),this.browser.hideTrackLabels()},Ak.prototype.doShow=function(){this.$button.addClass("igv-nav-bar-button-clicked"),this.browser.showTrackLabels()},Ak.prototype.setState=function(e){!0===e?this.$button.addClass("igv-nav-bar-button-clicked"):this.$button.removeClass("igv-nav-bar-button-clicked")},Ak.prototype.disable=function(){this.doHide(),this.$button.hide()},Ak.prototype.enable=function(){this.$button.show()};var Ek=function(e,t,r,n){var i=this;this.browser=n,this.$container=oc('<div class="igv-center-guide igv-center-guide-thin">'),e.append(this.$container),!0===r.showCenterGuideButton&&(this.$centerGuideToggle=oc('<div class="igv-nav-bar-button">'),t.append(this.$centerGuideToggle),this.$centerGuideToggle.text("center line"),this.$centerGuideToggle.on("click",(function(){!0===n.isCenterGuideVisible?i.doHide():i.doShow()})))};Ek.prototype.doHide=function(){this.$centerGuideToggle&&this.$centerGuideToggle.removeClass("igv-nav-bar-button-clicked"),this.browser.hideCenterGuide()},Ek.prototype.doShow=function(){this.$centerGuideToggle&&this.$centerGuideToggle.addClass("igv-nav-bar-button-clicked"),this.browser.showCenterGuide()},Ek.prototype.setState=function(e){this.$centerGuideToggle&&(!0===e?this.$centerGuideToggle.addClass("igv-nav-bar-button-clicked"):this.$centerGuideToggle.removeClass("igv-nav-bar-button-clicked"))},Ek.prototype.forcedHide=function(){this.$centerGuideToggle&&this.$centerGuideToggle.hide(),!0===this.browser.isCenterGuideVisible&&this.$container.hide()},Ek.prototype.forcedShow=function(){this.$centerGuideToggle&&this.$centerGuideToggle.show(),!0===this.browser.isCenterGuideVisible&&this.$container.show()},Ek.prototype.repaint=function(){var e,t,r,n,i,a,o;this.browser.genomicStateList&&(1/(o=this.browser.genomicStateList[0].referenceFrame).bpPerPixel>1?(e=this.browser.trackViews[0].$viewportContainer.position(),t=Math.round(this.browser.trackViews[0].$viewportContainer.width()/2),n=e.left+t-.5*(r=o.toPixels(1)),i=Math.round(n).toString()+"px",a=Math.round(r).toString()+"px",this.$container.css({left:i,width:a}),this.$container.removeClass("igv-center-guide-thin"),this.$container.addClass("igv-center-guide-wide")):(this.$container.css({left:"50%",width:"1px"}),this.$container.removeClass("igv-center-guide-wide"),this.$container.addClass("igv-center-guide-thin")))},Ek.prototype.resize=function(){this.repaint()};var Rk=function(e,t,r,n){var i=this,a=this;this.browser=n,this.$guide=oc('<div class="igv-cursor-tracking-guide">'),e.append(this.$guide),e.on("mousemove.cursor-guide",(function(t){t.preventDefault();var r=oc(document.elementFromPoint(t.clientX,t.clientY)),a=r.parent(),o=void 0;if(a.hasClass("igv-viewport-content-div")?o=a.parent():a.hasClass("igv-viewport-div")&&r.hasClass("igv-viewport-content-div")?o=a:a.hasClass("igv-viewport-container")&&r.hasClass("igv-viewport-div")&&(o=r),r.attr("class"),a.attr("class"),o){var s=Tk(t,o,i.$guide,e,n);if(s){var c=s.bp,h=s.start,u=s.end,l=s.interpolant;i.customMouseHandler&&i.customMouseHandler({bp:c,start:h,end:u,interpolant:l})}}})),!0===r.showCursorTrackingGuideButton&&(this.$button=oc('<div class="igv-nav-bar-button">'),t.append(this.$button),this.$button.text("cursor guide"),this.$button.on("click",(function(){!0===n.cursorGuideVisible?a.doHide():a.doShow()})))},Tk=function(e,t,r,n,i){var a=Ik(n.get(0),e).x,o="".concat(a,"px");r.css({left:o});var s=Ik(t.get(0),e),c=t.data("viewportGUID"),h=i.getViewportWithGUID(c);if(void 0!==h){var u=h.genomicState.referenceFrame,l=u.start,f=1+u.start+s.width*u.bpPerPixel,p=Math.round(l+s.x*u.bpPerPixel),d=t.closest(".igv-track-container-div");return Ik(d.get(0),e),{$host:d,host_css_left:o,bp:p,start:l,end:f,interpolant:s.xNormalized}}};function Ik(e,t){var r=e.getBoundingClientRect();return{x:t.clientX-r.left,y:t.clientY-r.top,xNormalized:(t.clientX-r.left)/r.width,yNormalized:(t.clientY-r.top)/r.height,width:r.width,height:r.height}}Rk.prototype.doHide=function(){this.$button&&this.$button.removeClass("igv-nav-bar-button-clicked"),this.browser.hideCursorGuide()},Rk.prototype.doShow=function(){this.$button.addClass("igv-nav-bar-button-clicked"),this.browser.showCursorGuide()},Rk.prototype.setState=function(e){this.$button&&(!0===e?this.$button.addClass("igv-nav-bar-button-clicked"):this.$button.removeClass("igv-nav-bar-button-clicked"))},Rk.prototype.disable=function(){this.doHide(),this.$guide.hide()},Rk.prototype.enable=function(){this.$button&&this.$button.show()};var Lk=function(e){this.browser=e};function Mk(e){this.browser.$toggle_button_container.removeClass(),this.browser.$toggle_button_container.addClass(e.$toggle_button_container),this.browser.zoomWidget.$zoomContainer.removeClass(),this.browser.zoomWidget.$zoomContainer.addClass(e.$zoomContainer)}function Pk(e,t){var r={};return t?this.browser.windowSizePanel.hide():this.browser.windowSizePanel.show(),e>990?(r.$toggle_button_container="igv-nav-bar-toggle-button-container",r.$zoomContainer="igv-zoom-widget"):e>860?(r.$toggle_button_container="igv-nav-bar-toggle-button-container",r.$zoomContainer="igv-zoom-widget-900"):e>540?(r.$toggle_button_container="igv-nav-bar-toggle-button-container-750",r.$zoomContainer="igv-zoom-widget-900"):(r.$toggle_button_container="igv-nav-bar-toggle-button-container-750",r.$zoomContainer="igv-zoom-widget-900",this.browser.windowSizePanel.hide()),t&&(r.$zoomContainer="igv-zoom-widget-hidden"),r}Lk.prototype.navbarDidResize=function(e,t){Mk.call(this,Pk.call(this,e,t))};var Ok=[];function Fk(){return(Fk=Vr(regeneratorRuntime.mark((function e(t,r){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(e){return e.sessionURL?n.loadSession({url:e.sessionURL}):n.loadSessionObject(e)},vv.init(oc(t)),void 0===r&&(r={}),qv.genomeList=r.genomeList||"https://s3.amazonaws.com/igv.org.genomes/genomes.json",Bk(r),!1!==r.queryParametersSupported&&zk(r),Nk(r),Dk(n=new pk(r,t),r),n.userFeedback=new kk(n.$content),n.userFeedback.hide(),n.alertDialog=new gv(n.$content),n.inputDialog=new yk(n.$root),n.trackRemovalDialog=new xk(n.$root),n.dataRangeDialog=new bk(n.$root,n),r.apiKey&&Kg.setApiKey(r.apiKey),r.oauthToken&&Jg.setToken(r.oauthToken),e.abrupt("return",i(r).then((function(e){!1===r.showTrackLabels?n.hideTrackLabels():(n.showTrackLabels(),n.trackLabelControl&&n.trackLabelControl.setState(n.trackLabelsVisible)),!1===r.showCursorTrackingGuide?n.cursorGuide.doHide():n.cursorGuide.doShow(),!1===r.showCenterGuide?n.centerGuide.doHide():n.centerGuide.doShow();var t=n.isMultiLocusWholeGenomeView()||qv.isWholeGenomeView(n.genomicStateList[0].referenceFrame);return n.isMultiLocusMode()||t?n.centerGuide.forcedHide():n.centerGuide.forcedShow(),Sv.startup(),n.navbarManager.navbarDidResize(n.$navigation.width(),t),n})).then((function(e){return Ok.push(e),e})));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nk(e){var t=1;e.tracks&&e.tracks.forEach((function(e){void 0===e.order&&(e.order=t++)}))}function Dk(e,t){var r;r=t.createControls?t.createControls(e,t):function(e,t){var r,n,i,a,o,s,c,h,u,l,f;return u=oc("<div>",{class:"igvControlDiv"}),l=oc("<div>",{class:"igv-navbar"}),u.append(l),e.$navigation=l,e.navbarManager=new Lk(e),n=oc("<div>",{class:"igv-nav-bar-left-container"}),l.append(n),c=oc("<div>",{class:"igv-logo"}),(h=oc('<svg width="690px" height="324px" viewBox="0 0 690 324" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>IGV</title><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="IGV" fill="#666666"><polygon id="Path" points="379.54574 8.00169252 455.581247 8.00169252 515.564813 188.87244 532.884012 253.529506 537.108207 253.529506 554.849825 188.87244 614.833392 8.00169252 689.60164 8.00169252 582.729511 320.722144 486.840288 320.722144"></polygon><path d="M261.482414,323.793286 C207.975678,323.793286 168.339046,310.552102 142.571329,284.069337 C116.803612,257.586572 103.919946,217.158702 103.919946,162.784513 C103.919946,108.410325 117.437235,67.8415913 144.472217,41.0770945 C171.507199,14.3125977 212.903894,0.930550071 268.663545,0.930550071 C283.025879,0.930550071 298.232828,1.84616386 314.284849,3.6774189 C330.33687,5.50867394 344.839793,7.97378798 357.794056,11.072835 L357.794056,68.968378 C339.48912,65.869331 323.578145,63.5450806 310.060654,61.9955571 C296.543163,60.4460336 284.574731,59.6712835 274.154998,59.6712835 C255.850062,59.6712835 240.502308,61.4320792 228.111274,64.9537236 C215.720241,68.4753679 205.793482,74.2507779 198.330701,82.2801269 C190.867919,90.309476 185.587729,100.87425 182.48997,113.974767 C179.392212,127.075284 177.843356,143.345037 177.843356,162.784513 C177.843356,181.942258 179.251407,198.000716 182.067551,210.960367 C184.883695,223.920018 189.671068,234.41436 196.429813,242.443709 C203.188559,250.473058 212.059279,256.178037 223.042241,259.558815 C234.025202,262.939594 247.683295,264.629958 264.01693,264.629958 C268.241146,264.629958 273.098922,264.489094 278.590403,264.207362 C284.081883,263.925631 289.643684,263.50304 295.275972,262.939577 L295.275972,159.826347 L361.595831,159.826347 L361.595831,308.579859 C344.698967,313.087564 327.239137,316.750019 309.215815,319.567334 C291.192494,322.38465 275.281519,323.793286 261.482414,323.793286 L261.482414,323.793286 L261.482414,323.793286 Z" id="Path"></path>;<polygon id="Path" points="0.81355666 5.00169252 73.0472883 5.00169252 73.0472883 317.722144 0.81355666 317.722144"></polygon></g> </g> </svg>')).css("width","34px"),h.css("height","32px"),c.append(h),n.append(c),e.$current_genome=oc("<div>",{class:"igv-current-genome"}),n.append(e.$current_genome),e.$current_genome.text(""),a=oc("<div>",{class:"igv-nav-bar-genomic-location"}),n.append(a),e.chromosomeSelectWidget=new Ck(e,a),void 0===t.showChromosomeWidget&&(t.showChromosomeWidget=!0),!0===t.showChromosomeWidget?e.chromosomeSelectWidget.$container.show():e.chromosomeSelectWidget.$container.hide(),o=oc("<div>",{class:"igv-locus-size-group"}),a.append(o),f=oc("<div>",{class:"igv-search-container"}),o.append(f),e.$searchInput=oc('<input type="text" placeholder="Locus Search">'),f.append(e.$searchInput),e.$searchInput.change((function(t){e.search(oc(this).val()).catch((function(t){e.presentAlert(t)}))})),r=oc("<div>"),f.append(r),r.append(Nf("search")),r.click((function(){e.search(e.$searchInput.val())})),e.windowSizePanel=new mk(o,e),i=oc('<div class="igv-nav-bar-right-container">'),l.append(i),s=oc('<div class="igv-nav-bar-toggle-button-container">'),i.append(s),e.$toggle_button_container=s,e.cursorGuide=new Rk(e.$content,s,t,e),e.centerGuide=new Ek(oc(e.trackContainerDiv),s,t,e),!0===t.showTrackLabelButton&&(e.trackLabelControl=new Ak(s,e)),t.showSVGButton&&(e.svgSaveControl=new Sk(s,e)),e.zoomWidget=new _k(e,i),!1===t.showNavigation&&e.$navigation.hide(),u.get(0)}(e,t),oc(r).insertBefore(e.$content),!1===t.showControls&&oc(r).hide()}function Bk(e){void 0===e.promisified&&(e.promisified=!1),void 0===e.minimumBases&&(e.minimumBases=40),void 0===e.showIdeogram&&(e.showIdeogram=!0),void 0===e.showCursorTrackingGuideButton&&(e.showCursorTrackingGuideButton=!0),void 0===e.showCenterGuideButton&&(e.showCenterGuideButton=!0),void 0===e.showSVGButton&&(e.showSVGButton=!0),void 0===e.showTrackLabelButton&&(e.showTrackLabelButton=!0),void 0===e.showCursorTrackingGuide&&(e.showCursorTrackingGuide=!1),void 0===e.showCenterGuide&&(e.showCenterGuide=!1),void 0===e.showTrackLabels&&(e.showTrackLabels=!0),void 0===e.showControls&&(e.showControls=!0),void 0===e.showNavigation&&(e.showNavigation=!0),void 0===e.showRuler&&(e.showRuler=!0),void 0===e.showSequence&&(e.showSequence=!0),void 0===e.flanking&&(e.flanking=1e3),void 0===e.pairsSupported&&(e.pairsSupported=!0),e.tracks||(e.tracks=[]),e.showSequence&&e.tracks.push({type:"sequence",order:-Number.MAX_SAFE_INTEGER})}function zk(e){var t,r,n,i,a,o,s,c,h,u,l;if(a={},t=(s=window.location.href).indexOf("?"),r=s.lastIndexOf("#"),t>=0)for(r<0&&(r=s.length),n=t+1;n<r;)(i=s.indexOf("&",n))<0&&(i=r),2===(o=s.substring(n,i).split("=",2)).length&&(c=o[0],h=decodeURIComponent(o[1]),"file"===c?u=h.split(","):"index"===c?l=h.split(","):e[c]=h,n=i+1);if(u){e.tracks||(e.tracks=[]);for(var f=0;f<u.length;f++){if(u[f].endsWith(".xml")||u[f].endsWith(".json")){e.sessionURL=u[f];break}var p={url:u[f]};l&&l.length>f&&(p.indexURL=l[f]),e.tracks.push(p)}}return a}var Uk,Hk=Sv,$k=kg,jk=gm;return(Uk=document.createElement("style")).setAttribute("type","text/css"),Uk.innerHTML='.igv-user-feedback {\n  position: fixed;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  width: 512px;\n  height: 360px;\n  z-index: 2048;\n  background-color: white;\n  border-color: #a2a2a2;\n  border-style: solid;\n  border-width: thin;\n  font-family: "Open Sans", sans-serif;\n  font-size: medium;\n  font-weight: 400;\n  color: #444;\n  display: flex;\n  flex-direction: column;\n  flex-wrap: nowrap;\n  justify-content: flex-start;\n  align-items: center; }\n  .igv-user-feedback div:first-child {\n    position: relative;\n    height: 24px;\n    width: 100%;\n    background-color: white;\n    border-bottom-color: #a2a2a2;\n    border-bottom-style: solid;\n    border-bottom-width: thin; }\n    .igv-user-feedback div:first-child div {\n      position: absolute;\n      top: 2px;\n      width: 16px;\n      height: 16px;\n      background-color: transparent; }\n    .igv-user-feedback div:first-child div:first-child {\n      left: 8px; }\n    .igv-user-feedback div:first-child div:last-child {\n      cursor: pointer;\n      right: 8px; }\n  .igv-user-feedback div:last-child {\n    width: 100%;\n    height: calc(100% - 24px);\n    border-width: 0; }\n    .igv-user-feedback div:last-child div {\n      width: auto;\n      height: auto;\n      margin: 8px; }\n\n.igv-color-swatch {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: wrap;\n  justify-content: center;\n  align-items: center;\n  width: 32px;\n  height: 32px;\n  border-style: solid;\n  border-width: 2px;\n  border-color: white;\n  border-radius: 4px; }\n\n.igv-colorpicker-menu-close-button {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: flex-end;\n  align-items: center;\n  width: 100%;\n  height: 32px;\n  margin-top: 4px;\n  margin-bottom: 4px;\n  padding-right: 8px; }\n  .igv-colorpicker-menu-close-button i.fa {\n    display: block;\n    margin-left: 4px;\n    margin-right: 4px;\n    color: #5f5f5f; }\n  .igv-colorpicker-menu-close-button i.fa:hover,\n  .igv-colorpicker-menu-close-button i.fa:focus,\n  .igv-colorpicker-menu-close-button i.fa:active {\n    cursor: pointer;\n    color: #0f0f0f; }\n\n.igv-alert-dialog-container {\n  position: absolute;\n  z-index: 2048;\n  top: 30%;\n  left: 50%;\n  margin: -150px 0 0 -150px;\n  width: 300px;\n  height: 256px;\n  border-color: #7F7F7F;\n  border-radius: 4px;\n  border-style: solid;\n  border-width: thin;\n  font-family: "Open Sans", sans-serif;\n  font-size: 15px;\n  font-weight: 400;\n  z-index: 2048;\n  background-color: white;\n  display: flex;\n  flex-flow: column;\n  flex-wrap: nowrap;\n  justify-content: flex-start;\n  align-items: center; }\n  .igv-alert-dialog-container div:first-child {\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: flex-end;\n    align-items: center;\n    width: 100%;\n    height: 24px;\n    cursor: move;\n    border-top-left-radius: 4px;\n    border-top-right-radius: 4px;\n    border-bottom-color: #7F7F7F;\n    border-bottom-style: solid;\n    border-bottom-width: thin;\n    background-color: #eee; }\n    .igv-alert-dialog-container div:first-child div {\n      margin-right: 4px;\n      margin-bottom: 2px;\n      height: 12px;\n      width: 12px;\n      color: #7F7F7F; }\n    .igv-alert-dialog-container div:first-child div:hover {\n      cursor: pointer;\n      color: #444; }\n  .igv-alert-dialog-container #igv-alert-dialog-body {\n    color: #373737;\n    width: 100%;\n    height: calc(100% - 24px - 64px);\n    overflow-y: scroll; }\n    .igv-alert-dialog-container #igv-alert-dialog-body #igv-alert-dialog-body-copy {\n      cursor: pointer;\n      margin: 16px;\n      width: auto;\n      height: auto;\n      overflow-wrap: break-word;\n      word-break: break-word;\n      background-color: white;\n      border: unset; }\n  .igv-alert-dialog-container div:last-child {\n    width: 100%;\n    height: 64px;\n    background-color: white;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: center;\n    align-items: center; }\n    .igv-alert-dialog-container div:last-child div {\n      width: 98px;\n      height: 36px;\n      line-height: 36px;\n      text-align: center;\n      color: white;\n      font-family: "Open Sans", sans-serif;\n      font-size: medium;\n      font-weight: 400;\n      border-color: #2B81AF;\n      border-style: solid;\n      border-width: thin;\n      border-radius: 4px;\n      background-color: #2B81AF; }\n    .igv-alert-dialog-container div:last-child div:hover {\n      cursor: pointer;\n      border-color: #25597f;\n      background-color: #25597f; }\n\n.igv-generic-container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 2048;\n  background-color: white;\n  cursor: pointer;\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n  justify-content: flex-start;\n  align-items: center; }\n  .igv-generic-container div:first-child {\n    cursor: move;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: flex-end;\n    align-items: center;\n    height: 24px;\n    width: 100%;\n    background-color: #dddddd; }\n    .igv-generic-container div:first-child i {\n      display: block;\n      color: #5f5f5f;\n      cursor: pointer;\n      width: 14px;\n      height: 14px;\n      margin-right: 8px;\n      margin-bottom: 4px; }\n\n.igv-generic-dialog-container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 300px;\n  height: 200px;\n  border-color: #7F7F7F;\n  border-radius: 4px;\n  border-style: solid;\n  border-width: thin;\n  font-family: "Open Sans", sans-serif;\n  font-size: medium;\n  font-weight: 400;\n  z-index: 2048;\n  background-color: white;\n  display: flex;\n  flex-flow: column;\n  flex-wrap: nowrap;\n  justify-content: flex-start;\n  align-items: center; }\n  .igv-generic-dialog-container .igv-generic-dialog-header {\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: flex-end;\n    align-items: center;\n    width: 100%;\n    height: 24px;\n    cursor: move;\n    border-top-left-radius: 4px;\n    border-top-right-radius: 4px;\n    border-bottom-color: #7F7F7F;\n    border-bottom-style: solid;\n    border-bottom-width: thin;\n    background-color: #eee; }\n    .igv-generic-dialog-container .igv-generic-dialog-header div {\n      margin-right: 4px;\n      margin-bottom: 2px;\n      height: 12px;\n      width: 12px;\n      color: #7F7F7F; }\n    .igv-generic-dialog-container .igv-generic-dialog-header div:hover {\n      cursor: pointer;\n      color: #444; }\n  .igv-generic-dialog-container .igv-generic-dialog-one-liner {\n    color: #373737;\n    width: 95%;\n    height: 24px;\n    line-height: 24px;\n    text-align: left;\n    margin-top: 8px;\n    padding-left: 8px;\n    overflow-wrap: break-word;\n    background-color: white; }\n  .igv-generic-dialog-container .igv-generic-dialog-label-input {\n    margin-top: 8px;\n    width: 95%;\n    height: 24px;\n    color: #373737;\n    line-height: 24px;\n    padding-left: 8px;\n    background-color: white;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: flex-start;\n    align-items: center; }\n    .igv-generic-dialog-container .igv-generic-dialog-label-input div {\n      width: 30%;\n      height: 100%;\n      font-size: 16px;\n      text-align: right;\n      padding-right: 8px;\n      background-color: white; }\n    .igv-generic-dialog-container .igv-generic-dialog-label-input input {\n      display: block;\n      height: 100%;\n      width: 100%;\n      padding-left: 4px;\n      font-family: "Open Sans", sans-serif;\n      font-weight: 400;\n      color: #373737;\n      text-align: left;\n      outline: none;\n      border-style: solid;\n      border-width: thin;\n      border-color: #7F7F7F;\n      background-color: white; }\n    .igv-generic-dialog-container .igv-generic-dialog-label-input input {\n      width: 50%;\n      font-size: 16px; }\n  .igv-generic-dialog-container .igv-generic-dialog-input {\n    margin-top: 8px;\n    width: calc(100% - 16px);\n    height: 24px;\n    color: #373737;\n    line-height: 24px;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: space-around;\n    align-items: center; }\n    .igv-generic-dialog-container .igv-generic-dialog-input input {\n      display: block;\n      height: 100%;\n      width: 100%;\n      padding-left: 4px;\n      font-family: "Open Sans", sans-serif;\n      font-weight: 400;\n      color: #373737;\n      text-align: left;\n      outline: none;\n      border-style: solid;\n      border-width: thin;\n      border-color: #7F7F7F;\n      background-color: white; }\n    .igv-generic-dialog-container .igv-generic-dialog-input input {\n      font-size: 16px; }\n  .igv-generic-dialog-container .igv-generic-dialog-ok-cancel {\n    width: 100%;\n    height: 28px;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: space-around;\n    align-items: center; }\n    .igv-generic-dialog-container .igv-generic-dialog-ok-cancel div {\n      margin-top: 32px;\n      color: white;\n      font-family: "Open Sans", sans-serif;\n      font-size: 14px;\n      font-weight: 400;\n      width: 75px;\n      height: 28px;\n      line-height: 28px;\n      text-align: center;\n      border-color: transparent;\n      border-style: solid;\n      border-width: thin;\n      border-radius: 2px; }\n    .igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child {\n      margin-left: 32px;\n      margin-right: 0;\n      background-color: #5ea4e0; }\n    .igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child {\n      margin-left: 0;\n      margin-right: 32px;\n      background-color: #c4c4c4; }\n    .igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child:hover {\n      cursor: pointer;\n      background-color: #3b5c7f; }\n    .igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child:hover {\n      cursor: pointer;\n      background-color: #7f7f7f; }\n  .igv-generic-dialog-container .igv-generic-dialog-ok {\n    width: 100%;\n    height: 36px;\n    margin-top: 32px;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: space-around;\n    align-items: center; }\n    .igv-generic-dialog-container .igv-generic-dialog-ok div {\n      width: 98px;\n      height: 36px;\n      line-height: 36px;\n      text-align: center;\n      color: white;\n      font-family: "Open Sans", sans-serif;\n      font-size: medium;\n      font-weight: 400;\n      border-color: white;\n      border-style: solid;\n      border-width: thin;\n      border-radius: 4px;\n      background-color: #2B81AF; }\n    .igv-generic-dialog-container .igv-generic-dialog-ok div:hover {\n      cursor: pointer;\n      background-color: #25597f; }\n\n.igv-popover {\n  position: absolute;\n  top: 0;\n  left: 0;\n  min-width: 128px;\n  z-index: 4096;\n  font-family: "Open Sans", sans-serif;\n  font-size: small;\n  font-weight: 400;\n  color: #4b4b4b;\n  background-color: white;\n  border-radius: 4px;\n  border-color: #7F7F7F;\n  border-style: solid;\n  border-width: thin;\n  display: none; }\n\n.igv-popover-header {\n  display: flex;\n  flex-direction: row;\n  flex-wrap: wrap;\n  justify-content: flex-end;\n  align-items: center;\n  width: 100%;\n  height: 24px;\n  cursor: move;\n  border-top-left-radius: 4px;\n  border-top-right-radius: 4px;\n  border-bottom-color: #7F7F7F;\n  border-bottom-style: solid;\n  border-bottom-width: thin;\n  background-color: #eee; }\n  .igv-popover-header div {\n    margin-right: 4px;\n    height: 12px;\n    width: 12px;\n    color: #7F7F7F; }\n  .igv-popover-header div:hover {\n    cursor: pointer;\n    color: #444; }\n\n.igv-popover-track-popup-content {\n  position: relative;\n  top: 0;\n  left: 0;\n  max-height: 384px;\n  overflow-x: hidden;\n  overflow-y: auto;\n  background-color: white; }\n  .igv-popover-track-popup-content div {\n    margin-left: 4px;\n    background-color: white; }\n  .igv-popover-track-popup-content div:hover {\n    cursor: pointer;\n    background-color: #efefef; }\n\n.igv-popover-name-value {\n  cursor: default;\n  text-wrap: none;\n  white-space: nowrap;\n  max-width: 384px; }\n\n.igv-popover-name {\n  font-weight: bold;\n  padding-right: 4px;\n  float: left; }\n\n.igv-popover-value {\n  padding-left: 4px;\n  overflow: hidden;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n  max-width: 256px;\n  display: inline-block; }\n\n.igv-trackgear-container {\n  position: relative;\n  width: 20px;\n  height: 20px;\n  margin-left: 4px;\n  color: #7F7F7F; }\n\n.igv-trackgear-container:hover {\n  cursor: pointer;\n  color: #444; }\n\n.igv-trackgear-popover {\n  position: absolute;\n  top: 0;\n  left: 0;\n  min-width: 132px;\n  z-index: 4096;\n  cursor: pointer;\n  font-family: "Open Sans", sans-serif;\n  font-size: small;\n  font-weight: 400;\n  color: #4b4b4b;\n  background: white;\n  border-radius: 4px;\n  border-color: #7F7F7F;\n  border-style: solid;\n  border-width: thin;\n  display: flex;\n  flex-flow: column;\n  flex-wrap: nowrap;\n  justify-content: flex-start;\n  align-items: flex-end;\n  text-align: left; }\n  .igv-trackgear-popover > div:not(:first-child) {\n    width: 100%; }\n    .igv-trackgear-popover > div:not(:first-child) > div {\n      background: white; }\n    .igv-trackgear-popover > div:not(:first-child) > div:last-child {\n      border-bottom-left-radius: 4px;\n      border-bottom-right-radius: 4px;\n      border-bottom-color: transparent;\n      border-bottom-style: solid;\n      border-bottom-width: thin; }\n    .igv-trackgear-popover > div:not(:first-child) > div:hover {\n      background: #efefef; }\n\n.igv-trackgear-popover-shim {\n  padding-left: 8px;\n  padding-right: 8px; }\n\n.igv-trackgear-popover-header {\n  position: relative;\n  width: 100%;\n  height: 24px;\n  cursor: move;\n  border-top-color: transparent;\n  border-top-left-radius: 4px;\n  border-top-right-radius: 4px;\n  border-bottom-color: #7F7F7F;\n  border-bottom-style: solid;\n  border-bottom-width: thin;\n  background-color: #eee;\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: flex-end;\n  align-items: center; }\n  .igv-trackgear-popover-header div {\n    margin-right: 4px;\n    height: 12px;\n    width: 12px;\n    color: #7F7F7F; }\n  .igv-trackgear-popover-header div:hover {\n    cursor: pointer;\n    color: #444; }\n\n.igv-trackgear-popover-check-container {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: flex-start;\n  align-items: center;\n  width: 100%;\n  height: 20px;\n  background-color: transparent; }\n  .igv-trackgear-popover-check-container div {\n    padding-top: 2px;\n    padding-left: 8px; }\n  .igv-trackgear-popover-check-container div:first-child {\n    position: relative;\n    width: 12px;\n    height: 12px; }\n    .igv-trackgear-popover-check-container div:first-child svg {\n      position: absolute;\n      width: 12px;\n      height: 12px; }\n\n.igvControlDiv {\n  position: relative; }\n\n.igv-content-header {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: flex-start;\n  align-items: center;\n  margin-top: 10px;\n  height: 16px;\n  width: 100%; }\n  .igv-content-header .igv-ideogram-shim {\n    height: 100%;\n    width: 50px;\n    background-color: white; }\n  .igv-content-header .igv-ideogram-content {\n    height: 100%;\n    background-color: white; }\n  .igv-content-header .igv-ideogram-content-border-right {\n    border-right-color: #292929;\n    border-right-style: solid;\n    border-right-width: 1px; }\n\n.igv-multi-locus-panel-border {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 100%;\n  width: 1px;\n  background-color: green;\n  border-right-color: #ff0000;\n  border-right-style: solid;\n  border-right-width: 1px; }\n\n.igv-navbar {\n  position: relative;\n  padding-left: 8px;\n  padding-right: 8px;\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: space-between;\n  align-items: center;\n  color: #444;\n  font-size: 12px;\n  font-family: "Open Sans", sans-serif;\n  font-weight: 400;\n  line-height: 32px;\n  margin-top: 2px;\n  margin-bottom: 4px;\n  height: 32px;\n  border-style: solid;\n  border-radius: 3px;\n  border-width: thin;\n  border-color: #bfbfbf;\n  background-color: #f3f3f3; }\n\n.igv-nav-bar-left-container {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: space-between;\n  align-items: center;\n  height: 32px;\n  line-height: 32px; }\n  .igv-nav-bar-left-container .igv-logo {\n    all: initial;\n    width: 34px;\n    height: 32px;\n    margin-right: 8px; }\n  .igv-nav-bar-left-container .igv-current-genome {\n    height: 32px;\n    margin-left: 4px;\n    margin-right: 4px;\n    user-select: none;\n    line-height: 32px;\n    vertical-align: middle;\n    text-align: center; }\n\n.igv-nav-bar-genomic-location {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: space-between;\n  align-items: center;\n  height: 100%; }\n\n.igv-chromosome-select-widget-container {\n  height: 100%;\n  width: 125px;\n  margin-right: 4px;\n  display: flex;\n  flex-flow: column;\n  flex-wrap: nowrap;\n  justify-content: space-around;\n  align-items: center; }\n  .igv-chromosome-select-widget-container select {\n    display: block;\n    cursor: pointer;\n    width: 100px;\n    height: 75%;\n    outline: none;\n    font-size: 12px;\n    font-family: "Open Sans", sans-serif;\n    font-weight: 400; }\n\n.igv-locus-size-group {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: space-between;\n  align-items: center;\n  margin-left: 8px;\n  height: calc(32px - 10px); }\n  .igv-locus-size-group .igv-search-container {\n    width: 200px;\n    height: calc(32px - 10px);\n    line-height: calc(32px - 10px);\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: flex-start;\n    align-items: center; }\n    .igv-locus-size-group .igv-search-container input {\n      cursor: text;\n      width: 85%;\n      height: calc(32px - 10px);\n      line-height: calc(32px - 10px);\n      font-size: 12px;\n      font-family: "Open Sans", sans-serif;\n      font-weight: 400;\n      text-align: left;\n      padding-left: 8px;\n      margin-right: 8px;\n      outline: none;\n      border-style: solid;\n      border-radius: 3px;\n      border-width: thin;\n      border-color: #bfbfbf;\n      background-color: white; }\n    .igv-locus-size-group .igv-search-container div {\n      cursor: pointer;\n      height: 16px;\n      width: 16px; }\n  .igv-locus-size-group .igv-windowsizepanel-content-div {\n    margin-left: 4px;\n    user-select: none; }\n\n.igv-nav-bar-right-container {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: space-between;\n  align-items: center;\n  height: 32px;\n  line-height: 32px; }\n  .igv-nav-bar-right-container .igv-nav-bar-toggle-button-container {\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: space-between;\n    align-items: center;\n    height: 100%; }\n    .igv-nav-bar-right-container .igv-nav-bar-toggle-button-container div {\n      margin-left: 0;\n      margin-right: 4px; }\n    .igv-nav-bar-right-container .igv-nav-bar-toggle-button-container div:last-child {\n      margin-left: 0;\n      margin-right: 0; }\n  .igv-nav-bar-right-container .igv-nav-bar-toggle-button-container-750 {\n    display: none; }\n  .igv-nav-bar-right-container .igv-zoom-widget {\n    color: #737373;\n    font-size: 18px;\n    height: 32px;\n    line-height: 32px;\n    margin-left: 8px;\n    user-select: none;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: flex-end;\n    align-items: center; }\n    .igv-nav-bar-right-container .igv-zoom-widget div {\n      cursor: pointer;\n      margin-left: unset;\n      margin-right: unset; }\n    .igv-nav-bar-right-container .igv-zoom-widget div:first-child {\n      height: 24px;\n      width: 24px;\n      margin-left: unset;\n      margin-right: 8px; }\n    .igv-nav-bar-right-container .igv-zoom-widget div:last-child {\n      height: 24px;\n      width: 24px;\n      margin-left: 8px;\n      margin-right: unset; }\n    .igv-nav-bar-right-container .igv-zoom-widget div:nth-child(even) {\n      display: block;\n      height: fit-content; }\n    .igv-nav-bar-right-container .igv-zoom-widget input {\n      display: block;\n      width: 125px; }\n    .igv-nav-bar-right-container .igv-zoom-widget svg {\n      display: block; }\n  .igv-nav-bar-right-container .igv-zoom-widget-900 {\n    color: #737373;\n    font-size: 18px;\n    height: 32px;\n    line-height: 32px;\n    margin-left: 8px;\n    user-select: none;\n    display: flex;\n    flex-flow: row;\n    flex-wrap: nowrap;\n    justify-content: flex-end;\n    align-items: center; }\n    .igv-nav-bar-right-container .igv-zoom-widget-900 div {\n      cursor: pointer;\n      margin-left: unset;\n      margin-right: unset; }\n    .igv-nav-bar-right-container .igv-zoom-widget-900 div:first-child {\n      height: 24px;\n      width: 24px;\n      margin-left: unset;\n      margin-right: 8px; }\n    .igv-nav-bar-right-container .igv-zoom-widget-900 div:last-child {\n      height: 24px;\n      width: 24px;\n      margin-left: 8px;\n      margin-right: unset; }\n    .igv-nav-bar-right-container .igv-zoom-widget-900 div:nth-child(even) {\n      width: 0;\n      height: 0;\n      display: none; }\n    .igv-nav-bar-right-container .igv-zoom-widget-900 input {\n      width: 0;\n      height: 0;\n      display: none; }\n    .igv-nav-bar-right-container .igv-zoom-widget-900 svg {\n      display: block; }\n  .igv-nav-bar-right-container .igv-zoom-widget-hidden {\n    display: none; }\n\n.igv-nav-bar-button {\n  box-sizing: unset;\n  padding-left: 6px;\n  padding-right: 6px;\n  height: 18px;\n  text-transform: capitalize;\n  user-select: none;\n  line-height: 18px;\n  text-align: center;\n  vertical-align: middle;\n  font-family: "Open Sans", sans-serif;\n  font-size: 11px;\n  font-weight: 200;\n  color: #737373;\n  background-color: #f3f3f3;\n  border-color: #737373;\n  border-style: solid;\n  border-width: thin;\n  border-radius: 6px; }\n\n.igv-nav-bar-button-clicked {\n  color: white;\n  background-color: #737373; }\n\n.igv-nav-bar-button:hover {\n  cursor: pointer; }\n\n.igv-logo-nonav {\n  margin-left: 4px;\n  margin-top: 12px;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 34px;\n  height: 16px; }\n\n.igv-search-results {\n  position: absolute;\n  top: 32px;\n  left: 2px;\n  height: 320px;\n  width: 213px;\n  background-color: white;\n  border-color: #7F7F7F;\n  border-style: solid;\n  border-width: thin;\n  overflow-x: hidden;\n  overflow-y: auto;\n  z-index: 9999; }\n  .igv-search-results tr {\n    font-family: "Open Sans", sans-serif;\n    font-size: small;\n    font-weight: 400;\n    color: #444; }\n  .igv-search-results tr:hover,\n  .igv-search-results tr:focus,\n  .igv-search-results tr:active {\n    cursor: pointer;\n    font-weight: 700;\n    color: #141414; }\n\n.igv-canvas {\n  all: initial; }\n\n.igv-root-div {\n  position: relative;\n  left: 0;\n  right: 0;\n  height: auto;\n  margin-left: 10px;\n  margin-right: 10px;\n  padding-top: 4px; }\n\n.igv-content-div {\n  position: relative;\n  width: 100%;\n  height: 100%; }\n\n.igv-track-container-div {\n  user-select: none;\n  position: relative;\n  clear: both; }\n\n.igv-track-div {\n  position: relative;\n  width: 100%;\n  margin-top: 5px;\n  margin-bottom: 5px; }\n\n.igv-viewport-container {\n  position: absolute;\n  left: 50px;\n  right: 50px;\n  height: 100%;\n  white-space: nowrap;\n  overflow-x: hidden;\n  overflow-y: hidden; }\n\n.igv-viewport-div {\n  position: relative;\n  display: inline-block;\n  height: 100%;\n  overflow-x: hidden;\n  overflow-y: hidden; }\n\n.igv-viewport-content-div {\n  position: absolute;\n  width: 100%; }\n\n.igv-viewport-message {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  color: rgba(0, 0, 0, 0.15);\n  font-family: "Open Sans", sans-serif;\n  font-size: 25px;\n  font-weight: bold;\n  user-select: none; }\n\n.igv-whole-genome-container {\n  display: flex;\n  flex-flow: row;\n  flex-wrap: nowrap;\n  justify-content: space-between;\n  width: 100%;\n  height: 100%;\n  background-color: white; }\n  .igv-whole-genome-container div {\n    font-family: "Open Sans", sans-serif;\n    font-size: 10px;\n    font-weight: 400;\n    color: #444;\n    height: 100%;\n    text-align: center;\n    border-right-color: #bfbfbf;\n    border-right-style: solid;\n    border-right-width: thin; }\n    .igv-whole-genome-container div span {\n      display: block;\n      padding-top: 6px;\n      text-overflow: ellipsis; }\n  .igv-whole-genome-container div:last-child {\n    border-right-color: transparent; }\n  .igv-whole-genome-container div:hover,\n  .igv-whole-genome-container div:focus,\n  .igv-whole-genome-container div:active {\n    cursor: pointer;\n    background-color: #efefef; }\n\n.igv-viewport-div-border-right {\n  border-right-color: #292929;\n  border-right-style: solid;\n  border-right-width: 1px; }\n\n.igv-multi-locus-panel-close-container {\n  position: absolute;\n  top: 4px;\n  right: 4px;\n  width: 16px;\n  height: 16px;\n  color: #666666;\n  z-index: 1000; }\n\n.igv-multi-locus-panel-close-container:hover {\n  cursor: pointer;\n  color: #434343; }\n\n.igv-multi-locus-panel-label-div {\n  position: absolute;\n  left: 50%;\n  top: 25%;\n  transform: translate(-50%, -25%);\n  font-family: "Open Sans", sans-serif;\n  font-size: 12px;\n  font-weight: 400;\n  text-align: center;\n  min-width: 16px;\n  z-index: 64;\n  color: #373737;\n  background-color: white;\n  padding: 1px; }\n\n.igv-multi-locus-panel-label-div:hover {\n  cursor: pointer; }\n\n.igv-viewport-ruler {\n  cursor: pointer;\n  font-family: "Open Sans", sans-serif;\n  font-size: 10px;\n  font-weight: 200;\n  text-align: center; }\n  .igv-viewport-ruler > div {\n    height: 100%; }\n\n.igv-viewport-sequence {\n  font-family: "Open Sans", sans-serif;\n  font-size: 8px;\n  font-weight: 200;\n  text-align: center; }\n\n.igv-viewport-spinner {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  z-index: 1024;\n  width: 24px;\n  height: 24px;\n  pointer-events: none;\n  color: #737373; }\n\n.igv-track-container-spinner {\n  position: absolute;\n  top: 90%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  z-index: 1024;\n  width: 24px;\n  height: 24px;\n  pointer-events: none;\n  color: #737373; }\n\n.igv-ruler-sweeper-div {\n  display: none;\n  pointer-events: none;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 0;\n  height: 100%;\n  z-index: 99999;\n  background-color: rgba(68, 134, 247, 0.25); }\n\n.igv-right-hand-gutter {\n  position: absolute;\n  right: 0;\n  width: 36px;\n  height: 100%;\n  background: white;\n  margin-top: 0px;\n  margin-bottom: 0px; }\n\n.igv-left-hand-gutter {\n  position: absolute;\n  left: 0;\n  width: 50px;\n  height: 100%; }\n  .igv-left-hand-gutter canvas {\n    position: absolute; }\n\n.igv-track-menu-border-top {\n  border-top-color: #a2a2a2;\n  border-top-style: solid;\n  border-top-width: thin; }\n\n.igv-track-menu-category {\n  padding-left: 4px;\n  font-weight: 400; }\n\n.igv-track-drag-scrim {\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  margin-top: 0px;\n  margin-bottom: 0px;\n  z-index: 256;\n  background-color: rgba(68, 134, 247, 0.25); }\n\n.igv-track-manipulation-handle {\n  cursor: pointer;\n  position: absolute;\n  right: 36px;\n  width: 12px;\n  margin-left: 2px;\n  height: 100%;\n  box-sizing: border-box;\n  font-size: medium;\n  border-color: #c4c4c4;\n  border-style: solid;\n  border-width: thin;\n  border-top-right-radius: 6px;\n  border-bottom-right-radius: 6px;\n  z-index: 512;\n  background-color: #c4c4c4; }\n\n.igv-track-manipulation-handle:hover,\n.igv-track-manipulation-handle:focus,\n.igv-track-manipulation-handle:active {\n  border-color: #7e7e7e;\n  background-color: #7e7e7e; }\n\n.igv-track-label {\n  position: absolute;\n  left: 8px;\n  top: 8px;\n  width: auto;\n  height: auto;\n  max-width: 200px;\n  padding-left: 4px;\n  padding-right: 4px;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  font-family: "Open Sans", sans-serif;\n  font-size: small;\n  font-weight: 400;\n  text-align: center;\n  user-select: none;\n  -moz-user-select: none;\n  -webkit-user-select: none;\n  border-color: #444;\n  border-radius: 2px;\n  border-style: solid;\n  border-width: thin;\n  background-color: white;\n  z-index: 128;\n  cursor: pointer; }\n\n.igv-track-label:hover,\n.igv-track-label:focus,\n.igv-track-label:active {\n  background-color: rgba(0, 0, 0, 0.05); }\n\n.igv-scrollbar-outer-div {\n  position: absolute;\n  top: 0;\n  right: 0;\n  width: 14px;\n  height: 100%;\n  background-color: white; }\n  .igv-scrollbar-outer-div div {\n    position: absolute;\n    top: 0;\n    left: 3px;\n    width: 8px;\n    border-style: solid;\n    border-width: thin;\n    border-color: #c4c4c4;\n    border-top-left-radius: 4px;\n    border-top-right-radius: 4px;\n    border-bottom-left-radius: 4px;\n    border-bottom-right-radius: 4px;\n    background-color: white; }\n  .igv-scrollbar-outer-div div:hover,\n  .igv-scrollbar-outer-div div:focus,\n  .igv-scrollbar-outer-div div:active {\n    cursor: pointer;\n    background-color: #c4c4c4; }\n\n.zoom-in-notice-container {\n  position: absolute;\n  top: 10px;\n  left: 50%; }\n  .zoom-in-notice-container div {\n    position: relative;\n    left: -50%;\n    font-family: "Open Sans", sans-serif;\n    font-size: medium;\n    font-weight: 400;\n    color: #3f3f3f;\n    background-color: rgba(255, 255, 255, 0.51);\n    z-index: 64; }\n\n.igv-center-guide {\n  pointer-events: none;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 50%;\n  width: 8px;\n  z-index: 8;\n  display: none;\n  user-select: none;\n  -moz-user-select: none;\n  -webkit-user-select: none;\n  border-left-style: dashed;\n  border-left-width: thin;\n  border-right-style: dashed;\n  border-right-width: thin; }\n\n.igv-center-guide-wide {\n  background-color: rgba(0, 0, 0, 0);\n  border-left-color: rgba(127, 127, 127, 0.51);\n  border-right-color: rgba(127, 127, 127, 0.51); }\n\n.igv-center-guide-thin {\n  left: 50%;\n  width: 1px;\n  background-color: rgba(0, 0, 0, 0);\n  border-left-color: rgba(127, 127, 127, 0.51);\n  border-right-color: rgba(0, 0, 0, 0);\n  /*background-color: rgba(127, 127, 127, 0.51);*/\n  /*border-left-color: rgba(0,0,0,0);*/\n  /*border-right-color: rgba(0,0,0,0);*/ }\n\n.igv-cursor-tracking-guide {\n  pointer-events: none;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 50%;\n  width: 1px;\n  z-index: 1;\n  border-left-style: dotted;\n  border-left-width: thin;\n  border-left-color: rgba(127, 127, 127, 0.76);\n  display: none;\n  user-select: none;\n  -moz-user-select: none;\n  -webkit-user-select: none; }\n\n.igv-clickable {\n  cursor: pointer;\n  background-color: white; }\n\n#color-by-tag {\n  color: #444; }\n\n#color-by-tag:hover,\n#color-by-tag:focus,\n#color-by-tag:active {\n  cursor: pointer;\n  padding-left: 2px;\n  padding-right: 2px;\n  color: white;\n  border-color: #444;\n  border-radius: 2px;\n  border-style: solid;\n  border-width: thin;\n  background-color: #7f7f7f; }\n\n.igv-ellipsis {\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis; }\n\n.igv-spinner-container {\n  color: #3f3f3f;\n  width: 100%;\n  height: 100%;\n  text-align: center;\n  padding-top: 8px;\n  font-size: 24px;\n  z-index: 512; }\n\n.igv-fa-check-visible {\n  color: inherit;\n  padding-right: 2px; }\n\n.igv-fa-check-hidden {\n  color: transparent;\n  padding-right: 2px; }\n\n.validateTips {\n  border: 1px solid transparent;\n  padding: 0.3em; }\n  .validateTips fieldset {\n    border: 0; }\n\n.igv-spacer-10 {\n  height: 10px;\n  width: 100%;\n  font-size: 0;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  display: block; }\n\n.igv-fa5-spin {\n  -webkit-animation: igv-fa5-spin 2s infinite linear;\n  animation: igv-fa5-spin 2s infinite linear; }\n\n@-webkit-keyframes igv-fa5-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n    transform: rotate(0deg); }\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg); } }\n@keyframes igv-fa5-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n    transform: rotate(0deg); }\n  100% {\n    -webkit-transform: rotate(360deg);\n    transform: rotate(360deg); } }\n\n/*# sourceMappingURL=igv.css.map */\n',document.head.insertBefore(Uk,document.head.childNodes[document.head.childNodes.length-1]),{createBrowser:function(e,t){return Fk.apply(this,arguments)},removeBrowser:function(e){e.dispose(),e.$root.remove(),Ok=Ok.filter((function(t){return t!==e}))},removeAllBrowsers:function(){var e,t=fn(Ok);try{for(t.s();!(e=t.n()).done;){var r=e.value;r.dispose(),r.$root.remove()}}catch(e){t.e(e)}finally{t.f()}Ok=[]},visibilityChange:function(){Ok.forEach((function(e){e.visibilityChange()}))},setGoogleOauthToken:function(e){return Jg.setToken(e)},oauth:Jg,version:function(){return"2.6.8"},download:Ug,getBrowser:function(){return Ok[0]},doAutoscale:Hg,graphics:jk,createTrack:function(e,t){return pk.prototype.createTrack.call(t,e)},getFilename:ov,getExtension:function(e){if(void 0!==e.url){var t=(sv(e.url)?e.url.name:e.url).toLowerCase(),r=t.indexOf("?");return r>0&&(t=t.substr(0,r)),t.endsWith(".gz")?t=t.substr(0,t.length-3):(t.endsWith(".txt")||t.endsWith(".tab")||t.endsWith(".bgz"))&&(t=t.substr(0,t.length-4)),(r=t.lastIndexOf("."))<0?t:t.substr(1+r)}},isFilePath:sv,inferFileFormat:$m,inferTrackTypes:Hm,knownFileExtensions:Um,appendRightHandGutter:function(e){_m.prototype.appendRightHandGutter.call(this,e)},attachDialogCloseHandlerWithParent:Sg,guid:Eg,pageCoordinates:Cg,translateMouseCoordinates:Ag,createIcon:Nf,GtexUtils:Fb,xhr:Hk,Color:$k,splitLines:bg,isString:mg,numberFormatter:yg,getDataWrapper:Nm,setApiKey:function(e){return Kg.setApiKey(e)},createColorSwatchSelector:_g,makeDraggable:df,GenericContainer:Sm,Popover:Tg,AlertDialog:gv,InputDialog:yk,TrackRemovalDialog:xk,DataRangeDialog:bk,MenuUtils:If,Alert:vv,google:Kg}},e.exports=i()}).call(this,r(48),r(56),r(142).Buffer)},142:function(e,t,r){"use strict";(function(e){
  /*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <http://feross.org>
   * @license  MIT
   */
  var n=r(143),i=r(144),a=r(145);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return h(this,e,t,r)}function h(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(c.isBuffer(t)){var r=0|p(t.length);return 0===(e=s(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(u(t),e=s(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function f(e,t){var r=t.length<0?0:0|p(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function d(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function h(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=r;a<s;a++)if(h(e,a)===h(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===c)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+c>s&&(r=s-c),a=r;a>=0;a--){for(var l=!0,f=0;f<c;f++)if(h(e,a+f)!==h(t,f)){l=!1;break}if(l)return a}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function w(e,t,r,n){return $(U(t,e.length-r),e,r,n)}function x(e,t,r,n){return $(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return x(e,t,r,n)}function S(e,t,r,n){return $(H(t),e,r,n)}function _(e,t,r,n){return $(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,c,h=e[i],u=null,l=h>239?4:h>223?3:h>191?2:1;if(i+l<=r)switch(l){case 1:h<128&&(u=h);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&h)<<6|63&a)>127&&(u=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&h)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&h)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(u=c)}null===u?(u=65533,l=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,r){return h(null,e,t,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,r){return function(e,t,r,n){return u(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},c.allocUnsafe=function(e){return l(null,e)},c.allocUnsafeSlow=function(e){return l(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):g.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),h=this.slice(n,i),u=e.slice(t,r),l=0;l<s;++l)if(h[l]!==u[l]){a=h[l],o=u[l];break}return a<o?-1:o<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return k(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function T(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=z(e[a]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function F(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,a){return a||F(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,a){return a||F(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=c.prototype;else{var i=t-e;r=new c(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},c.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},c.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||M(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||M(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=c.isBuffer(e)?e:U(new c(e,n).toString()),s=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(48))},143:function(e,t,r){"use strict";t.byteLength=function(e){var t=h(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=h(e),o=n[0],s=n[1],c=new a(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),u=0,l=s>0?o-4:o;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[u++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;o<s;o+=16383)a.push(u(e,o,o+16383>s?s:o+16383));1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s<c;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function h(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var i,a,o=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},144:function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<<s)-1,h=c>>1,u=-7,l=r?i-1:0,f=r?-1:1,p=e[t+l];for(l+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+l],l+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+l],l+=f,u-=8);if(0===a)a=1-h;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=h}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,c,h=8*a-i-1,u=(1<<h)-1,l=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=u?(s=0,o=u):o+l>=1?(s=(t*c-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,h+=i;h>0;e[r+p]=255&o,p+=d,o/=256,h-=8);e[r+p-d]|=128*g}},145:function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},39:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return p}));var n=r(1),i=r.n(n),a=r(12),o=r(141),s=r.n(o);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var p=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=u(this,l(t).call(this,e))).ref=i.a.createRef(),r}var r,n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(t,e),r=t,(n=[{key:"createIgvBrowser",value:function(){var e=this.ref.current,t={genome:this.props.genome,locus:this.props.locus,reference:this.props.reference,minimumBases:this.props.minimumBases,tracks:this.props.tracks};return s.a.createBrowser(e,t).then((function(e){s.a.browser=e}))}},{key:"componentDidMount",value:function(){this.createIgvBrowser()}},{key:"componentDidUpdate",value:function(e){this.props.genome===e.genome&&this.props.minimumBases===e.minimumBases&&this.props.locus===e.locus&&this.props.reference===e.reference&&this.props.tracks===e.tracks||(s.a.removeBrowser(s.a.browser),this.createIgvBrowser())}},{key:"render",value:function(){var e=this.props,t=e.id,r=e.style;return i.a.createElement("div",{id:t,style:r,ref:this.ref})}}])&&h(r.prototype,n),a&&h(r,a),t}(n.Component);p.defaultProps=a.b,p.propTypes=a.c}}]);