wuepgg3-track 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,73 @@
1
+ var AA=Object.defineProperty;var FA=(wn,bn,pr)=>bn in wn?AA(wn,bn,{enumerable:!0,configurable:!0,writable:!0,value:pr}):wn[bn]=pr;var de=(wn,bn,pr)=>FA(wn,typeof bn!="symbol"?bn+"":bn,pr);(function(){"use strict";var wn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pr={exports:{}};/**
2
+ * @license
3
+ * Lodash <https://lodash.com/>
4
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5
+ * Released under MIT license <https://lodash.com/license>
6
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8
+ */pr.exports,function(n,e){(function(){var t,a="4.17.21",o=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",h="Invalid `variable` option passed into `_.template`",v="__lodash_hash_undefined__",d=500,c="__lodash_placeholder__",D=1,y=2,m=4,I=1,S=2,T=1,N=2,Z=4,P=8,k=16,M=32,q=64,$=128,A=256,F=512,L=30,G="...",Y=800,ne=16,se=1,pe=2,ke=3,ae=1/0,ge=9007199254740991,_e=17976931348623157e292,Xe=NaN,le=4294967295,ue=le-1,fe=le>>>1,Ee=[["ary",$],["bind",T],["bindKey",N],["curry",P],["curryRight",k],["flip",F],["partial",M],["partialRight",q],["rearg",A]],ve="[object Arguments]",qe="[object Array]",ot="[object AsyncFunction]",be="[object Boolean]",Fe="[object Date]",Ke="[object DOMException]",he="[object Error]",Oe="[object Function]",Ye="[object GeneratorFunction]",we="[object Map]",Ae="[object Number]",Ce="[object Null]",ze="[object Object]",De="[object Promise]",Qe="[object Proxy]",At="[object RegExp]",vt="[object Set]",yt="[object String]",Qt="[object Symbol]",xt="[object Undefined]",rt="[object WeakMap]",wt="[object WeakSet]",Ft="[object ArrayBuffer]",dt="[object DataView]",Ar="[object Float32Array]",E="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",R="[object Int32Array]",W="[object Uint8Array]",X="[object Uint8ClampedArray]",J="[object Uint16Array]",Te="[object Uint32Array]",bt=/\b__p \+= '';/g,ft=/\b(__p \+=) '' \+/g,mt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,et=/&(?:amp|lt|gt|quot|#39);/g,Hd=/[&<>"']/g,Qm=RegExp(et.source),Jm=RegExp(Hd.source),jm=/<%-([\s\S]+?)%>/g,zm=/<%([\s\S]+?)%>/g,Zd=/<%=([\s\S]+?)%>/g,eD=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tD=/^\w*$/,nD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sf=/[\\^$.*+?()[\]{}|]/g,rD=RegExp(Sf.source),If=/^\s+/,iD=/\s/,aD=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,sD=/\{\n\/\* \[wrapped with (.+)\] \*/,uD=/,? & /,oD=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fD=/[()=,{}\[\]\/\s]/,lD=/\\(\\)?/g,hD=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vd=/\w*$/,cD=/^[-+]0x[0-9a-f]+$/i,dD=/^0b[01]+$/i,pD=/^\[object .+?Constructor\]$/,gD=/^0o[0-7]+$/i,_D=/^(?:0|[1-9]\d*)$/,vD=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,uu=/($^)/,wD=/['\n\r\u2028\u2029\\]/g,ou="\\ud800-\\udfff",bD="\\u0300-\\u036f",mD="\\ufe20-\\ufe2f",DD="\\u20d0-\\u20ff",Xd=bD+mD+DD,Kd="\\u2700-\\u27bf",Yd="a-z\\xdf-\\xf6\\xf8-\\xff",yD="\\xac\\xb1\\xd7\\xf7",xD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ED="\\u2000-\\u206f",CD=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qd="A-Z\\xc0-\\xd6\\xd8-\\xde",Jd="\\ufe0e\\ufe0f",jd=yD+xD+ED+CD,kf="['’]",AD="["+ou+"]",zd="["+jd+"]",fu="["+Xd+"]",e1="\\d+",FD="["+Kd+"]",t1="["+Yd+"]",n1="[^"+ou+jd+e1+Kd+Yd+Qd+"]",Tf="\\ud83c[\\udffb-\\udfff]",BD="(?:"+fu+"|"+Tf+")",r1="[^"+ou+"]",Rf="(?:\\ud83c[\\udde6-\\uddff]){2}",Nf="[\\ud800-\\udbff][\\udc00-\\udfff]",na="["+Qd+"]",i1="\\u200d",a1="(?:"+t1+"|"+n1+")",SD="(?:"+na+"|"+n1+")",s1="(?:"+kf+"(?:d|ll|m|re|s|t|ve))?",u1="(?:"+kf+"(?:D|LL|M|RE|S|T|VE))?",o1=BD+"?",f1="["+Jd+"]?",ID="(?:"+i1+"(?:"+[r1,Rf,Nf].join("|")+")"+f1+o1+")*",kD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",TD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",l1=f1+o1+ID,RD="(?:"+[FD,Rf,Nf].join("|")+")"+l1,ND="(?:"+[r1+fu+"?",fu,Rf,Nf,AD].join("|")+")",$D=RegExp(kf,"g"),LD=RegExp(fu,"g"),$f=RegExp(Tf+"(?="+Tf+")|"+ND+l1,"g"),OD=RegExp([na+"?"+t1+"+"+s1+"(?="+[zd,na,"$"].join("|")+")",SD+"+"+u1+"(?="+[zd,na+a1,"$"].join("|")+")",na+"?"+a1+"+"+s1,na+"+"+u1,TD,kD,e1,RD].join("|"),"g"),PD=RegExp("["+i1+ou+Xd+Jd+"]"),MD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,UD=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],WD=-1,pt={};pt[Ar]=pt[E]=pt[_]=pt[w]=pt[R]=pt[W]=pt[X]=pt[J]=pt[Te]=!0,pt[ve]=pt[qe]=pt[Ft]=pt[be]=pt[dt]=pt[Fe]=pt[he]=pt[Oe]=pt[we]=pt[Ae]=pt[ze]=pt[At]=pt[vt]=pt[yt]=pt[rt]=!1;var lt={};lt[ve]=lt[qe]=lt[Ft]=lt[dt]=lt[be]=lt[Fe]=lt[Ar]=lt[E]=lt[_]=lt[w]=lt[R]=lt[we]=lt[Ae]=lt[ze]=lt[At]=lt[vt]=lt[yt]=lt[Qt]=lt[W]=lt[X]=lt[J]=lt[Te]=!0,lt[he]=lt[Oe]=lt[rt]=!1;var qD={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},GD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},HD={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ZD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},VD=parseFloat,XD=parseInt,h1=typeof wn=="object"&&wn&&wn.Object===Object&&wn,KD=typeof self=="object"&&self&&self.Object===Object&&self,Gt=h1||KD||Function("return this")(),Lf=e&&!e.nodeType&&e,Ci=Lf&&!0&&n&&!n.nodeType&&n,c1=Ci&&Ci.exports===Lf,Of=c1&&h1.process,Tn=function(){try{var H=Ci&&Ci.require&&Ci.require("util").types;return H||Of&&Of.binding&&Of.binding("util")}catch{}}(),d1=Tn&&Tn.isArrayBuffer,p1=Tn&&Tn.isDate,g1=Tn&&Tn.isMap,_1=Tn&&Tn.isRegExp,v1=Tn&&Tn.isSet,w1=Tn&&Tn.isTypedArray;function cn(H,Q,K){switch(K.length){case 0:return H.call(Q);case 1:return H.call(Q,K[0]);case 2:return H.call(Q,K[0],K[1]);case 3:return H.call(Q,K[0],K[1],K[2])}return H.apply(Q,K)}function YD(H,Q,K,oe){for(var Be=-1,Je=H==null?0:H.length;++Be<Je;){var Ot=H[Be];Q(oe,Ot,K(Ot),H)}return oe}function Rn(H,Q){for(var K=-1,oe=H==null?0:H.length;++K<oe&&Q(H[K],K,H)!==!1;);return H}function QD(H,Q){for(var K=H==null?0:H.length;K--&&Q(H[K],K,H)!==!1;);return H}function b1(H,Q){for(var K=-1,oe=H==null?0:H.length;++K<oe;)if(!Q(H[K],K,H))return!1;return!0}function Kr(H,Q){for(var K=-1,oe=H==null?0:H.length,Be=0,Je=[];++K<oe;){var Ot=H[K];Q(Ot,K,H)&&(Je[Be++]=Ot)}return Je}function lu(H,Q){var K=H==null?0:H.length;return!!K&&ra(H,Q,0)>-1}function Pf(H,Q,K){for(var oe=-1,Be=H==null?0:H.length;++oe<Be;)if(K(Q,H[oe]))return!0;return!1}function Dt(H,Q){for(var K=-1,oe=H==null?0:H.length,Be=Array(oe);++K<oe;)Be[K]=Q(H[K],K,H);return Be}function Yr(H,Q){for(var K=-1,oe=Q.length,Be=H.length;++K<oe;)H[Be+K]=Q[K];return H}function Mf(H,Q,K,oe){var Be=-1,Je=H==null?0:H.length;for(oe&&Je&&(K=H[++Be]);++Be<Je;)K=Q(K,H[Be],Be,H);return K}function JD(H,Q,K,oe){var Be=H==null?0:H.length;for(oe&&Be&&(K=H[--Be]);Be--;)K=Q(K,H[Be],Be,H);return K}function Uf(H,Q){for(var K=-1,oe=H==null?0:H.length;++K<oe;)if(Q(H[K],K,H))return!0;return!1}var jD=Wf("length");function zD(H){return H.split("")}function ey(H){return H.match(oD)||[]}function m1(H,Q,K){var oe;return K(H,function(Be,Je,Ot){if(Q(Be,Je,Ot))return oe=Je,!1}),oe}function hu(H,Q,K,oe){for(var Be=H.length,Je=K+(oe?1:-1);oe?Je--:++Je<Be;)if(Q(H[Je],Je,H))return Je;return-1}function ra(H,Q,K){return Q===Q?cy(H,Q,K):hu(H,D1,K)}function ty(H,Q,K,oe){for(var Be=K-1,Je=H.length;++Be<Je;)if(oe(H[Be],Q))return Be;return-1}function D1(H){return H!==H}function y1(H,Q){var K=H==null?0:H.length;return K?Gf(H,Q)/K:Xe}function Wf(H){return function(Q){return Q==null?t:Q[H]}}function qf(H){return function(Q){return H==null?t:H[Q]}}function x1(H,Q,K,oe,Be){return Be(H,function(Je,Ot,it){K=oe?(oe=!1,Je):Q(K,Je,Ot,it)}),K}function ny(H,Q){var K=H.length;for(H.sort(Q);K--;)H[K]=H[K].value;return H}function Gf(H,Q){for(var K,oe=-1,Be=H.length;++oe<Be;){var Je=Q(H[oe]);Je!==t&&(K=K===t?Je:K+Je)}return K}function Hf(H,Q){for(var K=-1,oe=Array(H);++K<H;)oe[K]=Q(K);return oe}function ry(H,Q){return Dt(Q,function(K){return[K,H[K]]})}function E1(H){return H&&H.slice(0,B1(H)+1).replace(If,"")}function dn(H){return function(Q){return H(Q)}}function Zf(H,Q){return Dt(Q,function(K){return H[K]})}function za(H,Q){return H.has(Q)}function C1(H,Q){for(var K=-1,oe=H.length;++K<oe&&ra(Q,H[K],0)>-1;);return K}function A1(H,Q){for(var K=H.length;K--&&ra(Q,H[K],0)>-1;);return K}function iy(H,Q){for(var K=H.length,oe=0;K--;)H[K]===Q&&++oe;return oe}var ay=qf(qD),sy=qf(GD);function uy(H){return"\\"+ZD[H]}function oy(H,Q){return H==null?t:H[Q]}function ia(H){return PD.test(H)}function fy(H){return MD.test(H)}function ly(H){for(var Q,K=[];!(Q=H.next()).done;)K.push(Q.value);return K}function Vf(H){var Q=-1,K=Array(H.size);return H.forEach(function(oe,Be){K[++Q]=[Be,oe]}),K}function F1(H,Q){return function(K){return H(Q(K))}}function Qr(H,Q){for(var K=-1,oe=H.length,Be=0,Je=[];++K<oe;){var Ot=H[K];(Ot===Q||Ot===c)&&(H[K]=c,Je[Be++]=K)}return Je}function cu(H){var Q=-1,K=Array(H.size);return H.forEach(function(oe){K[++Q]=oe}),K}function hy(H){var Q=-1,K=Array(H.size);return H.forEach(function(oe){K[++Q]=[oe,oe]}),K}function cy(H,Q,K){for(var oe=K-1,Be=H.length;++oe<Be;)if(H[oe]===Q)return oe;return-1}function dy(H,Q,K){for(var oe=K+1;oe--;)if(H[oe]===Q)return oe;return oe}function aa(H){return ia(H)?gy(H):jD(H)}function Yn(H){return ia(H)?_y(H):zD(H)}function B1(H){for(var Q=H.length;Q--&&iD.test(H.charAt(Q)););return Q}var py=qf(HD);function gy(H){for(var Q=$f.lastIndex=0;$f.test(H);)++Q;return Q}function _y(H){return H.match($f)||[]}function vy(H){return H.match(OD)||[]}var wy=function H(Q){Q=Q==null?Gt:sa.defaults(Gt.Object(),Q,sa.pick(Gt,UD));var K=Q.Array,oe=Q.Date,Be=Q.Error,Je=Q.Function,Ot=Q.Math,it=Q.Object,Xf=Q.RegExp,by=Q.String,Nn=Q.TypeError,du=K.prototype,my=Je.prototype,ua=it.prototype,pu=Q["__core-js_shared__"],gu=my.toString,nt=ua.hasOwnProperty,Dy=0,S1=function(){var i=/[^.]+$/.exec(pu&&pu.keys&&pu.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),_u=ua.toString,yy=gu.call(it),xy=Gt._,Ey=Xf("^"+gu.call(nt).replace(Sf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vu=c1?Q.Buffer:t,Jr=Q.Symbol,wu=Q.Uint8Array,I1=vu?vu.allocUnsafe:t,bu=F1(it.getPrototypeOf,it),k1=it.create,T1=ua.propertyIsEnumerable,mu=du.splice,R1=Jr?Jr.isConcatSpreadable:t,es=Jr?Jr.iterator:t,Ai=Jr?Jr.toStringTag:t,Du=function(){try{var i=ki(it,"defineProperty");return i({},"",{}),i}catch{}}(),Cy=Q.clearTimeout!==Gt.clearTimeout&&Q.clearTimeout,Ay=oe&&oe.now!==Gt.Date.now&&oe.now,Fy=Q.setTimeout!==Gt.setTimeout&&Q.setTimeout,yu=Ot.ceil,xu=Ot.floor,Kf=it.getOwnPropertySymbols,By=vu?vu.isBuffer:t,N1=Q.isFinite,Sy=du.join,Iy=F1(it.keys,it),Pt=Ot.max,Zt=Ot.min,ky=oe.now,Ty=Q.parseInt,$1=Ot.random,Ry=du.reverse,Yf=ki(Q,"DataView"),ts=ki(Q,"Map"),Qf=ki(Q,"Promise"),oa=ki(Q,"Set"),ns=ki(Q,"WeakMap"),rs=ki(it,"create"),Eu=ns&&new ns,fa={},Ny=Ti(Yf),$y=Ti(ts),Ly=Ti(Qf),Oy=Ti(oa),Py=Ti(ns),Cu=Jr?Jr.prototype:t,is=Cu?Cu.valueOf:t,L1=Cu?Cu.toString:t;function C(i){if(Bt(i)&&!Ie(i)&&!(i instanceof Ue)){if(i instanceof $n)return i;if(nt.call(i,"__wrapped__"))return Op(i)}return new $n(i)}var la=function(){function i(){}return function(s){if(!Et(s))return{};if(k1)return k1(s);i.prototype=s;var l=new i;return i.prototype=t,l}}();function Au(){}function $n(i,s){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=t}C.templateSettings={escape:jm,evaluate:zm,interpolate:Zd,variable:"",imports:{_:C}},C.prototype=Au.prototype,C.prototype.constructor=C,$n.prototype=la(Au.prototype),$n.prototype.constructor=$n;function Ue(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=le,this.__views__=[]}function My(){var i=new Ue(this.__wrapped__);return i.__actions__=an(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=an(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=an(this.__views__),i}function Uy(){if(this.__filtered__){var i=new Ue(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function Wy(){var i=this.__wrapped__.value(),s=this.__dir__,l=Ie(i),p=s<0,x=l?i.length:0,B=zx(0,x,this.__views__),O=B.start,U=B.end,V=U-O,j=p?U:O-1,z=this.__iteratees__,te=z.length,ie=0,ce=Zt(V,this.__takeCount__);if(!l||!p&&x==V&&ce==V)return sp(i,this.__actions__);var ye=[];e:for(;V--&&ie<ce;){j+=s;for(var $e=-1,xe=i[j];++$e<te;){var Pe=z[$e],Ge=Pe.iteratee,_n=Pe.type,zt=Ge(xe);if(_n==pe)xe=zt;else if(!zt){if(_n==se)continue e;break e}}ye[ie++]=xe}return ye}Ue.prototype=la(Au.prototype),Ue.prototype.constructor=Ue;function Fi(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var p=i[s];this.set(p[0],p[1])}}function qy(){this.__data__=rs?rs(null):{},this.size=0}function Gy(i){var s=this.has(i)&&delete this.__data__[i];return this.size-=s?1:0,s}function Hy(i){var s=this.__data__;if(rs){var l=s[i];return l===v?t:l}return nt.call(s,i)?s[i]:t}function Zy(i){var s=this.__data__;return rs?s[i]!==t:nt.call(s,i)}function Vy(i,s){var l=this.__data__;return this.size+=this.has(i)?0:1,l[i]=rs&&s===t?v:s,this}Fi.prototype.clear=qy,Fi.prototype.delete=Gy,Fi.prototype.get=Hy,Fi.prototype.has=Zy,Fi.prototype.set=Vy;function Fr(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var p=i[s];this.set(p[0],p[1])}}function Xy(){this.__data__=[],this.size=0}function Ky(i){var s=this.__data__,l=Fu(s,i);if(l<0)return!1;var p=s.length-1;return l==p?s.pop():mu.call(s,l,1),--this.size,!0}function Yy(i){var s=this.__data__,l=Fu(s,i);return l<0?t:s[l][1]}function Qy(i){return Fu(this.__data__,i)>-1}function Jy(i,s){var l=this.__data__,p=Fu(l,i);return p<0?(++this.size,l.push([i,s])):l[p][1]=s,this}Fr.prototype.clear=Xy,Fr.prototype.delete=Ky,Fr.prototype.get=Yy,Fr.prototype.has=Qy,Fr.prototype.set=Jy;function Br(i){var s=-1,l=i==null?0:i.length;for(this.clear();++s<l;){var p=i[s];this.set(p[0],p[1])}}function jy(){this.size=0,this.__data__={hash:new Fi,map:new(ts||Fr),string:new Fi}}function zy(i){var s=Mu(this,i).delete(i);return this.size-=s?1:0,s}function ex(i){return Mu(this,i).get(i)}function tx(i){return Mu(this,i).has(i)}function nx(i,s){var l=Mu(this,i),p=l.size;return l.set(i,s),this.size+=l.size==p?0:1,this}Br.prototype.clear=jy,Br.prototype.delete=zy,Br.prototype.get=ex,Br.prototype.has=tx,Br.prototype.set=nx;function Bi(i){var s=-1,l=i==null?0:i.length;for(this.__data__=new Br;++s<l;)this.add(i[s])}function rx(i){return this.__data__.set(i,v),this}function ix(i){return this.__data__.has(i)}Bi.prototype.add=Bi.prototype.push=rx,Bi.prototype.has=ix;function Qn(i){var s=this.__data__=new Fr(i);this.size=s.size}function ax(){this.__data__=new Fr,this.size=0}function sx(i){var s=this.__data__,l=s.delete(i);return this.size=s.size,l}function ux(i){return this.__data__.get(i)}function ox(i){return this.__data__.has(i)}function fx(i,s){var l=this.__data__;if(l instanceof Fr){var p=l.__data__;if(!ts||p.length<o-1)return p.push([i,s]),this.size=++l.size,this;l=this.__data__=new Br(p)}return l.set(i,s),this.size=l.size,this}Qn.prototype.clear=ax,Qn.prototype.delete=sx,Qn.prototype.get=ux,Qn.prototype.has=ox,Qn.prototype.set=fx;function O1(i,s){var l=Ie(i),p=!l&&Ri(i),x=!l&&!p&&ni(i),B=!l&&!p&&!x&&pa(i),O=l||p||x||B,U=O?Hf(i.length,by):[],V=U.length;for(var j in i)(s||nt.call(i,j))&&!(O&&(j=="length"||x&&(j=="offset"||j=="parent")||B&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Tr(j,V)))&&U.push(j);return U}function P1(i){var s=i.length;return s?i[ul(0,s-1)]:t}function lx(i,s){return Uu(an(i),Si(s,0,i.length))}function hx(i){return Uu(an(i))}function Jf(i,s,l){(l!==t&&!Jn(i[s],l)||l===t&&!(s in i))&&Sr(i,s,l)}function as(i,s,l){var p=i[s];(!(nt.call(i,s)&&Jn(p,l))||l===t&&!(s in i))&&Sr(i,s,l)}function Fu(i,s){for(var l=i.length;l--;)if(Jn(i[l][0],s))return l;return-1}function cx(i,s,l,p){return jr(i,function(x,B,O){s(p,x,l(x),O)}),p}function M1(i,s){return i&&cr(s,Ut(s),i)}function dx(i,s){return i&&cr(s,un(s),i)}function Sr(i,s,l){s=="__proto__"&&Du?Du(i,s,{configurable:!0,enumerable:!0,value:l,writable:!0}):i[s]=l}function jf(i,s){for(var l=-1,p=s.length,x=K(p),B=i==null;++l<p;)x[l]=B?t:Tl(i,s[l]);return x}function Si(i,s,l){return i===i&&(l!==t&&(i=i<=l?i:l),s!==t&&(i=i>=s?i:s)),i}function Ln(i,s,l,p,x,B){var O,U=s&D,V=s&y,j=s&m;if(l&&(O=x?l(i,p,x,B):l(i)),O!==t)return O;if(!Et(i))return i;var z=Ie(i);if(z){if(O=t8(i),!U)return an(i,O)}else{var te=Vt(i),ie=te==Oe||te==Ye;if(ni(i))return fp(i,U);if(te==ze||te==ve||ie&&!x){if(O=V||ie?{}:Bp(i),!U)return V?Hx(i,dx(O,i)):Gx(i,M1(O,i))}else{if(!lt[te])return x?i:{};O=n8(i,te,U)}}B||(B=new Qn);var ce=B.get(i);if(ce)return ce;B.set(i,O),rg(i)?i.forEach(function(xe){O.add(Ln(xe,s,l,xe,i,B))}):tg(i)&&i.forEach(function(xe,Pe){O.set(Pe,Ln(xe,s,l,Pe,i,B))});var ye=j?V?wl:vl:V?un:Ut,$e=z?t:ye(i);return Rn($e||i,function(xe,Pe){$e&&(Pe=xe,xe=i[Pe]),as(O,Pe,Ln(xe,s,l,Pe,i,B))}),O}function px(i){var s=Ut(i);return function(l){return U1(l,i,s)}}function U1(i,s,l){var p=l.length;if(i==null)return!p;for(i=it(i);p--;){var x=l[p],B=s[x],O=i[x];if(O===t&&!(x in i)||!B(O))return!1}return!0}function W1(i,s,l){if(typeof i!="function")throw new Nn(f);return cs(function(){i.apply(t,l)},s)}function ss(i,s,l,p){var x=-1,B=lu,O=!0,U=i.length,V=[],j=s.length;if(!U)return V;l&&(s=Dt(s,dn(l))),p?(B=Pf,O=!1):s.length>=o&&(B=za,O=!1,s=new Bi(s));e:for(;++x<U;){var z=i[x],te=l==null?z:l(z);if(z=p||z!==0?z:0,O&&te===te){for(var ie=j;ie--;)if(s[ie]===te)continue e;V.push(z)}else B(s,te,p)||V.push(z)}return V}var jr=pp(hr),q1=pp(el,!0);function gx(i,s){var l=!0;return jr(i,function(p,x,B){return l=!!s(p,x,B),l}),l}function Bu(i,s,l){for(var p=-1,x=i.length;++p<x;){var B=i[p],O=s(B);if(O!=null&&(U===t?O===O&&!gn(O):l(O,U)))var U=O,V=B}return V}function _x(i,s,l,p){var x=i.length;for(l=Re(l),l<0&&(l=-l>x?0:x+l),p=p===t||p>x?x:Re(p),p<0&&(p+=x),p=l>p?0:ag(p);l<p;)i[l++]=s;return i}function G1(i,s){var l=[];return jr(i,function(p,x,B){s(p,x,B)&&l.push(p)}),l}function Ht(i,s,l,p,x){var B=-1,O=i.length;for(l||(l=i8),x||(x=[]);++B<O;){var U=i[B];s>0&&l(U)?s>1?Ht(U,s-1,l,p,x):Yr(x,U):p||(x[x.length]=U)}return x}var zf=gp(),H1=gp(!0);function hr(i,s){return i&&zf(i,s,Ut)}function el(i,s){return i&&H1(i,s,Ut)}function Su(i,s){return Kr(s,function(l){return Rr(i[l])})}function Ii(i,s){s=ei(s,i);for(var l=0,p=s.length;i!=null&&l<p;)i=i[dr(s[l++])];return l&&l==p?i:t}function Z1(i,s,l){var p=s(i);return Ie(i)?p:Yr(p,l(i))}function Jt(i){return i==null?i===t?xt:Ce:Ai&&Ai in it(i)?jx(i):h8(i)}function tl(i,s){return i>s}function vx(i,s){return i!=null&&nt.call(i,s)}function wx(i,s){return i!=null&&s in it(i)}function bx(i,s,l){return i>=Zt(s,l)&&i<Pt(s,l)}function nl(i,s,l){for(var p=l?Pf:lu,x=i[0].length,B=i.length,O=B,U=K(B),V=1/0,j=[];O--;){var z=i[O];O&&s&&(z=Dt(z,dn(s))),V=Zt(z.length,V),U[O]=!l&&(s||x>=120&&z.length>=120)?new Bi(O&&z):t}z=i[0];var te=-1,ie=U[0];e:for(;++te<x&&j.length<V;){var ce=z[te],ye=s?s(ce):ce;if(ce=l||ce!==0?ce:0,!(ie?za(ie,ye):p(j,ye,l))){for(O=B;--O;){var $e=U[O];if(!($e?za($e,ye):p(i[O],ye,l)))continue e}ie&&ie.push(ye),j.push(ce)}}return j}function mx(i,s,l,p){return hr(i,function(x,B,O){s(p,l(x),B,O)}),p}function us(i,s,l){s=ei(s,i),i=Tp(i,s);var p=i==null?i:i[dr(Pn(s))];return p==null?t:cn(p,i,l)}function V1(i){return Bt(i)&&Jt(i)==ve}function Dx(i){return Bt(i)&&Jt(i)==Ft}function yx(i){return Bt(i)&&Jt(i)==Fe}function os(i,s,l,p,x){return i===s?!0:i==null||s==null||!Bt(i)&&!Bt(s)?i!==i&&s!==s:xx(i,s,l,p,os,x)}function xx(i,s,l,p,x,B){var O=Ie(i),U=Ie(s),V=O?qe:Vt(i),j=U?qe:Vt(s);V=V==ve?ze:V,j=j==ve?ze:j;var z=V==ze,te=j==ze,ie=V==j;if(ie&&ni(i)){if(!ni(s))return!1;O=!0,z=!1}if(ie&&!z)return B||(B=new Qn),O||pa(i)?Cp(i,s,l,p,x,B):Qx(i,s,V,l,p,x,B);if(!(l&I)){var ce=z&&nt.call(i,"__wrapped__"),ye=te&&nt.call(s,"__wrapped__");if(ce||ye){var $e=ce?i.value():i,xe=ye?s.value():s;return B||(B=new Qn),x($e,xe,l,p,B)}}return ie?(B||(B=new Qn),Jx(i,s,l,p,x,B)):!1}function Ex(i){return Bt(i)&&Vt(i)==we}function rl(i,s,l,p){var x=l.length,B=x,O=!p;if(i==null)return!B;for(i=it(i);x--;){var U=l[x];if(O&&U[2]?U[1]!==i[U[0]]:!(U[0]in i))return!1}for(;++x<B;){U=l[x];var V=U[0],j=i[V],z=U[1];if(O&&U[2]){if(j===t&&!(V in i))return!1}else{var te=new Qn;if(p)var ie=p(j,z,V,i,s,te);if(!(ie===t?os(z,j,I|S,p,te):ie))return!1}}return!0}function X1(i){if(!Et(i)||s8(i))return!1;var s=Rr(i)?Ey:pD;return s.test(Ti(i))}function Cx(i){return Bt(i)&&Jt(i)==At}function Ax(i){return Bt(i)&&Vt(i)==vt}function Fx(i){return Bt(i)&&Vu(i.length)&&!!pt[Jt(i)]}function K1(i){return typeof i=="function"?i:i==null?on:typeof i=="object"?Ie(i)?J1(i[0],i[1]):Q1(i):_g(i)}function il(i){if(!hs(i))return Iy(i);var s=[];for(var l in it(i))nt.call(i,l)&&l!="constructor"&&s.push(l);return s}function Bx(i){if(!Et(i))return l8(i);var s=hs(i),l=[];for(var p in i)p=="constructor"&&(s||!nt.call(i,p))||l.push(p);return l}function al(i,s){return i<s}function Y1(i,s){var l=-1,p=sn(i)?K(i.length):[];return jr(i,function(x,B,O){p[++l]=s(x,B,O)}),p}function Q1(i){var s=ml(i);return s.length==1&&s[0][2]?Ip(s[0][0],s[0][1]):function(l){return l===i||rl(l,i,s)}}function J1(i,s){return yl(i)&&Sp(s)?Ip(dr(i),s):function(l){var p=Tl(l,i);return p===t&&p===s?Rl(l,i):os(s,p,I|S)}}function Iu(i,s,l,p,x){i!==s&&zf(s,function(B,O){if(x||(x=new Qn),Et(B))Sx(i,s,O,l,Iu,p,x);else{var U=p?p(El(i,O),B,O+"",i,s,x):t;U===t&&(U=B),Jf(i,O,U)}},un)}function Sx(i,s,l,p,x,B,O){var U=El(i,l),V=El(s,l),j=O.get(V);if(j){Jf(i,l,j);return}var z=B?B(U,V,l+"",i,s,O):t,te=z===t;if(te){var ie=Ie(V),ce=!ie&&ni(V),ye=!ie&&!ce&&pa(V);z=V,ie||ce||ye?Ie(U)?z=U:Tt(U)?z=an(U):ce?(te=!1,z=fp(V,!0)):ye?(te=!1,z=lp(V,!0)):z=[]:ds(V)||Ri(V)?(z=U,Ri(U)?z=sg(U):(!Et(U)||Rr(U))&&(z=Bp(V))):te=!1}te&&(O.set(V,z),x(z,V,p,B,O),O.delete(V)),Jf(i,l,z)}function j1(i,s){var l=i.length;if(l)return s+=s<0?l:0,Tr(s,l)?i[s]:t}function z1(i,s,l){s.length?s=Dt(s,function(B){return Ie(B)?function(O){return Ii(O,B.length===1?B[0]:B)}:B}):s=[on];var p=-1;s=Dt(s,dn(me()));var x=Y1(i,function(B,O,U){var V=Dt(s,function(j){return j(B)});return{criteria:V,index:++p,value:B}});return ny(x,function(B,O){return qx(B,O,l)})}function Ix(i,s){return ep(i,s,function(l,p){return Rl(i,p)})}function ep(i,s,l){for(var p=-1,x=s.length,B={};++p<x;){var O=s[p],U=Ii(i,O);l(U,O)&&fs(B,ei(O,i),U)}return B}function kx(i){return function(s){return Ii(s,i)}}function sl(i,s,l,p){var x=p?ty:ra,B=-1,O=s.length,U=i;for(i===s&&(s=an(s)),l&&(U=Dt(i,dn(l)));++B<O;)for(var V=0,j=s[B],z=l?l(j):j;(V=x(U,z,V,p))>-1;)U!==i&&mu.call(U,V,1),mu.call(i,V,1);return i}function tp(i,s){for(var l=i?s.length:0,p=l-1;l--;){var x=s[l];if(l==p||x!==B){var B=x;Tr(x)?mu.call(i,x,1):ll(i,x)}}return i}function ul(i,s){return i+xu($1()*(s-i+1))}function Tx(i,s,l,p){for(var x=-1,B=Pt(yu((s-i)/(l||1)),0),O=K(B);B--;)O[p?B:++x]=i,i+=l;return O}function ol(i,s){var l="";if(!i||s<1||s>ge)return l;do s%2&&(l+=i),s=xu(s/2),s&&(i+=i);while(s);return l}function Le(i,s){return Cl(kp(i,s,on),i+"")}function Rx(i){return P1(ga(i))}function Nx(i,s){var l=ga(i);return Uu(l,Si(s,0,l.length))}function fs(i,s,l,p){if(!Et(i))return i;s=ei(s,i);for(var x=-1,B=s.length,O=B-1,U=i;U!=null&&++x<B;){var V=dr(s[x]),j=l;if(V==="__proto__"||V==="constructor"||V==="prototype")return i;if(x!=O){var z=U[V];j=p?p(z,V,U):t,j===t&&(j=Et(z)?z:Tr(s[x+1])?[]:{})}as(U,V,j),U=U[V]}return i}var np=Eu?function(i,s){return Eu.set(i,s),i}:on,$x=Du?function(i,s){return Du(i,"toString",{configurable:!0,enumerable:!1,value:$l(s),writable:!0})}:on;function Lx(i){return Uu(ga(i))}function On(i,s,l){var p=-1,x=i.length;s<0&&(s=-s>x?0:x+s),l=l>x?x:l,l<0&&(l+=x),x=s>l?0:l-s>>>0,s>>>=0;for(var B=K(x);++p<x;)B[p]=i[p+s];return B}function Ox(i,s){var l;return jr(i,function(p,x,B){return l=s(p,x,B),!l}),!!l}function ku(i,s,l){var p=0,x=i==null?p:i.length;if(typeof s=="number"&&s===s&&x<=fe){for(;p<x;){var B=p+x>>>1,O=i[B];O!==null&&!gn(O)&&(l?O<=s:O<s)?p=B+1:x=B}return x}return fl(i,s,on,l)}function fl(i,s,l,p){var x=0,B=i==null?0:i.length;if(B===0)return 0;s=l(s);for(var O=s!==s,U=s===null,V=gn(s),j=s===t;x<B;){var z=xu((x+B)/2),te=l(i[z]),ie=te!==t,ce=te===null,ye=te===te,$e=gn(te);if(O)var xe=p||ye;else j?xe=ye&&(p||ie):U?xe=ye&&ie&&(p||!ce):V?xe=ye&&ie&&!ce&&(p||!$e):ce||$e?xe=!1:xe=p?te<=s:te<s;xe?x=z+1:B=z}return Zt(B,ue)}function rp(i,s){for(var l=-1,p=i.length,x=0,B=[];++l<p;){var O=i[l],U=s?s(O):O;if(!l||!Jn(U,V)){var V=U;B[x++]=O===0?0:O}}return B}function ip(i){return typeof i=="number"?i:gn(i)?Xe:+i}function pn(i){if(typeof i=="string")return i;if(Ie(i))return Dt(i,pn)+"";if(gn(i))return L1?L1.call(i):"";var s=i+"";return s=="0"&&1/i==-ae?"-0":s}function zr(i,s,l){var p=-1,x=lu,B=i.length,O=!0,U=[],V=U;if(l)O=!1,x=Pf;else if(B>=o){var j=s?null:Kx(i);if(j)return cu(j);O=!1,x=za,V=new Bi}else V=s?[]:U;e:for(;++p<B;){var z=i[p],te=s?s(z):z;if(z=l||z!==0?z:0,O&&te===te){for(var ie=V.length;ie--;)if(V[ie]===te)continue e;s&&V.push(te),U.push(z)}else x(V,te,l)||(V!==U&&V.push(te),U.push(z))}return U}function ll(i,s){return s=ei(s,i),i=Tp(i,s),i==null||delete i[dr(Pn(s))]}function ap(i,s,l,p){return fs(i,s,l(Ii(i,s)),p)}function Tu(i,s,l,p){for(var x=i.length,B=p?x:-1;(p?B--:++B<x)&&s(i[B],B,i););return l?On(i,p?0:B,p?B+1:x):On(i,p?B+1:0,p?x:B)}function sp(i,s){var l=i;return l instanceof Ue&&(l=l.value()),Mf(s,function(p,x){return x.func.apply(x.thisArg,Yr([p],x.args))},l)}function hl(i,s,l){var p=i.length;if(p<2)return p?zr(i[0]):[];for(var x=-1,B=K(p);++x<p;)for(var O=i[x],U=-1;++U<p;)U!=x&&(B[x]=ss(B[x]||O,i[U],s,l));return zr(Ht(B,1),s,l)}function up(i,s,l){for(var p=-1,x=i.length,B=s.length,O={};++p<x;){var U=p<B?s[p]:t;l(O,i[p],U)}return O}function cl(i){return Tt(i)?i:[]}function dl(i){return typeof i=="function"?i:on}function ei(i,s){return Ie(i)?i:yl(i,s)?[i]:Lp(tt(i))}var Px=Le;function ti(i,s,l){var p=i.length;return l=l===t?p:l,!s&&l>=p?i:On(i,s,l)}var op=Cy||function(i){return Gt.clearTimeout(i)};function fp(i,s){if(s)return i.slice();var l=i.length,p=I1?I1(l):new i.constructor(l);return i.copy(p),p}function pl(i){var s=new i.constructor(i.byteLength);return new wu(s).set(new wu(i)),s}function Mx(i,s){var l=s?pl(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.byteLength)}function Ux(i){var s=new i.constructor(i.source,Vd.exec(i));return s.lastIndex=i.lastIndex,s}function Wx(i){return is?it(is.call(i)):{}}function lp(i,s){var l=s?pl(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.length)}function hp(i,s){if(i!==s){var l=i!==t,p=i===null,x=i===i,B=gn(i),O=s!==t,U=s===null,V=s===s,j=gn(s);if(!U&&!j&&!B&&i>s||B&&O&&V&&!U&&!j||p&&O&&V||!l&&V||!x)return 1;if(!p&&!B&&!j&&i<s||j&&l&&x&&!p&&!B||U&&l&&x||!O&&x||!V)return-1}return 0}function qx(i,s,l){for(var p=-1,x=i.criteria,B=s.criteria,O=x.length,U=l.length;++p<O;){var V=hp(x[p],B[p]);if(V){if(p>=U)return V;var j=l[p];return V*(j=="desc"?-1:1)}}return i.index-s.index}function cp(i,s,l,p){for(var x=-1,B=i.length,O=l.length,U=-1,V=s.length,j=Pt(B-O,0),z=K(V+j),te=!p;++U<V;)z[U]=s[U];for(;++x<O;)(te||x<B)&&(z[l[x]]=i[x]);for(;j--;)z[U++]=i[x++];return z}function dp(i,s,l,p){for(var x=-1,B=i.length,O=-1,U=l.length,V=-1,j=s.length,z=Pt(B-U,0),te=K(z+j),ie=!p;++x<z;)te[x]=i[x];for(var ce=x;++V<j;)te[ce+V]=s[V];for(;++O<U;)(ie||x<B)&&(te[ce+l[O]]=i[x++]);return te}function an(i,s){var l=-1,p=i.length;for(s||(s=K(p));++l<p;)s[l]=i[l];return s}function cr(i,s,l,p){var x=!l;l||(l={});for(var B=-1,O=s.length;++B<O;){var U=s[B],V=p?p(l[U],i[U],U,l,i):t;V===t&&(V=i[U]),x?Sr(l,U,V):as(l,U,V)}return l}function Gx(i,s){return cr(i,Dl(i),s)}function Hx(i,s){return cr(i,Ap(i),s)}function Ru(i,s){return function(l,p){var x=Ie(l)?YD:cx,B=s?s():{};return x(l,i,me(p,2),B)}}function ha(i){return Le(function(s,l){var p=-1,x=l.length,B=x>1?l[x-1]:t,O=x>2?l[2]:t;for(B=i.length>3&&typeof B=="function"?(x--,B):t,O&&jt(l[0],l[1],O)&&(B=x<3?t:B,x=1),s=it(s);++p<x;){var U=l[p];U&&i(s,U,p,B)}return s})}function pp(i,s){return function(l,p){if(l==null)return l;if(!sn(l))return i(l,p);for(var x=l.length,B=s?x:-1,O=it(l);(s?B--:++B<x)&&p(O[B],B,O)!==!1;);return l}}function gp(i){return function(s,l,p){for(var x=-1,B=it(s),O=p(s),U=O.length;U--;){var V=O[i?U:++x];if(l(B[V],V,B)===!1)break}return s}}function Zx(i,s,l){var p=s&T,x=ls(i);function B(){var O=this&&this!==Gt&&this instanceof B?x:i;return O.apply(p?l:this,arguments)}return B}function _p(i){return function(s){s=tt(s);var l=ia(s)?Yn(s):t,p=l?l[0]:s.charAt(0),x=l?ti(l,1).join(""):s.slice(1);return p[i]()+x}}function ca(i){return function(s){return Mf(pg(dg(s).replace($D,"")),i,"")}}function ls(i){return function(){var s=arguments;switch(s.length){case 0:return new i;case 1:return new i(s[0]);case 2:return new i(s[0],s[1]);case 3:return new i(s[0],s[1],s[2]);case 4:return new i(s[0],s[1],s[2],s[3]);case 5:return new i(s[0],s[1],s[2],s[3],s[4]);case 6:return new i(s[0],s[1],s[2],s[3],s[4],s[5]);case 7:return new i(s[0],s[1],s[2],s[3],s[4],s[5],s[6])}var l=la(i.prototype),p=i.apply(l,s);return Et(p)?p:l}}function Vx(i,s,l){var p=ls(i);function x(){for(var B=arguments.length,O=K(B),U=B,V=da(x);U--;)O[U]=arguments[U];var j=B<3&&O[0]!==V&&O[B-1]!==V?[]:Qr(O,V);if(B-=j.length,B<l)return Dp(i,s,Nu,x.placeholder,t,O,j,t,t,l-B);var z=this&&this!==Gt&&this instanceof x?p:i;return cn(z,this,O)}return x}function vp(i){return function(s,l,p){var x=it(s);if(!sn(s)){var B=me(l,3);s=Ut(s),l=function(U){return B(x[U],U,x)}}var O=i(s,l,p);return O>-1?x[B?s[O]:O]:t}}function wp(i){return kr(function(s){var l=s.length,p=l,x=$n.prototype.thru;for(i&&s.reverse();p--;){var B=s[p];if(typeof B!="function")throw new Nn(f);if(x&&!O&&Pu(B)=="wrapper")var O=new $n([],!0)}for(p=O?p:l;++p<l;){B=s[p];var U=Pu(B),V=U=="wrapper"?bl(B):t;V&&xl(V[0])&&V[1]==($|P|M|A)&&!V[4].length&&V[9]==1?O=O[Pu(V[0])].apply(O,V[3]):O=B.length==1&&xl(B)?O[U]():O.thru(B)}return function(){var j=arguments,z=j[0];if(O&&j.length==1&&Ie(z))return O.plant(z).value();for(var te=0,ie=l?s[te].apply(this,j):z;++te<l;)ie=s[te].call(this,ie);return ie}})}function Nu(i,s,l,p,x,B,O,U,V,j){var z=s&$,te=s&T,ie=s&N,ce=s&(P|k),ye=s&F,$e=ie?t:ls(i);function xe(){for(var Pe=arguments.length,Ge=K(Pe),_n=Pe;_n--;)Ge[_n]=arguments[_n];if(ce)var zt=da(xe),vn=iy(Ge,zt);if(p&&(Ge=cp(Ge,p,x,ce)),B&&(Ge=dp(Ge,B,O,ce)),Pe-=vn,ce&&Pe<j){var Rt=Qr(Ge,zt);return Dp(i,s,Nu,xe.placeholder,l,Ge,Rt,U,V,j-Pe)}var jn=te?l:this,$r=ie?jn[i]:i;return Pe=Ge.length,U?Ge=c8(Ge,U):ye&&Pe>1&&Ge.reverse(),z&&V<Pe&&(Ge.length=V),this&&this!==Gt&&this instanceof xe&&($r=$e||ls($r)),$r.apply(jn,Ge)}return xe}function bp(i,s){return function(l,p){return mx(l,i,s(p),{})}}function $u(i,s){return function(l,p){var x;if(l===t&&p===t)return s;if(l!==t&&(x=l),p!==t){if(x===t)return p;typeof l=="string"||typeof p=="string"?(l=pn(l),p=pn(p)):(l=ip(l),p=ip(p)),x=i(l,p)}return x}}function gl(i){return kr(function(s){return s=Dt(s,dn(me())),Le(function(l){var p=this;return i(s,function(x){return cn(x,p,l)})})})}function Lu(i,s){s=s===t?" ":pn(s);var l=s.length;if(l<2)return l?ol(s,i):s;var p=ol(s,yu(i/aa(s)));return ia(s)?ti(Yn(p),0,i).join(""):p.slice(0,i)}function Xx(i,s,l,p){var x=s&T,B=ls(i);function O(){for(var U=-1,V=arguments.length,j=-1,z=p.length,te=K(z+V),ie=this&&this!==Gt&&this instanceof O?B:i;++j<z;)te[j]=p[j];for(;V--;)te[j++]=arguments[++U];return cn(ie,x?l:this,te)}return O}function mp(i){return function(s,l,p){return p&&typeof p!="number"&&jt(s,l,p)&&(l=p=t),s=Nr(s),l===t?(l=s,s=0):l=Nr(l),p=p===t?s<l?1:-1:Nr(p),Tx(s,l,p,i)}}function Ou(i){return function(s,l){return typeof s=="string"&&typeof l=="string"||(s=Mn(s),l=Mn(l)),i(s,l)}}function Dp(i,s,l,p,x,B,O,U,V,j){var z=s&P,te=z?O:t,ie=z?t:O,ce=z?B:t,ye=z?t:B;s|=z?M:q,s&=~(z?q:M),s&Z||(s&=-4);var $e=[i,s,x,ce,te,ye,ie,U,V,j],xe=l.apply(t,$e);return xl(i)&&Rp(xe,$e),xe.placeholder=p,Np(xe,i,s)}function _l(i){var s=Ot[i];return function(l,p){if(l=Mn(l),p=p==null?0:Zt(Re(p),292),p&&N1(l)){var x=(tt(l)+"e").split("e"),B=s(x[0]+"e"+(+x[1]+p));return x=(tt(B)+"e").split("e"),+(x[0]+"e"+(+x[1]-p))}return s(l)}}var Kx=oa&&1/cu(new oa([,-0]))[1]==ae?function(i){return new oa(i)}:Pl;function yp(i){return function(s){var l=Vt(s);return l==we?Vf(s):l==vt?hy(s):ry(s,i(s))}}function Ir(i,s,l,p,x,B,O,U){var V=s&N;if(!V&&typeof i!="function")throw new Nn(f);var j=p?p.length:0;if(j||(s&=-97,p=x=t),O=O===t?O:Pt(Re(O),0),U=U===t?U:Re(U),j-=x?x.length:0,s&q){var z=p,te=x;p=x=t}var ie=V?t:bl(i),ce=[i,s,l,p,x,z,te,B,O,U];if(ie&&f8(ce,ie),i=ce[0],s=ce[1],l=ce[2],p=ce[3],x=ce[4],U=ce[9]=ce[9]===t?V?0:i.length:Pt(ce[9]-j,0),!U&&s&(P|k)&&(s&=-25),!s||s==T)var ye=Zx(i,s,l);else s==P||s==k?ye=Vx(i,s,U):(s==M||s==(T|M))&&!x.length?ye=Xx(i,s,l,p):ye=Nu.apply(t,ce);var $e=ie?np:Rp;return Np($e(ye,ce),i,s)}function xp(i,s,l,p){return i===t||Jn(i,ua[l])&&!nt.call(p,l)?s:i}function Ep(i,s,l,p,x,B){return Et(i)&&Et(s)&&(B.set(s,i),Iu(i,s,t,Ep,B),B.delete(s)),i}function Yx(i){return ds(i)?t:i}function Cp(i,s,l,p,x,B){var O=l&I,U=i.length,V=s.length;if(U!=V&&!(O&&V>U))return!1;var j=B.get(i),z=B.get(s);if(j&&z)return j==s&&z==i;var te=-1,ie=!0,ce=l&S?new Bi:t;for(B.set(i,s),B.set(s,i);++te<U;){var ye=i[te],$e=s[te];if(p)var xe=O?p($e,ye,te,s,i,B):p(ye,$e,te,i,s,B);if(xe!==t){if(xe)continue;ie=!1;break}if(ce){if(!Uf(s,function(Pe,Ge){if(!za(ce,Ge)&&(ye===Pe||x(ye,Pe,l,p,B)))return ce.push(Ge)})){ie=!1;break}}else if(!(ye===$e||x(ye,$e,l,p,B))){ie=!1;break}}return B.delete(i),B.delete(s),ie}function Qx(i,s,l,p,x,B,O){switch(l){case dt:if(i.byteLength!=s.byteLength||i.byteOffset!=s.byteOffset)return!1;i=i.buffer,s=s.buffer;case Ft:return!(i.byteLength!=s.byteLength||!B(new wu(i),new wu(s)));case be:case Fe:case Ae:return Jn(+i,+s);case he:return i.name==s.name&&i.message==s.message;case At:case yt:return i==s+"";case we:var U=Vf;case vt:var V=p&I;if(U||(U=cu),i.size!=s.size&&!V)return!1;var j=O.get(i);if(j)return j==s;p|=S,O.set(i,s);var z=Cp(U(i),U(s),p,x,B,O);return O.delete(i),z;case Qt:if(is)return is.call(i)==is.call(s)}return!1}function Jx(i,s,l,p,x,B){var O=l&I,U=vl(i),V=U.length,j=vl(s),z=j.length;if(V!=z&&!O)return!1;for(var te=V;te--;){var ie=U[te];if(!(O?ie in s:nt.call(s,ie)))return!1}var ce=B.get(i),ye=B.get(s);if(ce&&ye)return ce==s&&ye==i;var $e=!0;B.set(i,s),B.set(s,i);for(var xe=O;++te<V;){ie=U[te];var Pe=i[ie],Ge=s[ie];if(p)var _n=O?p(Ge,Pe,ie,s,i,B):p(Pe,Ge,ie,i,s,B);if(!(_n===t?Pe===Ge||x(Pe,Ge,l,p,B):_n)){$e=!1;break}xe||(xe=ie=="constructor")}if($e&&!xe){var zt=i.constructor,vn=s.constructor;zt!=vn&&"constructor"in i&&"constructor"in s&&!(typeof zt=="function"&&zt instanceof zt&&typeof vn=="function"&&vn instanceof vn)&&($e=!1)}return B.delete(i),B.delete(s),$e}function kr(i){return Cl(kp(i,t,Up),i+"")}function vl(i){return Z1(i,Ut,Dl)}function wl(i){return Z1(i,un,Ap)}var bl=Eu?function(i){return Eu.get(i)}:Pl;function Pu(i){for(var s=i.name+"",l=fa[s],p=nt.call(fa,s)?l.length:0;p--;){var x=l[p],B=x.func;if(B==null||B==i)return x.name}return s}function da(i){var s=nt.call(C,"placeholder")?C:i;return s.placeholder}function me(){var i=C.iteratee||Ll;return i=i===Ll?K1:i,arguments.length?i(arguments[0],arguments[1]):i}function Mu(i,s){var l=i.__data__;return a8(s)?l[typeof s=="string"?"string":"hash"]:l.map}function ml(i){for(var s=Ut(i),l=s.length;l--;){var p=s[l],x=i[p];s[l]=[p,x,Sp(x)]}return s}function ki(i,s){var l=oy(i,s);return X1(l)?l:t}function jx(i){var s=nt.call(i,Ai),l=i[Ai];try{i[Ai]=t;var p=!0}catch{}var x=_u.call(i);return p&&(s?i[Ai]=l:delete i[Ai]),x}var Dl=Kf?function(i){return i==null?[]:(i=it(i),Kr(Kf(i),function(s){return T1.call(i,s)}))}:Ml,Ap=Kf?function(i){for(var s=[];i;)Yr(s,Dl(i)),i=bu(i);return s}:Ml,Vt=Jt;(Yf&&Vt(new Yf(new ArrayBuffer(1)))!=dt||ts&&Vt(new ts)!=we||Qf&&Vt(Qf.resolve())!=De||oa&&Vt(new oa)!=vt||ns&&Vt(new ns)!=rt)&&(Vt=function(i){var s=Jt(i),l=s==ze?i.constructor:t,p=l?Ti(l):"";if(p)switch(p){case Ny:return dt;case $y:return we;case Ly:return De;case Oy:return vt;case Py:return rt}return s});function zx(i,s,l){for(var p=-1,x=l.length;++p<x;){var B=l[p],O=B.size;switch(B.type){case"drop":i+=O;break;case"dropRight":s-=O;break;case"take":s=Zt(s,i+O);break;case"takeRight":i=Pt(i,s-O);break}}return{start:i,end:s}}function e8(i){var s=i.match(sD);return s?s[1].split(uD):[]}function Fp(i,s,l){s=ei(s,i);for(var p=-1,x=s.length,B=!1;++p<x;){var O=dr(s[p]);if(!(B=i!=null&&l(i,O)))break;i=i[O]}return B||++p!=x?B:(x=i==null?0:i.length,!!x&&Vu(x)&&Tr(O,x)&&(Ie(i)||Ri(i)))}function t8(i){var s=i.length,l=new i.constructor(s);return s&&typeof i[0]=="string"&&nt.call(i,"index")&&(l.index=i.index,l.input=i.input),l}function Bp(i){return typeof i.constructor=="function"&&!hs(i)?la(bu(i)):{}}function n8(i,s,l){var p=i.constructor;switch(s){case Ft:return pl(i);case be:case Fe:return new p(+i);case dt:return Mx(i,l);case Ar:case E:case _:case w:case R:case W:case X:case J:case Te:return lp(i,l);case we:return new p;case Ae:case yt:return new p(i);case At:return Ux(i);case vt:return new p;case Qt:return Wx(i)}}function r8(i,s){var l=s.length;if(!l)return i;var p=l-1;return s[p]=(l>1?"& ":"")+s[p],s=s.join(l>2?", ":" "),i.replace(aD,`{
9
+ /* [wrapped with `+s+`] */
10
+ `)}function i8(i){return Ie(i)||Ri(i)||!!(R1&&i&&i[R1])}function Tr(i,s){var l=typeof i;return s=s??ge,!!s&&(l=="number"||l!="symbol"&&_D.test(i))&&i>-1&&i%1==0&&i<s}function jt(i,s,l){if(!Et(l))return!1;var p=typeof s;return(p=="number"?sn(l)&&Tr(s,l.length):p=="string"&&s in l)?Jn(l[s],i):!1}function yl(i,s){if(Ie(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||gn(i)?!0:tD.test(i)||!eD.test(i)||s!=null&&i in it(s)}function a8(i){var s=typeof i;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?i!=="__proto__":i===null}function xl(i){var s=Pu(i),l=C[s];if(typeof l!="function"||!(s in Ue.prototype))return!1;if(i===l)return!0;var p=bl(l);return!!p&&i===p[0]}function s8(i){return!!S1&&S1 in i}var u8=pu?Rr:Ul;function hs(i){var s=i&&i.constructor,l=typeof s=="function"&&s.prototype||ua;return i===l}function Sp(i){return i===i&&!Et(i)}function Ip(i,s){return function(l){return l==null?!1:l[i]===s&&(s!==t||i in it(l))}}function o8(i){var s=Hu(i,function(p){return l.size===d&&l.clear(),p}),l=s.cache;return s}function f8(i,s){var l=i[1],p=s[1],x=l|p,B=x<(T|N|$),O=p==$&&l==P||p==$&&l==A&&i[7].length<=s[8]||p==($|A)&&s[7].length<=s[8]&&l==P;if(!(B||O))return i;p&T&&(i[2]=s[2],x|=l&T?0:Z);var U=s[3];if(U){var V=i[3];i[3]=V?cp(V,U,s[4]):U,i[4]=V?Qr(i[3],c):s[4]}return U=s[5],U&&(V=i[5],i[5]=V?dp(V,U,s[6]):U,i[6]=V?Qr(i[5],c):s[6]),U=s[7],U&&(i[7]=U),p&$&&(i[8]=i[8]==null?s[8]:Zt(i[8],s[8])),i[9]==null&&(i[9]=s[9]),i[0]=s[0],i[1]=x,i}function l8(i){var s=[];if(i!=null)for(var l in it(i))s.push(l);return s}function h8(i){return _u.call(i)}function kp(i,s,l){return s=Pt(s===t?i.length-1:s,0),function(){for(var p=arguments,x=-1,B=Pt(p.length-s,0),O=K(B);++x<B;)O[x]=p[s+x];x=-1;for(var U=K(s+1);++x<s;)U[x]=p[x];return U[s]=l(O),cn(i,this,U)}}function Tp(i,s){return s.length<2?i:Ii(i,On(s,0,-1))}function c8(i,s){for(var l=i.length,p=Zt(s.length,l),x=an(i);p--;){var B=s[p];i[p]=Tr(B,l)?x[B]:t}return i}function El(i,s){if(!(s==="constructor"&&typeof i[s]=="function")&&s!="__proto__")return i[s]}var Rp=$p(np),cs=Fy||function(i,s){return Gt.setTimeout(i,s)},Cl=$p($x);function Np(i,s,l){var p=s+"";return Cl(i,r8(p,d8(e8(p),l)))}function $p(i){var s=0,l=0;return function(){var p=ky(),x=ne-(p-l);if(l=p,x>0){if(++s>=Y)return arguments[0]}else s=0;return i.apply(t,arguments)}}function Uu(i,s){var l=-1,p=i.length,x=p-1;for(s=s===t?p:s;++l<s;){var B=ul(l,x),O=i[B];i[B]=i[l],i[l]=O}return i.length=s,i}var Lp=o8(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(nD,function(l,p,x,B){s.push(x?B.replace(lD,"$1"):p||l)}),s});function dr(i){if(typeof i=="string"||gn(i))return i;var s=i+"";return s=="0"&&1/i==-ae?"-0":s}function Ti(i){if(i!=null){try{return gu.call(i)}catch{}try{return i+""}catch{}}return""}function d8(i,s){return Rn(Ee,function(l){var p="_."+l[0];s&l[1]&&!lu(i,p)&&i.push(p)}),i.sort()}function Op(i){if(i instanceof Ue)return i.clone();var s=new $n(i.__wrapped__,i.__chain__);return s.__actions__=an(i.__actions__),s.__index__=i.__index__,s.__values__=i.__values__,s}function p8(i,s,l){(l?jt(i,s,l):s===t)?s=1:s=Pt(Re(s),0);var p=i==null?0:i.length;if(!p||s<1)return[];for(var x=0,B=0,O=K(yu(p/s));x<p;)O[B++]=On(i,x,x+=s);return O}function g8(i){for(var s=-1,l=i==null?0:i.length,p=0,x=[];++s<l;){var B=i[s];B&&(x[p++]=B)}return x}function _8(){var i=arguments.length;if(!i)return[];for(var s=K(i-1),l=arguments[0],p=i;p--;)s[p-1]=arguments[p];return Yr(Ie(l)?an(l):[l],Ht(s,1))}var v8=Le(function(i,s){return Tt(i)?ss(i,Ht(s,1,Tt,!0)):[]}),w8=Le(function(i,s){var l=Pn(s);return Tt(l)&&(l=t),Tt(i)?ss(i,Ht(s,1,Tt,!0),me(l,2)):[]}),b8=Le(function(i,s){var l=Pn(s);return Tt(l)&&(l=t),Tt(i)?ss(i,Ht(s,1,Tt,!0),t,l):[]});function m8(i,s,l){var p=i==null?0:i.length;return p?(s=l||s===t?1:Re(s),On(i,s<0?0:s,p)):[]}function D8(i,s,l){var p=i==null?0:i.length;return p?(s=l||s===t?1:Re(s),s=p-s,On(i,0,s<0?0:s)):[]}function y8(i,s){return i&&i.length?Tu(i,me(s,3),!0,!0):[]}function x8(i,s){return i&&i.length?Tu(i,me(s,3),!0):[]}function E8(i,s,l,p){var x=i==null?0:i.length;return x?(l&&typeof l!="number"&&jt(i,s,l)&&(l=0,p=x),_x(i,s,l,p)):[]}function Pp(i,s,l){var p=i==null?0:i.length;if(!p)return-1;var x=l==null?0:Re(l);return x<0&&(x=Pt(p+x,0)),hu(i,me(s,3),x)}function Mp(i,s,l){var p=i==null?0:i.length;if(!p)return-1;var x=p-1;return l!==t&&(x=Re(l),x=l<0?Pt(p+x,0):Zt(x,p-1)),hu(i,me(s,3),x,!0)}function Up(i){var s=i==null?0:i.length;return s?Ht(i,1):[]}function C8(i){var s=i==null?0:i.length;return s?Ht(i,ae):[]}function A8(i,s){var l=i==null?0:i.length;return l?(s=s===t?1:Re(s),Ht(i,s)):[]}function F8(i){for(var s=-1,l=i==null?0:i.length,p={};++s<l;){var x=i[s];p[x[0]]=x[1]}return p}function Wp(i){return i&&i.length?i[0]:t}function B8(i,s,l){var p=i==null?0:i.length;if(!p)return-1;var x=l==null?0:Re(l);return x<0&&(x=Pt(p+x,0)),ra(i,s,x)}function S8(i){var s=i==null?0:i.length;return s?On(i,0,-1):[]}var I8=Le(function(i){var s=Dt(i,cl);return s.length&&s[0]===i[0]?nl(s):[]}),k8=Le(function(i){var s=Pn(i),l=Dt(i,cl);return s===Pn(l)?s=t:l.pop(),l.length&&l[0]===i[0]?nl(l,me(s,2)):[]}),T8=Le(function(i){var s=Pn(i),l=Dt(i,cl);return s=typeof s=="function"?s:t,s&&l.pop(),l.length&&l[0]===i[0]?nl(l,t,s):[]});function R8(i,s){return i==null?"":Sy.call(i,s)}function Pn(i){var s=i==null?0:i.length;return s?i[s-1]:t}function N8(i,s,l){var p=i==null?0:i.length;if(!p)return-1;var x=p;return l!==t&&(x=Re(l),x=x<0?Pt(p+x,0):Zt(x,p-1)),s===s?dy(i,s,x):hu(i,D1,x,!0)}function $8(i,s){return i&&i.length?j1(i,Re(s)):t}var L8=Le(qp);function qp(i,s){return i&&i.length&&s&&s.length?sl(i,s):i}function O8(i,s,l){return i&&i.length&&s&&s.length?sl(i,s,me(l,2)):i}function P8(i,s,l){return i&&i.length&&s&&s.length?sl(i,s,t,l):i}var M8=kr(function(i,s){var l=i==null?0:i.length,p=jf(i,s);return tp(i,Dt(s,function(x){return Tr(x,l)?+x:x}).sort(hp)),p});function U8(i,s){var l=[];if(!(i&&i.length))return l;var p=-1,x=[],B=i.length;for(s=me(s,3);++p<B;){var O=i[p];s(O,p,i)&&(l.push(O),x.push(p))}return tp(i,x),l}function Al(i){return i==null?i:Ry.call(i)}function W8(i,s,l){var p=i==null?0:i.length;return p?(l&&typeof l!="number"&&jt(i,s,l)?(s=0,l=p):(s=s==null?0:Re(s),l=l===t?p:Re(l)),On(i,s,l)):[]}function q8(i,s){return ku(i,s)}function G8(i,s,l){return fl(i,s,me(l,2))}function H8(i,s){var l=i==null?0:i.length;if(l){var p=ku(i,s);if(p<l&&Jn(i[p],s))return p}return-1}function Z8(i,s){return ku(i,s,!0)}function V8(i,s,l){return fl(i,s,me(l,2),!0)}function X8(i,s){var l=i==null?0:i.length;if(l){var p=ku(i,s,!0)-1;if(Jn(i[p],s))return p}return-1}function K8(i){return i&&i.length?rp(i):[]}function Y8(i,s){return i&&i.length?rp(i,me(s,2)):[]}function Q8(i){var s=i==null?0:i.length;return s?On(i,1,s):[]}function J8(i,s,l){return i&&i.length?(s=l||s===t?1:Re(s),On(i,0,s<0?0:s)):[]}function j8(i,s,l){var p=i==null?0:i.length;return p?(s=l||s===t?1:Re(s),s=p-s,On(i,s<0?0:s,p)):[]}function z8(i,s){return i&&i.length?Tu(i,me(s,3),!1,!0):[]}function eE(i,s){return i&&i.length?Tu(i,me(s,3)):[]}var tE=Le(function(i){return zr(Ht(i,1,Tt,!0))}),nE=Le(function(i){var s=Pn(i);return Tt(s)&&(s=t),zr(Ht(i,1,Tt,!0),me(s,2))}),rE=Le(function(i){var s=Pn(i);return s=typeof s=="function"?s:t,zr(Ht(i,1,Tt,!0),t,s)});function iE(i){return i&&i.length?zr(i):[]}function aE(i,s){return i&&i.length?zr(i,me(s,2)):[]}function sE(i,s){return s=typeof s=="function"?s:t,i&&i.length?zr(i,t,s):[]}function Fl(i){if(!(i&&i.length))return[];var s=0;return i=Kr(i,function(l){if(Tt(l))return s=Pt(l.length,s),!0}),Hf(s,function(l){return Dt(i,Wf(l))})}function Gp(i,s){if(!(i&&i.length))return[];var l=Fl(i);return s==null?l:Dt(l,function(p){return cn(s,t,p)})}var uE=Le(function(i,s){return Tt(i)?ss(i,s):[]}),oE=Le(function(i){return hl(Kr(i,Tt))}),fE=Le(function(i){var s=Pn(i);return Tt(s)&&(s=t),hl(Kr(i,Tt),me(s,2))}),lE=Le(function(i){var s=Pn(i);return s=typeof s=="function"?s:t,hl(Kr(i,Tt),t,s)}),hE=Le(Fl);function cE(i,s){return up(i||[],s||[],as)}function dE(i,s){return up(i||[],s||[],fs)}var pE=Le(function(i){var s=i.length,l=s>1?i[s-1]:t;return l=typeof l=="function"?(i.pop(),l):t,Gp(i,l)});function Hp(i){var s=C(i);return s.__chain__=!0,s}function gE(i,s){return s(i),i}function Wu(i,s){return s(i)}var _E=kr(function(i){var s=i.length,l=s?i[0]:0,p=this.__wrapped__,x=function(B){return jf(B,i)};return s>1||this.__actions__.length||!(p instanceof Ue)||!Tr(l)?this.thru(x):(p=p.slice(l,+l+(s?1:0)),p.__actions__.push({func:Wu,args:[x],thisArg:t}),new $n(p,this.__chain__).thru(function(B){return s&&!B.length&&B.push(t),B}))});function vE(){return Hp(this)}function wE(){return new $n(this.value(),this.__chain__)}function bE(){this.__values__===t&&(this.__values__=ig(this.value()));var i=this.__index__>=this.__values__.length,s=i?t:this.__values__[this.__index__++];return{done:i,value:s}}function mE(){return this}function DE(i){for(var s,l=this;l instanceof Au;){var p=Op(l);p.__index__=0,p.__values__=t,s?x.__wrapped__=p:s=p;var x=p;l=l.__wrapped__}return x.__wrapped__=i,s}function yE(){var i=this.__wrapped__;if(i instanceof Ue){var s=i;return this.__actions__.length&&(s=new Ue(this)),s=s.reverse(),s.__actions__.push({func:Wu,args:[Al],thisArg:t}),new $n(s,this.__chain__)}return this.thru(Al)}function xE(){return sp(this.__wrapped__,this.__actions__)}var EE=Ru(function(i,s,l){nt.call(i,l)?++i[l]:Sr(i,l,1)});function CE(i,s,l){var p=Ie(i)?b1:gx;return l&&jt(i,s,l)&&(s=t),p(i,me(s,3))}function AE(i,s){var l=Ie(i)?Kr:G1;return l(i,me(s,3))}var FE=vp(Pp),BE=vp(Mp);function SE(i,s){return Ht(qu(i,s),1)}function IE(i,s){return Ht(qu(i,s),ae)}function kE(i,s,l){return l=l===t?1:Re(l),Ht(qu(i,s),l)}function Zp(i,s){var l=Ie(i)?Rn:jr;return l(i,me(s,3))}function Vp(i,s){var l=Ie(i)?QD:q1;return l(i,me(s,3))}var TE=Ru(function(i,s,l){nt.call(i,l)?i[l].push(s):Sr(i,l,[s])});function RE(i,s,l,p){i=sn(i)?i:ga(i),l=l&&!p?Re(l):0;var x=i.length;return l<0&&(l=Pt(x+l,0)),Xu(i)?l<=x&&i.indexOf(s,l)>-1:!!x&&ra(i,s,l)>-1}var NE=Le(function(i,s,l){var p=-1,x=typeof s=="function",B=sn(i)?K(i.length):[];return jr(i,function(O){B[++p]=x?cn(s,O,l):us(O,s,l)}),B}),$E=Ru(function(i,s,l){Sr(i,l,s)});function qu(i,s){var l=Ie(i)?Dt:Y1;return l(i,me(s,3))}function LE(i,s,l,p){return i==null?[]:(Ie(s)||(s=s==null?[]:[s]),l=p?t:l,Ie(l)||(l=l==null?[]:[l]),z1(i,s,l))}var OE=Ru(function(i,s,l){i[l?0:1].push(s)},function(){return[[],[]]});function PE(i,s,l){var p=Ie(i)?Mf:x1,x=arguments.length<3;return p(i,me(s,4),l,x,jr)}function ME(i,s,l){var p=Ie(i)?JD:x1,x=arguments.length<3;return p(i,me(s,4),l,x,q1)}function UE(i,s){var l=Ie(i)?Kr:G1;return l(i,Zu(me(s,3)))}function WE(i){var s=Ie(i)?P1:Rx;return s(i)}function qE(i,s,l){(l?jt(i,s,l):s===t)?s=1:s=Re(s);var p=Ie(i)?lx:Nx;return p(i,s)}function GE(i){var s=Ie(i)?hx:Lx;return s(i)}function HE(i){if(i==null)return 0;if(sn(i))return Xu(i)?aa(i):i.length;var s=Vt(i);return s==we||s==vt?i.size:il(i).length}function ZE(i,s,l){var p=Ie(i)?Uf:Ox;return l&&jt(i,s,l)&&(s=t),p(i,me(s,3))}var VE=Le(function(i,s){if(i==null)return[];var l=s.length;return l>1&&jt(i,s[0],s[1])?s=[]:l>2&&jt(s[0],s[1],s[2])&&(s=[s[0]]),z1(i,Ht(s,1),[])}),Gu=Ay||function(){return Gt.Date.now()};function XE(i,s){if(typeof s!="function")throw new Nn(f);return i=Re(i),function(){if(--i<1)return s.apply(this,arguments)}}function Xp(i,s,l){return s=l?t:s,s=i&&s==null?i.length:s,Ir(i,$,t,t,t,t,s)}function Kp(i,s){var l;if(typeof s!="function")throw new Nn(f);return i=Re(i),function(){return--i>0&&(l=s.apply(this,arguments)),i<=1&&(s=t),l}}var Bl=Le(function(i,s,l){var p=T;if(l.length){var x=Qr(l,da(Bl));p|=M}return Ir(i,p,s,l,x)}),Yp=Le(function(i,s,l){var p=T|N;if(l.length){var x=Qr(l,da(Yp));p|=M}return Ir(s,p,i,l,x)});function Qp(i,s,l){s=l?t:s;var p=Ir(i,P,t,t,t,t,t,s);return p.placeholder=Qp.placeholder,p}function Jp(i,s,l){s=l?t:s;var p=Ir(i,k,t,t,t,t,t,s);return p.placeholder=Jp.placeholder,p}function jp(i,s,l){var p,x,B,O,U,V,j=0,z=!1,te=!1,ie=!0;if(typeof i!="function")throw new Nn(f);s=Mn(s)||0,Et(l)&&(z=!!l.leading,te="maxWait"in l,B=te?Pt(Mn(l.maxWait)||0,s):B,ie="trailing"in l?!!l.trailing:ie);function ce(Rt){var jn=p,$r=x;return p=x=t,j=Rt,O=i.apply($r,jn),O}function ye(Rt){return j=Rt,U=cs(Pe,s),z?ce(Rt):O}function $e(Rt){var jn=Rt-V,$r=Rt-j,vg=s-jn;return te?Zt(vg,B-$r):vg}function xe(Rt){var jn=Rt-V,$r=Rt-j;return V===t||jn>=s||jn<0||te&&$r>=B}function Pe(){var Rt=Gu();if(xe(Rt))return Ge(Rt);U=cs(Pe,$e(Rt))}function Ge(Rt){return U=t,ie&&p?ce(Rt):(p=x=t,O)}function _n(){U!==t&&op(U),j=0,p=V=x=U=t}function zt(){return U===t?O:Ge(Gu())}function vn(){var Rt=Gu(),jn=xe(Rt);if(p=arguments,x=this,V=Rt,jn){if(U===t)return ye(V);if(te)return op(U),U=cs(Pe,s),ce(V)}return U===t&&(U=cs(Pe,s)),O}return vn.cancel=_n,vn.flush=zt,vn}var KE=Le(function(i,s){return W1(i,1,s)}),YE=Le(function(i,s,l){return W1(i,Mn(s)||0,l)});function QE(i){return Ir(i,F)}function Hu(i,s){if(typeof i!="function"||s!=null&&typeof s!="function")throw new Nn(f);var l=function(){var p=arguments,x=s?s.apply(this,p):p[0],B=l.cache;if(B.has(x))return B.get(x);var O=i.apply(this,p);return l.cache=B.set(x,O)||B,O};return l.cache=new(Hu.Cache||Br),l}Hu.Cache=Br;function Zu(i){if(typeof i!="function")throw new Nn(f);return function(){var s=arguments;switch(s.length){case 0:return!i.call(this);case 1:return!i.call(this,s[0]);case 2:return!i.call(this,s[0],s[1]);case 3:return!i.call(this,s[0],s[1],s[2])}return!i.apply(this,s)}}function JE(i){return Kp(2,i)}var jE=Px(function(i,s){s=s.length==1&&Ie(s[0])?Dt(s[0],dn(me())):Dt(Ht(s,1),dn(me()));var l=s.length;return Le(function(p){for(var x=-1,B=Zt(p.length,l);++x<B;)p[x]=s[x].call(this,p[x]);return cn(i,this,p)})}),Sl=Le(function(i,s){var l=Qr(s,da(Sl));return Ir(i,M,t,s,l)}),zp=Le(function(i,s){var l=Qr(s,da(zp));return Ir(i,q,t,s,l)}),zE=kr(function(i,s){return Ir(i,A,t,t,t,s)});function e3(i,s){if(typeof i!="function")throw new Nn(f);return s=s===t?s:Re(s),Le(i,s)}function t3(i,s){if(typeof i!="function")throw new Nn(f);return s=s==null?0:Pt(Re(s),0),Le(function(l){var p=l[s],x=ti(l,0,s);return p&&Yr(x,p),cn(i,this,x)})}function n3(i,s,l){var p=!0,x=!0;if(typeof i!="function")throw new Nn(f);return Et(l)&&(p="leading"in l?!!l.leading:p,x="trailing"in l?!!l.trailing:x),jp(i,s,{leading:p,maxWait:s,trailing:x})}function r3(i){return Xp(i,1)}function i3(i,s){return Sl(dl(s),i)}function a3(){if(!arguments.length)return[];var i=arguments[0];return Ie(i)?i:[i]}function s3(i){return Ln(i,m)}function u3(i,s){return s=typeof s=="function"?s:t,Ln(i,m,s)}function o3(i){return Ln(i,D|m)}function f3(i,s){return s=typeof s=="function"?s:t,Ln(i,D|m,s)}function l3(i,s){return s==null||U1(i,s,Ut(s))}function Jn(i,s){return i===s||i!==i&&s!==s}var h3=Ou(tl),c3=Ou(function(i,s){return i>=s}),Ri=V1(function(){return arguments}())?V1:function(i){return Bt(i)&&nt.call(i,"callee")&&!T1.call(i,"callee")},Ie=K.isArray,d3=d1?dn(d1):Dx;function sn(i){return i!=null&&Vu(i.length)&&!Rr(i)}function Tt(i){return Bt(i)&&sn(i)}function p3(i){return i===!0||i===!1||Bt(i)&&Jt(i)==be}var ni=By||Ul,g3=p1?dn(p1):yx;function _3(i){return Bt(i)&&i.nodeType===1&&!ds(i)}function v3(i){if(i==null)return!0;if(sn(i)&&(Ie(i)||typeof i=="string"||typeof i.splice=="function"||ni(i)||pa(i)||Ri(i)))return!i.length;var s=Vt(i);if(s==we||s==vt)return!i.size;if(hs(i))return!il(i).length;for(var l in i)if(nt.call(i,l))return!1;return!0}function w3(i,s){return os(i,s)}function b3(i,s,l){l=typeof l=="function"?l:t;var p=l?l(i,s):t;return p===t?os(i,s,t,l):!!p}function Il(i){if(!Bt(i))return!1;var s=Jt(i);return s==he||s==Ke||typeof i.message=="string"&&typeof i.name=="string"&&!ds(i)}function m3(i){return typeof i=="number"&&N1(i)}function Rr(i){if(!Et(i))return!1;var s=Jt(i);return s==Oe||s==Ye||s==ot||s==Qe}function eg(i){return typeof i=="number"&&i==Re(i)}function Vu(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=ge}function Et(i){var s=typeof i;return i!=null&&(s=="object"||s=="function")}function Bt(i){return i!=null&&typeof i=="object"}var tg=g1?dn(g1):Ex;function D3(i,s){return i===s||rl(i,s,ml(s))}function y3(i,s,l){return l=typeof l=="function"?l:t,rl(i,s,ml(s),l)}function x3(i){return ng(i)&&i!=+i}function E3(i){if(u8(i))throw new Be(u);return X1(i)}function C3(i){return i===null}function A3(i){return i==null}function ng(i){return typeof i=="number"||Bt(i)&&Jt(i)==Ae}function ds(i){if(!Bt(i)||Jt(i)!=ze)return!1;var s=bu(i);if(s===null)return!0;var l=nt.call(s,"constructor")&&s.constructor;return typeof l=="function"&&l instanceof l&&gu.call(l)==yy}var kl=_1?dn(_1):Cx;function F3(i){return eg(i)&&i>=-ge&&i<=ge}var rg=v1?dn(v1):Ax;function Xu(i){return typeof i=="string"||!Ie(i)&&Bt(i)&&Jt(i)==yt}function gn(i){return typeof i=="symbol"||Bt(i)&&Jt(i)==Qt}var pa=w1?dn(w1):Fx;function B3(i){return i===t}function S3(i){return Bt(i)&&Vt(i)==rt}function I3(i){return Bt(i)&&Jt(i)==wt}var k3=Ou(al),T3=Ou(function(i,s){return i<=s});function ig(i){if(!i)return[];if(sn(i))return Xu(i)?Yn(i):an(i);if(es&&i[es])return ly(i[es]());var s=Vt(i),l=s==we?Vf:s==vt?cu:ga;return l(i)}function Nr(i){if(!i)return i===0?i:0;if(i=Mn(i),i===ae||i===-ae){var s=i<0?-1:1;return s*_e}return i===i?i:0}function Re(i){var s=Nr(i),l=s%1;return s===s?l?s-l:s:0}function ag(i){return i?Si(Re(i),0,le):0}function Mn(i){if(typeof i=="number")return i;if(gn(i))return Xe;if(Et(i)){var s=typeof i.valueOf=="function"?i.valueOf():i;i=Et(s)?s+"":s}if(typeof i!="string")return i===0?i:+i;i=E1(i);var l=dD.test(i);return l||gD.test(i)?XD(i.slice(2),l?2:8):cD.test(i)?Xe:+i}function sg(i){return cr(i,un(i))}function R3(i){return i?Si(Re(i),-ge,ge):i===0?i:0}function tt(i){return i==null?"":pn(i)}var N3=ha(function(i,s){if(hs(s)||sn(s)){cr(s,Ut(s),i);return}for(var l in s)nt.call(s,l)&&as(i,l,s[l])}),ug=ha(function(i,s){cr(s,un(s),i)}),Ku=ha(function(i,s,l,p){cr(s,un(s),i,p)}),$3=ha(function(i,s,l,p){cr(s,Ut(s),i,p)}),L3=kr(jf);function O3(i,s){var l=la(i);return s==null?l:M1(l,s)}var P3=Le(function(i,s){i=it(i);var l=-1,p=s.length,x=p>2?s[2]:t;for(x&&jt(s[0],s[1],x)&&(p=1);++l<p;)for(var B=s[l],O=un(B),U=-1,V=O.length;++U<V;){var j=O[U],z=i[j];(z===t||Jn(z,ua[j])&&!nt.call(i,j))&&(i[j]=B[j])}return i}),M3=Le(function(i){return i.push(t,Ep),cn(og,t,i)});function U3(i,s){return m1(i,me(s,3),hr)}function W3(i,s){return m1(i,me(s,3),el)}function q3(i,s){return i==null?i:zf(i,me(s,3),un)}function G3(i,s){return i==null?i:H1(i,me(s,3),un)}function H3(i,s){return i&&hr(i,me(s,3))}function Z3(i,s){return i&&el(i,me(s,3))}function V3(i){return i==null?[]:Su(i,Ut(i))}function X3(i){return i==null?[]:Su(i,un(i))}function Tl(i,s,l){var p=i==null?t:Ii(i,s);return p===t?l:p}function K3(i,s){return i!=null&&Fp(i,s,vx)}function Rl(i,s){return i!=null&&Fp(i,s,wx)}var Y3=bp(function(i,s,l){s!=null&&typeof s.toString!="function"&&(s=_u.call(s)),i[s]=l},$l(on)),Q3=bp(function(i,s,l){s!=null&&typeof s.toString!="function"&&(s=_u.call(s)),nt.call(i,s)?i[s].push(l):i[s]=[l]},me),J3=Le(us);function Ut(i){return sn(i)?O1(i):il(i)}function un(i){return sn(i)?O1(i,!0):Bx(i)}function j3(i,s){var l={};return s=me(s,3),hr(i,function(p,x,B){Sr(l,s(p,x,B),p)}),l}function z3(i,s){var l={};return s=me(s,3),hr(i,function(p,x,B){Sr(l,x,s(p,x,B))}),l}var eC=ha(function(i,s,l){Iu(i,s,l)}),og=ha(function(i,s,l,p){Iu(i,s,l,p)}),tC=kr(function(i,s){var l={};if(i==null)return l;var p=!1;s=Dt(s,function(B){return B=ei(B,i),p||(p=B.length>1),B}),cr(i,wl(i),l),p&&(l=Ln(l,D|y|m,Yx));for(var x=s.length;x--;)ll(l,s[x]);return l});function nC(i,s){return fg(i,Zu(me(s)))}var rC=kr(function(i,s){return i==null?{}:Ix(i,s)});function fg(i,s){if(i==null)return{};var l=Dt(wl(i),function(p){return[p]});return s=me(s),ep(i,l,function(p,x){return s(p,x[0])})}function iC(i,s,l){s=ei(s,i);var p=-1,x=s.length;for(x||(x=1,i=t);++p<x;){var B=i==null?t:i[dr(s[p])];B===t&&(p=x,B=l),i=Rr(B)?B.call(i):B}return i}function aC(i,s,l){return i==null?i:fs(i,s,l)}function sC(i,s,l,p){return p=typeof p=="function"?p:t,i==null?i:fs(i,s,l,p)}var lg=yp(Ut),hg=yp(un);function uC(i,s,l){var p=Ie(i),x=p||ni(i)||pa(i);if(s=me(s,4),l==null){var B=i&&i.constructor;x?l=p?new B:[]:Et(i)?l=Rr(B)?la(bu(i)):{}:l={}}return(x?Rn:hr)(i,function(O,U,V){return s(l,O,U,V)}),l}function oC(i,s){return i==null?!0:ll(i,s)}function fC(i,s,l){return i==null?i:ap(i,s,dl(l))}function lC(i,s,l,p){return p=typeof p=="function"?p:t,i==null?i:ap(i,s,dl(l),p)}function ga(i){return i==null?[]:Zf(i,Ut(i))}function hC(i){return i==null?[]:Zf(i,un(i))}function cC(i,s,l){return l===t&&(l=s,s=t),l!==t&&(l=Mn(l),l=l===l?l:0),s!==t&&(s=Mn(s),s=s===s?s:0),Si(Mn(i),s,l)}function dC(i,s,l){return s=Nr(s),l===t?(l=s,s=0):l=Nr(l),i=Mn(i),bx(i,s,l)}function pC(i,s,l){if(l&&typeof l!="boolean"&&jt(i,s,l)&&(s=l=t),l===t&&(typeof s=="boolean"?(l=s,s=t):typeof i=="boolean"&&(l=i,i=t)),i===t&&s===t?(i=0,s=1):(i=Nr(i),s===t?(s=i,i=0):s=Nr(s)),i>s){var p=i;i=s,s=p}if(l||i%1||s%1){var x=$1();return Zt(i+x*(s-i+VD("1e-"+((x+"").length-1))),s)}return ul(i,s)}var gC=ca(function(i,s,l){return s=s.toLowerCase(),i+(l?cg(s):s)});function cg(i){return Nl(tt(i).toLowerCase())}function dg(i){return i=tt(i),i&&i.replace(vD,ay).replace(LD,"")}function _C(i,s,l){i=tt(i),s=pn(s);var p=i.length;l=l===t?p:Si(Re(l),0,p);var x=l;return l-=s.length,l>=0&&i.slice(l,x)==s}function vC(i){return i=tt(i),i&&Jm.test(i)?i.replace(Hd,sy):i}function wC(i){return i=tt(i),i&&rD.test(i)?i.replace(Sf,"\\$&"):i}var bC=ca(function(i,s,l){return i+(l?"-":"")+s.toLowerCase()}),mC=ca(function(i,s,l){return i+(l?" ":"")+s.toLowerCase()}),DC=_p("toLowerCase");function yC(i,s,l){i=tt(i),s=Re(s);var p=s?aa(i):0;if(!s||p>=s)return i;var x=(s-p)/2;return Lu(xu(x),l)+i+Lu(yu(x),l)}function xC(i,s,l){i=tt(i),s=Re(s);var p=s?aa(i):0;return s&&p<s?i+Lu(s-p,l):i}function EC(i,s,l){i=tt(i),s=Re(s);var p=s?aa(i):0;return s&&p<s?Lu(s-p,l)+i:i}function CC(i,s,l){return l||s==null?s=0:s&&(s=+s),Ty(tt(i).replace(If,""),s||0)}function AC(i,s,l){return(l?jt(i,s,l):s===t)?s=1:s=Re(s),ol(tt(i),s)}function FC(){var i=arguments,s=tt(i[0]);return i.length<3?s:s.replace(i[1],i[2])}var BC=ca(function(i,s,l){return i+(l?"_":"")+s.toLowerCase()});function SC(i,s,l){return l&&typeof l!="number"&&jt(i,s,l)&&(s=l=t),l=l===t?le:l>>>0,l?(i=tt(i),i&&(typeof s=="string"||s!=null&&!kl(s))&&(s=pn(s),!s&&ia(i))?ti(Yn(i),0,l):i.split(s,l)):[]}var IC=ca(function(i,s,l){return i+(l?" ":"")+Nl(s)});function kC(i,s,l){return i=tt(i),l=l==null?0:Si(Re(l),0,i.length),s=pn(s),i.slice(l,l+s.length)==s}function TC(i,s,l){var p=C.templateSettings;l&&jt(i,s,l)&&(s=t),i=tt(i),s=Ku({},s,p,xp);var x=Ku({},s.imports,p.imports,xp),B=Ut(x),O=Zf(x,B),U,V,j=0,z=s.interpolate||uu,te="__p += '",ie=Xf((s.escape||uu).source+"|"+z.source+"|"+(z===Zd?hD:uu).source+"|"+(s.evaluate||uu).source+"|$","g"),ce="//# sourceURL="+(nt.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++WD+"]")+`
11
+ `;i.replace(ie,function(xe,Pe,Ge,_n,zt,vn){return Ge||(Ge=_n),te+=i.slice(j,vn).replace(wD,uy),Pe&&(U=!0,te+=`' +
12
+ __e(`+Pe+`) +
13
+ '`),zt&&(V=!0,te+=`';
14
+ `+zt+`;
15
+ __p += '`),Ge&&(te+=`' +
16
+ ((__t = (`+Ge+`)) == null ? '' : __t) +
17
+ '`),j=vn+xe.length,xe}),te+=`';
18
+ `;var ye=nt.call(s,"variable")&&s.variable;if(!ye)te=`with (obj) {
19
+ `+te+`
20
+ }
21
+ `;else if(fD.test(ye))throw new Be(h);te=(V?te.replace(bt,""):te).replace(ft,"$1").replace(mt,"$1;"),te="function("+(ye||"obj")+`) {
22
+ `+(ye?"":`obj || (obj = {});
23
+ `)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(V?`, __j = Array.prototype.join;
24
+ function print() { __p += __j.call(arguments, '') }
25
+ `:`;
26
+ `)+te+`return __p
27
+ }`;var $e=gg(function(){return Je(B,ce+"return "+te).apply(t,O)});if($e.source=te,Il($e))throw $e;return $e}function RC(i){return tt(i).toLowerCase()}function NC(i){return tt(i).toUpperCase()}function $C(i,s,l){if(i=tt(i),i&&(l||s===t))return E1(i);if(!i||!(s=pn(s)))return i;var p=Yn(i),x=Yn(s),B=C1(p,x),O=A1(p,x)+1;return ti(p,B,O).join("")}function LC(i,s,l){if(i=tt(i),i&&(l||s===t))return i.slice(0,B1(i)+1);if(!i||!(s=pn(s)))return i;var p=Yn(i),x=A1(p,Yn(s))+1;return ti(p,0,x).join("")}function OC(i,s,l){if(i=tt(i),i&&(l||s===t))return i.replace(If,"");if(!i||!(s=pn(s)))return i;var p=Yn(i),x=C1(p,Yn(s));return ti(p,x).join("")}function PC(i,s){var l=L,p=G;if(Et(s)){var x="separator"in s?s.separator:x;l="length"in s?Re(s.length):l,p="omission"in s?pn(s.omission):p}i=tt(i);var B=i.length;if(ia(i)){var O=Yn(i);B=O.length}if(l>=B)return i;var U=l-aa(p);if(U<1)return p;var V=O?ti(O,0,U).join(""):i.slice(0,U);if(x===t)return V+p;if(O&&(U+=V.length-U),kl(x)){if(i.slice(U).search(x)){var j,z=V;for(x.global||(x=Xf(x.source,tt(Vd.exec(x))+"g")),x.lastIndex=0;j=x.exec(z);)var te=j.index;V=V.slice(0,te===t?U:te)}}else if(i.indexOf(pn(x),U)!=U){var ie=V.lastIndexOf(x);ie>-1&&(V=V.slice(0,ie))}return V+p}function MC(i){return i=tt(i),i&&Qm.test(i)?i.replace(et,py):i}var UC=ca(function(i,s,l){return i+(l?" ":"")+s.toUpperCase()}),Nl=_p("toUpperCase");function pg(i,s,l){return i=tt(i),s=l?t:s,s===t?fy(i)?vy(i):ey(i):i.match(s)||[]}var gg=Le(function(i,s){try{return cn(i,t,s)}catch(l){return Il(l)?l:new Be(l)}}),WC=kr(function(i,s){return Rn(s,function(l){l=dr(l),Sr(i,l,Bl(i[l],i))}),i});function qC(i){var s=i==null?0:i.length,l=me();return i=s?Dt(i,function(p){if(typeof p[1]!="function")throw new Nn(f);return[l(p[0]),p[1]]}):[],Le(function(p){for(var x=-1;++x<s;){var B=i[x];if(cn(B[0],this,p))return cn(B[1],this,p)}})}function GC(i){return px(Ln(i,D))}function $l(i){return function(){return i}}function HC(i,s){return i==null||i!==i?s:i}var ZC=wp(),VC=wp(!0);function on(i){return i}function Ll(i){return K1(typeof i=="function"?i:Ln(i,D))}function XC(i){return Q1(Ln(i,D))}function KC(i,s){return J1(i,Ln(s,D))}var YC=Le(function(i,s){return function(l){return us(l,i,s)}}),QC=Le(function(i,s){return function(l){return us(i,l,s)}});function Ol(i,s,l){var p=Ut(s),x=Su(s,p);l==null&&!(Et(s)&&(x.length||!p.length))&&(l=s,s=i,i=this,x=Su(s,Ut(s)));var B=!(Et(l)&&"chain"in l)||!!l.chain,O=Rr(i);return Rn(x,function(U){var V=s[U];i[U]=V,O&&(i.prototype[U]=function(){var j=this.__chain__;if(B||j){var z=i(this.__wrapped__),te=z.__actions__=an(this.__actions__);return te.push({func:V,args:arguments,thisArg:i}),z.__chain__=j,z}return V.apply(i,Yr([this.value()],arguments))})}),i}function JC(){return Gt._===this&&(Gt._=xy),this}function Pl(){}function jC(i){return i=Re(i),Le(function(s){return j1(s,i)})}var zC=gl(Dt),eA=gl(b1),tA=gl(Uf);function _g(i){return yl(i)?Wf(dr(i)):kx(i)}function nA(i){return function(s){return i==null?t:Ii(i,s)}}var rA=mp(),iA=mp(!0);function Ml(){return[]}function Ul(){return!1}function aA(){return{}}function sA(){return""}function uA(){return!0}function oA(i,s){if(i=Re(i),i<1||i>ge)return[];var l=le,p=Zt(i,le);s=me(s),i-=le;for(var x=Hf(p,s);++l<i;)s(l);return x}function fA(i){return Ie(i)?Dt(i,dr):gn(i)?[i]:an(Lp(tt(i)))}function lA(i){var s=++Dy;return tt(i)+s}var hA=$u(function(i,s){return i+s},0),cA=_l("ceil"),dA=$u(function(i,s){return i/s},1),pA=_l("floor");function gA(i){return i&&i.length?Bu(i,on,tl):t}function _A(i,s){return i&&i.length?Bu(i,me(s,2),tl):t}function vA(i){return y1(i,on)}function wA(i,s){return y1(i,me(s,2))}function bA(i){return i&&i.length?Bu(i,on,al):t}function mA(i,s){return i&&i.length?Bu(i,me(s,2),al):t}var DA=$u(function(i,s){return i*s},1),yA=_l("round"),xA=$u(function(i,s){return i-s},0);function EA(i){return i&&i.length?Gf(i,on):0}function CA(i,s){return i&&i.length?Gf(i,me(s,2)):0}return C.after=XE,C.ary=Xp,C.assign=N3,C.assignIn=ug,C.assignInWith=Ku,C.assignWith=$3,C.at=L3,C.before=Kp,C.bind=Bl,C.bindAll=WC,C.bindKey=Yp,C.castArray=a3,C.chain=Hp,C.chunk=p8,C.compact=g8,C.concat=_8,C.cond=qC,C.conforms=GC,C.constant=$l,C.countBy=EE,C.create=O3,C.curry=Qp,C.curryRight=Jp,C.debounce=jp,C.defaults=P3,C.defaultsDeep=M3,C.defer=KE,C.delay=YE,C.difference=v8,C.differenceBy=w8,C.differenceWith=b8,C.drop=m8,C.dropRight=D8,C.dropRightWhile=y8,C.dropWhile=x8,C.fill=E8,C.filter=AE,C.flatMap=SE,C.flatMapDeep=IE,C.flatMapDepth=kE,C.flatten=Up,C.flattenDeep=C8,C.flattenDepth=A8,C.flip=QE,C.flow=ZC,C.flowRight=VC,C.fromPairs=F8,C.functions=V3,C.functionsIn=X3,C.groupBy=TE,C.initial=S8,C.intersection=I8,C.intersectionBy=k8,C.intersectionWith=T8,C.invert=Y3,C.invertBy=Q3,C.invokeMap=NE,C.iteratee=Ll,C.keyBy=$E,C.keys=Ut,C.keysIn=un,C.map=qu,C.mapKeys=j3,C.mapValues=z3,C.matches=XC,C.matchesProperty=KC,C.memoize=Hu,C.merge=eC,C.mergeWith=og,C.method=YC,C.methodOf=QC,C.mixin=Ol,C.negate=Zu,C.nthArg=jC,C.omit=tC,C.omitBy=nC,C.once=JE,C.orderBy=LE,C.over=zC,C.overArgs=jE,C.overEvery=eA,C.overSome=tA,C.partial=Sl,C.partialRight=zp,C.partition=OE,C.pick=rC,C.pickBy=fg,C.property=_g,C.propertyOf=nA,C.pull=L8,C.pullAll=qp,C.pullAllBy=O8,C.pullAllWith=P8,C.pullAt=M8,C.range=rA,C.rangeRight=iA,C.rearg=zE,C.reject=UE,C.remove=U8,C.rest=e3,C.reverse=Al,C.sampleSize=qE,C.set=aC,C.setWith=sC,C.shuffle=GE,C.slice=W8,C.sortBy=VE,C.sortedUniq=K8,C.sortedUniqBy=Y8,C.split=SC,C.spread=t3,C.tail=Q8,C.take=J8,C.takeRight=j8,C.takeRightWhile=z8,C.takeWhile=eE,C.tap=gE,C.throttle=n3,C.thru=Wu,C.toArray=ig,C.toPairs=lg,C.toPairsIn=hg,C.toPath=fA,C.toPlainObject=sg,C.transform=uC,C.unary=r3,C.union=tE,C.unionBy=nE,C.unionWith=rE,C.uniq=iE,C.uniqBy=aE,C.uniqWith=sE,C.unset=oC,C.unzip=Fl,C.unzipWith=Gp,C.update=fC,C.updateWith=lC,C.values=ga,C.valuesIn=hC,C.without=uE,C.words=pg,C.wrap=i3,C.xor=oE,C.xorBy=fE,C.xorWith=lE,C.zip=hE,C.zipObject=cE,C.zipObjectDeep=dE,C.zipWith=pE,C.entries=lg,C.entriesIn=hg,C.extend=ug,C.extendWith=Ku,Ol(C,C),C.add=hA,C.attempt=gg,C.camelCase=gC,C.capitalize=cg,C.ceil=cA,C.clamp=cC,C.clone=s3,C.cloneDeep=o3,C.cloneDeepWith=f3,C.cloneWith=u3,C.conformsTo=l3,C.deburr=dg,C.defaultTo=HC,C.divide=dA,C.endsWith=_C,C.eq=Jn,C.escape=vC,C.escapeRegExp=wC,C.every=CE,C.find=FE,C.findIndex=Pp,C.findKey=U3,C.findLast=BE,C.findLastIndex=Mp,C.findLastKey=W3,C.floor=pA,C.forEach=Zp,C.forEachRight=Vp,C.forIn=q3,C.forInRight=G3,C.forOwn=H3,C.forOwnRight=Z3,C.get=Tl,C.gt=h3,C.gte=c3,C.has=K3,C.hasIn=Rl,C.head=Wp,C.identity=on,C.includes=RE,C.indexOf=B8,C.inRange=dC,C.invoke=J3,C.isArguments=Ri,C.isArray=Ie,C.isArrayBuffer=d3,C.isArrayLike=sn,C.isArrayLikeObject=Tt,C.isBoolean=p3,C.isBuffer=ni,C.isDate=g3,C.isElement=_3,C.isEmpty=v3,C.isEqual=w3,C.isEqualWith=b3,C.isError=Il,C.isFinite=m3,C.isFunction=Rr,C.isInteger=eg,C.isLength=Vu,C.isMap=tg,C.isMatch=D3,C.isMatchWith=y3,C.isNaN=x3,C.isNative=E3,C.isNil=A3,C.isNull=C3,C.isNumber=ng,C.isObject=Et,C.isObjectLike=Bt,C.isPlainObject=ds,C.isRegExp=kl,C.isSafeInteger=F3,C.isSet=rg,C.isString=Xu,C.isSymbol=gn,C.isTypedArray=pa,C.isUndefined=B3,C.isWeakMap=S3,C.isWeakSet=I3,C.join=R8,C.kebabCase=bC,C.last=Pn,C.lastIndexOf=N8,C.lowerCase=mC,C.lowerFirst=DC,C.lt=k3,C.lte=T3,C.max=gA,C.maxBy=_A,C.mean=vA,C.meanBy=wA,C.min=bA,C.minBy=mA,C.stubArray=Ml,C.stubFalse=Ul,C.stubObject=aA,C.stubString=sA,C.stubTrue=uA,C.multiply=DA,C.nth=$8,C.noConflict=JC,C.noop=Pl,C.now=Gu,C.pad=yC,C.padEnd=xC,C.padStart=EC,C.parseInt=CC,C.random=pC,C.reduce=PE,C.reduceRight=ME,C.repeat=AC,C.replace=FC,C.result=iC,C.round=yA,C.runInContext=H,C.sample=WE,C.size=HE,C.snakeCase=BC,C.some=ZE,C.sortedIndex=q8,C.sortedIndexBy=G8,C.sortedIndexOf=H8,C.sortedLastIndex=Z8,C.sortedLastIndexBy=V8,C.sortedLastIndexOf=X8,C.startCase=IC,C.startsWith=kC,C.subtract=xA,C.sum=EA,C.sumBy=CA,C.template=TC,C.times=oA,C.toFinite=Nr,C.toInteger=Re,C.toLength=ag,C.toLower=RC,C.toNumber=Mn,C.toSafeInteger=R3,C.toString=tt,C.toUpper=NC,C.trim=$C,C.trimEnd=LC,C.trimStart=OC,C.truncate=PC,C.unescape=MC,C.uniqueId=lA,C.upperCase=UC,C.upperFirst=Nl,C.each=Zp,C.eachRight=Vp,C.first=Wp,Ol(C,function(){var i={};return hr(C,function(s,l){nt.call(C.prototype,l)||(i[l]=s)}),i}(),{chain:!1}),C.VERSION=a,Rn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){C[i].placeholder=C}),Rn(["drop","take"],function(i,s){Ue.prototype[i]=function(l){l=l===t?1:Pt(Re(l),0);var p=this.__filtered__&&!s?new Ue(this):this.clone();return p.__filtered__?p.__takeCount__=Zt(l,p.__takeCount__):p.__views__.push({size:Zt(l,le),type:i+(p.__dir__<0?"Right":"")}),p},Ue.prototype[i+"Right"]=function(l){return this.reverse()[i](l).reverse()}}),Rn(["filter","map","takeWhile"],function(i,s){var l=s+1,p=l==se||l==ke;Ue.prototype[i]=function(x){var B=this.clone();return B.__iteratees__.push({iteratee:me(x,3),type:l}),B.__filtered__=B.__filtered__||p,B}}),Rn(["head","last"],function(i,s){var l="take"+(s?"Right":"");Ue.prototype[i]=function(){return this[l](1).value()[0]}}),Rn(["initial","tail"],function(i,s){var l="drop"+(s?"":"Right");Ue.prototype[i]=function(){return this.__filtered__?new Ue(this):this[l](1)}}),Ue.prototype.compact=function(){return this.filter(on)},Ue.prototype.find=function(i){return this.filter(i).head()},Ue.prototype.findLast=function(i){return this.reverse().find(i)},Ue.prototype.invokeMap=Le(function(i,s){return typeof i=="function"?new Ue(this):this.map(function(l){return us(l,i,s)})}),Ue.prototype.reject=function(i){return this.filter(Zu(me(i)))},Ue.prototype.slice=function(i,s){i=Re(i);var l=this;return l.__filtered__&&(i>0||s<0)?new Ue(l):(i<0?l=l.takeRight(-i):i&&(l=l.drop(i)),s!==t&&(s=Re(s),l=s<0?l.dropRight(-s):l.take(s-i)),l)},Ue.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ue.prototype.toArray=function(){return this.take(le)},hr(Ue.prototype,function(i,s){var l=/^(?:filter|find|map|reject)|While$/.test(s),p=/^(?:head|last)$/.test(s),x=C[p?"take"+(s=="last"?"Right":""):s],B=p||/^find/.test(s);x&&(C.prototype[s]=function(){var O=this.__wrapped__,U=p?[1]:arguments,V=O instanceof Ue,j=U[0],z=V||Ie(O),te=function(Pe){var Ge=x.apply(C,Yr([Pe],U));return p&&ie?Ge[0]:Ge};z&&l&&typeof j=="function"&&j.length!=1&&(V=z=!1);var ie=this.__chain__,ce=!!this.__actions__.length,ye=B&&!ie,$e=V&&!ce;if(!B&&z){O=$e?O:new Ue(this);var xe=i.apply(O,U);return xe.__actions__.push({func:Wu,args:[te],thisArg:t}),new $n(xe,ie)}return ye&&$e?i.apply(this,U):(xe=this.thru(te),ye?p?xe.value()[0]:xe.value():xe)})}),Rn(["pop","push","shift","sort","splice","unshift"],function(i){var s=du[i],l=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",p=/^(?:pop|shift)$/.test(i);C.prototype[i]=function(){var x=arguments;if(p&&!this.__chain__){var B=this.value();return s.apply(Ie(B)?B:[],x)}return this[l](function(O){return s.apply(Ie(O)?O:[],x)})}}),hr(Ue.prototype,function(i,s){var l=C[s];if(l){var p=l.name+"";nt.call(fa,p)||(fa[p]=[]),fa[p].push({name:s,func:l})}}),fa[Nu(t,N).name]=[{name:"wrapper",func:t}],Ue.prototype.clone=My,Ue.prototype.reverse=Uy,Ue.prototype.value=Wy,C.prototype.at=_E,C.prototype.chain=vE,C.prototype.commit=wE,C.prototype.next=bE,C.prototype.plant=DE,C.prototype.reverse=yE,C.prototype.toJSON=C.prototype.valueOf=C.prototype.value=xE,C.prototype.first=C.prototype.head,es&&(C.prototype[es]=mE),C},sa=wy();Ci?((Ci.exports=sa)._=sa,Lf._=sa):Gt._=sa}).call(wn)}(pr,pr.exports);var wg=pr.exports,fn=bn(wg);class je{constructor(e,t){if(this.start=e,this.end=t,t<e)throw new RangeError("End cannot be less than start");this.start=e,this.end=t}serialize(){return this}static deserialize(e){return new je(e.start,e.end)}*[Symbol.iterator](){yield this.start,yield this.end}getOverlap(e){const t=Math.max(this.start,e.start),a=Math.min(this.end,e.end);return t<a?new je(t,a):null}getLength(){return this.end-this.start}toString(){return`[${this.start}, ${this.end})`}}class Ct extends je{constructor(e,t,a){super(t,a),this.chr=e,this.start=t,this.end=a}static parse(e){const t=e.replace(/,/g,"").match(/([\w:.]+)\W+(\d+)\W+(\d+)/),a=e.includes(":")?1:0;if(t){const o=t[1],u=Math.max(Number.parseInt(t[2],10)-a,0),f=Number.parseInt(t[3],10);return new Ct(o,u,f)}else throw new RangeError("Could not parse interval")}static mergeAdvanced(e,t,a){const o=fn.groupBy(e,f=>a(f).chr),u=[];for(const f in o){const h=o[f];h.sort((c,D)=>a(c).start-a(D).start);const v=h.map(a);let d=0;for(;d<v.length;){const c=v[d].start;let D=v[d].end,y=d+1;for(;y<v.length;){const[m,I]=v[y];if(m-D>t)break;I>D&&(D=I),y++}u.push({locus:new Ct(f,c,D),sources:h.slice(d,y)}),d=y}}return u}static mergeOverlaps(e,t=2e3){return Ct.mergeAdvanced(e,t,fn.identity).map(o=>o.locus)}serialize(){return this}static deserialize(e){return new Ct(e.chr,e.start,e.end)}*[Symbol.iterator](){yield this.start,yield this.end}getLength(){return this.end-this.start}getOverlap(e){if(this.chr!==e.chr)return null;{const t=this.toOpenInterval().getOverlap(e);return t?new Ct(this.chr,t.start,t.end):null}}toString(){return`${this.chr}:${this.start}-${this.end}`}toOpenInterval(){return new je(this.start,this.end)}toStringWithOther(e){return`${this.chr}:${this.start}-${e.chr}:${e.end}`}}const bg="+",mg="-";class zn{constructor(e,t,a="",o=null){de(this,"name");de(this,"score");de(this,"id");de(this,"sequence");de(this,"variant");de(this,"value");this.locus=t,this.strand=a,this.name=e===void 0?t.toString():e,this.locus=t,this.strand=a,this.value=o}serialize(){return{name:this.name,locus:this.getLocus().serialize(),strand:this.strand}}static deserialize(e){return new zn(e.name,Ct.deserialize(e.locus),e.strand)}getName(){return this.name}getLocus(){return this.locus}getLength(){return this.locus.getLength()}getStrand(){return this.strand}getIsForwardStrand(){return this.strand===bg}getIsReverseStrand(){return this.strand===mg}getHasStrand(){return this.getIsForwardStrand()||this.getIsReverseStrand()}computeNavContextCoordinates(e){return e.convertGenomeIntervalToBases(this.getLocus())}}const Dg="-";class yg extends zn{constructor(t){const a=new Ct(t.chr,t.start,t.end);super(t[3].id,a,t.strand);de(this,"queryLocus");de(this,"targetSeq");de(this,"querySeq");de(this,"queryStrand");const{chr:o,start:u,stop:f,strand:h,targetseq:v,queryseq:d}=t[3].genomealign;this.queryLocus=new Ct(o,u,f),this.querySeq=d||"",this.targetSeq=v||"",this.queryStrand=h}getIsReverseStrandQuery(){return this.queryStrand===Dg}}const ps=0;class Ni{constructor(e,t=ps,a){de(this,"_navContext");de(this,"_startBase");de(this,"_endBase");this._navContext=e,a===void 0&&(a=e.getTotalBases()),this.setRegion(t,a)}clone(){return new Ni(this._navContext,this._startBase,this._endBase)}getNavigationContext(){return this._navContext}getWidth(){return this._endBase-this._startBase}getContextCoordinates(){return new je(this._startBase,this._endBase)}getFeatureSegments(e=!0){return this._navContext.getFeaturesInInterval(this._startBase,this._endBase,e)}getGenomeIntervals(){return this._navContext.getLociInInterval(this._startBase,this._endBase)}setRegion(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))throw new RangeError("Start and end must be well-defined");if(t<e)throw new RangeError("Start must be less than or equal to end");const a=t-e,o=this._navContext.getTotalBases();return e<ps?t=ps+a:t>o&&(e=o-a),this._startBase=Math.round(Math.max(ps,e)),this._endBase=Math.round(Math.min(t,o)),this}pan(e){return this.setRegion(this._startBase+e,this._endBase+e),this}panLeft(){const e=this.getWidth();return this.pan(-e)}panRight(){const e=this.getWidth();return this.pan(e)}zoom(e,t=.5){if(e<=0)throw new RangeError("Zoom factor must be greater than 0");const a=this.getWidth()*e,o=this.getWidth()*t+this._startBase,u=a*t+this._startBase,f=o-u,h=this._startBase+f,v=this._startBase+a+f;return this.setRegion(h,v),this}currentRegionAsString(){const e=this.getFeatureSegments();if(e.length===1)return e[0].toString();{const t=e[0],a=e[e.length-1];return t.toStringWithOther(a)}}}class xg{}class Eg{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(e=new xg){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(e),e.aborted?this.handleAborted(e):typeof e.addEventListener=="function"&&e.addEventListener("abort",()=>{this.handleAborted(e)})}handleAborted(e){this.signals.delete(e),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}class Cg{constructor(){this.callbacks=new Set}addCallback(e=()=>{}){this.callbacks.add(e),e(this.currentMessage)}callback(e){this.currentMessage=e;for(const t of this.callbacks)t(e)}}class _a{constructor({fill:e,cache:t}){if(typeof e!="function")throw new TypeError("must pass a fill function");if(typeof t!="object")throw new TypeError("must pass a cache object");if(typeof t.get!="function"||typeof t.set!="function"||typeof t.delete!="function")throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=t,this.fillCallback=e}static isAbortException(e){return e.name==="AbortError"||e.code==="ERR_ABORTED"||e.message==="AbortError: aborted"||e.message==="Error: aborted"}evict(e,t){this.cache.get(e)===t&&this.cache.delete(e)}fill(e,t,a,o){const u=new Eg,f=new Cg;f.addCallback(o);const h={aborter:u,promise:this.fillCallback(t,u.signal,v=>{f.callback(v)}),settled:!1,statusReporter:f,get aborted(){return this.aborter.signal.aborted}};h.aborter.addSignal(a),h.aborter.signal.addEventListener("abort",()=>{h.settled||this.evict(e,h)}),h.promise.then(()=>{h.settled=!0},()=>{h.settled=!0,this.evict(e,h)}).catch(v=>{throw console.error(v),v}),this.cache.set(e,h)}static checkSinglePromise(e,t){function a(){if(t!=null&&t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return e.then(o=>(a(),o),o=>{throw a(),o})}has(e){return this.cache.has(e)}get(e,t,a,o){if(!a&&t instanceof AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const u=this.cache.get(e);return u?u.aborted&&!u.settled?(this.evict(e,u),this.get(e,t,a,o)):u.settled?u.promise:(u.aborter.addSignal(a),u.statusReporter.addCallback(o),_a.checkSinglePromise(u.promise,a)):(this.fill(e,t,a,o),_a.checkSinglePromise(this.cache.get(e).promise,a))}delete(e){const t=this.cache.get(e);t&&(t.settled||t.aborter.abort(),this.cache.delete(e))}clear(){const e=this.cache.keys();let t=0;for(let a=e.next();!a.done;a=e.next())this.delete(a.value),t+=1;return t}}class Ag{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}var Fg=Ag,Wl=bn(Fg),ql={},gs={};gs.byteLength=Ig,gs.toByteArray=Tg,gs.fromByteArray=$g;for(var er=[],mn=[],Bg=typeof Uint8Array<"u"?Uint8Array:Array,Qu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$i=0,Sg=Qu.length;$i<Sg;++$i)er[$i]=Qu[$i],mn[Qu.charCodeAt($i)]=$i;mn[45]=62,mn[95]=63;function Gl(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var a=t===e?0:4-t%4;return[t,a]}function Ig(n){var e=Gl(n),t=e[0],a=e[1];return(t+a)*3/4-a}function kg(n,e,t){return(e+t)*3/4-t}function Tg(n){var e,t=Gl(n),a=t[0],o=t[1],u=new Bg(kg(n,a,o)),f=0,h=o>0?a-4:a,v;for(v=0;v<h;v+=4)e=mn[n.charCodeAt(v)]<<18|mn[n.charCodeAt(v+1)]<<12|mn[n.charCodeAt(v+2)]<<6|mn[n.charCodeAt(v+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=e&255;return o===2&&(e=mn[n.charCodeAt(v)]<<2|mn[n.charCodeAt(v+1)]>>4,u[f++]=e&255),o===1&&(e=mn[n.charCodeAt(v)]<<10|mn[n.charCodeAt(v+1)]<<4|mn[n.charCodeAt(v+2)]>>2,u[f++]=e>>8&255,u[f++]=e&255),u}function Rg(n){return er[n>>18&63]+er[n>>12&63]+er[n>>6&63]+er[n&63]}function Ng(n,e,t){for(var a,o=[],u=e;u<t;u+=3)a=(n[u]<<16&16711680)+(n[u+1]<<8&65280)+(n[u+2]&255),o.push(Rg(a));return o.join("")}function $g(n){for(var e,t=n.length,a=t%3,o=[],u=16383,f=0,h=t-a;f<h;f+=u)o.push(Ng(n,f,f+u>h?h:f+u));return a===1?(e=n[t-1],o.push(er[e>>2]+er[e<<4&63]+"==")):a===2&&(e=(n[t-2]<<8)+n[t-1],o.push(er[e>>10]+er[e>>4&63]+er[e<<2&63]+"=")),o.join("")}var Ju={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Ju.read=function(n,e,t,a,o){var u,f,h=o*8-a-1,v=(1<<h)-1,d=v>>1,c=-7,D=t?o-1:0,y=t?-1:1,m=n[e+D];for(D+=y,u=m&(1<<-c)-1,m>>=-c,c+=h;c>0;u=u*256+n[e+D],D+=y,c-=8);for(f=u&(1<<-c)-1,u>>=-c,c+=a;c>0;f=f*256+n[e+D],D+=y,c-=8);if(u===0)u=1-d;else{if(u===v)return f?NaN:(m?-1:1)*(1/0);f=f+Math.pow(2,a),u=u-d}return(m?-1:1)*f*Math.pow(2,u-a)},Ju.write=function(n,e,t,a,o,u){var f,h,v,d=u*8-o-1,c=(1<<d)-1,D=c>>1,y=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=a?0:u-1,I=a?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(h=isNaN(e)?1:0,f=c):(f=Math.floor(Math.log(e)/Math.LN2),e*(v=Math.pow(2,-f))<1&&(f--,v*=2),f+D>=1?e+=y/v:e+=y*Math.pow(2,1-D),e*v>=2&&(f++,v/=2),f+D>=c?(h=0,f=c):f+D>=1?(h=(e*v-1)*Math.pow(2,o),f=f+D):(h=e*Math.pow(2,D-1)*Math.pow(2,o),f=0));o>=8;n[t+m]=h&255,m+=I,h/=256,o-=8);for(f=f<<o|h,d+=o;d>0;n[t+m]=f&255,m+=I,f/=256,d-=8);n[t+m-I]|=S*128};/*!
28
+ * The buffer module from node.js, for the browser.
29
+ *
30
+ * @author Feross Aboukhadijeh <https://feross.org>
31
+ * @license MIT
32
+ */(function(n){const e=gs,t=Ju,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=c,n.SlowBuffer=M,n.INSPECT_MAX_BYTES=50;const o=2147483647;n.kMaxLength=o;const{Uint8Array:u,ArrayBuffer:f,SharedArrayBuffer:h}=globalThis;c.TYPED_ARRAY_SUPPORT=v(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function v(){try{const E=new u(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,u.prototype),Object.setPrototypeOf(E,_),E.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function d(E){if(E>o)throw new RangeError('The value "'+E+'" is invalid for option "size"');const _=new u(E);return Object.setPrototypeOf(_,c.prototype),_}function c(E,_,w){if(typeof E=="number"){if(typeof _=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return I(E)}return D(E,_,w)}c.poolSize=8192;function D(E,_,w){if(typeof E=="string")return S(E,_);if(f.isView(E))return N(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(rt(E,f)||E&&rt(E.buffer,f)||typeof h<"u"&&(rt(E,h)||E&&rt(E.buffer,h)))return Z(E,_,w);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const R=E.valueOf&&E.valueOf();if(R!=null&&R!==E)return c.from(R,_,w);const W=P(E);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return c.from(E[Symbol.toPrimitive]("string"),_,w);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}c.from=function(E,_,w){return D(E,_,w)},Object.setPrototypeOf(c.prototype,u.prototype),Object.setPrototypeOf(c,u);function y(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function m(E,_,w){return y(E),E<=0?d(E):_!==void 0?typeof w=="string"?d(E).fill(_,w):d(E).fill(_):d(E)}c.alloc=function(E,_,w){return m(E,_,w)};function I(E){return y(E),d(E<0?0:k(E)|0)}c.allocUnsafe=function(E){return I(E)},c.allocUnsafeSlow=function(E){return I(E)};function S(E,_){if((typeof _!="string"||_==="")&&(_="utf8"),!c.isEncoding(_))throw new TypeError("Unknown encoding: "+_);const w=q(E,_)|0;let R=d(w);const W=R.write(E,_);return W!==w&&(R=R.slice(0,W)),R}function T(E){const _=E.length<0?0:k(E.length)|0,w=d(_);for(let R=0;R<_;R+=1)w[R]=E[R]&255;return w}function N(E){if(rt(E,u)){const _=new u(E);return Z(_.buffer,_.byteOffset,_.byteLength)}return T(E)}function Z(E,_,w){if(_<0||E.byteLength<_)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<_+(w||0))throw new RangeError('"length" is outside of buffer bounds');let R;return _===void 0&&w===void 0?R=new u(E):w===void 0?R=new u(E,_):R=new u(E,_,w),Object.setPrototypeOf(R,c.prototype),R}function P(E){if(c.isBuffer(E)){const _=k(E.length)|0,w=d(_);return w.length===0||E.copy(w,0,0,_),w}if(E.length!==void 0)return typeof E.length!="number"||wt(E.length)?d(0):T(E);if(E.type==="Buffer"&&Array.isArray(E.data))return T(E.data)}function k(E){if(E>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return E|0}function M(E){return+E!=E&&(E=0),c.alloc(+E)}c.isBuffer=function(_){return _!=null&&_._isBuffer===!0&&_!==c.prototype},c.compare=function(_,w){if(rt(_,u)&&(_=c.from(_,_.offset,_.byteLength)),rt(w,u)&&(w=c.from(w,w.offset,w.byteLength)),!c.isBuffer(_)||!c.isBuffer(w))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_===w)return 0;let R=_.length,W=w.length;for(let X=0,J=Math.min(R,W);X<J;++X)if(_[X]!==w[X]){R=_[X],W=w[X];break}return R<W?-1:W<R?1:0},c.isEncoding=function(_){switch(String(_).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(_,w){if(!Array.isArray(_))throw new TypeError('"list" argument must be an Array of Buffers');if(_.length===0)return c.alloc(0);let R;if(w===void 0)for(w=0,R=0;R<_.length;++R)w+=_[R].length;const W=c.allocUnsafe(w);let X=0;for(R=0;R<_.length;++R){let J=_[R];if(rt(J,u))X+J.length>W.length?(c.isBuffer(J)||(J=c.from(J)),J.copy(W,X)):u.prototype.set.call(W,J,X);else if(c.isBuffer(J))J.copy(W,X);else throw new TypeError('"list" argument must be an Array of Buffers');X+=J.length}return W};function q(E,_){if(c.isBuffer(E))return E.length;if(f.isView(E)||rt(E,f))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const w=E.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&w===0)return 0;let W=!1;for(;;)switch(_){case"ascii":case"latin1":case"binary":return w;case"utf8":case"utf-8":return At(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w*2;case"hex":return w>>>1;case"base64":return Qt(E).length;default:if(W)return R?-1:At(E).length;_=(""+_).toLowerCase(),W=!0}}c.byteLength=q;function $(E,_,w){let R=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((w===void 0||w>this.length)&&(w=this.length),w<=0)||(w>>>=0,_>>>=0,w<=_))return"";for(E||(E="utf8");;)switch(E){case"hex":return ue(this,_,w);case"utf8":case"utf-8":return ae(this,_,w);case"ascii":return Xe(this,_,w);case"latin1":case"binary":return le(this,_,w);case"base64":return ke(this,_,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,_,w);default:if(R)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),R=!0}}c.prototype._isBuffer=!0;function A(E,_,w){const R=E[_];E[_]=E[w],E[w]=R}c.prototype.swap16=function(){const _=this.length;if(_%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let w=0;w<_;w+=2)A(this,w,w+1);return this},c.prototype.swap32=function(){const _=this.length;if(_%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let w=0;w<_;w+=4)A(this,w,w+3),A(this,w+1,w+2);return this},c.prototype.swap64=function(){const _=this.length;if(_%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let w=0;w<_;w+=8)A(this,w,w+7),A(this,w+1,w+6),A(this,w+2,w+5),A(this,w+3,w+4);return this},c.prototype.toString=function(){const _=this.length;return _===0?"":arguments.length===0?ae(this,0,_):$.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(_){if(!c.isBuffer(_))throw new TypeError("Argument must be a Buffer");return this===_?!0:c.compare(this,_)===0},c.prototype.inspect=function(){let _="";const w=n.INSPECT_MAX_BYTES;return _=this.toString("hex",0,w).replace(/(.{2})/g,"$1 ").trim(),this.length>w&&(_+=" ... "),"<Buffer "+_+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(_,w,R,W,X){if(rt(_,u)&&(_=c.from(_,_.offset,_.byteLength)),!c.isBuffer(_))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof _);if(w===void 0&&(w=0),R===void 0&&(R=_?_.length:0),W===void 0&&(W=0),X===void 0&&(X=this.length),w<0||R>_.length||W<0||X>this.length)throw new RangeError("out of range index");if(W>=X&&w>=R)return 0;if(W>=X)return-1;if(w>=R)return 1;if(w>>>=0,R>>>=0,W>>>=0,X>>>=0,this===_)return 0;let J=X-W,Te=R-w;const bt=Math.min(J,Te),ft=this.slice(W,X),mt=_.slice(w,R);for(let et=0;et<bt;++et)if(ft[et]!==mt[et]){J=ft[et],Te=mt[et];break}return J<Te?-1:Te<J?1:0};function F(E,_,w,R,W){if(E.length===0)return-1;if(typeof w=="string"?(R=w,w=0):w>2147483647?w=2147483647:w<-2147483648&&(w=-2147483648),w=+w,wt(w)&&(w=W?0:E.length-1),w<0&&(w=E.length+w),w>=E.length){if(W)return-1;w=E.length-1}else if(w<0)if(W)w=0;else return-1;if(typeof _=="string"&&(_=c.from(_,R)),c.isBuffer(_))return _.length===0?-1:L(E,_,w,R,W);if(typeof _=="number")return _=_&255,typeof u.prototype.indexOf=="function"?W?u.prototype.indexOf.call(E,_,w):u.prototype.lastIndexOf.call(E,_,w):L(E,[_],w,R,W);throw new TypeError("val must be string, number or Buffer")}function L(E,_,w,R,W){let X=1,J=E.length,Te=_.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(E.length<2||_.length<2)return-1;X=2,J/=2,Te/=2,w/=2}function bt(mt,et){return X===1?mt[et]:mt.readUInt16BE(et*X)}let ft;if(W){let mt=-1;for(ft=w;ft<J;ft++)if(bt(E,ft)===bt(_,mt===-1?0:ft-mt)){if(mt===-1&&(mt=ft),ft-mt+1===Te)return mt*X}else mt!==-1&&(ft-=ft-mt),mt=-1}else for(w+Te>J&&(w=J-Te),ft=w;ft>=0;ft--){let mt=!0;for(let et=0;et<Te;et++)if(bt(E,ft+et)!==bt(_,et)){mt=!1;break}if(mt)return ft}return-1}c.prototype.includes=function(_,w,R){return this.indexOf(_,w,R)!==-1},c.prototype.indexOf=function(_,w,R){return F(this,_,w,R,!0)},c.prototype.lastIndexOf=function(_,w,R){return F(this,_,w,R,!1)};function G(E,_,w,R){w=Number(w)||0;const W=E.length-w;R?(R=Number(R),R>W&&(R=W)):R=W;const X=_.length;R>X/2&&(R=X/2);let J;for(J=0;J<R;++J){const Te=parseInt(_.substr(J*2,2),16);if(wt(Te))return J;E[w+J]=Te}return J}function Y(E,_,w,R){return xt(At(_,E.length-w),E,w,R)}function ne(E,_,w,R){return xt(vt(_),E,w,R)}function se(E,_,w,R){return xt(Qt(_),E,w,R)}function pe(E,_,w,R){return xt(yt(_,E.length-w),E,w,R)}c.prototype.write=function(_,w,R,W){if(w===void 0)W="utf8",R=this.length,w=0;else if(R===void 0&&typeof w=="string")W=w,R=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(R)?(R=R>>>0,W===void 0&&(W="utf8")):(W=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const X=this.length-w;if((R===void 0||R>X)&&(R=X),_.length>0&&(R<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let J=!1;for(;;)switch(W){case"hex":return G(this,_,w,R);case"utf8":case"utf-8":return Y(this,_,w,R);case"ascii":case"latin1":case"binary":return ne(this,_,w,R);case"base64":return se(this,_,w,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,_,w,R);default:if(J)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),J=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ke(E,_,w){return _===0&&w===E.length?e.fromByteArray(E):e.fromByteArray(E.slice(_,w))}function ae(E,_,w){w=Math.min(E.length,w);const R=[];let W=_;for(;W<w;){const X=E[W];let J=null,Te=X>239?4:X>223?3:X>191?2:1;if(W+Te<=w){let bt,ft,mt,et;switch(Te){case 1:X<128&&(J=X);break;case 2:bt=E[W+1],(bt&192)===128&&(et=(X&31)<<6|bt&63,et>127&&(J=et));break;case 3:bt=E[W+1],ft=E[W+2],(bt&192)===128&&(ft&192)===128&&(et=(X&15)<<12|(bt&63)<<6|ft&63,et>2047&&(et<55296||et>57343)&&(J=et));break;case 4:bt=E[W+1],ft=E[W+2],mt=E[W+3],(bt&192)===128&&(ft&192)===128&&(mt&192)===128&&(et=(X&15)<<18|(bt&63)<<12|(ft&63)<<6|mt&63,et>65535&&et<1114112&&(J=et))}}J===null?(J=65533,Te=1):J>65535&&(J-=65536,R.push(J>>>10&1023|55296),J=56320|J&1023),R.push(J),W+=Te}return _e(R)}const ge=4096;function _e(E){const _=E.length;if(_<=ge)return String.fromCharCode.apply(String,E);let w="",R=0;for(;R<_;)w+=String.fromCharCode.apply(String,E.slice(R,R+=ge));return w}function Xe(E,_,w){let R="";w=Math.min(E.length,w);for(let W=_;W<w;++W)R+=String.fromCharCode(E[W]&127);return R}function le(E,_,w){let R="";w=Math.min(E.length,w);for(let W=_;W<w;++W)R+=String.fromCharCode(E[W]);return R}function ue(E,_,w){const R=E.length;(!_||_<0)&&(_=0),(!w||w<0||w>R)&&(w=R);let W="";for(let X=_;X<w;++X)W+=Ft[E[X]];return W}function fe(E,_,w){const R=E.slice(_,w);let W="";for(let X=0;X<R.length-1;X+=2)W+=String.fromCharCode(R[X]+R[X+1]*256);return W}c.prototype.slice=function(_,w){const R=this.length;_=~~_,w=w===void 0?R:~~w,_<0?(_+=R,_<0&&(_=0)):_>R&&(_=R),w<0?(w+=R,w<0&&(w=0)):w>R&&(w=R),w<_&&(w=_);const W=this.subarray(_,w);return Object.setPrototypeOf(W,c.prototype),W};function Ee(E,_,w){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+_>w)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(_,w,R){_=_>>>0,w=w>>>0,R||Ee(_,w,this.length);let W=this[_],X=1,J=0;for(;++J<w&&(X*=256);)W+=this[_+J]*X;return W},c.prototype.readUintBE=c.prototype.readUIntBE=function(_,w,R){_=_>>>0,w=w>>>0,R||Ee(_,w,this.length);let W=this[_+--w],X=1;for(;w>0&&(X*=256);)W+=this[_+--w]*X;return W},c.prototype.readUint8=c.prototype.readUInt8=function(_,w){return _=_>>>0,w||Ee(_,1,this.length),this[_]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(_,w){return _=_>>>0,w||Ee(_,2,this.length),this[_]|this[_+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(_,w){return _=_>>>0,w||Ee(_,2,this.length),this[_]<<8|this[_+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(_,w){return _=_>>>0,w||Ee(_,4,this.length),(this[_]|this[_+1]<<8|this[_+2]<<16)+this[_+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(_,w){return _=_>>>0,w||Ee(_,4,this.length),this[_]*16777216+(this[_+1]<<16|this[_+2]<<8|this[_+3])},c.prototype.readBigUInt64LE=dt(function(_){_=_>>>0,Ce(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&ze(_,this.length-8);const W=w+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24,X=this[++_]+this[++_]*2**8+this[++_]*2**16+R*2**24;return BigInt(W)+(BigInt(X)<<BigInt(32))}),c.prototype.readBigUInt64BE=dt(function(_){_=_>>>0,Ce(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&ze(_,this.length-8);const W=w*2**24+this[++_]*2**16+this[++_]*2**8+this[++_],X=this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+R;return(BigInt(W)<<BigInt(32))+BigInt(X)}),c.prototype.readIntLE=function(_,w,R){_=_>>>0,w=w>>>0,R||Ee(_,w,this.length);let W=this[_],X=1,J=0;for(;++J<w&&(X*=256);)W+=this[_+J]*X;return X*=128,W>=X&&(W-=Math.pow(2,8*w)),W},c.prototype.readIntBE=function(_,w,R){_=_>>>0,w=w>>>0,R||Ee(_,w,this.length);let W=w,X=1,J=this[_+--W];for(;W>0&&(X*=256);)J+=this[_+--W]*X;return X*=128,J>=X&&(J-=Math.pow(2,8*w)),J},c.prototype.readInt8=function(_,w){return _=_>>>0,w||Ee(_,1,this.length),this[_]&128?(255-this[_]+1)*-1:this[_]},c.prototype.readInt16LE=function(_,w){_=_>>>0,w||Ee(_,2,this.length);const R=this[_]|this[_+1]<<8;return R&32768?R|4294901760:R},c.prototype.readInt16BE=function(_,w){_=_>>>0,w||Ee(_,2,this.length);const R=this[_+1]|this[_]<<8;return R&32768?R|4294901760:R},c.prototype.readInt32LE=function(_,w){return _=_>>>0,w||Ee(_,4,this.length),this[_]|this[_+1]<<8|this[_+2]<<16|this[_+3]<<24},c.prototype.readInt32BE=function(_,w){return _=_>>>0,w||Ee(_,4,this.length),this[_]<<24|this[_+1]<<16|this[_+2]<<8|this[_+3]},c.prototype.readBigInt64LE=dt(function(_){_=_>>>0,Ce(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&ze(_,this.length-8);const W=this[_+4]+this[_+5]*2**8+this[_+6]*2**16+(R<<24);return(BigInt(W)<<BigInt(32))+BigInt(w+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24)}),c.prototype.readBigInt64BE=dt(function(_){_=_>>>0,Ce(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&ze(_,this.length-8);const W=(w<<24)+this[++_]*2**16+this[++_]*2**8+this[++_];return(BigInt(W)<<BigInt(32))+BigInt(this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+R)}),c.prototype.readFloatLE=function(_,w){return _=_>>>0,w||Ee(_,4,this.length),t.read(this,_,!0,23,4)},c.prototype.readFloatBE=function(_,w){return _=_>>>0,w||Ee(_,4,this.length),t.read(this,_,!1,23,4)},c.prototype.readDoubleLE=function(_,w){return _=_>>>0,w||Ee(_,8,this.length),t.read(this,_,!0,52,8)},c.prototype.readDoubleBE=function(_,w){return _=_>>>0,w||Ee(_,8,this.length),t.read(this,_,!1,52,8)};function ve(E,_,w,R,W,X){if(!c.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>W||_<X)throw new RangeError('"value" argument is out of bounds');if(w+R>E.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(_,w,R,W){if(_=+_,w=w>>>0,R=R>>>0,!W){const Te=Math.pow(2,8*R)-1;ve(this,_,w,R,Te,0)}let X=1,J=0;for(this[w]=_&255;++J<R&&(X*=256);)this[w+J]=_/X&255;return w+R},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(_,w,R,W){if(_=+_,w=w>>>0,R=R>>>0,!W){const Te=Math.pow(2,8*R)-1;ve(this,_,w,R,Te,0)}let X=R-1,J=1;for(this[w+X]=_&255;--X>=0&&(J*=256);)this[w+X]=_/J&255;return w+R},c.prototype.writeUint8=c.prototype.writeUInt8=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,1,255,0),this[w]=_&255,w+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,2,65535,0),this[w]=_&255,this[w+1]=_>>>8,w+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,2,65535,0),this[w]=_>>>8,this[w+1]=_&255,w+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,4,4294967295,0),this[w+3]=_>>>24,this[w+2]=_>>>16,this[w+1]=_>>>8,this[w]=_&255,w+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,4,4294967295,0),this[w]=_>>>24,this[w+1]=_>>>16,this[w+2]=_>>>8,this[w+3]=_&255,w+4};function qe(E,_,w,R,W){Ae(_,R,W,E,w,7);let X=Number(_&BigInt(4294967295));E[w++]=X,X=X>>8,E[w++]=X,X=X>>8,E[w++]=X,X=X>>8,E[w++]=X;let J=Number(_>>BigInt(32)&BigInt(4294967295));return E[w++]=J,J=J>>8,E[w++]=J,J=J>>8,E[w++]=J,J=J>>8,E[w++]=J,w}function ot(E,_,w,R,W){Ae(_,R,W,E,w,7);let X=Number(_&BigInt(4294967295));E[w+7]=X,X=X>>8,E[w+6]=X,X=X>>8,E[w+5]=X,X=X>>8,E[w+4]=X;let J=Number(_>>BigInt(32)&BigInt(4294967295));return E[w+3]=J,J=J>>8,E[w+2]=J,J=J>>8,E[w+1]=J,J=J>>8,E[w]=J,w+8}c.prototype.writeBigUInt64LE=dt(function(_,w=0){return qe(this,_,w,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=dt(function(_,w=0){return ot(this,_,w,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(_,w,R,W){if(_=+_,w=w>>>0,!W){const bt=Math.pow(2,8*R-1);ve(this,_,w,R,bt-1,-bt)}let X=0,J=1,Te=0;for(this[w]=_&255;++X<R&&(J*=256);)_<0&&Te===0&&this[w+X-1]!==0&&(Te=1),this[w+X]=(_/J>>0)-Te&255;return w+R},c.prototype.writeIntBE=function(_,w,R,W){if(_=+_,w=w>>>0,!W){const bt=Math.pow(2,8*R-1);ve(this,_,w,R,bt-1,-bt)}let X=R-1,J=1,Te=0;for(this[w+X]=_&255;--X>=0&&(J*=256);)_<0&&Te===0&&this[w+X+1]!==0&&(Te=1),this[w+X]=(_/J>>0)-Te&255;return w+R},c.prototype.writeInt8=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,1,127,-128),_<0&&(_=255+_+1),this[w]=_&255,w+1},c.prototype.writeInt16LE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,2,32767,-32768),this[w]=_&255,this[w+1]=_>>>8,w+2},c.prototype.writeInt16BE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,2,32767,-32768),this[w]=_>>>8,this[w+1]=_&255,w+2},c.prototype.writeInt32LE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,4,2147483647,-2147483648),this[w]=_&255,this[w+1]=_>>>8,this[w+2]=_>>>16,this[w+3]=_>>>24,w+4},c.prototype.writeInt32BE=function(_,w,R){return _=+_,w=w>>>0,R||ve(this,_,w,4,2147483647,-2147483648),_<0&&(_=4294967295+_+1),this[w]=_>>>24,this[w+1]=_>>>16,this[w+2]=_>>>8,this[w+3]=_&255,w+4},c.prototype.writeBigInt64LE=dt(function(_,w=0){return qe(this,_,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=dt(function(_,w=0){return ot(this,_,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function be(E,_,w,R,W,X){if(w+R>E.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function Fe(E,_,w,R,W){return _=+_,w=w>>>0,W||be(E,_,w,4),t.write(E,_,w,R,23,4),w+4}c.prototype.writeFloatLE=function(_,w,R){return Fe(this,_,w,!0,R)},c.prototype.writeFloatBE=function(_,w,R){return Fe(this,_,w,!1,R)};function Ke(E,_,w,R,W){return _=+_,w=w>>>0,W||be(E,_,w,8),t.write(E,_,w,R,52,8),w+8}c.prototype.writeDoubleLE=function(_,w,R){return Ke(this,_,w,!0,R)},c.prototype.writeDoubleBE=function(_,w,R){return Ke(this,_,w,!1,R)},c.prototype.copy=function(_,w,R,W){if(!c.isBuffer(_))throw new TypeError("argument should be a Buffer");if(R||(R=0),!W&&W!==0&&(W=this.length),w>=_.length&&(w=_.length),w||(w=0),W>0&&W<R&&(W=R),W===R||_.length===0||this.length===0)return 0;if(w<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),_.length-w<W-R&&(W=_.length-w+R);const X=W-R;return this===_&&typeof u.prototype.copyWithin=="function"?this.copyWithin(w,R,W):u.prototype.set.call(_,this.subarray(R,W),w),X},c.prototype.fill=function(_,w,R,W){if(typeof _=="string"){if(typeof w=="string"?(W=w,w=0,R=this.length):typeof R=="string"&&(W=R,R=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!c.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(_.length===1){const J=_.charCodeAt(0);(W==="utf8"&&J<128||W==="latin1")&&(_=J)}}else typeof _=="number"?_=_&255:typeof _=="boolean"&&(_=Number(_));if(w<0||this.length<w||this.length<R)throw new RangeError("Out of range index");if(R<=w)return this;w=w>>>0,R=R===void 0?this.length:R>>>0,_||(_=0);let X;if(typeof _=="number")for(X=w;X<R;++X)this[X]=_;else{const J=c.isBuffer(_)?_:c.from(_,W),Te=J.length;if(Te===0)throw new TypeError('The value "'+_+'" is invalid for argument "value"');for(X=0;X<R-w;++X)this[X+w]=J[X%Te]}return this};const he={};function Oe(E,_,w){he[E]=class extends w{constructor(){super(),Object.defineProperty(this,"message",{value:_.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(E,_){return`The "${E}" argument must be of type number. Received type ${typeof _}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(E,_,w){let R=`The value of "${E}" is out of range.`,W=w;return Number.isInteger(w)&&Math.abs(w)>2**32?W=Ye(String(w)):typeof w=="bigint"&&(W=String(w),(w>BigInt(2)**BigInt(32)||w<-(BigInt(2)**BigInt(32)))&&(W=Ye(W)),W+="n"),R+=` It must be ${_}. Received ${W}`,R},RangeError);function Ye(E){let _="",w=E.length;const R=E[0]==="-"?1:0;for(;w>=R+4;w-=3)_=`_${E.slice(w-3,w)}${_}`;return`${E.slice(0,w)}${_}`}function we(E,_,w){Ce(_,"offset"),(E[_]===void 0||E[_+w]===void 0)&&ze(_,E.length-(w+1))}function Ae(E,_,w,R,W,X){if(E>w||E<_){const J=typeof _=="bigint"?"n":"";let Te;throw _===0||_===BigInt(0)?Te=`>= 0${J} and < 2${J} ** ${(X+1)*8}${J}`:Te=`>= -(2${J} ** ${(X+1)*8-1}${J}) and < 2 ** ${(X+1)*8-1}${J}`,new he.ERR_OUT_OF_RANGE("value",Te,E)}we(R,W,X)}function Ce(E,_){if(typeof E!="number")throw new he.ERR_INVALID_ARG_TYPE(_,"number",E)}function ze(E,_,w){throw Math.floor(E)!==E?(Ce(E,w),new he.ERR_OUT_OF_RANGE("offset","an integer",E)):_<0?new he.ERR_BUFFER_OUT_OF_BOUNDS:new he.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${_}`,E)}const De=/[^+/0-9A-Za-z-_]/g;function Qe(E){if(E=E.split("=")[0],E=E.trim().replace(De,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function At(E,_){_=_||1/0;let w;const R=E.length;let W=null;const X=[];for(let J=0;J<R;++J){if(w=E.charCodeAt(J),w>55295&&w<57344){if(!W){if(w>56319){(_-=3)>-1&&X.push(239,191,189);continue}else if(J+1===R){(_-=3)>-1&&X.push(239,191,189);continue}W=w;continue}if(w<56320){(_-=3)>-1&&X.push(239,191,189),W=w;continue}w=(W-55296<<10|w-56320)+65536}else W&&(_-=3)>-1&&X.push(239,191,189);if(W=null,w<128){if((_-=1)<0)break;X.push(w)}else if(w<2048){if((_-=2)<0)break;X.push(w>>6|192,w&63|128)}else if(w<65536){if((_-=3)<0)break;X.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((_-=4)<0)break;X.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return X}function vt(E){const _=[];for(let w=0;w<E.length;++w)_.push(E.charCodeAt(w)&255);return _}function yt(E,_){let w,R,W;const X=[];for(let J=0;J<E.length&&!((_-=2)<0);++J)w=E.charCodeAt(J),R=w>>8,W=w%256,X.push(W),X.push(R);return X}function Qt(E){return e.toByteArray(Qe(E))}function xt(E,_,w,R){let W;for(W=0;W<R&&!(W+w>=_.length||W>=E.length);++W)_[W+w]=E[W];return W}function rt(E,_){return E instanceof _||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===_.name}function wt(E){return E!==E}const Ft=function(){const E="0123456789abcdef",_=new Array(256);for(let w=0;w<16;++w){const R=w*16;for(let W=0;W<16;++W)_[R+W]=E[w]+E[W]}return _}();function dt(E){return typeof BigInt>"u"?Ar:E}function Ar(){throw new Error("BigInt not supported")}})(ql);const Un=ql.Buffer;var va={};function Hl(n){return(typeof n=="object"&&n!==null&&"message"in n?n.message:`${n}`).replace(/\.$/,"")}class tr{async getBufferFromResponse(e){const t=await e.arrayBuffer();return Un.from(t)}constructor(e,t={}){this.baseOverrides={},this.url=e;const a=t.fetch||globalThis.fetch.bind(globalThis);if(!a)throw new TypeError("no fetch function supplied, and none found in global environment");t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=a}async fetch(e,t){let a;try{a=await this.fetchImplementation(e,t)}catch(o){if(`${o}`.includes("Failed to fetch")){console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{a=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(u){throw new Error(`${Hl(u)} fetching ${e}`,{cause:u})}}else throw new Error(`${Hl(o)} fetching ${e}`,{cause:o})}return a}async read(e,t=0,a,o=0,u={}){const{headers:f={},signal:h,overrides:v={}}=u;a<1/0?f.range=`bytes=${o}-${o+a}`:a===1/0&&o!==0&&(f.range=`bytes=${o}-`);const d=await this.fetch(this.url,{...this.baseOverrides,...v,headers:{...f,...v.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:h});if(!d.ok)throw new Error(`HTTP ${d.status} fetching ${this.url}`);if(d.status===200&&o===0||d.status===206){const c=await this.getBufferFromResponse(d),D=c.copy(e,t,0,Math.min(a,c.length)),y=d.headers.get("content-range"),m=/\/(\d+)$/.exec(y||"");return m!=null&&m[1]&&(this._stat={size:parseInt(m[1],10)}),{bytesRead:D,buffer:e}}throw d.status===200?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${d.status} fetching ${this.url}`)}async readFile(e={}){let t,a;typeof e=="string"?(t=e,a={}):(t=e.encoding,a=e,delete a.encoding);const{headers:o={},signal:u,overrides:f={}}=a,h=await this.fetch(this.url,{headers:o,method:"GET",redirect:"follow",mode:"cors",signal:u,...this.baseOverrides,...f});if(h.status!==200)throw new Error(`HTTP ${h.status} fetching ${this.url}`);if(t==="utf8")return h.text();if(t)throw new Error(`unsupported encoding: ${t}`);return this.getBufferFromResponse(h)}async stat(){if(!this._stat){const e=Un.allocUnsafe(10);if(await this.read(e,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}function Zl(n){const e=new FileReader;return new Promise((t,a)=>{e.onerror=()=>{e.abort(),a(new Error("problem reading blob"))},e.onabort=()=>{a(new Error("blob reading was aborted"))},e.onload=()=>{e.result&&typeof e.result!="string"?t(e.result):a(new Error("unknown error reading blob"))},e.readAsArrayBuffer(n)})}function Lg(n){const e=new FileReader;return new Promise((t,a)=>{e.onerror=()=>{e.abort(),a(new Error("problem reading blob"))},e.onabort=()=>{a(new Error("blob reading was aborted"))},e.onload=()=>{e.result&&typeof e.result=="string"?t(e.result):a(new Error("unknown error reading blob"))},e.readAsText(n)})}class Vl{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0,a,o=0){if(!a)return{bytesRead:0,buffer:e};const u=o,f=u+a,h=await Zl(this.blob.slice(u,f)),v=Un.from(h);return{bytesRead:v.copy(e,t),buffer:v}}async readFile(e){const t=typeof e=="string"?e:e==null?void 0:e.encoding;if(t==="utf8")return Lg(this.blob);if(t)throw new Error(`unsupported encoding: ${t}`);const a=await Zl(this.blob);return Un.from(a)}async stat(){return{size:this.size}}async close(){}}var gr={};(function(n){var e=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(u,f){return Object.prototype.hasOwnProperty.call(u,f)}n.assign=function(u){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var h=f.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var v in h)t(h,v)&&(u[v]=h[v])}}return u},n.shrinkBuf=function(u,f){return u.length===f?u:u.subarray?u.subarray(0,f):(u.length=f,u)};var a={arraySet:function(u,f,h,v,d){if(f.subarray&&u.subarray){u.set(f.subarray(h,h+v),d);return}for(var c=0;c<v;c++)u[d+c]=f[h+c]},flattenChunks:function(u){var f,h,v,d,c,D;for(v=0,f=0,h=u.length;f<h;f++)v+=u[f].length;for(D=new Uint8Array(v),d=0,f=0,h=u.length;f<h;f++)c=u[f],D.set(c,d),d+=c.length;return D}},o={arraySet:function(u,f,h,v,d){for(var c=0;c<v;c++)u[d+c]=f[h+c]},flattenChunks:function(u){return[].concat.apply([],u)}};n.setTyped=function(u){u?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(e)})(gr);var wa={},nr={},Li={},Og=gr,Pg=4,Xl=0,Kl=1,Mg=2;function Oi(n){for(var e=n.length;--e>=0;)n[e]=0}var Ug=0,Yl=1,Wg=2,qg=3,Gg=258,ju=29,ba=256,ma=ba+1+ju,Pi=30,zu=19,Ql=2*ma+1,ri=15,eo=16,Hg=7,to=256,Jl=16,jl=17,zl=18,no=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_s=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Zg=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],eh=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Vg=512,_r=new Array((ma+2)*2);Oi(_r);var Da=new Array(Pi*2);Oi(Da);var ya=new Array(Vg);Oi(ya);var xa=new Array(Gg-qg+1);Oi(xa);var ro=new Array(ju);Oi(ro);var vs=new Array(Pi);Oi(vs);function io(n,e,t,a,o){this.static_tree=n,this.extra_bits=e,this.extra_base=t,this.elems=a,this.max_length=o,this.has_stree=n&&n.length}var th,nh,rh;function ao(n,e){this.dyn_tree=n,this.max_code=0,this.stat_desc=e}function ih(n){return n<256?ya[n]:ya[256+(n>>>7)]}function Ea(n,e){n.pending_buf[n.pending++]=e&255,n.pending_buf[n.pending++]=e>>>8&255}function en(n,e,t){n.bi_valid>eo-t?(n.bi_buf|=e<<n.bi_valid&65535,Ea(n,n.bi_buf),n.bi_buf=e>>eo-n.bi_valid,n.bi_valid+=t-eo):(n.bi_buf|=e<<n.bi_valid&65535,n.bi_valid+=t)}function rr(n,e,t){en(n,t[e*2],t[e*2+1])}function ah(n,e){var t=0;do t|=n&1,n>>>=1,t<<=1;while(--e>0);return t>>>1}function Xg(n){n.bi_valid===16?(Ea(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)}function Kg(n,e){var t=e.dyn_tree,a=e.max_code,o=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,v=e.stat_desc.max_length,d,c,D,y,m,I,S=0;for(y=0;y<=ri;y++)n.bl_count[y]=0;for(t[n.heap[n.heap_max]*2+1]=0,d=n.heap_max+1;d<Ql;d++)c=n.heap[d],y=t[t[c*2+1]*2+1]+1,y>v&&(y=v,S++),t[c*2+1]=y,!(c>a)&&(n.bl_count[y]++,m=0,c>=h&&(m=f[c-h]),I=t[c*2],n.opt_len+=I*(y+m),u&&(n.static_len+=I*(o[c*2+1]+m)));if(S!==0){do{for(y=v-1;n.bl_count[y]===0;)y--;n.bl_count[y]--,n.bl_count[y+1]+=2,n.bl_count[v]--,S-=2}while(S>0);for(y=v;y!==0;y--)for(c=n.bl_count[y];c!==0;)D=n.heap[--d],!(D>a)&&(t[D*2+1]!==y&&(n.opt_len+=(y-t[D*2+1])*t[D*2],t[D*2+1]=y),c--)}}function sh(n,e,t){var a=new Array(ri+1),o=0,u,f;for(u=1;u<=ri;u++)a[u]=o=o+t[u-1]<<1;for(f=0;f<=e;f++){var h=n[f*2+1];h!==0&&(n[f*2]=ah(a[h]++,h))}}function Yg(){var n,e,t,a,o,u=new Array(ri+1);for(t=0,a=0;a<ju-1;a++)for(ro[a]=t,n=0;n<1<<no[a];n++)xa[t++]=a;for(xa[t-1]=a,o=0,a=0;a<16;a++)for(vs[a]=o,n=0;n<1<<_s[a];n++)ya[o++]=a;for(o>>=7;a<Pi;a++)for(vs[a]=o<<7,n=0;n<1<<_s[a]-7;n++)ya[256+o++]=a;for(e=0;e<=ri;e++)u[e]=0;for(n=0;n<=143;)_r[n*2+1]=8,n++,u[8]++;for(;n<=255;)_r[n*2+1]=9,n++,u[9]++;for(;n<=279;)_r[n*2+1]=7,n++,u[7]++;for(;n<=287;)_r[n*2+1]=8,n++,u[8]++;for(sh(_r,ma+1,u),n=0;n<Pi;n++)Da[n*2+1]=5,Da[n*2]=ah(n,5);th=new io(_r,no,ba+1,ma,ri),nh=new io(Da,_s,0,Pi,ri),rh=new io(new Array(0),Zg,0,zu,Hg)}function uh(n){var e;for(e=0;e<ma;e++)n.dyn_ltree[e*2]=0;for(e=0;e<Pi;e++)n.dyn_dtree[e*2]=0;for(e=0;e<zu;e++)n.bl_tree[e*2]=0;n.dyn_ltree[to*2]=1,n.opt_len=n.static_len=0,n.last_lit=n.matches=0}function oh(n){n.bi_valid>8?Ea(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0}function Qg(n,e,t,a){oh(n),Ea(n,t),Ea(n,~t),Og.arraySet(n.pending_buf,n.window,e,t,n.pending),n.pending+=t}function fh(n,e,t,a){var o=e*2,u=t*2;return n[o]<n[u]||n[o]===n[u]&&a[e]<=a[t]}function so(n,e,t){for(var a=n.heap[t],o=t<<1;o<=n.heap_len&&(o<n.heap_len&&fh(e,n.heap[o+1],n.heap[o],n.depth)&&o++,!fh(e,a,n.heap[o],n.depth));)n.heap[t]=n.heap[o],t=o,o<<=1;n.heap[t]=a}function lh(n,e,t){var a,o,u=0,f,h;if(n.last_lit!==0)do a=n.pending_buf[n.d_buf+u*2]<<8|n.pending_buf[n.d_buf+u*2+1],o=n.pending_buf[n.l_buf+u],u++,a===0?rr(n,o,e):(f=xa[o],rr(n,f+ba+1,e),h=no[f],h!==0&&(o-=ro[f],en(n,o,h)),a--,f=ih(a),rr(n,f,t),h=_s[f],h!==0&&(a-=vs[f],en(n,a,h)));while(u<n.last_lit);rr(n,to,e)}function uo(n,e){var t=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,u=e.stat_desc.elems,f,h,v=-1,d;for(n.heap_len=0,n.heap_max=Ql,f=0;f<u;f++)t[f*2]!==0?(n.heap[++n.heap_len]=v=f,n.depth[f]=0):t[f*2+1]=0;for(;n.heap_len<2;)d=n.heap[++n.heap_len]=v<2?++v:0,t[d*2]=1,n.depth[d]=0,n.opt_len--,o&&(n.static_len-=a[d*2+1]);for(e.max_code=v,f=n.heap_len>>1;f>=1;f--)so(n,t,f);d=u;do f=n.heap[1],n.heap[1]=n.heap[n.heap_len--],so(n,t,1),h=n.heap[1],n.heap[--n.heap_max]=f,n.heap[--n.heap_max]=h,t[d*2]=t[f*2]+t[h*2],n.depth[d]=(n.depth[f]>=n.depth[h]?n.depth[f]:n.depth[h])+1,t[f*2+1]=t[h*2+1]=d,n.heap[1]=d++,so(n,t,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],Kg(n,e),sh(t,v,n.bl_count)}function hh(n,e,t){var a,o=-1,u,f=e[0*2+1],h=0,v=7,d=4;for(f===0&&(v=138,d=3),e[(t+1)*2+1]=65535,a=0;a<=t;a++)u=f,f=e[(a+1)*2+1],!(++h<v&&u===f)&&(h<d?n.bl_tree[u*2]+=h:u!==0?(u!==o&&n.bl_tree[u*2]++,n.bl_tree[Jl*2]++):h<=10?n.bl_tree[jl*2]++:n.bl_tree[zl*2]++,h=0,o=u,f===0?(v=138,d=3):u===f?(v=6,d=3):(v=7,d=4))}function ch(n,e,t){var a,o=-1,u,f=e[0*2+1],h=0,v=7,d=4;for(f===0&&(v=138,d=3),a=0;a<=t;a++)if(u=f,f=e[(a+1)*2+1],!(++h<v&&u===f)){if(h<d)do rr(n,u,n.bl_tree);while(--h!==0);else u!==0?(u!==o&&(rr(n,u,n.bl_tree),h--),rr(n,Jl,n.bl_tree),en(n,h-3,2)):h<=10?(rr(n,jl,n.bl_tree),en(n,h-3,3)):(rr(n,zl,n.bl_tree),en(n,h-11,7));h=0,o=u,f===0?(v=138,d=3):u===f?(v=6,d=3):(v=7,d=4)}}function Jg(n){var e;for(hh(n,n.dyn_ltree,n.l_desc.max_code),hh(n,n.dyn_dtree,n.d_desc.max_code),uo(n,n.bl_desc),e=zu-1;e>=3&&n.bl_tree[eh[e]*2+1]===0;e--);return n.opt_len+=3*(e+1)+5+5+4,e}function jg(n,e,t,a){var o;for(en(n,e-257,5),en(n,t-1,5),en(n,a-4,4),o=0;o<a;o++)en(n,n.bl_tree[eh[o]*2+1],3);ch(n,n.dyn_ltree,e-1),ch(n,n.dyn_dtree,t-1)}function zg(n){var e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&n.dyn_ltree[t*2]!==0)return Xl;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return Kl;for(t=32;t<ba;t++)if(n.dyn_ltree[t*2]!==0)return Kl;return Xl}var dh=!1;function e_(n){dh||(Yg(),dh=!0),n.l_desc=new ao(n.dyn_ltree,th),n.d_desc=new ao(n.dyn_dtree,nh),n.bl_desc=new ao(n.bl_tree,rh),n.bi_buf=0,n.bi_valid=0,uh(n)}function ph(n,e,t,a){en(n,(Ug<<1)+(a?1:0),3),Qg(n,e,t)}function t_(n){en(n,Yl<<1,3),rr(n,to,_r),Xg(n)}function n_(n,e,t,a){var o,u,f=0;n.level>0?(n.strm.data_type===Mg&&(n.strm.data_type=zg(n)),uo(n,n.l_desc),uo(n,n.d_desc),f=Jg(n),o=n.opt_len+3+7>>>3,u=n.static_len+3+7>>>3,u<=o&&(o=u)):o=u=t+5,t+4<=o&&e!==-1?ph(n,e,t,a):n.strategy===Pg||u===o?(en(n,(Yl<<1)+(a?1:0),3),lh(n,_r,Da)):(en(n,(Wg<<1)+(a?1:0),3),jg(n,n.l_desc.max_code+1,n.d_desc.max_code+1,f+1),lh(n,n.dyn_ltree,n.dyn_dtree)),uh(n),a&&oh(n)}function r_(n,e,t){return n.pending_buf[n.d_buf+n.last_lit*2]=e>>>8&255,n.pending_buf[n.d_buf+n.last_lit*2+1]=e&255,n.pending_buf[n.l_buf+n.last_lit]=t&255,n.last_lit++,e===0?n.dyn_ltree[t*2]++:(n.matches++,e--,n.dyn_ltree[(xa[t]+ba+1)*2]++,n.dyn_dtree[ih(e)*2]++),n.last_lit===n.lit_bufsize-1}Li._tr_init=e_,Li._tr_stored_block=ph,Li._tr_flush_block=n_,Li._tr_tally=r_,Li._tr_align=t_;function i_(n,e,t,a){for(var o=n&65535|0,u=n>>>16&65535|0,f=0;t!==0;){f=t>2e3?2e3:t,t-=f;do o=o+e[a++]|0,u=u+o|0;while(--f);o%=65521,u%=65521}return o|u<<16|0}var gh=i_;function a_(){for(var n,e=[],t=0;t<256;t++){n=t;for(var a=0;a<8;a++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}var s_=a_();function u_(n,e,t,a){var o=s_,u=a+t;n^=-1;for(var f=a;f<u;f++)n=n>>>8^o[(n^e[f])&255];return n^-1}var _h=u_,oo={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"},Xt=gr,Dn=Li,vh=gh,Lr=_h,o_=oo,ii=0,f_=1,l_=3,Or=4,wh=5,ir=0,bh=1,yn=-2,h_=-3,fo=-5,c_=-1,d_=1,ws=2,p_=3,g_=4,__=0,v_=2,bs=8,w_=9,b_=15,m_=8,D_=29,y_=256,lo=y_+1+D_,x_=30,E_=19,C_=2*lo+1,A_=15,We=3,Pr=258,Wn=Pr+We+1,F_=32,ms=42,ho=69,Ds=73,ys=91,xs=103,ai=113,Ca=666,$t=1,Aa=2,si=3,Mi=4,B_=3;function Mr(n,e){return n.msg=o_[e],e}function mh(n){return(n<<1)-(n>4?9:0)}function Ur(n){for(var e=n.length;--e>=0;)n[e]=0}function Wr(n){var e=n.state,t=e.pending;t>n.avail_out&&(t=n.avail_out),t!==0&&(Xt.arraySet(n.output,e.pending_buf,e.pending_out,t,n.next_out),n.next_out+=t,e.pending_out+=t,n.total_out+=t,n.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))}function Wt(n,e){Dn._tr_flush_block(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,e),n.block_start=n.strstart,Wr(n.strm)}function Ze(n,e){n.pending_buf[n.pending++]=e}function Fa(n,e){n.pending_buf[n.pending++]=e>>>8&255,n.pending_buf[n.pending++]=e&255}function S_(n,e,t,a){var o=n.avail_in;return o>a&&(o=a),o===0?0:(n.avail_in-=o,Xt.arraySet(e,n.input,n.next_in,o,t),n.state.wrap===1?n.adler=vh(n.adler,e,o,t):n.state.wrap===2&&(n.adler=Lr(n.adler,e,o,t)),n.next_in+=o,n.total_in+=o,o)}function Dh(n,e){var t=n.max_chain_length,a=n.strstart,o,u,f=n.prev_length,h=n.nice_match,v=n.strstart>n.w_size-Wn?n.strstart-(n.w_size-Wn):0,d=n.window,c=n.w_mask,D=n.prev,y=n.strstart+Pr,m=d[a+f-1],I=d[a+f];n.prev_length>=n.good_match&&(t>>=2),h>n.lookahead&&(h=n.lookahead);do if(o=e,!(d[o+f]!==I||d[o+f-1]!==m||d[o]!==d[a]||d[++o]!==d[a+1])){a+=2,o++;do;while(d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&d[++a]===d[++o]&&a<y);if(u=Pr-(y-a),a=y-Pr,u>f){if(n.match_start=e,f=u,u>=h)break;m=d[a+f-1],I=d[a+f]}}while((e=D[e&c])>v&&--t!==0);return f<=n.lookahead?f:n.lookahead}function ui(n){var e=n.w_size,t,a,o,u,f;do{if(u=n.window_size-n.lookahead-n.strstart,n.strstart>=e+(e-Wn)){Xt.arraySet(n.window,n.window,e,e,0),n.match_start-=e,n.strstart-=e,n.block_start-=e,a=n.hash_size,t=a;do o=n.head[--t],n.head[t]=o>=e?o-e:0;while(--a);a=e,t=a;do o=n.prev[--t],n.prev[t]=o>=e?o-e:0;while(--a);u+=e}if(n.strm.avail_in===0)break;if(a=S_(n.strm,n.window,n.strstart+n.lookahead,u),n.lookahead+=a,n.lookahead+n.insert>=We)for(f=n.strstart-n.insert,n.ins_h=n.window[f],n.ins_h=(n.ins_h<<n.hash_shift^n.window[f+1])&n.hash_mask;n.insert&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[f+We-1])&n.hash_mask,n.prev[f&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=f,f++,n.insert--,!(n.lookahead+n.insert<We)););}while(n.lookahead<Wn&&n.strm.avail_in!==0)}function I_(n,e){var t=65535;for(t>n.pending_buf_size-5&&(t=n.pending_buf_size-5);;){if(n.lookahead<=1){if(ui(n),n.lookahead===0&&e===ii)return $t;if(n.lookahead===0)break}n.strstart+=n.lookahead,n.lookahead=0;var a=n.block_start+t;if((n.strstart===0||n.strstart>=a)&&(n.lookahead=n.strstart-a,n.strstart=a,Wt(n,!1),n.strm.avail_out===0)||n.strstart-n.block_start>=n.w_size-Wn&&(Wt(n,!1),n.strm.avail_out===0))return $t}return n.insert=0,e===Or?(Wt(n,!0),n.strm.avail_out===0?si:Mi):(n.strstart>n.block_start&&(Wt(n,!1),n.strm.avail_out===0),$t)}function co(n,e){for(var t,a;;){if(n.lookahead<Wn){if(ui(n),n.lookahead<Wn&&e===ii)return $t;if(n.lookahead===0)break}if(t=0,n.lookahead>=We&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+We-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),t!==0&&n.strstart-t<=n.w_size-Wn&&(n.match_length=Dh(n,t)),n.match_length>=We)if(a=Dn._tr_tally(n,n.strstart-n.match_start,n.match_length-We),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=We){n.match_length--;do n.strstart++,n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+We-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+1])&n.hash_mask;else a=Dn._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(a&&(Wt(n,!1),n.strm.avail_out===0))return $t}return n.insert=n.strstart<We-1?n.strstart:We-1,e===Or?(Wt(n,!0),n.strm.avail_out===0?si:Mi):n.last_lit&&(Wt(n,!1),n.strm.avail_out===0)?$t:Aa}function Ui(n,e){for(var t,a,o;;){if(n.lookahead<Wn){if(ui(n),n.lookahead<Wn&&e===ii)return $t;if(n.lookahead===0)break}if(t=0,n.lookahead>=We&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+We-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=We-1,t!==0&&n.prev_length<n.max_lazy_match&&n.strstart-t<=n.w_size-Wn&&(n.match_length=Dh(n,t),n.match_length<=5&&(n.strategy===d_||n.match_length===We&&n.strstart-n.match_start>4096)&&(n.match_length=We-1)),n.prev_length>=We&&n.match_length<=n.prev_length){o=n.strstart+n.lookahead-We,a=Dn._tr_tally(n,n.strstart-1-n.prev_match,n.prev_length-We),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=o&&(n.ins_h=(n.ins_h<<n.hash_shift^n.window[n.strstart+We-1])&n.hash_mask,t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=We-1,n.strstart++,a&&(Wt(n,!1),n.strm.avail_out===0))return $t}else if(n.match_available){if(a=Dn._tr_tally(n,0,n.window[n.strstart-1]),a&&Wt(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return $t}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(a=Dn._tr_tally(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<We-1?n.strstart:We-1,e===Or?(Wt(n,!0),n.strm.avail_out===0?si:Mi):n.last_lit&&(Wt(n,!1),n.strm.avail_out===0)?$t:Aa}function k_(n,e){for(var t,a,o,u,f=n.window;;){if(n.lookahead<=Pr){if(ui(n),n.lookahead<=Pr&&e===ii)return $t;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=We&&n.strstart>0&&(o=n.strstart-1,a=f[o],a===f[++o]&&a===f[++o]&&a===f[++o])){u=n.strstart+Pr;do;while(a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&a===f[++o]&&o<u);n.match_length=Pr-(u-o),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=We?(t=Dn._tr_tally(n,1,n.match_length-We),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=Dn._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&(Wt(n,!1),n.strm.avail_out===0))return $t}return n.insert=0,e===Or?(Wt(n,!0),n.strm.avail_out===0?si:Mi):n.last_lit&&(Wt(n,!1),n.strm.avail_out===0)?$t:Aa}function T_(n,e){for(var t;;){if(n.lookahead===0&&(ui(n),n.lookahead===0)){if(e===ii)return $t;break}if(n.match_length=0,t=Dn._tr_tally(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,t&&(Wt(n,!1),n.strm.avail_out===0))return $t}return n.insert=0,e===Or?(Wt(n,!0),n.strm.avail_out===0?si:Mi):n.last_lit&&(Wt(n,!1),n.strm.avail_out===0)?$t:Aa}function ar(n,e,t,a,o){this.good_length=n,this.max_lazy=e,this.nice_length=t,this.max_chain=a,this.func=o}var Wi;Wi=[new ar(0,0,0,0,I_),new ar(4,4,8,4,co),new ar(4,5,16,8,co),new ar(4,6,32,32,co),new ar(4,4,16,16,Ui),new ar(8,16,32,32,Ui),new ar(8,16,128,128,Ui),new ar(8,32,128,256,Ui),new ar(32,128,258,1024,Ui),new ar(32,258,258,4096,Ui)];function R_(n){n.window_size=2*n.w_size,Ur(n.head),n.max_lazy_match=Wi[n.level].max_lazy,n.good_match=Wi[n.level].good_length,n.nice_match=Wi[n.level].nice_length,n.max_chain_length=Wi[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=We-1,n.match_available=0,n.ins_h=0}function N_(){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=bs,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 Xt.Buf16(C_*2),this.dyn_dtree=new Xt.Buf16((2*x_+1)*2),this.bl_tree=new Xt.Buf16((2*E_+1)*2),Ur(this.dyn_ltree),Ur(this.dyn_dtree),Ur(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Xt.Buf16(A_+1),this.heap=new Xt.Buf16(2*lo+1),Ur(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Xt.Buf16(2*lo+1),Ur(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 yh(n){var e;return!n||!n.state?Mr(n,yn):(n.total_in=n.total_out=0,n.data_type=v_,e=n.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ms:ai,n.adler=e.wrap===2?0:1,e.last_flush=ii,Dn._tr_init(e),ir)}function xh(n){var e=yh(n);return e===ir&&R_(n.state),e}function $_(n,e){return!n||!n.state||n.state.wrap!==2?yn:(n.state.gzhead=e,ir)}function Eh(n,e,t,a,o,u){if(!n)return yn;var f=1;if(e===c_&&(e=6),a<0?(f=0,a=-a):a>15&&(f=2,a-=16),o<1||o>w_||t!==bs||a<8||a>15||e<0||e>9||u<0||u>g_)return Mr(n,yn);a===8&&(a=9);var h=new N_;return n.state=h,h.strm=n,h.wrap=f,h.gzhead=null,h.w_bits=a,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=o+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+We-1)/We),h.window=new Xt.Buf8(h.w_size*2),h.head=new Xt.Buf16(h.hash_size),h.prev=new Xt.Buf16(h.w_size),h.lit_bufsize=1<<o+6,h.pending_buf_size=h.lit_bufsize*4,h.pending_buf=new Xt.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=u,h.method=t,xh(n)}function L_(n,e){return Eh(n,e,bs,b_,m_,__)}function O_(n,e){var t,a,o,u;if(!n||!n.state||e>wh||e<0)return n?Mr(n,yn):yn;if(a=n.state,!n.output||!n.input&&n.avail_in!==0||a.status===Ca&&e!==Or)return Mr(n,n.avail_out===0?fo:yn);if(a.strm=n,t=a.last_flush,a.last_flush=e,a.status===ms)if(a.wrap===2)n.adler=0,Ze(a,31),Ze(a,139),Ze(a,8),a.gzhead?(Ze(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),Ze(a,a.gzhead.time&255),Ze(a,a.gzhead.time>>8&255),Ze(a,a.gzhead.time>>16&255),Ze(a,a.gzhead.time>>24&255),Ze(a,a.level===9?2:a.strategy>=ws||a.level<2?4:0),Ze(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(Ze(a,a.gzhead.extra.length&255),Ze(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(n.adler=Lr(n.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=ho):(Ze(a,0),Ze(a,0),Ze(a,0),Ze(a,0),Ze(a,0),Ze(a,a.level===9?2:a.strategy>=ws||a.level<2?4:0),Ze(a,B_),a.status=ai);else{var f=bs+(a.w_bits-8<<4)<<8,h=-1;a.strategy>=ws||a.level<2?h=0:a.level<6?h=1:a.level===6?h=2:h=3,f|=h<<6,a.strstart!==0&&(f|=F_),f+=31-f%31,a.status=ai,Fa(a,f),a.strstart!==0&&(Fa(a,n.adler>>>16),Fa(a,n.adler&65535)),n.adler=1}if(a.status===ho)if(a.gzhead.extra){for(o=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(n.adler=Lr(n.adler,a.pending_buf,a.pending-o,o)),Wr(n),o=a.pending,a.pending===a.pending_buf_size));)Ze(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>o&&(n.adler=Lr(n.adler,a.pending_buf,a.pending-o,o)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=Ds)}else a.status=Ds;if(a.status===Ds)if(a.gzhead.name){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(n.adler=Lr(n.adler,a.pending_buf,a.pending-o,o)),Wr(n),o=a.pending,a.pending===a.pending_buf_size)){u=1;break}a.gzindex<a.gzhead.name.length?u=a.gzhead.name.charCodeAt(a.gzindex++)&255:u=0,Ze(a,u)}while(u!==0);a.gzhead.hcrc&&a.pending>o&&(n.adler=Lr(n.adler,a.pending_buf,a.pending-o,o)),u===0&&(a.gzindex=0,a.status=ys)}else a.status=ys;if(a.status===ys)if(a.gzhead.comment){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(n.adler=Lr(n.adler,a.pending_buf,a.pending-o,o)),Wr(n),o=a.pending,a.pending===a.pending_buf_size)){u=1;break}a.gzindex<a.gzhead.comment.length?u=a.gzhead.comment.charCodeAt(a.gzindex++)&255:u=0,Ze(a,u)}while(u!==0);a.gzhead.hcrc&&a.pending>o&&(n.adler=Lr(n.adler,a.pending_buf,a.pending-o,o)),u===0&&(a.status=xs)}else a.status=xs;if(a.status===xs&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&Wr(n),a.pending+2<=a.pending_buf_size&&(Ze(a,n.adler&255),Ze(a,n.adler>>8&255),n.adler=0,a.status=ai)):a.status=ai),a.pending!==0){if(Wr(n),n.avail_out===0)return a.last_flush=-1,ir}else if(n.avail_in===0&&mh(e)<=mh(t)&&e!==Or)return Mr(n,fo);if(a.status===Ca&&n.avail_in!==0)return Mr(n,fo);if(n.avail_in!==0||a.lookahead!==0||e!==ii&&a.status!==Ca){var v=a.strategy===ws?T_(a,e):a.strategy===p_?k_(a,e):Wi[a.level].func(a,e);if((v===si||v===Mi)&&(a.status=Ca),v===$t||v===si)return n.avail_out===0&&(a.last_flush=-1),ir;if(v===Aa&&(e===f_?Dn._tr_align(a):e!==wh&&(Dn._tr_stored_block(a,0,0,!1),e===l_&&(Ur(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),Wr(n),n.avail_out===0))return a.last_flush=-1,ir}return e!==Or?ir:a.wrap<=0?bh:(a.wrap===2?(Ze(a,n.adler&255),Ze(a,n.adler>>8&255),Ze(a,n.adler>>16&255),Ze(a,n.adler>>24&255),Ze(a,n.total_in&255),Ze(a,n.total_in>>8&255),Ze(a,n.total_in>>16&255),Ze(a,n.total_in>>24&255)):(Fa(a,n.adler>>>16),Fa(a,n.adler&65535)),Wr(n),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?ir:bh)}function P_(n){var e;return!n||!n.state?yn:(e=n.state.status,e!==ms&&e!==ho&&e!==Ds&&e!==ys&&e!==xs&&e!==ai&&e!==Ca?Mr(n,yn):(n.state=null,e===ai?Mr(n,h_):ir))}function M_(n,e){var t=e.length,a,o,u,f,h,v,d,c;if(!n||!n.state||(a=n.state,f=a.wrap,f===2||f===1&&a.status!==ms||a.lookahead))return yn;for(f===1&&(n.adler=vh(n.adler,e,t,0)),a.wrap=0,t>=a.w_size&&(f===0&&(Ur(a.head),a.strstart=0,a.block_start=0,a.insert=0),c=new Xt.Buf8(a.w_size),Xt.arraySet(c,e,t-a.w_size,a.w_size,0),e=c,t=a.w_size),h=n.avail_in,v=n.next_in,d=n.input,n.avail_in=t,n.next_in=0,n.input=e,ui(a);a.lookahead>=We;){o=a.strstart,u=a.lookahead-(We-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+We-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--u);a.strstart=o,a.lookahead=We-1,ui(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=We-1,a.match_available=0,n.next_in=v,n.input=d,n.avail_in=h,a.wrap=f,ir}nr.deflateInit=L_,nr.deflateInit2=Eh,nr.deflateReset=xh,nr.deflateResetKeep=yh,nr.deflateSetHeader=$_,nr.deflate=O_,nr.deflateEnd=P_,nr.deflateSetDictionary=M_,nr.deflateInfo="pako deflate (from Nodeca project)";var oi={},Es=gr,Ch=!0,Ah=!0;try{String.fromCharCode.apply(null,[0])}catch{Ch=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ah=!1}for(var Ba=new Es.Buf8(256),qr=0;qr<256;qr++)Ba[qr]=qr>=252?6:qr>=248?5:qr>=240?4:qr>=224?3:qr>=192?2:1;Ba[254]=Ba[254]=1,oi.string2buf=function(n){var e,t,a,o,u,f=n.length,h=0;for(o=0;o<f;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),h+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Es.Buf8(h),u=0,o=0;u<h;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),t<128?e[u++]=t:t<2048?(e[u++]=192|t>>>6,e[u++]=128|t&63):t<65536?(e[u++]=224|t>>>12,e[u++]=128|t>>>6&63,e[u++]=128|t&63):(e[u++]=240|t>>>18,e[u++]=128|t>>>12&63,e[u++]=128|t>>>6&63,e[u++]=128|t&63);return e};function Fh(n,e){if(e<65534&&(n.subarray&&Ah||!n.subarray&&Ch))return String.fromCharCode.apply(null,Es.shrinkBuf(n,e));for(var t="",a=0;a<e;a++)t+=String.fromCharCode(n[a]);return t}oi.buf2binstring=function(n){return Fh(n,n.length)},oi.binstring2buf=function(n){for(var e=new Es.Buf8(n.length),t=0,a=e.length;t<a;t++)e[t]=n.charCodeAt(t);return e},oi.buf2string=function(n,e){var t,a,o,u,f=e||n.length,h=new Array(f*2);for(a=0,t=0;t<f;){if(o=n[t++],o<128){h[a++]=o;continue}if(u=Ba[o],u>4){h[a++]=65533,t+=u-1;continue}for(o&=u===2?31:u===3?15:7;u>1&&t<f;)o=o<<6|n[t++]&63,u--;if(u>1){h[a++]=65533;continue}o<65536?h[a++]=o:(o-=65536,h[a++]=55296|o>>10&1023,h[a++]=56320|o&1023)}return Fh(h,a)},oi.utf8border=function(n,e){var t;for(e=e||n.length,e>n.length&&(e=n.length),t=e-1;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+Ba[n[t]]>e?t:e};function U_(){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}var Bh=U_,Sa=nr,Ia=gr,po=oi,go=oo,W_=Bh,Sh=Object.prototype.toString,q_=0,_o=4,qi=0,Ih=1,kh=2,G_=-1,H_=0,Z_=8;function fi(n){if(!(this instanceof fi))return new fi(n);this.options=Ia.assign({level:G_,method:Z_,chunkSize:16384,windowBits:15,memLevel:8,strategy:H_,to:""},n||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W_,this.strm.avail_out=0;var t=Sa.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==qi)throw new Error(go[t]);if(e.header&&Sa.deflateSetHeader(this.strm,e.header),e.dictionary){var a;if(typeof e.dictionary=="string"?a=po.string2buf(e.dictionary):Sh.call(e.dictionary)==="[object ArrayBuffer]"?a=new Uint8Array(e.dictionary):a=e.dictionary,t=Sa.deflateSetDictionary(this.strm,a),t!==qi)throw new Error(go[t]);this._dict_set=!0}}fi.prototype.push=function(n,e){var t=this.strm,a=this.options.chunkSize,o,u;if(this.ended)return!1;u=e===~~e?e:e===!0?_o:q_,typeof n=="string"?t.input=po.string2buf(n):Sh.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Ia.Buf8(a),t.next_out=0,t.avail_out=a),o=Sa.deflate(t,u),o!==Ih&&o!==qi)return this.onEnd(o),this.ended=!0,!1;(t.avail_out===0||t.avail_in===0&&(u===_o||u===kh))&&(this.options.to==="string"?this.onData(po.buf2binstring(Ia.shrinkBuf(t.output,t.next_out))):this.onData(Ia.shrinkBuf(t.output,t.next_out)))}while((t.avail_in>0||t.avail_out===0)&&o!==Ih);return u===_o?(o=Sa.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===qi):(u===kh&&(this.onEnd(qi),t.avail_out=0),!0)},fi.prototype.onData=function(n){this.chunks.push(n)},fi.prototype.onEnd=function(n){n===qi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ia.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function vo(n,e){var t=new fi(e);if(t.push(n,!0),t.err)throw t.msg||go[t.err];return t.result}function V_(n,e){return e=e||{},e.raw=!0,vo(n,e)}function X_(n,e){return e=e||{},e.gzip=!0,vo(n,e)}wa.Deflate=fi,wa.deflate=vo,wa.deflateRaw=V_,wa.gzip=X_;var ka={},qn={},Cs=30,K_=12,Y_=function(e,t){var a,o,u,f,h,v,d,c,D,y,m,I,S,T,N,Z,P,k,M,q,$,A,F,L,G;a=e.state,o=e.next_in,L=e.input,u=o+(e.avail_in-5),f=e.next_out,G=e.output,h=f-(t-e.avail_out),v=f+(e.avail_out-257),d=a.dmax,c=a.wsize,D=a.whave,y=a.wnext,m=a.window,I=a.hold,S=a.bits,T=a.lencode,N=a.distcode,Z=(1<<a.lenbits)-1,P=(1<<a.distbits)-1;e:do{S<15&&(I+=L[o++]<<S,S+=8,I+=L[o++]<<S,S+=8),k=T[I&Z];t:for(;;){if(M=k>>>24,I>>>=M,S-=M,M=k>>>16&255,M===0)G[f++]=k&65535;else if(M&16){q=k&65535,M&=15,M&&(S<M&&(I+=L[o++]<<S,S+=8),q+=I&(1<<M)-1,I>>>=M,S-=M),S<15&&(I+=L[o++]<<S,S+=8,I+=L[o++]<<S,S+=8),k=N[I&P];n:for(;;){if(M=k>>>24,I>>>=M,S-=M,M=k>>>16&255,M&16){if($=k&65535,M&=15,S<M&&(I+=L[o++]<<S,S+=8,S<M&&(I+=L[o++]<<S,S+=8)),$+=I&(1<<M)-1,$>d){e.msg="invalid distance too far back",a.mode=Cs;break e}if(I>>>=M,S-=M,M=f-h,$>M){if(M=$-M,M>D&&a.sane){e.msg="invalid distance too far back",a.mode=Cs;break e}if(A=0,F=m,y===0){if(A+=c-M,M<q){q-=M;do G[f++]=m[A++];while(--M);A=f-$,F=G}}else if(y<M){if(A+=c+y-M,M-=y,M<q){q-=M;do G[f++]=m[A++];while(--M);if(A=0,y<q){M=y,q-=M;do G[f++]=m[A++];while(--M);A=f-$,F=G}}}else if(A+=y-M,M<q){q-=M;do G[f++]=m[A++];while(--M);A=f-$,F=G}for(;q>2;)G[f++]=F[A++],G[f++]=F[A++],G[f++]=F[A++],q-=3;q&&(G[f++]=F[A++],q>1&&(G[f++]=F[A++]))}else{A=f-$;do G[f++]=G[A++],G[f++]=G[A++],G[f++]=G[A++],q-=3;while(q>2);q&&(G[f++]=G[A++],q>1&&(G[f++]=G[A++]))}}else if(M&64){e.msg="invalid distance code",a.mode=Cs;break e}else{k=N[(k&65535)+(I&(1<<M)-1)];continue n}break}}else if(M&64)if(M&32){a.mode=K_;break e}else{e.msg="invalid literal/length code",a.mode=Cs;break e}else{k=T[(k&65535)+(I&(1<<M)-1)];continue t}break}}while(o<u&&f<v);q=S>>3,o-=q,S-=q<<3,I&=(1<<S)-1,e.next_in=o,e.next_out=f,e.avail_in=o<u?5+(u-o):5-(o-u),e.avail_out=f<v?257+(v-f):257-(f-v),a.hold=I,a.bits=S},Th=gr,Gi=15,Rh=852,Nh=592,$h=0,wo=1,Lh=2,Q_=[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],J_=[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],j_=[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],z_=[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],e2=function(e,t,a,o,u,f,h,v){var d=v.bits,c=0,D=0,y=0,m=0,I=0,S=0,T=0,N=0,Z=0,P=0,k,M,q,$,A,F=null,L=0,G,Y=new Th.Buf16(Gi+1),ne=new Th.Buf16(Gi+1),se=null,pe=0,ke,ae,ge;for(c=0;c<=Gi;c++)Y[c]=0;for(D=0;D<o;D++)Y[t[a+D]]++;for(I=d,m=Gi;m>=1&&Y[m]===0;m--);if(I>m&&(I=m),m===0)return u[f++]=1<<24|64<<16|0,u[f++]=1<<24|64<<16|0,v.bits=1,0;for(y=1;y<m&&Y[y]===0;y++);for(I<y&&(I=y),N=1,c=1;c<=Gi;c++)if(N<<=1,N-=Y[c],N<0)return-1;if(N>0&&(e===$h||m!==1))return-1;for(ne[1]=0,c=1;c<Gi;c++)ne[c+1]=ne[c]+Y[c];for(D=0;D<o;D++)t[a+D]!==0&&(h[ne[t[a+D]]++]=D);if(e===$h?(F=se=h,G=19):e===wo?(F=Q_,L-=257,se=J_,pe-=257,G=256):(F=j_,se=z_,G=-1),P=0,D=0,c=y,A=f,S=I,T=0,q=-1,Z=1<<I,$=Z-1,e===wo&&Z>Rh||e===Lh&&Z>Nh)return 1;for(;;){ke=c-T,h[D]<G?(ae=0,ge=h[D]):h[D]>G?(ae=se[pe+h[D]],ge=F[L+h[D]]):(ae=96,ge=0),k=1<<c-T,M=1<<S,y=M;do M-=k,u[A+(P>>T)+M]=ke<<24|ae<<16|ge|0;while(M!==0);for(k=1<<c-1;P&k;)k>>=1;if(k!==0?(P&=k-1,P+=k):P=0,D++,--Y[c]===0){if(c===m)break;c=t[a+h[D]]}if(c>I&&(P&$)!==q){for(T===0&&(T=I),A+=y,S=c-T,N=1<<S;S+T<m&&(N-=Y[S+T],!(N<=0));)S++,N<<=1;if(Z+=1<<S,e===wo&&Z>Rh||e===Lh&&Z>Nh)return 1;q=P&$,u[q]=I<<24|S<<16|A-f|0}}return P!==0&&(u[A+P]=c-T<<24|64<<16|0),v.bits=I,0},ln=gr,bo=gh,sr=_h,t2=Y_,Ta=e2,n2=0,Oh=1,Ph=2,Mh=4,r2=5,As=6,li=0,i2=1,a2=2,xn=-2,Uh=-3,Wh=-4,s2=-5,qh=8,Gh=1,Hh=2,Zh=3,Vh=4,Xh=5,Kh=6,Yh=7,Qh=8,Jh=9,jh=10,Fs=11,vr=12,mo=13,zh=14,Do=15,e0=16,t0=17,n0=18,r0=19,Bs=20,Ss=21,i0=22,a0=23,s0=24,u0=25,o0=26,yo=27,f0=28,l0=29,gt=30,h0=31,u2=32,o2=852,f2=592,l2=15,h2=l2;function c0(n){return(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24)}function c2(){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 ln.Buf16(320),this.work=new ln.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d0(n){var e;return!n||!n.state?xn:(e=n.state,n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=Gh,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new ln.Buf32(o2),e.distcode=e.distdyn=new ln.Buf32(f2),e.sane=1,e.back=-1,li)}function p0(n){var e;return!n||!n.state?xn:(e=n.state,e.wsize=0,e.whave=0,e.wnext=0,d0(n))}function g0(n,e){var t,a;return!n||!n.state||(a=n.state,e<0?(t=0,e=-e):(t=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?xn:(a.window!==null&&a.wbits!==e&&(a.window=null),a.wrap=t,a.wbits=e,p0(n))}function _0(n,e){var t,a;return n?(a=new c2,n.state=a,a.window=null,t=g0(n,e),t!==li&&(n.state=null),t):xn}function d2(n){return _0(n,h2)}var v0=!0,xo,Eo;function p2(n){if(v0){var e;for(xo=new ln.Buf32(512),Eo=new ln.Buf32(32),e=0;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(Ta(Oh,n.lens,0,288,xo,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;Ta(Ph,n.lens,0,32,Eo,0,n.work,{bits:5}),v0=!1}n.lencode=xo,n.lenbits=9,n.distcode=Eo,n.distbits=5}function w0(n,e,t,a){var o,u=n.state;return u.window===null&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new ln.Buf8(u.wsize)),a>=u.wsize?(ln.arraySet(u.window,e,t-u.wsize,u.wsize,0),u.wnext=0,u.whave=u.wsize):(o=u.wsize-u.wnext,o>a&&(o=a),ln.arraySet(u.window,e,t-a,o,u.wnext),a-=o,a?(ln.arraySet(u.window,e,t-a,a,0),u.wnext=a,u.whave=u.wsize):(u.wnext+=o,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=o))),0}function g2(n,e){var t,a,o,u,f,h,v,d,c,D,y,m,I,S,T=0,N,Z,P,k,M,q,$,A,F=new ln.Buf8(4),L,G,Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!n||!n.state||!n.output||!n.input&&n.avail_in!==0)return xn;t=n.state,t.mode===vr&&(t.mode=mo),f=n.next_out,o=n.output,v=n.avail_out,u=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,D=h,y=v,A=li;e:for(;;)switch(t.mode){case Gh:if(t.wrap===0){t.mode=mo;break}for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.wrap&2&&d===35615){t.check=0,F[0]=d&255,F[1]=d>>>8&255,t.check=sr(t.check,F,2,0),d=0,c=0,t.mode=Hh;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){n.msg="incorrect header check",t.mode=gt;break}if((d&15)!==qh){n.msg="unknown compression method",t.mode=gt;break}if(d>>>=4,c-=4,$=(d&15)+8,t.wbits===0)t.wbits=$;else if($>t.wbits){n.msg="invalid window size",t.mode=gt;break}t.dmax=1<<$,n.adler=t.check=1,t.mode=d&512?jh:vr,d=0,c=0;break;case Hh:for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.flags=d,(t.flags&255)!==qh){n.msg="unknown compression method",t.mode=gt;break}if(t.flags&57344){n.msg="unknown header flags set",t.mode=gt;break}t.head&&(t.head.text=d>>8&1),t.flags&512&&(F[0]=d&255,F[1]=d>>>8&255,t.check=sr(t.check,F,2,0)),d=0,c=0,t.mode=Zh;case Zh:for(;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.head&&(t.head.time=d),t.flags&512&&(F[0]=d&255,F[1]=d>>>8&255,F[2]=d>>>16&255,F[3]=d>>>24&255,t.check=sr(t.check,F,4,0)),d=0,c=0,t.mode=Vh;case Vh:for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.head&&(t.head.xflags=d&255,t.head.os=d>>8),t.flags&512&&(F[0]=d&255,F[1]=d>>>8&255,t.check=sr(t.check,F,2,0)),d=0,c=0,t.mode=Xh;case Xh:if(t.flags&1024){for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.length=d,t.head&&(t.head.extra_len=d),t.flags&512&&(F[0]=d&255,F[1]=d>>>8&255,t.check=sr(t.check,F,2,0)),d=0,c=0}else t.head&&(t.head.extra=null);t.mode=Kh;case Kh:if(t.flags&1024&&(m=t.length,m>h&&(m=h),m&&(t.head&&($=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),ln.arraySet(t.head.extra,a,u,m,$)),t.flags&512&&(t.check=sr(t.check,a,m,u)),h-=m,u+=m,t.length-=m),t.length))break e;t.length=0,t.mode=Yh;case Yh:if(t.flags&2048){if(h===0)break e;m=0;do $=a[u+m++],t.head&&$&&t.length<65536&&(t.head.name+=String.fromCharCode($));while($&&m<h);if(t.flags&512&&(t.check=sr(t.check,a,m,u)),h-=m,u+=m,$)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Qh;case Qh:if(t.flags&4096){if(h===0)break e;m=0;do $=a[u+m++],t.head&&$&&t.length<65536&&(t.head.comment+=String.fromCharCode($));while($&&m<h);if(t.flags&512&&(t.check=sr(t.check,a,m,u)),h-=m,u+=m,$)break e}else t.head&&(t.head.comment=null);t.mode=Jh;case Jh:if(t.flags&512){for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(d!==(t.check&65535)){n.msg="header crc mismatch",t.mode=gt;break}d=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=vr;break;case jh:for(;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}n.adler=t.check=c0(d),d=0,c=0,t.mode=Fs;case Fs:if(t.havedict===0)return n.next_out=f,n.avail_out=v,n.next_in=u,n.avail_in=h,t.hold=d,t.bits=c,a2;n.adler=t.check=1,t.mode=vr;case vr:if(e===r2||e===As)break e;case mo:if(t.last){d>>>=c&7,c-=c&7,t.mode=yo;break}for(;c<3;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}switch(t.last=d&1,d>>>=1,c-=1,d&3){case 0:t.mode=zh;break;case 1:if(p2(t),t.mode=Bs,e===As){d>>>=2,c-=2;break e}break;case 2:t.mode=t0;break;case 3:n.msg="invalid block type",t.mode=gt}d>>>=2,c-=2;break;case zh:for(d>>>=c&7,c-=c&7;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if((d&65535)!==(d>>>16^65535)){n.msg="invalid stored block lengths",t.mode=gt;break}if(t.length=d&65535,d=0,c=0,t.mode=Do,e===As)break e;case Do:t.mode=e0;case e0:if(m=t.length,m){if(m>h&&(m=h),m>v&&(m=v),m===0)break e;ln.arraySet(o,a,u,m,f),h-=m,u+=m,v-=m,f+=m,t.length-=m;break}t.mode=vr;break;case t0:for(;c<14;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.nlen=(d&31)+257,d>>>=5,c-=5,t.ndist=(d&31)+1,d>>>=5,c-=5,t.ncode=(d&15)+4,d>>>=4,c-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=gt;break}t.have=0,t.mode=n0;case n0:for(;t.have<t.ncode;){for(;c<3;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.lens[Y[t.have++]]=d&7,d>>>=3,c-=3}for(;t.have<19;)t.lens[Y[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,L={bits:t.lenbits},A=Ta(n2,t.lens,0,19,t.lencode,0,t.work,L),t.lenbits=L.bits,A){n.msg="invalid code lengths set",t.mode=gt;break}t.have=0,t.mode=r0;case r0:for(;t.have<t.nlen+t.ndist;){for(;T=t.lencode[d&(1<<t.lenbits)-1],N=T>>>24,Z=T>>>16&255,P=T&65535,!(N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(P<16)d>>>=N,c-=N,t.lens[t.have++]=P;else{if(P===16){for(G=N+2;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(d>>>=N,c-=N,t.have===0){n.msg="invalid bit length repeat",t.mode=gt;break}$=t.lens[t.have-1],m=3+(d&3),d>>>=2,c-=2}else if(P===17){for(G=N+3;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=N,c-=N,$=0,m=3+(d&7),d>>>=3,c-=3}else{for(G=N+7;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=N,c-=N,$=0,m=11+(d&127),d>>>=7,c-=7}if(t.have+m>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=gt;break}for(;m--;)t.lens[t.have++]=$}}if(t.mode===gt)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=gt;break}if(t.lenbits=9,L={bits:t.lenbits},A=Ta(Oh,t.lens,0,t.nlen,t.lencode,0,t.work,L),t.lenbits=L.bits,A){n.msg="invalid literal/lengths set",t.mode=gt;break}if(t.distbits=6,t.distcode=t.distdyn,L={bits:t.distbits},A=Ta(Ph,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,L),t.distbits=L.bits,A){n.msg="invalid distances set",t.mode=gt;break}if(t.mode=Bs,e===As)break e;case Bs:t.mode=Ss;case Ss:if(h>=6&&v>=258){n.next_out=f,n.avail_out=v,n.next_in=u,n.avail_in=h,t.hold=d,t.bits=c,t2(n,y),f=n.next_out,o=n.output,v=n.avail_out,u=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,t.mode===vr&&(t.back=-1);break}for(t.back=0;T=t.lencode[d&(1<<t.lenbits)-1],N=T>>>24,Z=T>>>16&255,P=T&65535,!(N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(Z&&!(Z&240)){for(k=N,M=Z,q=P;T=t.lencode[q+((d&(1<<k+M)-1)>>k)],N=T>>>24,Z=T>>>16&255,P=T&65535,!(k+N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=k,c-=k,t.back+=k}if(d>>>=N,c-=N,t.back+=N,t.length=P,Z===0){t.mode=o0;break}if(Z&32){t.back=-1,t.mode=vr;break}if(Z&64){n.msg="invalid literal/length code",t.mode=gt;break}t.extra=Z&15,t.mode=i0;case i0:if(t.extra){for(G=t.extra;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.length+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=a0;case a0:for(;T=t.distcode[d&(1<<t.distbits)-1],N=T>>>24,Z=T>>>16&255,P=T&65535,!(N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(!(Z&240)){for(k=N,M=Z,q=P;T=t.distcode[q+((d&(1<<k+M)-1)>>k)],N=T>>>24,Z=T>>>16&255,P=T&65535,!(k+N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=k,c-=k,t.back+=k}if(d>>>=N,c-=N,t.back+=N,Z&64){n.msg="invalid distance code",t.mode=gt;break}t.offset=P,t.extra=Z&15,t.mode=s0;case s0:if(t.extra){for(G=t.extra;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.offset+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=gt;break}t.mode=u0;case u0:if(v===0)break e;if(m=y-v,t.offset>m){if(m=t.offset-m,m>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=gt;break}m>t.wnext?(m-=t.wnext,I=t.wsize-m):I=t.wnext-m,m>t.length&&(m=t.length),S=t.window}else S=o,I=f-t.offset,m=t.length;m>v&&(m=v),v-=m,t.length-=m;do o[f++]=S[I++];while(--m);t.length===0&&(t.mode=Ss);break;case o0:if(v===0)break e;o[f++]=t.length,v--,t.mode=Ss;break;case yo:if(t.wrap){for(;c<32;){if(h===0)break e;h--,d|=a[u++]<<c,c+=8}if(y-=v,n.total_out+=y,t.total+=y,y&&(n.adler=t.check=t.flags?sr(t.check,o,y,f-y):bo(t.check,o,y,f-y)),y=v,(t.flags?d:c0(d))!==t.check){n.msg="incorrect data check",t.mode=gt;break}d=0,c=0}t.mode=f0;case f0:if(t.wrap&&t.flags){for(;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(d!==(t.total&4294967295)){n.msg="incorrect length check",t.mode=gt;break}d=0,c=0}t.mode=l0;case l0:A=i2;break e;case gt:A=Uh;break e;case h0:return Wh;case u2:default:return xn}return n.next_out=f,n.avail_out=v,n.next_in=u,n.avail_in=h,t.hold=d,t.bits=c,(t.wsize||y!==n.avail_out&&t.mode<gt&&(t.mode<yo||e!==Mh))&&w0(n,n.output,n.next_out,y-n.avail_out),D-=n.avail_in,y-=n.avail_out,n.total_in+=D,n.total_out+=y,t.total+=y,t.wrap&&y&&(n.adler=t.check=t.flags?sr(t.check,o,y,n.next_out-y):bo(t.check,o,y,n.next_out-y)),n.data_type=t.bits+(t.last?64:0)+(t.mode===vr?128:0)+(t.mode===Bs||t.mode===Do?256:0),(D===0&&y===0||e===Mh)&&A===li&&(A=s2),A}function _2(n){if(!n||!n.state)return xn;var e=n.state;return e.window&&(e.window=null),n.state=null,li}function v2(n,e){var t;return!n||!n.state||(t=n.state,!(t.wrap&2))?xn:(t.head=e,e.done=!1,li)}function w2(n,e){var t=e.length,a,o,u;return!n||!n.state||(a=n.state,a.wrap!==0&&a.mode!==Fs)?xn:a.mode===Fs&&(o=1,o=bo(o,e,t,0),o!==a.check)?Uh:(u=w0(n,e,t,t),u?(a.mode=h0,Wh):(a.havedict=1,li))}qn.inflateReset=p0,qn.inflateReset2=g0,qn.inflateResetKeep=d0,qn.inflateInit=d2,qn.inflateInit2=_0,qn.inflate=g2,qn.inflateEnd=_2,qn.inflateGetHeader=v2,qn.inflateSetDictionary=w2,qn.inflateInfo="pako inflate (from Nodeca project)";var b0={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 b2(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var m2=b2,Hi=qn,Ra=gr,Is=oi,St=b0,Co=oo,D2=Bh,y2=m2,m0=Object.prototype.toString;function hi(n){if(!(this instanceof hi))return new hi(n);this.options=Ra.assign({chunkSize:16384,windowBits:0,to:""},n||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new D2,this.strm.avail_out=0;var t=Hi.inflateInit2(this.strm,e.windowBits);if(t!==St.Z_OK)throw new Error(Co[t]);if(this.header=new y2,Hi.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Is.string2buf(e.dictionary):m0.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Hi.inflateSetDictionary(this.strm,e.dictionary),t!==St.Z_OK)))throw new Error(Co[t])}hi.prototype.push=function(n,e){var t=this.strm,a=this.options.chunkSize,o=this.options.dictionary,u,f,h,v,d,c=!1;if(this.ended)return!1;f=e===~~e?e:e===!0?St.Z_FINISH:St.Z_NO_FLUSH,typeof n=="string"?t.input=Is.binstring2buf(n):m0.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Ra.Buf8(a),t.next_out=0,t.avail_out=a),u=Hi.inflate(t,St.Z_NO_FLUSH),u===St.Z_NEED_DICT&&o&&(u=Hi.inflateSetDictionary(this.strm,o)),u===St.Z_BUF_ERROR&&c===!0&&(u=St.Z_OK,c=!1),u!==St.Z_STREAM_END&&u!==St.Z_OK)return this.onEnd(u),this.ended=!0,!1;t.next_out&&(t.avail_out===0||u===St.Z_STREAM_END||t.avail_in===0&&(f===St.Z_FINISH||f===St.Z_SYNC_FLUSH))&&(this.options.to==="string"?(h=Is.utf8border(t.output,t.next_out),v=t.next_out-h,d=Is.buf2string(t.output,h),t.next_out=v,t.avail_out=a-v,v&&Ra.arraySet(t.output,t.output,h,v,0),this.onData(d)):this.onData(Ra.shrinkBuf(t.output,t.next_out))),t.avail_in===0&&t.avail_out===0&&(c=!0)}while((t.avail_in>0||t.avail_out===0)&&u!==St.Z_STREAM_END);return u===St.Z_STREAM_END&&(f=St.Z_FINISH),f===St.Z_FINISH?(u=Hi.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===St.Z_OK):(f===St.Z_SYNC_FLUSH&&(this.onEnd(St.Z_OK),t.avail_out=0),!0)},hi.prototype.onData=function(n){this.chunks.push(n)},hi.prototype.onEnd=function(n){n===St.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ra.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Ao(n,e){var t=new hi(e);if(t.push(n,!0),t.err)throw t.msg||Co[t.err];return t.result}function x2(n,e){return e=e||{},e.raw=!0,Ao(n,e)}ka.Inflate=hi,ka.inflate=Ao,ka.inflateRaw=x2,ka.ungzip=Ao;var E2=gr.assign,C2=wa,A2=ka,F2=b0,D0={};E2(D0,C2,A2,F2);var ks=D0;async function Fo(n){try{let e,t=0,a=0;const o=[];let u=0,f;do{const v=n.subarray(t);if(f=new ks.Inflate,{strm:e}=f,f.push(v,ks.Z_SYNC_FLUSH),f.err)throw new Error(f.msg);t+=e.next_in,o[a]=f.result,u+=o[a].length,a+=1}while(e.avail_in);const h=new Uint8Array(u);for(let v=0,d=0;v<o.length;v++)h.set(o[v],d),d+=o[v].length;return Un.from(h)}catch(e){throw/incorrect header check/.exec(`${e}`)?new Error("problem decompressing block: incorrect gzip header check"):e}}async function B2(n,e){try{let t;const{minv:a,maxv:o}=e;let u=a.blockPosition,f=a.dataPosition;const h=[],v=[],d=[];let c=0,D=0;do{const I=n.subarray(u-a.blockPosition),S=new ks.Inflate;if({strm:t}=S,S.push(I,ks.Z_SYNC_FLUSH),S.err)throw new Error(S.msg);const T=S.result;h.push(T);let N=T.length;v.push(u),d.push(f),h.length===1&&a.dataPosition&&(h[0]=h[0].subarray(a.dataPosition),N=h[0].length);const Z=u;if(u+=t.next_in,f+=N,Z>=o.blockPosition){h[D]=h[D].subarray(0,o.blockPosition===a.blockPosition?o.dataPosition-a.dataPosition+1:o.dataPosition+1),v.push(u),d.push(f),c+=h[D].length;break}c+=h[D].length,D++}while(t.avail_in);const y=new Uint8Array(c);for(let I=0,S=0;I<h.length;I++)y.set(h[I],S),S+=h[I].length;return{buffer:Un.from(y),cpositions:v,dpositions:d}}catch(t){throw/incorrect header check/.exec(`${t}`)?new Error("problem decompressing block: incorrect gzip header check"):t}}var S2=at,En=null;try{En=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{}function at(n,e,t){this.low=n|0,this.high=e|0,this.unsigned=!!t}at.prototype.__isLong__,Object.defineProperty(at.prototype,"__isLong__",{value:!0});function tn(n){return(n&&n.__isLong__)===!0}at.isLong=tn;var y0={},x0={};function ci(n,e){var t,a,o;return e?(n>>>=0,(o=0<=n&&n<256)&&(a=x0[n],a)?a:(t=st(n,(n|0)<0?-1:0,!0),o&&(x0[n]=t),t)):(n|=0,(o=-128<=n&&n<128)&&(a=y0[n],a)?a:(t=st(n,n<0?-1:0,!1),o&&(y0[n]=t),t))}at.fromInt=ci;function Cn(n,e){if(isNaN(n))return e?di:An;if(e){if(n<0)return di;if(n>=C0)return I0}else{if(n<=-A0)return nn;if(n+1>=A0)return S0}return n<0?Cn(-n,e).neg():st(n%Zi|0,n/Zi|0,e)}at.fromNumber=Cn;function st(n,e,t){return new at(n,e,t)}at.fromBits=st;var Ts=Math.pow;function Bo(n,e,t){if(n.length===0)throw Error("empty string");if(n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return An;if(typeof e=="number"?(t=e,e=!1):e=!!e,t=t||10,t<2||36<t)throw RangeError("radix");var a;if((a=n.indexOf("-"))>0)throw Error("interior hyphen");if(a===0)return Bo(n.substring(1),e,t).neg();for(var o=Cn(Ts(t,8)),u=An,f=0;f<n.length;f+=8){var h=Math.min(8,n.length-f),v=parseInt(n.substring(f,f+h),t);if(h<8){var d=Cn(Ts(t,h));u=u.mul(d).add(Cn(v))}else u=u.mul(o),u=u.add(Cn(v))}return u.unsigned=e,u}at.fromString=Bo;function Gn(n,e){return typeof n=="number"?Cn(n,e):typeof n=="string"?Bo(n,e):st(n.low,n.high,typeof e=="boolean"?e:n.unsigned)}at.fromValue=Gn;var E0=65536,I2=1<<24,Zi=E0*E0,C0=Zi*Zi,A0=C0/2,F0=ci(I2),An=ci(0);at.ZERO=An;var di=ci(0,!0);at.UZERO=di;var Vi=ci(1);at.ONE=Vi;var B0=ci(1,!0);at.UONE=B0;var So=ci(-1);at.NEG_ONE=So;var S0=st(-1,2147483647,!1);at.MAX_VALUE=S0;var I0=st(-1,-1,!0);at.MAX_UNSIGNED_VALUE=I0;var nn=st(0,-2147483648,!1);at.MIN_VALUE=nn;var re=at.prototype;re.toInt=function(){return this.unsigned?this.low>>>0:this.low},re.toNumber=function(){return this.unsigned?(this.high>>>0)*Zi+(this.low>>>0):this.high*Zi+(this.low>>>0)},re.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(nn)){var t=Cn(e),a=this.div(t),o=a.mul(t).sub(this);return a.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var u=Cn(Ts(e,6),this.unsigned),f=this,h="";;){var v=f.div(u),d=f.sub(v.mul(u)).toInt()>>>0,c=d.toString(e);if(f=v,f.isZero())return c+h;for(;c.length<6;)c="0"+c;h=""+c+h}},re.getHighBits=function(){return this.high},re.getHighBitsUnsigned=function(){return this.high>>>0},re.getLowBits=function(){return this.low},re.getLowBitsUnsigned=function(){return this.low>>>0},re.getNumBitsAbs=function(){if(this.isNegative())return this.eq(nn)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return this.high!=0?t+33:t+1},re.isZero=function(){return this.high===0&&this.low===0},re.eqz=re.isZero,re.isNegative=function(){return!this.unsigned&&this.high<0},re.isPositive=function(){return this.unsigned||this.high>=0},re.isOdd=function(){return(this.low&1)===1},re.isEven=function(){return(this.low&1)===0},re.equals=function(e){return tn(e)||(e=Gn(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},re.eq=re.equals,re.notEquals=function(e){return!this.eq(e)},re.neq=re.notEquals,re.ne=re.notEquals,re.lessThan=function(e){return this.comp(e)<0},re.lt=re.lessThan,re.lessThanOrEqual=function(e){return this.comp(e)<=0},re.lte=re.lessThanOrEqual,re.le=re.lessThanOrEqual,re.greaterThan=function(e){return this.comp(e)>0},re.gt=re.greaterThan,re.greaterThanOrEqual=function(e){return this.comp(e)>=0},re.gte=re.greaterThanOrEqual,re.ge=re.greaterThanOrEqual,re.compare=function(e){if(tn(e)||(e=Gn(e)),this.eq(e))return 0;var t=this.isNegative(),a=e.isNegative();return t&&!a?-1:!t&&a?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},re.comp=re.compare,re.negate=function(){return!this.unsigned&&this.eq(nn)?nn:this.not().add(Vi)},re.neg=re.negate,re.add=function(e){tn(e)||(e=Gn(e));var t=this.high>>>16,a=this.high&65535,o=this.low>>>16,u=this.low&65535,f=e.high>>>16,h=e.high&65535,v=e.low>>>16,d=e.low&65535,c=0,D=0,y=0,m=0;return m+=u+d,y+=m>>>16,m&=65535,y+=o+v,D+=y>>>16,y&=65535,D+=a+h,c+=D>>>16,D&=65535,c+=t+f,c&=65535,st(y<<16|m,c<<16|D,this.unsigned)},re.subtract=function(e){return tn(e)||(e=Gn(e)),this.add(e.neg())},re.sub=re.subtract,re.multiply=function(e){if(this.isZero())return An;if(tn(e)||(e=Gn(e)),En){var t=En.mul(this.low,this.high,e.low,e.high);return st(t,En.get_high(),this.unsigned)}if(e.isZero())return An;if(this.eq(nn))return e.isOdd()?nn:An;if(e.eq(nn))return this.isOdd()?nn:An;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(F0)&&e.lt(F0))return Cn(this.toNumber()*e.toNumber(),this.unsigned);var a=this.high>>>16,o=this.high&65535,u=this.low>>>16,f=this.low&65535,h=e.high>>>16,v=e.high&65535,d=e.low>>>16,c=e.low&65535,D=0,y=0,m=0,I=0;return I+=f*c,m+=I>>>16,I&=65535,m+=u*c,y+=m>>>16,m&=65535,m+=f*d,y+=m>>>16,m&=65535,y+=o*c,D+=y>>>16,y&=65535,y+=u*d,D+=y>>>16,y&=65535,y+=f*v,D+=y>>>16,y&=65535,D+=a*c+o*d+u*v+f*h,D&=65535,st(m<<16|I,D<<16|y,this.unsigned)},re.mul=re.multiply,re.divide=function(e){if(tn(e)||(e=Gn(e)),e.isZero())throw Error("division by zero");if(En){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var t=(this.unsigned?En.div_u:En.div_s)(this.low,this.high,e.low,e.high);return st(t,En.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?di:An;var a,o,u;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return di;if(e.gt(this.shru(1)))return B0;u=di}else{if(this.eq(nn)){if(e.eq(Vi)||e.eq(So))return nn;if(e.eq(nn))return Vi;var f=this.shr(1);return a=f.div(e).shl(1),a.eq(An)?e.isNegative()?Vi:So:(o=this.sub(e.mul(a)),u=a.add(o.div(e)),u)}else if(e.eq(nn))return this.unsigned?di:An;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();u=An}for(o=this;o.gte(e);){a=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var h=Math.ceil(Math.log(a)/Math.LN2),v=h<=48?1:Ts(2,h-48),d=Cn(a),c=d.mul(e);c.isNegative()||c.gt(o);)a-=v,d=Cn(a,this.unsigned),c=d.mul(e);d.isZero()&&(d=Vi),u=u.add(d),o=o.sub(c)}return u},re.div=re.divide,re.modulo=function(e){if(tn(e)||(e=Gn(e)),En){var t=(this.unsigned?En.rem_u:En.rem_s)(this.low,this.high,e.low,e.high);return st(t,En.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},re.mod=re.modulo,re.rem=re.modulo,re.not=function(){return st(~this.low,~this.high,this.unsigned)},re.and=function(e){return tn(e)||(e=Gn(e)),st(this.low&e.low,this.high&e.high,this.unsigned)},re.or=function(e){return tn(e)||(e=Gn(e)),st(this.low|e.low,this.high|e.high,this.unsigned)},re.xor=function(e){return tn(e)||(e=Gn(e)),st(this.low^e.low,this.high^e.high,this.unsigned)},re.shiftLeft=function(e){return tn(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?st(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):st(0,this.low<<e-32,this.unsigned)},re.shl=re.shiftLeft,re.shiftRight=function(e){return tn(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?st(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):st(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},re.shr=re.shiftRight,re.shiftRightUnsigned=function(e){if(tn(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var a=this.low;return st(a>>>e|t<<32-e,t>>>e,this.unsigned)}else return e===32?st(t,0,this.unsigned):st(t>>>e-32,0,this.unsigned)},re.shru=re.shiftRightUnsigned,re.shr_u=re.shiftRightUnsigned,re.toSigned=function(){return this.unsigned?st(this.low,this.high,!1):this},re.toUnsigned=function(){return this.unsigned?this:st(this.low,this.high,!0)},re.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},re.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},re.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},at.fromBytes=function(e,t,a){return a?at.fromBytesLE(e,t):at.fromBytesBE(e,t)},at.fromBytesLE=function(e,t){return new at(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},at.fromBytesBE=function(e,t){return new at(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var k0=bn(S2);function T0(n){if(n.greaterThan(Number.MAX_SAFE_INTEGER)||n.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return n.toNumber()}let k2=class extends Error{};function Na(n){if(n&&n.aborted){if(typeof DOMException<"u")throw new DOMException("aborted","AbortError");{const e=new k2("aborted");throw e.code="ERR_ABORTED",e}}}function T2(n,e){return e.minv.blockPosition-n.maxv.blockPosition<65e3&&e.maxv.blockPosition-n.minv.blockPosition<5e6}function R0(n,e){const t=[];let a=null;return n.length===0?n:(n.sort(function(o,u){const f=o.minv.blockPosition-u.minv.blockPosition;return f!==0?f:o.minv.dataPosition-u.minv.dataPosition}),n.forEach(o=>{(!e||o.maxv.compareTo(e)>0)&&(a===null?(t.push(o),a=o):T2(a,o)?o.maxv.compareTo(a.maxv)>0&&(a.maxv=o.maxv):(t.push(o),a=o))}),t)}class Io{constructor(e,t){this.blockPosition=e,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}}function Xi(n,e=0,t=!1){if(t)throw new Error("big-endian virtual file offsets not implemented");return new Io(n[e+7]*1099511627776+n[e+6]*4294967296+n[e+5]*16777216+n[e+4]*65536+n[e+3]*256+n[e+2],n[e+1]<<8|n[e])}class Rs{constructor(e,t,a,o=void 0){this.minv=e,this.maxv=t,this.bin=a,this._fetchedSize=o}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}class N0{constructor({filehandle:e,renameRefSeqs:t=a=>a}){this.filehandle=e,this.renameRefSeq=t}async getMetadata(e={}){const{indices:t,...a}=await this.parse(e);return a}_findFirstData(e,t){return e?e.compareTo(t)>0?t:e:t}async parse(e={}){return this.parseP||(this.parseP=this._parse(e).catch(t=>{throw this.parseP=void 0,t})),this.parseP}async hasRefSeq(e,t={}){var a;return!!(!((a=(await this.parse(t)).indices[e])===null||a===void 0)&&a.binIndex)}}const R2=21578324,$0=14;function N2(n,e){return n+=1,e-=1,[[0,0],[1+(n>>26),1+(e>>26)],[9+(n>>23),9+(e>>23)],[73+(n>>20),73+(e>>20)],[585+(n>>17),585+(e>>17)],[4681+(n>>14),4681+(e>>14)]]}class $a extends N0{async lineCount(e,t={}){const a=await this.parse(t),o=a.refNameToId[e];if(o===void 0||!a.indices[o])return-1;const{stats:f}=a.indices[o];return f?f.lineCount:-1}async _parse(e={}){const t=await this.filehandle.readFile(e),a=await Fo(t);if(Na(e.signal),a.readUInt32LE(0)!==R2)throw new Error("Not a TBI file");const o=a.readInt32LE(4),u=a.readInt32LE(8),f=u&65536?"zero-based-half-open":"1-based-closed",v={0:"generic",1:"SAM",2:"VCF"}[u&15];if(!v)throw new Error(`invalid Tabix preset format flags ${u}`);const d={ref:a.readInt32LE(12),start:a.readInt32LE(16),end:a.readInt32LE(20)},c=a.readInt32LE(24),D=5,y=((1<<(D+1)*3)-1)/7,m=2**(14+D*3),I=c?String.fromCharCode(c):null,S=a.readInt32LE(28),T=a.readInt32LE(32),{refNameToId:N,refIdToName:Z}=this._parseNameBytes(a.slice(36,36+T));let P=36+T,k;return{indices:new Array(o).fill(0).map(()=>{const q=a.readInt32LE(P);P+=4;const $={};let A;for(let G=0;G<q;G+=1){const Y=a.readUInt32LE(P);if(P+=4,Y>y+1)throw new Error("tabix index contains too many bins, please use a CSI index");if(Y===y+1){const ne=a.readInt32LE(P);P+=4,ne===2&&(A=this.parsePseudoBin(a,P)),P+=16*ne}else{const ne=a.readInt32LE(P);P+=4;const se=new Array(ne);for(let pe=0;pe<ne;pe+=1){const ke=Xi(a,P),ae=Xi(a,P+8);P+=16,k=this._findFirstData(k,ke),se[pe]=new Rs(ke,ae,Y)}$[Y]=se}}const F=a.readInt32LE(P);P+=4;const L=new Array(F);for(let G=0;G<F;G+=1)L[G]=Xi(a,P),P+=8,k=this._findFirstData(k,L[G]);return{binIndex:$,linearIndex:L,stats:A}}),metaChar:I,maxBinNumber:y,maxRefLength:m,skipLines:S,firstDataLine:k,columnNumbers:d,coordinateType:f,format:v,refIdToName:Z,refNameToId:N,maxBlockSize:65536}}parsePseudoBin(e,t){return{lineCount:T0(k0.fromBytesLE(e.slice(t+16,t+24),!0))}}_parseNameBytes(e){let t=0,a=0;const o=[],u={};for(let f=0;f<e.length;f+=1)if(!e[f]){if(a<f){let h=e.toString("utf8",a,f);h=this.renameRefSeq(h),o[t]=h,u[h]=t}a=f+1,t+=1}return{refNameToId:u,refIdToName:o}}async blocksForRange(e,t,a,o={}){t<0&&(t=0);const u=await this.parse(o),f=u.refNameToId[e];if(f===void 0)return[];const h=u.indices[f];if(!h)return[];(h.linearIndex.length?h.linearIndex[t>>$0>=h.linearIndex.length?h.linearIndex.length-1:t>>$0]:new Io(0,0))||console.warn("querying outside of possible tabix range");const d=N2(t,a),c=[];for(const[S,T]of d)for(let N=S;N<=T;N++)if(h.binIndex[N])for(const Z of h.binIndex[N])c.push(new Rs(Z.minv,Z.maxv,N));const D=h.linearIndex.length;let y=null;const m=Math.min(t>>14,D-1),I=Math.min(a>>14,D-1);for(let S=m;S<=I;++S){const T=h.linearIndex[S];T&&(!y||T.compareTo(y)<0)&&(y=T)}return R0(c,y)}}const $2=21582659,L2=38359875;function O2(n,e){return n*2**e}function L0(n,e){return Math.floor(n/2**e)}class ko extends N0{constructor(e){super(e),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(e,t={}){const a=await this.parse(t),o=a.refNameToId[e];if(o===void 0||!a.indices[o])return-1;const{stats:f}=a.indices[o];return f?f.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(e,t){const a=e.readInt32LE(t),o=a&65536?"zero-based-half-open":"1-based-closed",u={0:"generic",1:"SAM",2:"VCF"}[a&15];if(!u)throw new Error(`invalid Tabix preset format flags ${a}`);const f={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},h=e.readInt32LE(t+16),v=h?String.fromCharCode(h):null,d=e.readInt32LE(t+20),c=e.readInt32LE(t+24),{refIdToName:D,refNameToId:y}=this._parseNameBytes(e.slice(t+28,t+28+c));return{refIdToName:D,refNameToId:y,skipLines:d,metaChar:v,columnNumbers:f,format:u,coordinateType:o}}_parseNameBytes(e){let t=0,a=0;const o=[],u={};for(let f=0;f<e.length;f+=1)if(!e[f]){if(a<f){let h=e.toString("utf8",a,f);h=this.renameRefSeq(h),o[t]=h,u[h]=t}a=f+1,t+=1}return{refNameToId:u,refIdToName:o}}async _parse(e={}){const t=await Fo(await this.filehandle.readFile(e));let a;if(t.readUInt32LE(0)===$2)a=1;else if(t.readUInt32LE(0)===L2)a=2;else throw new Error("Not a CSI file");this.minShift=t.readInt32LE(4),this.depth=t.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const o=2**(this.minShift+this.depth*3),u=t.readInt32LE(12),f=u&&u>=30?this.parseAuxData(t,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},h=t.readInt32LE(16+u);let v,d=16+u+4;const c=new Array(h).fill(0).map(()=>{const D=t.readInt32LE(d);d+=4;const y={};let m;for(let I=0;I<D;I+=1){const S=t.readUInt32LE(d);if(S>this.maxBinNumber)m=this.parsePseudoBin(t,d+4),d+=48;else{const T=Xi(t,d+4);v=this._findFirstData(v,T);const N=t.readInt32LE(d+12);d+=16;const Z=new Array(N);for(let P=0;P<N;P+=1){const k=Xi(t,d),M=Xi(t,d+8);d+=16,Z[P]=new Rs(k,M,S)}y[S]=Z}}return{binIndex:y,stats:m}});return{...f,csi:!0,refCount:h,maxBlockSize:65536,firstDataLine:v,csiVersion:a,indices:c,depth:this.depth,maxBinNumber:this.maxBinNumber,maxRefLength:o}}parsePseudoBin(e,t){return{lineCount:T0(k0.fromBytesLE(e.slice(t+28,t+36),!0))}}async blocksForRange(e,t,a,o={}){t<0&&(t=0);const u=await this.parse(o),f=u.refNameToId[e];if(f===void 0)return[];const h=u.indices[f];if(!h)return[];const v=this.reg2bins(t,a),d=[];for(const[c,D]of v)for(let y=c;y<=D;y++)if(h.binIndex[y])for(const m of h.binIndex[y])d.push(new Rs(m.minv,m.maxv,y));return R0(d,new Io(0,0))}reg2bins(e,t){e-=1,e<1&&(e=1),t>2**50&&(t=2**34),t-=1;let a=0,o=0,u=this.minShift+this.depth*3;const f=[];for(;a<=this.depth;u-=3,o+=O2(1,a*3),a+=1){const h=o+L0(e,u),v=o+L0(t,u);if(v-h+f.length>this.maxBinNumber)throw new Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);f.push([h,v])}return f}}function P2(n){return/^[\u0000-\u007F]*$/.test(n)}const Ki=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;class O0{constructor({path:e,filehandle:t,url:a,tbiPath:o,tbiUrl:u,tbiFilehandle:f,csiPath:h,csiUrl:v,csiFilehandle:d,renameRefSeqs:c=y=>y,chunkCacheSize:D=5*2**20}){if(t)this.filehandle=t;else if(e)this.filehandle=new va(e);else if(a)this.filehandle=new tr(a);else throw new TypeError("must provide either filehandle or path");if(f)this.index=new $a({filehandle:f,renameRefSeqs:c});else if(d)this.index=new ko({filehandle:d,renameRefSeqs:c});else if(o)this.index=new $a({filehandle:new va(o),renameRefSeqs:c});else if(h)this.index=new ko({filehandle:new va(h),renameRefSeqs:c});else if(e)this.index=new $a({filehandle:new va(`${e}.tbi`),renameRefSeqs:c});else if(v)this.index=new ko({filehandle:new tr(v)});else if(u)this.index=new $a({filehandle:new tr(u)});else if(a)this.index=new $a({filehandle:new tr(`${a}.tbi`)});else throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");this.renameRefSeq=c,this.chunkCache=new _a({cache:new Wl({maxSize:Math.floor(D/65536)}),fill:(y,m)=>this.readChunk(y,{signal:m})})}async getLines(e,t,a,o){var u,f;let h,v={},d;typeof o=="function"?d=o:(v=o,d=o.lineCallback,h=o.signal);const c=await this.index.getMetadata(v);Na(h);const D=t??0,y=a??c.maxRefLength;if(!(D<=y))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(D===y)return;const m=await this.index.blocksForRange(e,D,y,v);Na(h);for(const I of m){const{buffer:S,cpositions:T,dpositions:N}=await this.chunkCache.get(I.toString(),I,h);Na(h);let Z=0,P=0;const k=(u=Ki==null?void 0:Ki.decode(S))!==null&&u!==void 0?u:S.toString(),M=S.length<5e8&&P2(k);for(;Z<k.length;){let q,$;if(M){if($=k.indexOf(`
33
+ `,Z),$===-1)break;q=k.slice(Z,$)}else{if($=S.indexOf(`
34
+ `,Z),$===-1)break;const L=S.slice(Z,$);q=(f=Ki==null?void 0:Ki.decode(L))!==null&&f!==void 0?f:L.toString()}if(N){for(;Z+I.minv.dataPosition>=N[P++];);P--}const{startCoordinate:A,overlaps:F}=this.checkLine(c,e,D,y,q);if(F)d(q,T[P]*256+(Z-N[P])+I.minv.dataPosition+1);else if(A!==void 0&&A>=y)return;Z=$+1}}}async getMetadata(e={}){return this.index.getMetadata(e)}async getHeaderBuffer(e={}){const{firstDataLine:t,metaChar:a,maxBlockSize:o}=await this.getMetadata(e);Na(e.signal);const u=((t==null?void 0:t.blockPosition)||0)+o,f=await this._readRegion(0,u,e),h=await Fo(f);if(a){let v=-1;const d=10,c=a.charCodeAt(0);for(let D=0;D<h.length&&!(D===v+1&&h[D]!==c);D+=1)h[D]===d&&(v=D);return h.subarray(0,v+1)}return h}async getHeader(e={}){return(await this.getHeaderBuffer(e)).toString("utf8")}async getReferenceSequenceNames(e={}){return(await this.getMetadata(e)).refIdToName}checkLine(e,t,a,o,u){const{columnNumbers:f,metaChar:h,coordinateType:v,format:d}=e;if(h&&u.startsWith(h))return{overlaps:!1};let{ref:c,start:D,end:y}=f;c||(c=0),D||(D=0),y||(y=0),d==="VCF"&&(y=8);const m=Math.max(c,D,y);let I=1,S=0,T="",N=-1/0;const Z=u.length;for(let P=0;P<Z+1;P++)if(u[P]===" "||P===Z){if(I===c){if(this.renameRefSeq(u.slice(S,P))!==t)return{overlaps:!1}}else if(I===D){if(N=parseInt(u.slice(S,P),10),v==="1-based-closed"&&(N-=1),N>=o)return{startCoordinate:N,overlaps:!1};if((y===0||y===D)&&N+1<=a)return{startCoordinate:N,overlaps:!1}}else if(d==="VCF"&&I===4)T=u.slice(S,P);else if(I===y&&(d==="VCF"?this._getVcfEnd(N,T,u.slice(S,P)):Number.parseInt(u.slice(S,P),10))<=a)return{overlaps:!1};if(S=P+1,I+=1,I>m)break}return{startCoordinate:N,overlaps:!0}}_getVcfEnd(e,t,a){let o=e+t.length;const u=a.includes("SVTYPE=TRA");if(a[0]!=="."&&!u){let f=";";for(let h=0;h<a.length;h+=1){if(f===";"&&a.slice(h,h+4)==="END="){let v=a.indexOf(";",h);v===-1&&(v=a.length),o=parseInt(a.slice(h+4,v),10);break}f=a[h]}}else if(u)return e+1;return o}async lineCount(e,t={}){return this.index.lineCount(e,t)}async _readRegion(e,t,a={}){const o=Un.alloc(t),{bytesRead:u,buffer:f}=await this.filehandle.read(o,0,t,e,a);return f.subarray(0,u)}async readChunk(e,t={}){const a=await this._readRegion(e.minv.blockPosition,e.fetchedSize(),t);return B2(a,e)}}const P0=globalThis||void 0||self;var qt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof P0<"u"&&P0||{},Kt={searchParams:"URLSearchParams"in qt,iterable:"Symbol"in qt&&"iterator"in Symbol,blob:"FileReader"in qt&&"Blob"in qt&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in qt,arrayBuffer:"ArrayBuffer"in qt};function M2(n){return n&&DataView.prototype.isPrototypeOf(n)}if(Kt.arrayBuffer)var U2=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],W2=ArrayBuffer.isView||function(n){return n&&U2.indexOf(Object.prototype.toString.call(n))>-1};function Yi(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function To(n){return typeof n!="string"&&(n=String(n)),n}function Ro(n){var e={next:function(){var t=n.shift();return{done:t===void 0,value:t}}};return Kt.iterable&&(e[Symbol.iterator]=function(){return e}),e}function Lt(n){this.map={},n instanceof Lt?n.forEach(function(e,t){this.append(t,e)},this):Array.isArray(n)?n.forEach(function(e){if(e.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(e){this.append(e,n[e])},this)}Lt.prototype.append=function(n,e){n=Yi(n),e=To(e);var t=this.map[n];this.map[n]=t?t+", "+e:e},Lt.prototype.delete=function(n){delete this.map[Yi(n)]},Lt.prototype.get=function(n){return n=Yi(n),this.has(n)?this.map[n]:null},Lt.prototype.has=function(n){return this.map.hasOwnProperty(Yi(n))},Lt.prototype.set=function(n,e){this.map[Yi(n)]=To(e)},Lt.prototype.forEach=function(n,e){for(var t in this.map)this.map.hasOwnProperty(t)&&n.call(e,this.map[t],t,this)},Lt.prototype.keys=function(){var n=[];return this.forEach(function(e,t){n.push(t)}),Ro(n)},Lt.prototype.values=function(){var n=[];return this.forEach(function(e){n.push(e)}),Ro(n)},Lt.prototype.entries=function(){var n=[];return this.forEach(function(e,t){n.push([t,e])}),Ro(n)},Kt.iterable&&(Lt.prototype[Symbol.iterator]=Lt.prototype.entries);function No(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function M0(n){return new Promise(function(e,t){n.onload=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function q2(n){var e=new FileReader,t=M0(e);return e.readAsArrayBuffer(n),t}function G2(n){var e=new FileReader,t=M0(e),a=/charset=([A-Za-z0-9_-]+)/.exec(n.type),o=a?a[1]:"utf-8";return e.readAsText(n,o),t}function H2(n){for(var e=new Uint8Array(n),t=new Array(e.length),a=0;a<e.length;a++)t[a]=String.fromCharCode(e[a]);return t.join("")}function U0(n){if(n.slice)return n.slice(0);var e=new Uint8Array(n.byteLength);return e.set(new Uint8Array(n)),e.buffer}function W0(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:Kt.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:Kt.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:Kt.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():Kt.arrayBuffer&&Kt.blob&&M2(n)?(this._bodyArrayBuffer=U0(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Kt.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||W2(n))?this._bodyArrayBuffer=U0(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Kt.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Kt.blob&&(this.blob=function(){var n=No(this);if(n)return n;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(){if(this._bodyArrayBuffer){var n=No(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(Kt.blob)return this.blob().then(q2);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=No(this);if(n)return n;if(this._bodyBlob)return G2(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H2(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Kt.formData&&(this.formData=function(){return this.text().then(X2)}),this.json=function(){return this.text().then(JSON.parse)},this}var Z2=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function V2(n){var e=n.toUpperCase();return Z2.indexOf(e)>-1?e:n}function pi(n,e){if(!(this instanceof pi))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(n instanceof pi){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,e.headers||(this.headers=new Lt(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!t&&n._bodyInit!=null&&(t=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new Lt(e.headers)),this.method=V2(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in qt){var u=new AbortController;return u.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var a=/([?&])_=[^&]*/;if(a.test(this.url))this.url=this.url.replace(a,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}pi.prototype.clone=function(){return new pi(this,{body:this._bodyInit})};function X2(n){var e=new FormData;return n.trim().split("&").forEach(function(t){if(t){var a=t.split("="),o=a.shift().replace(/\+/g," "),u=a.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(u))}}),e}function K2(n){var e=new Lt,t=n.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(a){return a.indexOf(`
35
+ `)===0?a.substr(1,a.length):a}).forEach(function(a){var o=a.split(":"),u=o.shift().trim();if(u){var f=o.join(":").trim();try{e.append(u,f)}catch(h){console.warn("Response "+h.message)}}}),e}W0.call(pi.prototype);function ur(n,e){if(!(this instanceof ur))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new Lt(e.headers),this.url=e.url||"",this._initBody(n)}W0.call(ur.prototype),ur.prototype.clone=function(){return new ur(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Lt(this.headers),url:this.url})},ur.error=function(){var n=new ur(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var Y2=[301,302,303,307,308];ur.redirect=function(n,e){if(Y2.indexOf(e)===-1)throw new RangeError("Invalid status code");return new ur(null,{status:e,headers:{location:n}})};var gi=qt.DOMException;try{new gi}catch{gi=function(e,t){this.message=e,this.name=t;var a=Error(e);this.stack=a.stack},gi.prototype=Object.create(Error.prototype),gi.prototype.constructor=gi}function q0(n,e){return new Promise(function(t,a){var o=new pi(n,e);if(o.signal&&o.signal.aborted)return a(new gi("Aborted","AbortError"));var u=new XMLHttpRequest;function f(){u.abort()}u.onload=function(){var d={statusText:u.statusText,headers:K2(u.getAllResponseHeaders()||"")};o.url.indexOf("file://")===0&&(u.status<200||u.status>599)?d.status=200:d.status=u.status,d.url="responseURL"in u?u.responseURL:d.headers.get("X-Request-URL");var c="response"in u?u.response:u.responseText;setTimeout(function(){t(new ur(c,d))},0)},u.onerror=function(){setTimeout(function(){a(new TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){a(new TypeError("Network request timed out"))},0)},u.onabort=function(){setTimeout(function(){a(new gi("Aborted","AbortError"))},0)};function h(d){try{return d===""&&qt.location.href?qt.location.href:d}catch{return d}}if(u.open(o.method,h(o.url),!0),o.credentials==="include"?u.withCredentials=!0:o.credentials==="omit"&&(u.withCredentials=!1),"responseType"in u&&(Kt.blob?u.responseType="blob":Kt.arrayBuffer&&(u.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof Lt||qt.Headers&&e.headers instanceof qt.Headers)){var v=[];Object.getOwnPropertyNames(e.headers).forEach(function(d){v.push(Yi(d)),u.setRequestHeader(d,To(e.headers[d]))}),o.headers.forEach(function(d,c){v.indexOf(c)===-1&&u.setRequestHeader(c,d)})}else o.headers.forEach(function(d,c){u.setRequestHeader(c,d)});o.signal&&(o.signal.addEventListener("abort",f),u.onreadystatechange=function(){u.readyState===4&&o.signal.removeEventListener("abort",f)}),u.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}q0.polyfill=!0,qt.fetch||(qt.fetch=q0,qt.Headers=Lt,qt.Request=pi,qt.Response=ur);var Q2=self.fetch.bind(self),$o=bn(Q2),J2={rgb2hsl:La,rgb2hsv:Ns,rgb2hwb:Oa,rgb2cmyk:Pa,rgb2keyword:Ma,rgb2xyz:Lo,rgb2lab:Oo,rgb2lch:j2,hsl2rgb:$s,hsl2hsv:z2,hsl2hwb:ev,hsl2cmyk:tv,hsl2keyword:nv,hsv2rgb:Ls,hsv2hsl:rv,hsv2hwb:iv,hsv2cmyk:av,hsv2keyword:sv,hwb2rgb:Ua,hwb2hsl:uv,hwb2hsv:ov,hwb2cmyk:fv,hwb2keyword:lv,cmyk2rgb:Wa,cmyk2hsl:hv,cmyk2hsv:cv,cmyk2hwb:dv,cmyk2keyword:pv,keyword2rgb:_i,keyword2hsl:wv,keyword2hsv:bv,keyword2hwb:mv,keyword2cmyk:Dv,keyword2lab:yv,keyword2xyz:xv,xyz2rgb:G0,xyz2lab:H0,xyz2lch:gv,lab2xyz:Po,lab2rgb:Z0,lab2lch:Mo,lch2lab:Uo,lch2xyz:_v,lch2rgb:vv};function La(n){var e=n[0]/255,t=n[1]/255,a=n[2]/255,o=Math.min(e,t,a),u=Math.max(e,t,a),f=u-o,h,v,d;return u==o?h=0:e==u?h=(t-a)/f:t==u?h=2+(a-e)/f:a==u&&(h=4+(e-t)/f),h=Math.min(h*60,360),h<0&&(h+=360),d=(o+u)/2,u==o?v=0:d<=.5?v=f/(u+o):v=f/(2-u-o),[h,v*100,d*100]}function Ns(n){var e=n[0],t=n[1],a=n[2],o=Math.min(e,t,a),u=Math.max(e,t,a),f=u-o,h,v,d;return u==0?v=0:v=f/u*1e3/10,u==o?h=0:e==u?h=(t-a)/f:t==u?h=2+(a-e)/f:a==u&&(h=4+(e-t)/f),h=Math.min(h*60,360),h<0&&(h+=360),d=u/255*1e3/10,[h,v,d]}function Oa(n){var e=n[0],t=n[1],u=n[2],a=La(n)[0],o=1/255*Math.min(e,Math.min(t,u)),u=1-1/255*Math.max(e,Math.max(t,u));return[a,o*100,u*100]}function Pa(n){var e=n[0]/255,t=n[1]/255,a=n[2]/255,o,u,f,h;return h=Math.min(1-e,1-t,1-a),o=(1-e-h)/(1-h)||0,u=(1-t-h)/(1-h)||0,f=(1-a-h)/(1-h)||0,[o*100,u*100,f*100,h*100]}function Ma(n){return V0[JSON.stringify(n)]}function Lo(n){var e=n[0]/255,t=n[1]/255,a=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92;var o=e*.4124+t*.3576+a*.1805,u=e*.2126+t*.7152+a*.0722,f=e*.0193+t*.1192+a*.9505;return[o*100,u*100,f*100]}function Oo(n){var e=Lo(n),t=e[0],a=e[1],o=e[2],u,f,h;return t/=95.047,a/=100,o/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,u=116*a-16,f=500*(t-a),h=200*(a-o),[u,f,h]}function j2(n){return Mo(Oo(n))}function $s(n){var e=n[0]/360,t=n[1]/100,a=n[2]/100,o,u,f,h,v;if(t==0)return v=a*255,[v,v,v];a<.5?u=a*(1+t):u=a+t-a*t,o=2*a-u,h=[0,0,0];for(var d=0;d<3;d++)f=e+1/3*-(d-1),f<0&&f++,f>1&&f--,6*f<1?v=o+(u-o)*6*f:2*f<1?v=u:3*f<2?v=o+(u-o)*(2/3-f)*6:v=o,h[d]=v*255;return h}function z2(n){var e=n[0],t=n[1]/100,a=n[2]/100,o,u;return a===0?[0,0,0]:(a*=2,t*=a<=1?a:2-a,u=(a+t)/2,o=2*t/(a+t),[e,o*100,u*100])}function ev(n){return Oa($s(n))}function tv(n){return Pa($s(n))}function nv(n){return Ma($s(n))}function Ls(n){var e=n[0]/60,t=n[1]/100,v=n[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),u=255*v*(1-t),f=255*v*(1-t*o),h=255*v*(1-t*(1-o)),v=255*v;switch(a){case 0:return[v,h,u];case 1:return[f,v,u];case 2:return[u,v,h];case 3:return[u,f,v];case 4:return[h,u,v];case 5:return[v,u,f]}}function rv(n){var e=n[0],t=n[1]/100,a=n[2]/100,o,u;return u=(2-t)*a,o=t*a,o/=u<=1?u:2-u,o=o||0,u/=2,[e,o*100,u*100]}function iv(n){return Oa(Ls(n))}function av(n){return Pa(Ls(n))}function sv(n){return Ma(Ls(n))}function Ua(n){var e=n[0]/360,t=n[1]/100,a=n[2]/100,o=t+a,u,f,h,v;switch(o>1&&(t/=o,a/=o),u=Math.floor(6*e),f=1-a,h=6*e-u,u&1&&(h=1-h),v=t+h*(f-t),u){default:case 6:case 0:r=f,g=v,b=t;break;case 1:r=v,g=f,b=t;break;case 2:r=t,g=f,b=v;break;case 3:r=t,g=v,b=f;break;case 4:r=v,g=t,b=f;break;case 5:r=f,g=t,b=v;break}return[r*255,g*255,b*255]}function uv(n){return La(Ua(n))}function ov(n){return Ns(Ua(n))}function fv(n){return Pa(Ua(n))}function lv(n){return Ma(Ua(n))}function Wa(n){var e=n[0]/100,t=n[1]/100,a=n[2]/100,o=n[3]/100,u,f,h;return u=1-Math.min(1,e*(1-o)+o),f=1-Math.min(1,t*(1-o)+o),h=1-Math.min(1,a*(1-o)+o),[u*255,f*255,h*255]}function hv(n){return La(Wa(n))}function cv(n){return Ns(Wa(n))}function dv(n){return Oa(Wa(n))}function pv(n){return Ma(Wa(n))}function G0(n){var e=n[0]/100,t=n[1]/100,a=n[2]/100,o,u,f;return o=e*3.2406+t*-1.5372+a*-.4986,u=e*-.9689+t*1.8758+a*.0415,f=e*.0557+t*-.204+a*1.057,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,u=u>.0031308?1.055*Math.pow(u,1/2.4)-.055:u=u*12.92,f=f>.0031308?1.055*Math.pow(f,1/2.4)-.055:f=f*12.92,o=Math.min(Math.max(0,o),1),u=Math.min(Math.max(0,u),1),f=Math.min(Math.max(0,f),1),[o*255,u*255,f*255]}function H0(n){var e=n[0],t=n[1],a=n[2],o,u,f;return e/=95.047,t/=100,a/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=116*t-16,u=500*(e-t),f=200*(t-a),[o,u,f]}function gv(n){return Mo(H0(n))}function Po(n){var e=n[0],t=n[1],a=n[2],o,u,f,h;return e<=8?(u=e*100/903.3,h=7.787*(u/100)+16/116):(u=100*Math.pow((e+16)/116,3),h=Math.pow(u/100,1/3)),o=o/95.047<=.008856?o=95.047*(t/500+h-16/116)/7.787:95.047*Math.pow(t/500+h,3),f=f/108.883<=.008859?f=108.883*(h-a/200-16/116)/7.787:108.883*Math.pow(h-a/200,3),[o,u,f]}function Mo(n){var e=n[0],t=n[1],a=n[2],o,u,f;return o=Math.atan2(a,t),u=o*360/2/Math.PI,u<0&&(u+=360),f=Math.sqrt(t*t+a*a),[e,f,u]}function Z0(n){return G0(Po(n))}function Uo(n){var e=n[0],t=n[1],a=n[2],o,u,f;return f=a/360*2*Math.PI,o=t*Math.cos(f),u=t*Math.sin(f),[e,o,u]}function _v(n){return Po(Uo(n))}function vv(n){return Z0(Uo(n))}function _i(n){return Wo[n]}function wv(n){return La(_i(n))}function bv(n){return Ns(_i(n))}function mv(n){return Oa(_i(n))}function Dv(n){return Pa(_i(n))}function yv(n){return Oo(_i(n))}function xv(n){return Lo(_i(n))}var Wo={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},V0={};for(var X0 in Wo)V0[JSON.stringify(Wo[X0])]=X0;var qo=J2,Qi=function(){return new Ga};for(var qa in qo){Qi[qa+"Raw"]=function(n){return function(e){return typeof e=="number"&&(e=Array.prototype.slice.call(arguments)),qo[n](e)}}(qa);var K0=/(\w+)2(\w+)/.exec(qa),Go=K0[1],Ev=K0[2];Qi[Go]=Qi[Go]||{},Qi[Go][Ev]=Qi[qa]=function(n){return function(e){typeof e=="number"&&(e=Array.prototype.slice.call(arguments));var t=qo[n](e);if(typeof t=="string"||t===void 0)return t;for(var a=0;a<t.length;a++)t[a]=Math.round(t[a]);return t}}(qa)}var Ga=function(){this.convs={}};Ga.prototype.routeSpace=function(n,e){var t=e[0];return t===void 0?this.getValues(n):(typeof t=="number"&&(t=Array.prototype.slice.call(e)),this.setValues(n,t))},Ga.prototype.setValues=function(n,e){return this.space=n,this.convs={},this.convs[n]=e,this},Ga.prototype.getValues=function(n){var e=this.convs[n];if(!e){var t=this.space,a=this.convs[t];e=Qi[t][n](a),this.convs[n]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(n){Ga.prototype[n]=function(e){return this.routeSpace(n,arguments)}});function Cv(n,e){if(n.length<=e)return n;const t=[];for(let a=0;a<e;a++){const o=a/e,u=Math.ceil(o*n.length);t.push(n[u])}return t}function Ji(n,e=!1){const t=n>=1e3?Math.floor(n):Math.round(n);return t>=75e4?`${(t/1e6).toFixed(1)} Mb`:t>=1e4?`${(t/1e3).toFixed(1)} Kb`:t>0?`${t} bp`:e?"<1 bp":"0 bp"}class Av{constructor(e,t=null,a=1e5){de(this,"url");de(this,"indexUrl");de(this,"dataLimit");de(this,"tabix");de(this,"getData",async(e,t,a)=>{const o=e.map(f=>{let h=a&&a.ensemblStyle?f.chr.replace("chr",""):f.chr;return h==="M"&&(h="MT"),this.getDataForLocus(h,f.start,f.end)}),u=await Promise.all(o);return a&&a.ensemblStyle&&e.forEach((f,h)=>{u[h].forEach(v=>v.chr=f.chr)}),fn.flatten(u)});de(this,"getDataForLocus",async(e,t,a)=>{const o=[];await this.tabix.getLines(e,t,a,f=>o.push(f));let u;return o.length>this.dataLimit?u=Cv(o,this.dataLimit):u=o,u.map(this._parseLine)});de(this,"_parseLine",e=>{const t=e.split(" ");if(t.length<3)return;let a={chr:t[0],start:Number.parseInt(t[1],10),end:Number.parseInt(t[2],10),n:t.length};for(let o=3;o<t.length;o++)a[o]=t[o];return a});this.url=e,this.indexUrl=t||e+".tbi",this.dataLimit=a,this.tabix=new O0({filehandle:new tr(e,{fetch:$o}),tbiFilehandle:new tr(this.indexUrl,{fetch:$o})})}}const Os=BigInt(32);function Fv(n,e,t){const a=+!!t,o=+!t;return BigInt(n.getInt32(e,t)*o+n.getInt32(e+4,t)*a)<<Os|BigInt(n.getUint32(e,t)*a+n.getUint32(e+4,t)*o)}function Bv(n,e,t){const a=n.getUint32(e,t),o=n.getUint32(e+4,t),u=+!!t,f=+!t;return BigInt(a*f+o*u)<<Os|BigInt(a*u+o*f)}function Sv(n,e,t,a){const o=Number(t>>Os),u=Number(t&BigInt(4294967295));a?(n.setInt32(e+4,o,a),n.setUint32(e,u,a)):(n.setInt32(e,o,a),n.setUint32(e+4,u,a))}function Iv(n,e,t,a){const o=Number(t>>Os),u=Number(t&BigInt(4294967295));a?(n.setUint32(e+4,o,a),n.setUint32(e,u,a)):(n.setUint32(e,o,a),n.setUint32(e+4,u,a))}"getBigInt64"in DataView||(DataView.prototype.getBigInt64=function(n,e){return Fv(this,n,e)}),"getBigUint64"in DataView||(DataView.prototype.getBigUint64=function(n,e){return Bv(this,n,e)}),"setBigInt64"in DataView||(DataView.prototype.setBigInt64=function(n,e,t){Sv(this,n,e,t)}),"setBigUint64"in DataView||(DataView.prototype.setBigUint64=function(n,e,t){Iv(this,n,e,t)});class kv{constructor(e,t){this.code="",this.scopes=[["vars"]],this.bitFields=[],this.tmpVariableCount=0,this.references=new Map,this.imports=[],this.reverseImports=new Map,this.useContextVariables=!1,this.importPath=e,this.useContextVariables=t}generateVariable(e){const t=[...this.scopes[this.scopes.length-1]];return e&&t.push(e),t.join(".")}generateOption(e){switch(typeof e){case"number":return e.toString();case"string":return this.generateVariable(e);case"function":return`${this.addImport(e)}.call(${this.generateVariable()}, vars)`}}generateError(e){this.pushCode(`throw new Error(${e});`)}generateTmpVariable(){return"$tmp"+this.tmpVariableCount++}pushCode(e){this.code+=e+`
36
+ `}pushPath(e){e&&this.scopes[this.scopes.length-1].push(e)}popPath(e){e&&this.scopes[this.scopes.length-1].pop()}pushScope(e){this.scopes.push([e])}popScope(){this.scopes.pop()}addImport(e){if(!this.importPath)return`(${e})`;let t=this.reverseImports.get(e);return t||(t=this.imports.push(e)-1,this.reverseImports.set(e,t)),`${this.importPath}[${t}]`}addReference(e){this.references.has(e)||this.references.set(e,{resolved:!1,requested:!1})}markResolved(e){const t=this.references.get(e);t&&(t.resolved=!0)}markRequested(e){e.forEach(t=>{const a=this.references.get(t);a&&(a.requested=!0)})}getUnresolvedReferences(){return Array.from(this.references).filter(([e,t])=>!t.resolved&&!t.requested).map(([e,t])=>e)}}const Hn=new Map,vi="___parser_",Zn={uint8:1,uint16le:2,uint16be:2,uint32le:4,uint32be:4,int8:1,int16le:2,int16be:2,int32le:4,int32be:4,int64be:8,int64le:8,uint64be:8,uint64le:8,floatle:4,floatbe:4,doublele:8,doublebe:8},Ps={uint8:"Uint8",uint16le:"Uint16",uint16be:"Uint16",uint32le:"Uint32",uint32be:"Uint32",int8:"Int8",int16le:"Int16",int16be:"Int16",int32le:"Int32",int32be:"Int32",int64be:"BigInt64",int64le:"BigInt64",uint64be:"BigUint64",uint64le:"BigUint64",floatle:"Float32",floatbe:"Float32",doublele:"Float64",doublebe:"Float64"},Ms={uint8:!1,uint16le:!0,uint16be:!1,uint32le:!0,uint32be:!1,int8:!1,int16le:!0,int16be:!1,int32le:!0,int32be:!1,int64be:!1,int64le:!0,uint64be:!1,uint64le:!0,floatle:!0,floatbe:!1,doublele:!0,doublebe:!1};class Ve{constructor(){this.varName="",this.type="",this.options={},this.endian="be",this.useContextVariables=!1}static start(){return new Ve}primitiveGenerateN(e,t){const a=Ps[e],o=Ms[e];t.pushCode(`${t.generateVariable(this.varName)} = dataView.get${a}(offset, ${o});`),t.pushCode(`offset += ${Zn[e]};`)}primitiveN(e,t,a){return this.setNextParser(e,t,a)}useThisEndian(e){return e+this.endian.toLowerCase()}uint8(e,t={}){return this.primitiveN("uint8",e,t)}uint16(e,t={}){return this.primitiveN(this.useThisEndian("uint16"),e,t)}uint16le(e,t={}){return this.primitiveN("uint16le",e,t)}uint16be(e,t={}){return this.primitiveN("uint16be",e,t)}uint32(e,t={}){return this.primitiveN(this.useThisEndian("uint32"),e,t)}uint32le(e,t={}){return this.primitiveN("uint32le",e,t)}uint32be(e,t={}){return this.primitiveN("uint32be",e,t)}int8(e,t={}){return this.primitiveN("int8",e,t)}int16(e,t={}){return this.primitiveN(this.useThisEndian("int16"),e,t)}int16le(e,t={}){return this.primitiveN("int16le",e,t)}int16be(e,t={}){return this.primitiveN("int16be",e,t)}int32(e,t={}){return this.primitiveN(this.useThisEndian("int32"),e,t)}int32le(e,t={}){return this.primitiveN("int32le",e,t)}int32be(e,t={}){return this.primitiveN("int32be",e,t)}bigIntVersionCheck(){if(!DataView.prototype.getBigInt64)throw new Error("BigInt64 is unsupported on this runtime")}int64(e,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("int64"),e,t)}int64be(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64be",e,t)}int64le(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64le",e,t)}uint64(e,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("uint64"),e,t)}uint64be(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64be",e,t)}uint64le(e,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64le",e,t)}floatle(e,t={}){return this.primitiveN("floatle",e,t)}floatbe(e,t={}){return this.primitiveN("floatbe",e,t)}doublele(e,t={}){return this.primitiveN("doublele",e,t)}doublebe(e,t={}){return this.primitiveN("doublebe",e,t)}bitN(e,t,a){return a.length=e,this.setNextParser("bit",t,a)}bit1(e,t={}){return this.bitN(1,e,t)}bit2(e,t={}){return this.bitN(2,e,t)}bit3(e,t={}){return this.bitN(3,e,t)}bit4(e,t={}){return this.bitN(4,e,t)}bit5(e,t={}){return this.bitN(5,e,t)}bit6(e,t={}){return this.bitN(6,e,t)}bit7(e,t={}){return this.bitN(7,e,t)}bit8(e,t={}){return this.bitN(8,e,t)}bit9(e,t={}){return this.bitN(9,e,t)}bit10(e,t={}){return this.bitN(10,e,t)}bit11(e,t={}){return this.bitN(11,e,t)}bit12(e,t={}){return this.bitN(12,e,t)}bit13(e,t={}){return this.bitN(13,e,t)}bit14(e,t={}){return this.bitN(14,e,t)}bit15(e,t={}){return this.bitN(15,e,t)}bit16(e,t={}){return this.bitN(16,e,t)}bit17(e,t={}){return this.bitN(17,e,t)}bit18(e,t={}){return this.bitN(18,e,t)}bit19(e,t={}){return this.bitN(19,e,t)}bit20(e,t={}){return this.bitN(20,e,t)}bit21(e,t={}){return this.bitN(21,e,t)}bit22(e,t={}){return this.bitN(22,e,t)}bit23(e,t={}){return this.bitN(23,e,t)}bit24(e,t={}){return this.bitN(24,e,t)}bit25(e,t={}){return this.bitN(25,e,t)}bit26(e,t={}){return this.bitN(26,e,t)}bit27(e,t={}){return this.bitN(27,e,t)}bit28(e,t={}){return this.bitN(28,e,t)}bit29(e,t={}){return this.bitN(29,e,t)}bit30(e,t={}){return this.bitN(30,e,t)}bit31(e,t={}){return this.bitN(31,e,t)}bit32(e,t={}){return this.bitN(32,e,t)}namely(e){return Hn.set(e,this),this.alias=e,this}skip(e,t={}){return this.seek(e,t)}seek(e,t={}){if(t.assert)throw new Error("assert option on seek is not allowed.");return this.setNextParser("seek","",{length:e})}string(e,t){if(!t.zeroTerminated&&!t.length&&!t.greedy)throw new Error("One of length, zeroTerminated, or greedy must be 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 enabled.");return t.encoding=t.encoding||"utf8",this.setNextParser("string",e,t)}buffer(e,t){if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for buffer.");return this.setNextParser("buffer",e,t)}wrapped(e,t){if(typeof t!="object"&&typeof e=="object"&&(t=e,e=""),!t||!t.wrapper||!t.type)throw new Error("Both wrapper and type must be defined for wrapped.");if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for wrapped.");return this.setNextParser("wrapper",e,t)}array(e,t){if(!t.readUntil&&!t.length&&!t.lengthInBytes)throw new Error("One of readUntil, length and lengthInBytes must be defined for array.");if(!t.type)throw new Error("type is required for array.");if(typeof t.type=="string"&&!Hn.has(t.type)&&!(t.type in Zn))throw new Error(`Array element type "${t.type}" is unkown.`);return this.setNextParser("array",e,t)}choice(e,t){if(typeof t!="object"&&typeof e=="object"&&(t=e,e=""),!t)throw new Error("tag and choices are are required for choice.");if(!t.tag)throw new Error("tag is requird for choice.");if(!t.choices)throw new Error("choices is required for choice.");for(const a in t.choices){const o=parseInt(a,10),u=t.choices[o];if(isNaN(o))throw new Error(`Choice key "${a}" is not a number.`);if(typeof u=="string"&&!Hn.has(u)&&!(u in Zn))throw new Error(`Choice type "${u}" is unkown.`)}return this.setNextParser("choice",e,t)}nest(e,t){if(typeof t!="object"&&typeof e=="object"&&(t=e,e=""),!t||!t.type)throw new Error("type is required for nest.");if(!(t.type instanceof Ve)&&!Hn.has(t.type))throw new Error("type must be a known parser name or a Parser object.");if(!(t.type instanceof Ve)&&!e)throw new Error("type must be a Parser object if the variable name is omitted.");return this.setNextParser("nest",e,t)}pointer(e,t){if(!t.offset)throw new Error("offset is required for pointer.");if(!t.type)throw new Error("type is required for pointer.");if(typeof t.type=="string"&&!(t.type in Zn)&&!Hn.has(t.type))throw new Error(`Pointer type "${t.type}" is unkown.`);return this.setNextParser("pointer",e,t)}saveOffset(e,t={}){return this.setNextParser("saveOffset",e,t)}endianness(e){switch(e.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error('endianness must be one of "little" or "big"')}return this}endianess(e){return this.endianness(e)}useContextVars(e=!0){return this.useContextVariables=e,this}create(e){if(!(e instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=e,this}getContext(e){const t=new kv(e,this.useContextVariables);return t.pushCode("var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.alias?(this.addAliasedCode(t),t.pushCode(`return ${vi+this.alias}(0).result;`)):this.addRawCode(t),t}getCode(){return this.getContext("imports").code}addRawCode(e){e.pushCode("var offset = 0;"),e.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),e.pushCode("vars.$parent = null;"),e.pushCode("vars.$root = vars;"),this.generate(e),this.resolveReferences(e),e.pushCode("delete vars.$parent;"),e.pushCode("delete vars.$root;"),e.pushCode("return vars;")}addAliasedCode(e){return e.pushCode(`function ${vi+this.alias}(offset, context) {`),e.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),e.pushCode("var ctx = Object.assign({$parent: null, $root: vars}, context || {});"),e.pushCode("vars = Object.assign(vars, ctx);"),this.generate(e),e.markResolved(this.alias),this.resolveReferences(e),e.pushCode("Object.keys(ctx).forEach(function (item) { delete vars[item]; });"),e.pushCode("return { offset: offset, result: vars };"),e.pushCode("}"),e}resolveReferences(e){const t=e.getUnresolvedReferences();e.markRequested(t),t.forEach(a=>{var o;(o=Hn.get(a))===null||o===void 0||o.addAliasedCode(e)})}compile(){const e="imports",t=this.getContext(e);this.compiled=new Function(e,"TextDecoder",`return function (buffer, constructorFn) { ${t.code} };`)(t.imports,TextDecoder)}sizeOf(){let e=NaN;if(Object.keys(Zn).indexOf(this.type)>=0)e=Zn[this.type];else if(this.type==="string"&&typeof this.options.length=="number")e=this.options.length;else if(this.type==="buffer"&&typeof this.options.length=="number")e=this.options.length;else if(this.type==="array"&&typeof this.options.length=="number"){let t=NaN;typeof this.options.type=="string"?t=Zn[this.options.type]:this.options.type instanceof Ve&&(t=this.options.type.sizeOf()),e=this.options.length*t}else this.type==="seek"?e=this.options.length:this.type==="nest"?e=this.options.type.sizeOf():this.type||(e=0);return this.next&&(e+=this.next.sizeOf()),e}parse(e){return this.compiled||this.compile(),this.compiled(e,this.constructorFn)}setNextParser(e,t,a){const o=new Ve;return o.type=e,o.varName=t,o.options=a,o.endian=this.endian,this.head?this.head.next=o:this.next=o,this.head=o,this}generate(e){if(this.type){switch(this.type){case"uint8":case"uint16le":case"uint16be":case"uint32le":case"uint32be":case"int8":case"int16le":case"int16be":case"int32le":case"int32be":case"int64be":case"int64le":case"uint64be":case"uint64le":case"floatle":case"floatbe":case"doublele":case"doublebe":this.primitiveGenerateN(this.type,e);break;case"bit":this.generateBit(e);break;case"string":this.generateString(e);break;case"buffer":this.generateBuffer(e);break;case"seek":this.generateSeek(e);break;case"nest":this.generateNest(e);break;case"array":this.generateArray(e);break;case"choice":this.generateChoice(e);break;case"pointer":this.generatePointer(e);break;case"saveOffset":this.generateSaveOffset(e);break;case"wrapper":this.generateWrapper(e);break}this.type!=="bit"&&this.generateAssert(e)}const t=e.generateVariable(this.varName);return this.options.formatter&&this.type!=="bit"&&this.generateFormatter(e,t,this.options.formatter),this.generateNext(e)}generateAssert(e){if(!this.options.assert)return;const t=e.generateVariable(this.varName);switch(typeof this.options.assert){case"function":{const a=e.addImport(this.options.assert);e.pushCode(`if (!${a}.call(vars, ${t})) {`)}break;case"number":e.pushCode(`if (${this.options.assert} !== ${t}) {`);break;case"string":e.pushCode(`if (${JSON.stringify(this.options.assert)} !== ${t}) {`);break;default:throw new Error("assert option must be a string, number or a function.")}e.generateError(`"Assertion error: ${t} is " + ${JSON.stringify(this.options.assert.toString())}`),e.pushCode("}")}generateNext(e){return this.next&&(e=this.next.generate(e)),e}generateBit(e){const t=JSON.parse(JSON.stringify(this));if(t.options=this.options,t.generateAssert=this.generateAssert.bind(this),t.generateFormatter=this.generateFormatter.bind(this),t.varName=e.generateVariable(t.varName),e.bitFields.push(t),!this.next||this.next&&["bit","nest"].indexOf(this.next.type)<0){const a=e.generateTmpVariable();e.pushCode(`var ${a} = 0;`);const o=(c=0)=>{let D=0;for(let y=c;y<e.bitFields.length;y++){const m=e.bitFields[y].options.length;if(D+m>32)break;D+=m}return D},u=c=>(c<=8?(e.pushCode(`${a} = dataView.getUint8(offset);`),c=8):c<=16?(e.pushCode(`${a} = dataView.getUint16(offset);`),c=16):c<=24?(e.pushCode(`${a} = (dataView.getUint16(offset) << 8) | dataView.getUint8(offset + 2);`),c=24):(e.pushCode(`${a} = dataView.getUint32(offset);`),c=32),e.pushCode(`offset += ${c/8};`),c);let f=0;const h=this.endian==="be";let v=0,d=0;e.bitFields.forEach((c,D)=>{let y=c.options.length;if(y>d){if(d){const S=-1>>>32-d;e.pushCode(`${c.varName} = (${a} & 0x${S.toString(16)}) << ${y-d};`),y-=d}f=0,d=v=u(o(D)-d)}const m=h?v-f-y:f,I=-1>>>32-y;e.pushCode(`${c.varName} ${y<c.options.length?"|=":"="} ${a} >> ${m} & 0x${I.toString(16)};`),c.options.length===32&&e.pushCode(`${c.varName} >>>= 0`),c.options.assert&&c.generateAssert(e),c.options.formatter&&c.generateFormatter(e,c.varName,c.options.formatter),f+=y,d-=y}),e.bitFields=[]}}generateSeek(e){const t=e.generateOption(this.options.length);e.pushCode(`offset += ${t};`)}generateString(e){const t=e.generateVariable(this.varName),a=e.generateTmpVariable(),o=this.options.encoding,u=o.toLowerCase()==="hex",f='b => b.toString(16).padStart(2, "0")';if(this.options.length&&this.options.zeroTerminated){const h=this.options.length;e.pushCode(`var ${a} = offset;`),e.pushCode(`while(dataView.getUint8(offset++) !== 0 && offset - ${a} < ${h});`);const v=`offset - ${a} < ${h} ? offset - 1 : offset`;e.pushCode(u?`${t} = Array.from(buffer.subarray(${a}, ${v}), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(${a}, ${v}));`)}else if(this.options.length){const h=e.generateOption(this.options.length);e.pushCode(u?`${t} = Array.from(buffer.subarray(offset, offset + ${h}), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(offset, offset + ${h}));`),e.pushCode(`offset += ${h};`)}else this.options.zeroTerminated?(e.pushCode(`var ${a} = offset;`),e.pushCode("while(dataView.getUint8(offset++) !== 0);"),e.pushCode(u?`${t} = Array.from(buffer.subarray(${a}, offset - 1), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(${a}, offset - 1));`)):this.options.greedy&&(e.pushCode(`var ${a} = offset;`),e.pushCode("while(buffer.length > offset++);"),e.pushCode(u?`${t} = Array.from(buffer.subarray(${a}, offset), ${f}).join('');`:`${t} = new TextDecoder('${o}').decode(buffer.subarray(${a}, offset));`));this.options.stripNull&&e.pushCode(`${t} = ${t}.replace(/\\x00+$/g, '')`)}generateBuffer(e){const t=e.generateVariable(this.varName);if(typeof this.options.readUntil=="function"){const a=this.options.readUntil,o=e.generateTmpVariable(),u=e.generateTmpVariable();e.pushCode(`var ${o} = offset;`),e.pushCode(`var ${u} = 0;`),e.pushCode("while (offset < buffer.length) {"),e.pushCode(`${u} = dataView.getUint8(offset);`);const f=e.addImport(a);e.pushCode(`if (${f}.call(${e.generateVariable()}, ${u}, buffer.subarray(offset))) break;`),e.pushCode("offset += 1;"),e.pushCode("}"),e.pushCode(`${t} = buffer.subarray(${o}, offset);`)}else if(this.options.readUntil==="eof")e.pushCode(`${t} = buffer.subarray(offset);`);else{const a=e.generateOption(this.options.length);e.pushCode(`${t} = buffer.subarray(offset, offset + ${a});`),e.pushCode(`offset += ${a};`)}this.options.clone&&e.pushCode(`${t} = buffer.constructor.from(${t});`)}generateArray(e){const t=e.generateOption(this.options.length),a=e.generateOption(this.options.lengthInBytes),o=this.options.type,u=e.generateTmpVariable(),f=e.generateVariable(this.varName),h=e.generateTmpVariable(),v=this.options.key,d=typeof v=="string";if(d?e.pushCode(`${f} = {};`):e.pushCode(`${f} = [];`),typeof this.options.readUntil=="function"?e.pushCode("do {"):this.options.readUntil==="eof"?e.pushCode(`for (var ${u} = 0; offset < buffer.length; ${u}++) {`):a!==void 0?e.pushCode(`for (var ${u} = offset + ${a}; offset < ${u}; ) {`):e.pushCode(`for (var ${u} = ${t}; ${u} > 0; ${u}--) {`),typeof o=="string")if(Hn.get(o)){const c=e.generateTmpVariable();if(e.pushCode(`var ${c} = ${vi+o}(offset, {`),e.useContextVariables){const D=e.generateVariable();e.pushCode(`$parent: ${D},`),e.pushCode(`$root: ${D}.$root,`),!this.options.readUntil&&a===void 0&&e.pushCode(`$index: ${t} - ${u},`)}e.pushCode("});"),e.pushCode(`var ${h} = ${c}.result; offset = ${c}.offset;`),o!==this.alias&&e.addReference(o)}else{const c=Ps[o],D=Ms[o];e.pushCode(`var ${h} = dataView.get${c}(offset, ${D});`),e.pushCode(`offset += ${Zn[o]};`)}else if(o instanceof Ve){e.pushCode(`var ${h} = {};`);const c=e.generateVariable();e.pushScope(h),e.useContextVariables&&(e.pushCode(`${h}.$parent = ${c};`),e.pushCode(`${h}.$root = ${c}.$root;`),!this.options.readUntil&&a===void 0&&e.pushCode(`${h}.$index = ${t} - ${u};`)),o.generate(e),e.useContextVariables&&(e.pushCode(`delete ${h}.$parent;`),e.pushCode(`delete ${h}.$root;`),e.pushCode(`delete ${h}.$index;`)),e.popScope()}if(d?e.pushCode(`${f}[${h}.${v}] = ${h};`):e.pushCode(`${f}.push(${h});`),e.pushCode("}"),typeof this.options.readUntil=="function"){const c=this.options.readUntil,D=e.addImport(c);e.pushCode(`while (!${D}.call(${e.generateVariable()}, ${h}, buffer.subarray(offset)));`)}}generateChoiceCase(e,t,a){if(typeof a=="string"){const o=e.generateVariable(this.varName);if(Hn.has(a)){const u=e.generateTmpVariable();e.pushCode(`var ${u} = ${vi+a}(offset, {`),e.useContextVariables&&(e.pushCode(`$parent: ${o}.$parent,`),e.pushCode(`$root: ${o}.$root,`)),e.pushCode("});"),e.pushCode(`${o} = ${u}.result; offset = ${u}.offset;`),a!==this.alias&&e.addReference(a)}else{const u=Ps[a],f=Ms[a];e.pushCode(`${o} = dataView.get${u}(offset, ${f});`),e.pushCode(`offset += ${Zn[a]}`)}}else a instanceof Ve&&(e.pushPath(t),a.generate(e),e.popPath(t))}generateChoice(e){const t=e.generateOption(this.options.tag),a=e.generateVariable(this.varName);if(this.varName&&(e.pushCode(`${a} = {};`),e.useContextVariables)){const o=e.generateVariable();e.pushCode(`${a}.$parent = ${o};`),e.pushCode(`${a}.$root = ${o}.$root;`)}e.pushCode(`switch(${t}) {`);for(const o in this.options.choices){const u=parseInt(o,10),f=this.options.choices[u];e.pushCode(`case ${u}:`),this.generateChoiceCase(e,this.varName,f),e.pushCode("break;")}e.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(e,this.varName,this.options.defaultChoice):e.generateError(`"Met undefined tag value " + ${t} + " at choice"`),e.pushCode("}"),this.varName&&e.useContextVariables&&(e.pushCode(`delete ${a}.$parent;`),e.pushCode(`delete ${a}.$root;`))}generateNest(e){const t=e.generateVariable(this.varName);if(this.options.type instanceof Ve){if(this.varName&&(e.pushCode(`${t} = {};`),e.useContextVariables)){const a=e.generateVariable();e.pushCode(`${t}.$parent = ${a};`),e.pushCode(`${t}.$root = ${a}.$root;`)}e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName),this.varName&&e.useContextVariables&&e.useContextVariables&&(e.pushCode(`delete ${t}.$parent;`),e.pushCode(`delete ${t}.$root;`))}else if(Hn.has(this.options.type)){const a=e.generateTmpVariable();if(e.pushCode(`var ${a} = ${vi+this.options.type}(offset, {`),e.useContextVariables){const o=e.generateVariable();e.pushCode(`$parent: ${o},`),e.pushCode(`$root: ${o}.$root,`)}e.pushCode("});"),e.pushCode(`${t} = ${a}.result; offset = ${a}.offset;`),this.options.type!==this.alias&&e.addReference(this.options.type)}}generateWrapper(e){const t=e.generateVariable(this.varName),a=e.generateTmpVariable();if(typeof this.options.readUntil=="function"){const v=this.options.readUntil,d=e.generateTmpVariable(),c=e.generateTmpVariable();e.pushCode(`var ${d} = offset;`),e.pushCode(`var ${c} = 0;`),e.pushCode("while (offset < buffer.length) {"),e.pushCode(`${c} = dataView.getUint8(offset);`);const D=e.addImport(v);e.pushCode(`if (${D}.call(${e.generateVariable()}, ${c}, buffer.subarray(offset))) break;`),e.pushCode("offset += 1;"),e.pushCode("}"),e.pushCode(`${a} = buffer.subarray(${d}, offset);`)}else if(this.options.readUntil==="eof")e.pushCode(`${a} = buffer.subarray(offset);`);else{const v=e.generateOption(this.options.length);e.pushCode(`${a} = buffer.subarray(offset, offset + ${v});`),e.pushCode(`offset += ${v};`)}this.options.clone&&e.pushCode(`${a} = buffer.constructor.from(${a});`);const o=e.generateTmpVariable(),u=e.generateTmpVariable(),f=e.generateTmpVariable(),h=e.addImport(this.options.wrapper);if(e.pushCode(`${a} = ${h}.call(this, ${a}).subarray(0);`),e.pushCode(`var ${o} = buffer;`),e.pushCode(`var ${u} = offset;`),e.pushCode(`var ${f} = dataView;`),e.pushCode(`buffer = ${a};`),e.pushCode("offset = 0;"),e.pushCode("dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.options.type instanceof Ve)this.varName&&e.pushCode(`${t} = {};`),e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName);else if(Hn.has(this.options.type)){const v=e.generateTmpVariable();e.pushCode(`var ${v} = ${vi+this.options.type}(0);`),e.pushCode(`${t} = ${v}.result;`),this.options.type!==this.alias&&e.addReference(this.options.type)}e.pushCode(`buffer = ${o};`),e.pushCode(`dataView = ${f};`),e.pushCode(`offset = ${u};`)}generateFormatter(e,t,a){if(typeof a=="function"){const o=e.addImport(a);e.pushCode(`${t} = ${o}.call(${e.generateVariable()}, ${t});`)}}generatePointer(e){const t=this.options.type,a=e.generateOption(this.options.offset),o=e.generateTmpVariable(),u=e.generateVariable(this.varName);if(e.pushCode(`var ${o} = offset;`),e.pushCode(`offset = ${a};`),this.options.type instanceof Ve){if(e.pushCode(`${u} = {};`),e.useContextVariables){const f=e.generateVariable();e.pushCode(`${u}.$parent = ${f};`),e.pushCode(`${u}.$root = ${f}.$root;`)}e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName),e.useContextVariables&&(e.pushCode(`delete ${u}.$parent;`),e.pushCode(`delete ${u}.$root;`))}else if(Hn.has(this.options.type)){const f=e.generateTmpVariable();if(e.pushCode(`var ${f} = ${vi+this.options.type}(offset, {`),e.useContextVariables){const h=e.generateVariable();e.pushCode(`$parent: ${h},`),e.pushCode(`$root: ${h}.$root,`)}e.pushCode("});"),e.pushCode(`${u} = ${f}.result; offset = ${f}.offset;`),this.options.type!==this.alias&&e.addReference(this.options.type)}else if(Object.keys(Zn).indexOf(this.options.type)>=0){const f=Ps[t],h=Ms[t];e.pushCode(`${u} = dataView.get${f}(offset, ${h});`),e.pushCode(`offset += ${Zn[t]};`)}e.pushCode(`offset = ${o};`)}generateSaveOffset(e){const t=e.generateVariable(this.varName);e.pushCode(`${t} = offset`)}}let Y0=class Yu{constructor(e){this.ranges=e}get min(){return this.ranges[0].min}get max(){return this.ranges[this.ranges.length-1].max}contains(e){for(const t of this.ranges)if(t.min<=e&&t.max>=e)return!0;return!1}isContiguous(){return this.ranges.length>1}getRanges(){return this.ranges.map(e=>new Yu([{min:e.min,max:e.max}]))}toString(){return this.ranges.map(e=>`[${e.min}-${e.max}]`).join(",")}union(e){const t=[...this.getRanges(),...e.getRanges()].sort((u,f)=>u.min<f.min?-1:u.min>f.min?1:u.max<f.max?-1:f.max>u.max?1:0),a=[];let o=t[0];for(const u of t)u.min>o.max+1?(a.push(o),o=u):u.max>o.max&&(o=new Yu([{min:o.min,max:u.max}]));return a.push(o),a.length===1?a[0]:new Yu(a)}};function ji(n){let e=n.length;for(;--e>=0;)n[e]=0}const Tv=3,Rv=258,Q0=29,Nv=256+1+Q0,J0=30,$v=512,Lv=new Array((Nv+2)*2);ji(Lv);const Ov=new Array(J0*2);ji(Ov);const Pv=new Array($v);ji(Pv);const Mv=new Array(Rv-Tv+1);ji(Mv);const Uv=new Array(Q0);ji(Uv);const Wv=new Array(J0);ji(Wv);var Ho=(n,e,t,a)=>{let o=n&65535|0,u=n>>>16&65535|0,f=0;for(;t!==0;){f=t>2e3?2e3:t,t-=f;do o=o+e[a++]|0,u=u+o|0;while(--f);o%=65521,u%=65521}return o|u<<16|0};const qv=()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var a=0;a<8;a++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},Gv=new Uint32Array(qv());var or=(n,e,t,a)=>{const o=Gv,u=a+t;n^=-1;for(let f=a;f<u;f++)n=n>>>8^o[(n^e[f])&255];return n^-1},Zo={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"},j0={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const Hv=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var Zv=function(n){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const a in t)Hv(t,a)&&(n[a]=t[a])}}return n},Vv=n=>{let e=0;for(let a=0,o=n.length;a<o;a++)e+=n[a].length;const t=new Uint8Array(e);for(let a=0,o=0,u=n.length;a<u;a++){let f=n[a];t.set(f,o),o+=f.length}return t},z0={assign:Zv,flattenChunks:Vv};let ec=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ec=!1}const Ha=new Uint8Array(256);for(let n=0;n<256;n++)Ha[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;Ha[254]=Ha[254]=1;var Xv=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,a,o,u,f=n.length,h=0;for(o=0;o<f;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),h+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(h),u=0,o=0;u<h;o++)t=n.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=n.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),t<128?e[u++]=t:t<2048?(e[u++]=192|t>>>6,e[u++]=128|t&63):t<65536?(e[u++]=224|t>>>12,e[u++]=128|t>>>6&63,e[u++]=128|t&63):(e[u++]=240|t>>>18,e[u++]=128|t>>>12&63,e[u++]=128|t>>>6&63,e[u++]=128|t&63);return e};const Kv=(n,e)=>{if(e<65534&&n.subarray&&ec)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let a=0;a<e;a++)t+=String.fromCharCode(n[a]);return t};var Yv=(n,e)=>{const t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let a,o;const u=new Array(t*2);for(o=0,a=0;a<t;){let f=n[a++];if(f<128){u[o++]=f;continue}let h=Ha[f];if(h>4){u[o++]=65533,a+=h-1;continue}for(f&=h===2?31:h===3?15:7;h>1&&a<t;)f=f<<6|n[a++]&63,h--;if(h>1){u[o++]=65533;continue}f<65536?u[o++]=f:(f-=65536,u[o++]=55296|f>>10&1023,u[o++]=56320|f&1023)}return Kv(u,o)},Qv=(n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+Ha[n[t]]>e?t:e},Vo={string2buf:Xv,buf2string:Yv,utf8border:Qv};function Jv(){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}var jv=Jv;const Us=16209,zv=16191;var ew=function(e,t){let a,o,u,f,h,v,d,c,D,y,m,I,S,T,N,Z,P,k,M,q,$,A,F,L;const G=e.state;a=e.next_in,F=e.input,o=a+(e.avail_in-5),u=e.next_out,L=e.output,f=u-(t-e.avail_out),h=u+(e.avail_out-257),v=G.dmax,d=G.wsize,c=G.whave,D=G.wnext,y=G.window,m=G.hold,I=G.bits,S=G.lencode,T=G.distcode,N=(1<<G.lenbits)-1,Z=(1<<G.distbits)-1;e:do{I<15&&(m+=F[a++]<<I,I+=8,m+=F[a++]<<I,I+=8),P=S[m&N];t:for(;;){if(k=P>>>24,m>>>=k,I-=k,k=P>>>16&255,k===0)L[u++]=P&65535;else if(k&16){M=P&65535,k&=15,k&&(I<k&&(m+=F[a++]<<I,I+=8),M+=m&(1<<k)-1,m>>>=k,I-=k),I<15&&(m+=F[a++]<<I,I+=8,m+=F[a++]<<I,I+=8),P=T[m&Z];n:for(;;){if(k=P>>>24,m>>>=k,I-=k,k=P>>>16&255,k&16){if(q=P&65535,k&=15,I<k&&(m+=F[a++]<<I,I+=8,I<k&&(m+=F[a++]<<I,I+=8)),q+=m&(1<<k)-1,q>v){e.msg="invalid distance too far back",G.mode=Us;break e}if(m>>>=k,I-=k,k=u-f,q>k){if(k=q-k,k>c&&G.sane){e.msg="invalid distance too far back",G.mode=Us;break e}if($=0,A=y,D===0){if($+=d-k,k<M){M-=k;do L[u++]=y[$++];while(--k);$=u-q,A=L}}else if(D<k){if($+=d+D-k,k-=D,k<M){M-=k;do L[u++]=y[$++];while(--k);if($=0,D<M){k=D,M-=k;do L[u++]=y[$++];while(--k);$=u-q,A=L}}}else if($+=D-k,k<M){M-=k;do L[u++]=y[$++];while(--k);$=u-q,A=L}for(;M>2;)L[u++]=A[$++],L[u++]=A[$++],L[u++]=A[$++],M-=3;M&&(L[u++]=A[$++],M>1&&(L[u++]=A[$++]))}else{$=u-q;do L[u++]=L[$++],L[u++]=L[$++],L[u++]=L[$++],M-=3;while(M>2);M&&(L[u++]=L[$++],M>1&&(L[u++]=L[$++]))}}else if(k&64){e.msg="invalid distance code",G.mode=Us;break e}else{P=T[(P&65535)+(m&(1<<k)-1)];continue n}break}}else if(k&64)if(k&32){G.mode=zv;break e}else{e.msg="invalid literal/length code",G.mode=Us;break e}else{P=S[(P&65535)+(m&(1<<k)-1)];continue t}break}}while(a<o&&u<h);M=I>>3,a-=M,I-=M<<3,m&=(1<<I)-1,e.next_in=a,e.next_out=u,e.avail_in=a<o?5+(o-a):5-(a-o),e.avail_out=u<h?257+(h-u):257-(u-h),G.hold=m,G.bits=I};const zi=15,tc=852,nc=592,rc=0,Xo=1,ic=2,tw=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,0,0]),nw=new Uint8Array([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]),rw=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,0,0]),iw=new Uint8Array([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]);var Za=(n,e,t,a,o,u,f,h)=>{const v=h.bits;let d=0,c=0,D=0,y=0,m=0,I=0,S=0,T=0,N=0,Z=0,P,k,M,q,$,A=null,F;const L=new Uint16Array(zi+1),G=new Uint16Array(zi+1);let Y=null,ne,se,pe;for(d=0;d<=zi;d++)L[d]=0;for(c=0;c<a;c++)L[e[t+c]]++;for(m=v,y=zi;y>=1&&L[y]===0;y--);if(m>y&&(m=y),y===0)return o[u++]=1<<24|64<<16|0,o[u++]=1<<24|64<<16|0,h.bits=1,0;for(D=1;D<y&&L[D]===0;D++);for(m<D&&(m=D),T=1,d=1;d<=zi;d++)if(T<<=1,T-=L[d],T<0)return-1;if(T>0&&(n===rc||y!==1))return-1;for(G[1]=0,d=1;d<zi;d++)G[d+1]=G[d]+L[d];for(c=0;c<a;c++)e[t+c]!==0&&(f[G[e[t+c]]++]=c);if(n===rc?(A=Y=f,F=20):n===Xo?(A=tw,Y=nw,F=257):(A=rw,Y=iw,F=0),Z=0,c=0,d=D,$=u,I=m,S=0,M=-1,N=1<<m,q=N-1,n===Xo&&N>tc||n===ic&&N>nc)return 1;for(;;){ne=d-S,f[c]+1<F?(se=0,pe=f[c]):f[c]>=F?(se=Y[f[c]-F],pe=A[f[c]-F]):(se=96,pe=0),P=1<<d-S,k=1<<I,D=k;do k-=P,o[$+(Z>>S)+k]=ne<<24|se<<16|pe|0;while(k!==0);for(P=1<<d-1;Z&P;)P>>=1;if(P!==0?(Z&=P-1,Z+=P):Z=0,c++,--L[d]===0){if(d===y)break;d=e[t+f[c]]}if(d>m&&(Z&q)!==M){for(S===0&&(S=m),$+=D,I=d-S,T=1<<I;I+S<y&&(T-=L[I+S],!(T<=0));)I++,T<<=1;if(N+=1<<I,n===Xo&&N>tc||n===ic&&N>nc)return 1;M=Z&q,o[M]=m<<24|I<<16|$-u|0}}return Z!==0&&(o[$+Z]=d-S<<24|64<<16|0),h.bits=m,0};const aw=0,ac=1,sc=2,{Z_FINISH:uc,Z_BLOCK:sw,Z_TREES:Ws,Z_OK:wi,Z_STREAM_END:uw,Z_NEED_DICT:ow,Z_STREAM_ERROR:Fn,Z_DATA_ERROR:oc,Z_MEM_ERROR:fc,Z_BUF_ERROR:fw,Z_DEFLATED:lc}=j0,qs=16180,hc=16181,cc=16182,dc=16183,pc=16184,gc=16185,_c=16186,vc=16187,wc=16188,bc=16189,Gs=16190,wr=16191,Ko=16192,mc=16193,Yo=16194,Dc=16195,yc=16196,xc=16197,Ec=16198,Hs=16199,Zs=16200,Cc=16201,Ac=16202,Fc=16203,Bc=16204,Sc=16205,Qo=16206,Ic=16207,kc=16208,_t=16209,Tc=16210,Rc=16211,lw=852,hw=592,cw=15,Nc=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function dw(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const bi=n=>{if(!n)return 1;const e=n.state;return!e||e.strm!==n||e.mode<qs||e.mode>Rc?1:0},$c=n=>{if(bi(n))return Fn;const e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=qs,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(lw),e.distcode=e.distdyn=new Int32Array(hw),e.sane=1,e.back=-1,wi},Lc=n=>{if(bi(n))return Fn;const e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,$c(n)},Oc=(n,e)=>{let t;if(bi(n))return Fn;const a=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Fn:(a.window!==null&&a.wbits!==e&&(a.window=null),a.wrap=t,a.wbits=e,Lc(n))},Pc=(n,e)=>{if(!n)return Fn;const t=new dw;n.state=t,t.strm=n,t.window=null,t.mode=qs;const a=Oc(n,e);return a!==wi&&(n.state=null),a},pw=n=>Pc(n,cw);let Mc=!0,Jo,jo;const gw=n=>{if(Mc){Jo=new Int32Array(512),jo=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(Za(ac,n.lens,0,288,Jo,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;Za(sc,n.lens,0,32,jo,0,n.work,{bits:5}),Mc=!1}n.lencode=Jo,n.lenbits=9,n.distcode=jo,n.distbits=5},Uc=(n,e,t,a)=>{let o;const u=n.state;return u.window===null&&(u.wsize=1<<u.wbits,u.wnext=0,u.whave=0,u.window=new Uint8Array(u.wsize)),a>=u.wsize?(u.window.set(e.subarray(t-u.wsize,t),0),u.wnext=0,u.whave=u.wsize):(o=u.wsize-u.wnext,o>a&&(o=a),u.window.set(e.subarray(t-a,t-a+o),u.wnext),a-=o,a?(u.window.set(e.subarray(t-a,t),0),u.wnext=a,u.whave=u.wsize):(u.wnext+=o,u.wnext===u.wsize&&(u.wnext=0),u.whave<u.wsize&&(u.whave+=o))),0},_w=(n,e)=>{let t,a,o,u,f,h,v,d,c,D,y,m,I,S,T=0,N,Z,P,k,M,q,$,A;const F=new Uint8Array(4);let L,G;const Y=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(bi(n)||!n.output||!n.input&&n.avail_in!==0)return Fn;t=n.state,t.mode===wr&&(t.mode=Ko),f=n.next_out,o=n.output,v=n.avail_out,u=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,D=h,y=v,A=wi;e:for(;;)switch(t.mode){case qs:if(t.wrap===0){t.mode=Ko;break}for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.wrap&2&&d===35615){t.wbits===0&&(t.wbits=15),t.check=0,F[0]=d&255,F[1]=d>>>8&255,t.check=or(t.check,F,2,0),d=0,c=0,t.mode=hc;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){n.msg="incorrect header check",t.mode=_t;break}if((d&15)!==lc){n.msg="unknown compression method",t.mode=_t;break}if(d>>>=4,c-=4,$=(d&15)+8,t.wbits===0&&(t.wbits=$),$>15||$>t.wbits){n.msg="invalid window size",t.mode=_t;break}t.dmax=1<<t.wbits,t.flags=0,n.adler=t.check=1,t.mode=d&512?bc:wr,d=0,c=0;break;case hc:for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.flags=d,(t.flags&255)!==lc){n.msg="unknown compression method",t.mode=_t;break}if(t.flags&57344){n.msg="unknown header flags set",t.mode=_t;break}t.head&&(t.head.text=d>>8&1),t.flags&512&&t.wrap&4&&(F[0]=d&255,F[1]=d>>>8&255,t.check=or(t.check,F,2,0)),d=0,c=0,t.mode=cc;case cc:for(;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.head&&(t.head.time=d),t.flags&512&&t.wrap&4&&(F[0]=d&255,F[1]=d>>>8&255,F[2]=d>>>16&255,F[3]=d>>>24&255,t.check=or(t.check,F,4,0)),d=0,c=0,t.mode=dc;case dc:for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.head&&(t.head.xflags=d&255,t.head.os=d>>8),t.flags&512&&t.wrap&4&&(F[0]=d&255,F[1]=d>>>8&255,t.check=or(t.check,F,2,0)),d=0,c=0,t.mode=pc;case pc:if(t.flags&1024){for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.length=d,t.head&&(t.head.extra_len=d),t.flags&512&&t.wrap&4&&(F[0]=d&255,F[1]=d>>>8&255,t.check=or(t.check,F,2,0)),d=0,c=0}else t.head&&(t.head.extra=null);t.mode=gc;case gc:if(t.flags&1024&&(m=t.length,m>h&&(m=h),m&&(t.head&&($=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(a.subarray(u,u+m),$)),t.flags&512&&t.wrap&4&&(t.check=or(t.check,a,m,u)),h-=m,u+=m,t.length-=m),t.length))break e;t.length=0,t.mode=_c;case _c:if(t.flags&2048){if(h===0)break e;m=0;do $=a[u+m++],t.head&&$&&t.length<65536&&(t.head.name+=String.fromCharCode($));while($&&m<h);if(t.flags&512&&t.wrap&4&&(t.check=or(t.check,a,m,u)),h-=m,u+=m,$)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=vc;case vc:if(t.flags&4096){if(h===0)break e;m=0;do $=a[u+m++],t.head&&$&&t.length<65536&&(t.head.comment+=String.fromCharCode($));while($&&m<h);if(t.flags&512&&t.wrap&4&&(t.check=or(t.check,a,m,u)),h-=m,u+=m,$)break e}else t.head&&(t.head.comment=null);t.mode=wc;case wc:if(t.flags&512){for(;c<16;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.wrap&4&&d!==(t.check&65535)){n.msg="header crc mismatch",t.mode=_t;break}d=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=wr;break;case bc:for(;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}n.adler=t.check=Nc(d),d=0,c=0,t.mode=Gs;case Gs:if(t.havedict===0)return n.next_out=f,n.avail_out=v,n.next_in=u,n.avail_in=h,t.hold=d,t.bits=c,ow;n.adler=t.check=1,t.mode=wr;case wr:if(e===sw||e===Ws)break e;case Ko:if(t.last){d>>>=c&7,c-=c&7,t.mode=Qo;break}for(;c<3;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}switch(t.last=d&1,d>>>=1,c-=1,d&3){case 0:t.mode=mc;break;case 1:if(gw(t),t.mode=Hs,e===Ws){d>>>=2,c-=2;break e}break;case 2:t.mode=yc;break;case 3:n.msg="invalid block type",t.mode=_t}d>>>=2,c-=2;break;case mc:for(d>>>=c&7,c-=c&7;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if((d&65535)!==(d>>>16^65535)){n.msg="invalid stored block lengths",t.mode=_t;break}if(t.length=d&65535,d=0,c=0,t.mode=Yo,e===Ws)break e;case Yo:t.mode=Dc;case Dc:if(m=t.length,m){if(m>h&&(m=h),m>v&&(m=v),m===0)break e;o.set(a.subarray(u,u+m),f),h-=m,u+=m,v-=m,f+=m,t.length-=m;break}t.mode=wr;break;case yc:for(;c<14;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.nlen=(d&31)+257,d>>>=5,c-=5,t.ndist=(d&31)+1,d>>>=5,c-=5,t.ncode=(d&15)+4,d>>>=4,c-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=_t;break}t.have=0,t.mode=xc;case xc:for(;t.have<t.ncode;){for(;c<3;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.lens[Y[t.have++]]=d&7,d>>>=3,c-=3}for(;t.have<19;)t.lens[Y[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,L={bits:t.lenbits},A=Za(aw,t.lens,0,19,t.lencode,0,t.work,L),t.lenbits=L.bits,A){n.msg="invalid code lengths set",t.mode=_t;break}t.have=0,t.mode=Ec;case Ec:for(;t.have<t.nlen+t.ndist;){for(;T=t.lencode[d&(1<<t.lenbits)-1],N=T>>>24,Z=T>>>16&255,P=T&65535,!(N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(P<16)d>>>=N,c-=N,t.lens[t.have++]=P;else{if(P===16){for(G=N+2;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(d>>>=N,c-=N,t.have===0){n.msg="invalid bit length repeat",t.mode=_t;break}$=t.lens[t.have-1],m=3+(d&3),d>>>=2,c-=2}else if(P===17){for(G=N+3;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=N,c-=N,$=0,m=3+(d&7),d>>>=3,c-=3}else{for(G=N+7;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=N,c-=N,$=0,m=11+(d&127),d>>>=7,c-=7}if(t.have+m>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=_t;break}for(;m--;)t.lens[t.have++]=$}}if(t.mode===_t)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=_t;break}if(t.lenbits=9,L={bits:t.lenbits},A=Za(ac,t.lens,0,t.nlen,t.lencode,0,t.work,L),t.lenbits=L.bits,A){n.msg="invalid literal/lengths set",t.mode=_t;break}if(t.distbits=6,t.distcode=t.distdyn,L={bits:t.distbits},A=Za(sc,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,L),t.distbits=L.bits,A){n.msg="invalid distances set",t.mode=_t;break}if(t.mode=Hs,e===Ws)break e;case Hs:t.mode=Zs;case Zs:if(h>=6&&v>=258){n.next_out=f,n.avail_out=v,n.next_in=u,n.avail_in=h,t.hold=d,t.bits=c,ew(n,y),f=n.next_out,o=n.output,v=n.avail_out,u=n.next_in,a=n.input,h=n.avail_in,d=t.hold,c=t.bits,t.mode===wr&&(t.back=-1);break}for(t.back=0;T=t.lencode[d&(1<<t.lenbits)-1],N=T>>>24,Z=T>>>16&255,P=T&65535,!(N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(Z&&!(Z&240)){for(k=N,M=Z,q=P;T=t.lencode[q+((d&(1<<k+M)-1)>>k)],N=T>>>24,Z=T>>>16&255,P=T&65535,!(k+N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=k,c-=k,t.back+=k}if(d>>>=N,c-=N,t.back+=N,t.length=P,Z===0){t.mode=Sc;break}if(Z&32){t.back=-1,t.mode=wr;break}if(Z&64){n.msg="invalid literal/length code",t.mode=_t;break}t.extra=Z&15,t.mode=Cc;case Cc:if(t.extra){for(G=t.extra;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.length+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Ac;case Ac:for(;T=t.distcode[d&(1<<t.distbits)-1],N=T>>>24,Z=T>>>16&255,P=T&65535,!(N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(!(Z&240)){for(k=N,M=Z,q=P;T=t.distcode[q+((d&(1<<k+M)-1)>>k)],N=T>>>24,Z=T>>>16&255,P=T&65535,!(k+N<=c);){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}d>>>=k,c-=k,t.back+=k}if(d>>>=N,c-=N,t.back+=N,Z&64){n.msg="invalid distance code",t.mode=_t;break}t.offset=P,t.extra=Z&15,t.mode=Fc;case Fc:if(t.extra){for(G=t.extra;c<G;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}t.offset+=d&(1<<t.extra)-1,d>>>=t.extra,c-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=_t;break}t.mode=Bc;case Bc:if(v===0)break e;if(m=y-v,t.offset>m){if(m=t.offset-m,m>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=_t;break}m>t.wnext?(m-=t.wnext,I=t.wsize-m):I=t.wnext-m,m>t.length&&(m=t.length),S=t.window}else S=o,I=f-t.offset,m=t.length;m>v&&(m=v),v-=m,t.length-=m;do o[f++]=S[I++];while(--m);t.length===0&&(t.mode=Zs);break;case Sc:if(v===0)break e;o[f++]=t.length,v--,t.mode=Zs;break;case Qo:if(t.wrap){for(;c<32;){if(h===0)break e;h--,d|=a[u++]<<c,c+=8}if(y-=v,n.total_out+=y,t.total+=y,t.wrap&4&&y&&(n.adler=t.check=t.flags?or(t.check,o,y,f-y):Ho(t.check,o,y,f-y)),y=v,t.wrap&4&&(t.flags?d:Nc(d))!==t.check){n.msg="incorrect data check",t.mode=_t;break}d=0,c=0}t.mode=Ic;case Ic:if(t.wrap&&t.flags){for(;c<32;){if(h===0)break e;h--,d+=a[u++]<<c,c+=8}if(t.wrap&4&&d!==(t.total&4294967295)){n.msg="incorrect length check",t.mode=_t;break}d=0,c=0}t.mode=kc;case kc:A=uw;break e;case _t:A=oc;break e;case Tc:return fc;case Rc:default:return Fn}return n.next_out=f,n.avail_out=v,n.next_in=u,n.avail_in=h,t.hold=d,t.bits=c,(t.wsize||y!==n.avail_out&&t.mode<_t&&(t.mode<Qo||e!==uc))&&Uc(n,n.output,n.next_out,y-n.avail_out),D-=n.avail_in,y-=n.avail_out,n.total_in+=D,n.total_out+=y,t.total+=y,t.wrap&4&&y&&(n.adler=t.check=t.flags?or(t.check,o,y,n.next_out-y):Ho(t.check,o,y,n.next_out-y)),n.data_type=t.bits+(t.last?64:0)+(t.mode===wr?128:0)+(t.mode===Hs||t.mode===Yo?256:0),(D===0&&y===0||e===uc)&&A===wi&&(A=fw),A},vw=n=>{if(bi(n))return Fn;let e=n.state;return e.window&&(e.window=null),n.state=null,wi},ww=(n,e)=>{if(bi(n))return Fn;const t=n.state;return t.wrap&2?(t.head=e,e.done=!1,wi):Fn},bw=(n,e)=>{const t=e.length;let a,o,u;return bi(n)||(a=n.state,a.wrap!==0&&a.mode!==Gs)?Fn:a.mode===Gs&&(o=1,o=Ho(o,e,t,0),o!==a.check)?oc:(u=Uc(n,e,t,t),u?(a.mode=Tc,fc):(a.havedict=1,wi))};var mw=Lc,Dw=Oc,yw=$c,xw=pw,Ew=Pc,Cw=_w,Aw=vw,Fw=ww,Bw=bw,Sw="pako inflate (from Nodeca project)",br={inflateReset:mw,inflateReset2:Dw,inflateResetKeep:yw,inflateInit:xw,inflateInit2:Ew,inflate:Cw,inflateEnd:Aw,inflateGetHeader:Fw,inflateSetDictionary:Bw,inflateInfo:Sw};function Iw(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var kw=Iw;const Wc=Object.prototype.toString,{Z_NO_FLUSH:Tw,Z_FINISH:Rw,Z_OK:Va,Z_STREAM_END:zo,Z_NEED_DICT:ef,Z_STREAM_ERROR:Nw,Z_DATA_ERROR:qc,Z_MEM_ERROR:$w}=j0;function Vs(n){this.options=z0.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jv,this.strm.avail_out=0;let t=br.inflateInit2(this.strm,e.windowBits);if(t!==Va)throw new Error(Zo[t]);if(this.header=new kw,br.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Vo.string2buf(e.dictionary):Wc.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=br.inflateSetDictionary(this.strm,e.dictionary),t!==Va)))throw new Error(Zo[t])}Vs.prototype.push=function(n,e){const t=this.strm,a=this.options.chunkSize,o=this.options.dictionary;let u,f,h;if(this.ended)return!1;for(e===~~e?f=e:f=e===!0?Rw:Tw,Wc.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(a),t.next_out=0,t.avail_out=a),u=br.inflate(t,f),u===ef&&o&&(u=br.inflateSetDictionary(t,o),u===Va?u=br.inflate(t,f):u===qc&&(u=ef));t.avail_in>0&&u===zo&&t.state.wrap>0&&n[t.next_in]!==0;)br.inflateReset(t),u=br.inflate(t,f);switch(u){case Nw:case qc:case ef:case $w:return this.onEnd(u),this.ended=!0,!1}if(h=t.avail_out,t.next_out&&(t.avail_out===0||u===zo))if(this.options.to==="string"){let v=Vo.utf8border(t.output,t.next_out),d=t.next_out-v,c=Vo.buf2string(t.output,v);t.next_out=d,t.avail_out=a-d,d&&t.output.set(t.output.subarray(v,v+d),0),this.onData(c)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(u===Va&&h===0)){if(u===zo)return u=br.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Vs.prototype.onData=function(n){this.chunks.push(n)},Vs.prototype.onEnd=function(n){n===Va&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=z0.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Lw(n,e){const t=new Vs(e);if(t.push(n),t.err)throw t.msg||Zo[t.err];return t.result}function Ow(n,e){return e=e||{},e.raw=!0,Lw(n,e)}var Pw=Ow,Mw={inflateRaw:Pw};const{inflateRaw:Uw}=Mw;var Ww=Uw;function qw(n){return Ww(n.subarray(2))}class Gw extends Error{constructor(e){super(e),this.code="ERR_ABORTED"}}function Hw(n){n.sort((o,u)=>Number(o.offset)-Number(u.offset));const e=[];let t,a;for(const o of n)t&&a&&Number(o.offset)-a<=2e3?(t.length=BigInt(Number(t.length)+Number(o.length)-a+Number(o.offset)),t.blocks.push(o)):e.push(t={blocks:[o],length:o.length,offset:o.offset}),a=Number(t.offset)+Number(t.length);return e}function Xs(n){if(n&&n.aborted)if(typeof DOMException>"u"){const e=new Gw("aborted");throw e.code="ERR_ABORTED",e}else throw new DOMException("aborted","AbortError")}const Zw=1,Vw=2,Xw=3;function tf(n,e,t,a){return n<a&&e>=t}function Kw(n){const e=n?"big":"little",t=new Ve().endianess(e).uint32("chromId").uint32("start").uint32("end").uint32("validCnt").floatle("minScore").floatle("maxScore").floatle("sumData").floatle("sumSqData").saveOffset("offset"),a=new Ve().endianess(e).uint8("isLeaf").skip(1).uint16("cnt").choice({tag:"isLeaf",choices:{1:new Ve().endianess(e).array("blocksToFetch",{length:"cnt",type:new Ve().endianess(e).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").uint64("blockSize").saveOffset("offset")}),0:new Ve().array("recurOffsets",{length:"cnt",type:new Ve().endianess(e).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").saveOffset("offset")})}}),o=new Ve().endianess(e).uint32("chromId").int32("start").int32("end").string("rest",{zeroTerminated:!0}).saveOffset("offset");return{bigWigParser:new Ve().endianess(e).skip(4).int32("blockStart").skip(4).uint32("itemStep").uint32("itemSpan").uint8("blockType").skip(1).uint16("itemCount").choice({tag:"blockType",choices:{[Xw]:new Ve().array("items",{length:"itemCount",type:new Ve().floatle("score")}),[Vw]:new Ve().array("items",{length:"itemCount",type:new Ve().endianess(e).int32("start").floatle("score")}),[Zw]:new Ve().array("items",{length:"itemCount",type:new Ve().endianess(e).int32("start").int32("end").floatle("score")})}}),bigBedParser:o,summaryParser:t,leafParser:a}}class Gc{constructor(e,t,a,o,u,f){if(this.bbi=e,this.refsByName=t,this.cirTreeOffset=a,this.isBigEndian=o,this.isCompressed=u,this.blockType=f,this.featureCache=new _a({cache:new Wl({maxSize:1e3}),fill:async(v,d)=>{const c=Number(v.length),D=Number(v.offset),{buffer:y}=await this.bbi.read(Un.alloc(c),0,c,D,{signal:d});return y}}),!(a>=0))throw new Error("invalid cirTreeOffset!");const h=Kw(o);this.leafParser=h.leafParser,this.bigBedParser=h.bigBedParser}async readWigData(e,t,a,o,u){try{const{refsByName:f,bbi:h,cirTreeOffset:v,isBigEndian:d}=this,c=f[e];c===void 0&&o.complete();const D={chrId:c,start:t,end:a};this.cirTreePromise||(this.cirTreePromise=h.read(Un.alloc(48),0,48,Number(v),u));const{buffer:y}=await this.cirTreePromise,m=d?y.readUInt32BE(4):y.readUInt32LE(4);let I=[],S=0;const T=(k,M,q)=>{try{const $=k.subarray(M),A=this.leafParser.parse($);if(A.blocksToFetch&&(I=I.concat(A.blocksToFetch.filter(F=>N(F)).map(F=>({offset:F.blockOffset,length:F.blockSize})))),A.recurOffsets){const F=A.recurOffsets.filter(L=>N(L)).map(L=>Number(L.blockOffset));F.length>0&&P(F,q+1)}}catch($){o.error($)}},N=k=>{const{startChrom:M,startBase:q,endChrom:$,endBase:A}=k;return(M<c||M===c&&q<=a)&&($>c||$===c&&A>=t)},Z=async(k,M,q)=>{try{const $=M.max-M.min,A=M.min,F=await this.featureCache.get(`${$}_${A}`,{length:$,offset:A},u==null?void 0:u.signal);for(const L of k)M.contains(L)&&(T(F,L-A,q),S-=1,S===0&&this.readFeatures(o,I,{...u,request:D}).catch(G=>o.error(G)))}catch($){o.error($)}},P=(k,M)=>{try{S+=k.length;const q=4+Number(m)*32;let $=new Y0([{min:k[0],max:k[0]+q}]);for(let A=1;A<k.length;A+=1){const F=new Y0([{min:k[A],max:k[A]+q}]);$=$.union(F)}$.getRanges().map(A=>Z(k,A,M))}catch(q){o.error(q)}};return P([Number(v)+48],1)}catch(f){o.error(f)}}parseSummaryBlock(e,t,a){const o=[];let u=t;const f=new DataView(e.buffer,e.byteOffset,e.length);for(;u<e.byteLength;){const h=f.getUint32(u,!0);u+=4;const v=f.getUint32(u,!0);u+=4;const d=f.getUint32(u,!0);u+=4;const c=f.getUint32(u,!0);u+=4;const D=f.getFloat32(u,!0);u+=4;const y=f.getFloat32(u,!0);u+=4;const m=f.getFloat32(u,!0);u+=4,u+=4,(!a||h===a.chrId&&tf(v,d,a.start,a.end))&&o.push({start:v,end:d,maxScore:y,minScore:D,summary:!0,score:m/(c||1)})}return o}parseBigBedBlock(e,t,a,o){const u=[];let f=t;for(;f<e.byteLength;){const h=this.bigBedParser.parse(e.subarray(f));h.uniqueId=`bb-${a+f}`,u.push(h),f+=h.offset}return o?u.filter(h=>tf(h.start,h.end,o.start,o.end)):u}parseBigWigBlock(e,t,a){const o=e.subarray(t),u=new DataView(o.buffer,o.byteOffset,o.length);let f=0;f+=4;const h=u.getInt32(f,!0);f+=8;const v=u.getUint32(f,!0);f+=4;const d=u.getUint32(f,!0);f+=4;const c=u.getUint8(f);f+=2;const D=u.getUint16(f,!0);f+=2;const y=new Array(D);switch(c){case 1:{for(let m=0;m<D;m++){const I=u.getInt32(f,!0);f+=4;const S=u.getInt32(f,!0);f+=4;const T=u.getFloat32(f,!0);f+=4,y[m]={start:I,end:S,score:T}}break}case 2:{for(let m=0;m<D;m++){const I=u.getInt32(f,!0);f+=4;const S=u.getFloat32(f,!0);f+=4,y[m]={score:S,start:I,end:I+d}}break}case 3:{for(let m=0;m<D;m++){const I=u.getFloat32(f,!0);f+=4;const S=h+m*v;y[m]={score:I,start:S,end:S+d}}break}}return a?y.filter(m=>tf(m.start,m.end,a.start,a.end)):y}async readFeatures(e,t,a={}){try{const{blockType:o,isCompressed:u}=this,{signal:f,request:h}=a,v=Hw(t);Xs(f),await Promise.all(v.map(async d=>{Xs(f);const{length:c,offset:D}=d,y=await this.featureCache.get(`${c}_${D}`,d,f);for(const m of d.blocks){Xs(f);let I=Number(m.offset)-Number(d.offset),S=y;switch(u&&(S=qw(y.subarray(I)),I=0),Xs(f),o){case"summary":{e.next(this.parseSummaryBlock(S,I,h));break}case"bigwig":{e.next(this.parseBigWigBlock(S,I,h));break}case"bigbed":{e.next(this.parseBigBedBlock(S,I,Number(m.offset)*256,h));break}default:console.warn(`Don't know what to do with ${o}`)}}})),e.complete()}catch(o){e.error(o)}}}var nf=function(n,e){return nf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o])},nf(n,e)};function rf(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nf(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Hc(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],a=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function af(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var a=t.call(n),o,u=[],f;try{for(;(e===void 0||e-- >0)&&!(o=a.next()).done;)u.push(o.value)}catch(h){f={error:h}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(f)throw f.error}}return u}function sf(n,e,t){if(t||arguments.length===2)for(var a=0,o=e.length,u;a<o;a++)(u||!(a in e))&&(u||(u=Array.prototype.slice.call(e,0,a)),u[a]=e[a]);return n.concat(u||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function fr(n){return typeof n=="function"}function Zc(n){var e=function(a){Error.call(a),a.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var uf=Zc(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
37
+ `+t.map(function(a,o){return o+1+") "+a.toString()}).join(`
38
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Vc(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var of=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,a,o,u;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var h=Hc(f),v=h.next();!v.done;v=h.next()){var d=v.value;d.remove(this)}}catch(S){e={error:S}}finally{try{v&&!v.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}else f.remove(this);var c=this.initialTeardown;if(fr(c))try{c()}catch(S){u=S instanceof uf?S.errors:[S]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var y=Hc(D),m=y.next();!m.done;m=y.next()){var I=m.value;try{Kc(I)}catch(S){u=u??[],S instanceof uf?u=sf(sf([],af(u)),af(S.errors)):u.push(S)}}}catch(S){a={error:S}}finally{try{m&&!m.done&&(o=y.return)&&o.call(y)}finally{if(a)throw a.error}}}if(u)throw new uf(u)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Kc(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Vc(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&Vc(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}();of.EMPTY;function Xc(n){return n instanceof of||n&&"closed"in n&&fr(n.remove)&&fr(n.add)&&fr(n.unsubscribe)}function Kc(n){fr(n)?n():n.unsubscribe()}var Yw={Promise:void 0},Qw={setTimeout:function(n,e){for(var t=[],a=2;a<arguments.length;a++)t[a-2]=arguments[a];return setTimeout.apply(void 0,sf([n,e],af(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Jw(n){Qw.setTimeout(function(){throw n})}function Yc(){}function jw(n){n()}var ff=function(n){rf(e,n);function e(t){var a=n.call(this)||this;return a.isStopped=!1,t?(a.destination=t,Xc(t)&&t.add(a)):a.destination=tb,a}return e.create=function(t,a,o){return new Ks(t,a,o)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(of),zw=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(a){Ys(a)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(a){Ys(a)}else Ys(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Ys(t)}},n}(),Ks=function(n){rf(e,n);function e(t,a,o){var u=n.call(this)||this,f;return fr(t)||!t?f={next:t??void 0,error:a??void 0,complete:o??void 0}:f=t,u.destination=new zw(f),u}return e}(ff);function Ys(n){Jw(n)}function eb(n){throw n}var tb={closed:!0,next:Yc,error:eb,complete:Yc},nb=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function rb(n){return n}function ib(n){return n.length===0?rb:n.length===1?n[0]:function(t){return n.reduce(function(a,o){return o(a)},t)}}var ab=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,a){var o=this,u=ub(e)?e:new Ks(e,t,a);return jw(function(){var f=o,h=f.operator,v=f.source;u.add(h?h.call(u,v):v?o._subscribe(u):o._trySubscribe(u))}),u},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var a=this;return t=Qc(t),new t(function(o,u){var f=new Ks({next:function(h){try{e(h)}catch(v){u(v),f.unsubscribe()}},error:u,complete:o});a.subscribe(f)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[nb]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ib(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=Qc(e),new e(function(a,o){var u;t.subscribe(function(f){return u=f},function(f){return o(f)},function(){return a(u)})})},n.create=function(e){return new n(e)},n}();function Qc(n){var e;return(e=n??Yw.Promise)!==null&&e!==void 0?e:Promise}function sb(n){return n&&fr(n.next)&&fr(n.error)&&fr(n.complete)}function ub(n){return n&&n instanceof ff||sb(n)&&Xc(n)}function ob(n){return fr(n==null?void 0:n.lift)}function Jc(n){return function(e){if(ob(e))return e.lift(function(t){try{return n(t,this)}catch(a){this.error(a)}});throw new TypeError("Unable to lift unknown Observable type")}}function fb(n,e,t,a,o){return new lb(n,e,t,a,o)}var lb=function(n){rf(e,n);function e(t,a,o,u,f,h){var v=n.call(this,t)||this;return v.onFinalize=f,v.shouldUnsubscribe=h,v._next=a?function(d){try{a(d)}catch(c){t.error(c)}}:n.prototype._next,v._error=u?function(d){try{u(d)}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._error,v._complete=o?function(){try{o()}catch(d){t.error(d)}finally{this.unsubscribe()}}:n.prototype._complete,v}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var a=this.closed;n.prototype.unsubscribe.call(this),!a&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(ff),hb=Zc(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function cb(n,e){return new Promise(function(t,a){var o=new Ks({next:function(u){t(u),o.unsubscribe()},error:a,complete:function(){a(new hb)}});n.subscribe(o)})}function db(n,e,t,a,o){return function(u,f){var h=t,v=e,d=0;u.subscribe(fb(f,function(c){var D=d++;v=h?n(v,c,D):(h=!0,c)},function(){h&&f.next(v),f.complete()}))}}function pb(n,e){return Jc(db(n,e,arguments.length>=2,!1,!0))}var gb=function(n,e){return n.push(e),n};function _b(){return Jc(function(n,e){pb(gb,[])(n).subscribe(e)})}const jc=-2003829722,lf=-2021002517;function vb(n){return new TextDecoder().decode(n)}function zc(n){const e=n?"big":"little",t=new Ve().endianess(e).int32("magic").uint16("version").uint16("numZoomLevels").uint64("chromTreeOffset").uint64("unzoomedDataOffset").uint64("unzoomedIndexOffset").uint16("fieldCount").uint16("definedFieldCount").uint64("asOffset").uint64("totalSummaryOffset").uint32("uncompressBufSize").uint64("extHeaderOffset").array("zoomLevels",{length:"numZoomLevels",type:new Ve().endianess(e).uint32("reductionLevel").uint32("reserved").uint64("dataOffset").uint64("indexOffset")}),a=new Ve().endianess(e).uint64("basesCovered").doublele("scoreMin").doublele("scoreMax").doublele("scoreSum").doublele("scoreSumSquares"),o=new Ve().endianess(e).uint32("magic").uint32("blockSize").uint32("keySize").uint32("valSize").uint64("itemCount"),u=new Ve().endianess(e).uint8("isLeafNode").skip(1).uint16("cnt").saveOffset("offset");return{chromTreeParser:o,totalSummaryParser:a,headerParser:t,isLeafNode:u}}class wb{getHeader(e){return this.headerP||(this.headerP=this._getHeader(e).catch(t=>{throw this.headerP=void 0,t})),this.headerP}constructor(e){const{filehandle:t,renameRefSeqs:a=f=>f,path:o,url:u}=e;if(this.renameRefSeqs=a,t)this.bbi=t;else if(u)this.bbi=new tr(u);else if(o)this.bbi=new va(o);else throw new Error("no file given")}async _getHeader(e){const t=await this._getMainHeader(e),a=await this._readChromTree(t,e);return{...t,...a}}async _getMainHeader(e,t=2e3){const{buffer:a}=await this.bbi.read(Un.alloc(t),0,t,0,e),o=this._isBigEndian(a),u=zc(o),f=u.headerParser.parse(a),{magic:h,asOffset:v,totalSummaryOffset:d}=f;if(f.fileType=h===lf?"bigbed":"bigwig",v>t||d>t)return this._getMainHeader(e,t*2);if(v){const c=Number(f.asOffset);f.autoSql=vb(a.subarray(c,a.indexOf(0,c)))}if(f.totalSummaryOffset>t-8*5)return this._getMainHeader(e,t*2);if(f.totalSummaryOffset){const c=a.subarray(Number(f.totalSummaryOffset)),D=u.totalSummaryParser.parse(c);f.totalSummary={...D,basesCovered:Number(D.basesCovered)}}return{...f,isBigEndian:o}}_isBigEndian(e){let t=e.readInt32LE(0);if(t===jc||t===lf)return!1;if(t=e.readInt32BE(0),t===jc||t===lf)return!0;throw new Error("not a BigWig/BigBed file")}async _readChromTree(e,t){const a=e.isBigEndian,o=a?"big":"little",u=[],f={};let h=Number(e.unzoomedDataOffset);const v=Number(e.chromTreeOffset);for(;h%4!==0;)h+=1;const d=h-v,{buffer:c}=await this.bbi.read(Un.alloc(d),0,d,Number(v),t),D=zc(a),{keySize:y}=D.chromTreeParser.parse(c),m=new Ve().endianess(o).string("key",{stripNull:!0,length:y}).uint32("refId").uint32("refSize").saveOffset("offset"),I=new Ve().endianess(o).skip(y).uint64("childOffset").saveOffset("offset"),S=32,T=async N=>{let Z=N;if(Z>=c.length)throw new Error("reading beyond end of buffer");const P=D.isLeafNode.parse(c.subarray(Z)),{isLeafNode:k,cnt:M}=P;if(Z+=P.offset,k)for(let q=0;q<M;q+=1){const $=m.parse(c.subarray(Z));Z+=$.offset;const{key:A,refId:F,refSize:L}=$,G={name:A,id:F,length:L};f[this.renameRefSeqs(A)]=F,u[F]=G}else{const q=[];for(let $=0;$<M;$+=1){const A=I.parse(c.subarray(Z)),{childOffset:F}=A;Z+=A.offset,q.push(T(Number(F)-Number(v)))}await Promise.all(q)}};return await T(S),{refsByName:f,refsByNumber:u}}async getUnzoomedView(e){const{unzoomedIndexOffset:t,refsByName:a,uncompressBufSize:o,isBigEndian:u,fileType:f}=await this.getHeader(e);return new Gc(this.bbi,a,t,u,o>0,f)}async getFeatureStream(e,t,a,o){await this.getHeader(o);const u=this.renameRefSeqs(e);let f;const{basesPerSpan:h,scale:v}=o||{};return h?f=await this.getView(1/h,o):v?f=await this.getView(v,o):f=await this.getView(1,o),new ab(d=>{f.readWigData(u,t,a,d,o).catch(c=>d.error(c))})}async getFeatures(e,t,a,o){const u=await this.getFeatureStream(e,t,a,o);return(await cb(u.pipe(_b()))).flat()}}let bb=class extends wb{async getView(e,t){const{zoomLevels:a,refsByName:o,fileSize:u,isBigEndian:f,uncompressBufSize:h}=await this.getHeader(t),v=1/e;let d=a.length;u||(d-=1);for(let c=d;c>=0;c-=1){const D=a[c];if(D&&D.reductionLevel<=2*v){const y=Number(D.indexOffset);return new Gc(this.bbi,o,y,f,h>0,"summary")}}return this.getUnzoomedView(t)}};class hf{constructor(e){de(this,"url");de(this,"bw");this.url=e,this.bw=new bb({filehandle:new tr(e,{fetch:$o})})}async getData(e,t){const a=e.map(f=>{let h=t.ensemblStyle?f.chr.replace("chr",""):f.chr;return h==="M"&&(h="MT"),this.bw.getFeatures(h,f.start,f.end)}),o=await Promise.all(a);return e.forEach((f,h)=>{o[h].forEach(v=>v.chr=f.chr)}),fn.flatten(o)}}const mb=1e3;class Db{constructor(e){de(this,"maxBasesPerPixel");de(this,"workerSource");this.maxBasesPerPixel=mb,this.workerSource=new hf(e)}getData(e,t,a){return t>this.maxBasesPerPixel?Promise.resolve([]):this.workerSource.getData(e,a)}}const yb=2;class xb{constructor(e){de(this,"maxBasesPerPixel");de(this,"workerSource");this.maxBasesPerPixel=yb,this.workerSource=new hf(e)}getData(e,t,a){return t>this.maxBasesPerPixel?Promise.resolve([]):this.workerSource.getData(e,a)}}var Qs={InfoFields:{AA:{Number:1,Type:"String",Description:"Ancestral allele"},AC:{Number:"A",Type:"Integer",Description:"Allele count in genotypes, for each ALT allele, in the same order as listed"},AD:{Number:"R",Type:"Integer",Description:"Total read depth for each allele"},ADF:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the forward strand"},ADR:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the reverse strand"},AF:{Number:"A",Type:"Float",Description:"Allele frequency for each ALT allele in the same order as listed (estimated from primary data, not called genotypes)"},AN:{Number:1,Type:"Integer",Description:"Total number of alleles in called genotypes"},BQ:{Number:1,Type:"Float",Description:"RMS base quality"},CIGAR:{Number:1,Type:"Float",Description:"Cigar string describing how to align an alternate allele to the reference allele"},DB:{Number:0,Type:"Flag",Description:"dbSNP membership"},DP:{Number:1,Type:"Integer",Description:"combined depth across samples"},END:{Number:1,Type:"Integer",Description:"End position (for use with symbolic alleles)"},H2:{Number:0,Type:"Flag",Description:"HapMap2 membership"},H3:{Number:0,Type:"Flag",Description:"HapMap3 membership"},MQ:{Number:1,Type:null,Description:"RMS mapping quality"},MQ0:{Number:1,Type:"Integer",Description:"Number of MAPQ == 0 reads"},NS:{Number:1,Type:"Integer",Description:"Number of samples with data"},SB:{Number:4,Type:"Integer",Description:"Strand bias"},SOMATIC:{Number:0,Type:"Flag",Description:"Somatic mutation (for cancer genomics)"},VALIDATED:{Number:0,Type:"Flag",Description:"Validated by follow-up experiment"},"1000G":{Number:0,Type:"Flag",Description:"1000 Genomes membership"},IMPRECISE:{Number:0,Type:"Flag",Description:"Imprecise structural variation"},NOVEL:{Number:0,Type:"Flag",Description:"Indicates a novel structural variation"},SVTYPE:{Number:1,Type:"String",Description:"Type of structural variant"},SVLEN:{Number:null,Type:"Integer",Description:"Difference in length between REF and ALT alleles"},CIPOS:{Number:2,Type:"Integer",Description:"Confidence interval around POS for imprecise variants"},CIEND:{Number:2,Type:"Integer",Description:"Confidence interval around END for imprecise variants"},HOMLEN:{Type:"Integer",Description:"Length of base pair identical micro-homology at event breakpoints"},HOMSEQ:{Type:"String",Description:"Sequence of base pair identical micro-homology at event breakpoints"},BKPTID:{Type:"String",Description:"ID of the assembled alternate allele in the assembly file"},MEINFO:{Number:4,Type:"String",Description:"Mobile element info of the form NAME,START,END,POLARITY"},METRANS:{Number:4,Type:"String",Description:"Mobile element transduction info of the form CHR,START,END,POLARITY"},DGVID:{Number:1,Type:"String",Description:"ID of this element in Database of Genomic Variation"},DBVARID:{Number:1,Type:"String",Description:"ID of this element in DBVAR"},DBRIPID:{Number:1,Type:"String",Description:"ID of this element in DBRIP"},MATEID:{Number:null,Type:"String",Description:"ID of mate breakends"},PARID:{Number:1,Type:"String",Description:"ID of partner breakend"},EVENT:{Number:1,Type:"String",Description:"ID of event associated to breakend"},CILEN:{Number:2,Type:"Integer",Description:"Confidence interval around the inserted material between breakend"},DPADJ:{Type:"Integer",Description:"Read Depth of adjacency"},CN:{Number:1,Type:"Integer",Description:"Copy number of segment containing breakend"},CNADJ:{Number:null,Type:"Integer",Description:"Copy number of adjacency"},CICN:{Number:2,Type:"Integer",Description:"Confidence interval around copy number for the segment"},CICNADJ:{Number:null,Type:"Integer",Description:"Confidence interval around copy number for the adjacency"}},GenotypeFields:{AD:{Number:"R",Type:"Integer",Description:"Read depth for each allele"},ADF:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the forward strand"},ADR:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the reverse strand"},DP:{Number:1,Type:"Integer",Description:"Read depth"},EC:{Number:"A",Type:"Integer",Description:"Expected alternate allele counts"},FT:{Number:1,Type:"String",Description:'Filter indicating if this genotype was "called"'},GL:{Number:"G",Type:"Float",Description:"Genotype likelihoods"},GP:{Number:"G",Type:"Float",Description:"Genotype posterior probabilities"},GQ:{Number:1,Type:"Integer",Description:"Conditional genotype quality"},GT:{Number:1,Type:"String",Description:"Genotype"},HQ:{Number:2,Type:"Integer",Description:"Haplotype quality"},MQ:{Number:1,Type:"Integer",Description:"RMS mapping quality"},PL:{Number:"G",Type:"Integer",Description:"Phred-scaled genotype likelihoods rounded to the closest integer"},PQ:{Number:1,Type:"Integer",Description:"Phasing quality"},PS:{Number:1,Type:"Integer",Description:"Phase set"}},AltTypes:{DEL:{Description:"Deletion relative to the reference"},INS:{Description:"Insertion of novel sequence relative to the reference"},DUP:{Description:"Region of elevated copy number relative to the reference"},INV:{Description:"Inversion of reference sequence"},CNV:{Description:"Copy number variable region (may be both deletion and duplication)"},"DUP:TANDEM":{Description:"Tandem duplication"},"DEL:ME":{Description:"Deletion of mobile element relative to the reference"},"INS:ME":{Description:"Insertion of a mobile element relative to the reference"},NON_REF:{Description:"Represents any possible alternative allele at this location"},"*":{Description:"Represents any possible alternative allele at this location"}},FilterTypes:{PASS:{Description:"Passed all filters"}}};function Eb(n){Object.assign(this,n)}function Cb(n){try{return decodeURIComponent(n)}catch{return n}}class Ab{constructor({header:e="",strict:t=!0}){if(!e||!e.length)throw new Error("empty header received");const a=e.split(/[\r\n]+/).filter(v=>v);if(!a.length)throw new Error("no non-empty header lines specified");this.strict=t,this.metadata=JSON.parse(JSON.stringify({INFO:Qs.InfoFields,FORMAT:Qs.GenotypeFields,ALT:Qs.AltTypes,FILTER:Qs.FilterTypes}));let o;if(a.forEach(v=>{if(v.startsWith("#"))v.startsWith("##")?this._parseMetadata(v):o=v;else throw new Error(`Bad line in header:
39
+ ${v}`)}),!o)throw new Error("No format line found in header");const u=o.trim().split(" "),f=u.slice(0,8),h=["#CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO"];if(u.length<8)throw new Error(`VCF header missing columns:
40
+ ${o}`);if(f.length!==h.length||!f.every((v,d)=>v===h[d]))throw new Error(`VCF column headers not correct:
41
+ ${o}`);this.samples=u.slice(9)}_parseGenotypes(e,t){const a=t.split(" "),o={},u=e==null?void 0:e.split(":");return u&&this.samples.forEach((f,h)=>{o[f]={},u.forEach(v=>{o[f][v]=null}),a[h].split(":").filter(v=>v).forEach((v,d)=>{let c;if(v===""||v==="."||v===void 0)c=null;else{const D=v.split(",").map(m=>m==="."?null:m),y=this.getMetadata("FORMAT",u[d],"Type");y==="Integer"||y==="Float"?c=D.map(m=>m&&+m):c=D}o[f][u[d]]=c},{})}),o}_parseMetadata(e){const t=e.trim().match(/^##(.+?)=(.*)/);if(!t)throw new Error(`Line is not a valid metadata line: ${e}`);const[a,o]=t.slice(1,3);if(o.startsWith("<")){a in this.metadata||(this.metadata[a]={});const[u,f]=this._parseStructuredMetaVal(o);this.metadata[a][u]=f}else this.metadata[a]=o}_parseStructuredMetaVal(e){const t=this._parseKeyValue(e.replace(/^<|>$/g,""),","),a=t.ID;return delete t.ID,"Number"in t&&(Number.isNaN(Number(t.Number))||(t.Number=Number(t.Number))),[a,t]}getMetadata(...e){let t=this.metadata;for(let a=0;a<e.length;a+=1)if(t=t[e[a]],!t)return t;return t}_parseKeyValue(e,t=";"){const a={};let o="",u="",f=1;for(let h=0;h<e.length;h+=1)f===1?e[h]==="="?f=2:e[h]!==t?o+=e[h]:u===""&&(a[o]=null,o=""):f===2?e[h]===t?(a[o]=u,o="",u="",f=1):e[h]==='"'?f=3:u+=e[h]:f===3&&(e[h]!=='"'?u+=e[h]:f=2);return f===2||f===3?a[o]=u:f===1&&(a[o]=null),a}parseLine(e){if(e=e.trim(),!e.length)return;const t=this;let a=0;for(let q=0;a<e.length&&(e[a]===" "&&(q+=1),q!==9);a+=1);const o=e.substr(0,a).split(" "),u=e.substr(a+1),[f,h,v,d,c,D,y]=o,m=f,I=+h,S=v==="."?null:v.split(";"),T=d,N=c==="."?null:c.split(","),Z=D==="."?null:+D,P=y==="."?null:y.split(";");if(this.strict&&o[7]===void 0)throw new Error("no INFO field specified, must contain at least a '.' (turn off strict mode to allow)");const k=o[7]===void 0||o[7]==="."?{}:this._parseKeyValue(o[7]);Object.keys(k).forEach(q=>{let $;k[q]?$=k[q].split(",").map(F=>F==="."?null:F).map(F=>F&&Cb(F)):$=k[q];const A=this.getMetadata("INFO",q,"Type");A&&(A==="Integer"||A==="Float"?$=$.map(F=>F===null?null:Number(F)):A==="Flag"&&(k[q]?console.warn(`Info field ${q} is a Flag and should not have a value (got value ${k[q]})`):$=!0)),k[q]=$});const M=new Eb({CHROM:m,POS:I,ALT:N,INFO:k,REF:T,FILTER:P&&P.length===1&&P[0]==="PASS"?"PASS":P,ID:S,QUAL:Z});return Object.defineProperty(M,"SAMPLES",{get(){const q=t._parseGenotypes(o[8],u);return Object.defineProperty(this,"SAMPLES",{value:q,configurable:!1}),q},configurable:!0}),M}}class Fb{constructor(e,t=null){de(this,"header");de(this,"vcf");de(this,"parser");let a,o;Array.isArray(e)?(a=new Vl(e.filter(u=>!u.name.endsWith(".tbi"))[0]),o=new Vl(e.filter(u=>u.name.endsWith(".tbi"))[0])):(a=new tr(e),o=new tr(t||e+".tbi")),this.vcf=new O0({filehandle:a,tbiFilehandle:o}),this.header=null,this.parser=null}async getData(e,t,a){this.header||(this.header=await this.vcf.getHeader()),this.parser||(this.parser=new Ab({header:this.header}));const o=e.map(h=>this._getDataInLocus(h,a)),u=await Promise.all(o);return fn.flatten(u)}async _getDataInLocus(e,t){const a=[];let o=t&&t.ensemblStyle?e.chr.replace("chr",""):e.chr;if(o==="M"&&(o="MT"),await this.vcf.getLines(o,e.start+1,e.end,u=>a.push(this.parser.parseLine(u))),t&&t.ensemblStyle)for(let u of a)u.CHROM=e.chr;return a}}const Bb={AUTO:"auto"};function rn(n,e){if(typeof n!="number"||typeof e!="number")throw"Bad range "+n+","+e;this._min=n,this._max=e}rn.prototype.min=function(){return this._min},rn.prototype.max=function(){return this._max},rn.prototype.contains=function(n){return n>=this._min&&n<=this._max},rn.prototype.isContiguous=function(){return!0},rn.prototype.ranges=function(){return[this]},rn.prototype._pushRanges=function(n){n.push(this)},rn.prototype.toString=function(){return"["+this._min+"-"+this._max+"]"};function Bn(n){var e=n.sort(ed),t=[],a=e.shift();e.forEach(function(o){o._min<=a._max?o._max>a._max&&(a._max=o._max):(t.push(a),a=o)}),t.push(a),this._ranges=t}Bn.prototype.min=function(){return this._ranges[0].min()},Bn.prototype.max=function(){return this._ranges[this._ranges.length-1].max()},Bn.prototype.lower_bound=function(n){var e=this.ranges();if(n>this.max())return e.length;if(n<this.min())return 0;for(var t=0,a=e.length-1;t<=a;){var o=Math.floor((t+a)/2);if(n>e[o]._max)t=o+1;else if(n<e[o]._min)a=o-1;else return o}return t},Bn.prototype.contains=function(n){var e=this.lower_bound(n);return!!(e<this._ranges.length&&this._ranges[e].contains(n))},Bn.prototype.insertRange=function(n){var e=this.lower_bound(n._min);if(e===this._ranges.length){this._ranges.push(n);return}var t=this.ranges();if(n._max<t[e]._min){this._ranges.splice(e,0,n);return}t[e]._min<n._min&&(n._min=t[e]._min);for(var a=e+1;a<t.length&&t[a]._min<=n._max;)a++;a--,t[a]._max>n._max&&(n._max=t[a]._max),this._ranges.splice(e,a-e+1,n)},Bn.prototype.isContiguous=function(){return this._ranges.length>1},Bn.prototype.ranges=function(){return this._ranges},Bn.prototype._pushRanges=function(n){for(var e=0;e<this._ranges.length;++e)n.push(this._ranges[e])},Bn.prototype.toString=function(){for(var n="",e=0;e<this._ranges.length;++e)e>0&&(n=n+","),n=n+this._ranges[e].toString();return n};function Sb(n,e){return n instanceof Bn||(n instanceof Array||(n=[n]),n=new Bn(n)),e&&n.insertRange(e),n}function Ib(n,e){for(var t=n.ranges(),a=e.ranges(),o=t.length,u=a.length,f=0,h=0,v=[];f<o&&h<u;){var n=t[f],e=a[h],d=Math.max(n.min(),e.min()),c=Math.min(n.max(),e.max());c>=d&&v.push(new rn(d,c)),n.max()>e.max()?++h:++f}return v.length==0?null:v.length==1?v[0]:new Bn(v)}function kb(n){for(var e=0,t=n.ranges(),a=0;a<t.length;++a){var o=t[a];e+=o.max()-o.min()+1}return e}function Tb(n,e){return n.min()<e.min()?-1:n.min()>e.min()?1:n.max()<e.max()?-1:e.max()>n.max()?1:0}function ed(n,e){return n._min<e._min?-1:n._min>e._min?1:n._max<e._max?-1:e._max>n._max?1:0}typeof module<"u"&&(module.exports={Range:rn,union:Sb,intersection:Ib,coverage:kb,rangeOver:Tb,_rangeOrder:ed});var Rb=15,td=Rb,nd=1440,Gr=15,Nb=32,$b=0,Lb=4,Ob=8,He=0,mr=1,Pb=2,Sn=-2,ut=-3,rd=-4,lr=-5,id=0,ad=1,sd=2,ud=3,od=4,fd=5,cf=6,Xa=7,ld=8,hd=9,cd=10,dd=11,Js=12,In=13,hn=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ea=0,df=1,pd=2,gd=3,_d=4,vd=5,js=6,zs=7,Mb=8,eu=9,Ub=9,Wb=5,qb=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Gb=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Hb=[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],Zb=[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,112,112],Vb=[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],Xb=[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];function ta(){}ta.prototype.inflateInit=function(n,e){return n||(n=td),e&&(e=!1),this.istate=new Hr,this.istate.inflateInit(this,e?-n:n)},ta.prototype.inflate=function(n){return this.istate==null?Sn:this.istate.inflate(this,n)},ta.prototype.inflateEnd=function(){if(this.istate==null)return Sn;var n=istate.inflateEnd(this);return this.istate=null,n},ta.prototype.inflateSync=function(){return istate.inflateSync(this)},ta.prototype.inflateSetDictionary=function(n,e){return istate.inflateSetDictionary(this,n,e)};function Hr(){this.was=[0]}Hr.prototype.inflateReset=function(n){return n==null||n.istate==null?Sn:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=n.istate.nowrap!=0?Xa:id,n.istate.blocks.reset(n,null),He)},Hr.prototype.inflateEnd=function(n){return this.blocks!=null&&this.blocks.free(n),this.blocks=null,He},Hr.prototype.inflateInit=function(n,e){return n.msg=null,this.blocks=null,e<0&&(e=-e),e<8||e>15?(this.inflateEnd(n),Sn):(this.wbits=e,n.istate.blocks=new mi(n,n.istate.nowrap!=0?null:this,1<<e),this.inflateReset(n),He)},Hr.prototype.inflate=function(n,e){var t,a;if(n==null||n.istate==null||n.next_in==null)return Sn;for(e=e==Lb?lr:He,t=lr;;)switch(n.istate.mode){case id:if(n.avail_in==0)return t;if(t=e,n.avail_in--,n.total_in++,((n.istate.method=n.next_in[n.next_in_index++])&15)!=Ob){n.istate.mode=In,n.msg="unknown compression method",n.istate.marker=5;break}if((n.istate.method>>4)+8>n.istate.wbits){n.istate.mode=In,n.msg="invalid window size",n.istate.marker=5;break}n.istate.mode=ad;case ad:if(n.avail_in==0)return t;if(t=e,n.avail_in--,n.total_in++,a=n.next_in[n.next_in_index++]&255,((n.istate.method<<8)+a)%31!=0){n.istate.mode=In,n.msg="incorrect header check",n.istate.marker=5;break}if(!(a&Nb)){n.istate.mode=Xa;break}n.istate.mode=sd;case sd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need=(n.next_in[n.next_in_index++]&255)<<24&4278190080,n.istate.mode=ud;case ud:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<16&16711680,n.istate.mode=od;case od:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<8&65280,n.istate.mode=fd;case fd:return n.avail_in==0?t:(t=e,n.avail_in--,n.total_in++,n.istate.need+=n.next_in[n.next_in_index++]&255,n.adler=n.istate.need,n.istate.mode=cf,Pb);case cf:return n.istate.mode=In,n.msg="need dictionary",n.istate.marker=0,Sn;case Xa:if(t=n.istate.blocks.proc(n,t),t==ut){n.istate.mode=In,n.istate.marker=0;break}if(t==He&&(t=e),t!=mr)return t;if(t=e,n.istate.blocks.reset(n,n.istate.was),n.istate.nowrap!=0){n.istate.mode=Js;break}n.istate.mode=ld;case ld:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need=(n.next_in[n.next_in_index++]&255)<<24&4278190080,n.istate.mode=hd;case hd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<16&16711680,n.istate.mode=cd;case cd:if(n.avail_in==0)return t;t=e,n.avail_in--,n.total_in++,n.istate.need+=(n.next_in[n.next_in_index++]&255)<<8&65280,n.istate.mode=dd;case dd:if(n.avail_in==0)return t;if(t=e,n.avail_in--,n.total_in++,n.istate.need+=n.next_in[n.next_in_index++]&255,n.istate.was[0]!=n.istate.need){n.istate.mode=In,n.msg="incorrect data check",n.istate.marker=5;break}n.istate.mode=Js;case Js:return mr;case In:return ut;default:return Sn}},Hr.prototype.inflateSetDictionary=function(n,e,t){var a=0,o=t;return n==null||n.istate==null||n.istate.mode!=cf?Sn:n._adler.adler32(1,e,0,t)!=n.adler?ut:(n.adler=n._adler.adler32(0,null,0,0),o>=1<<n.istate.wbits&&(o=(1<<n.istate.wbits)-1,a=t-o),n.istate.blocks.set_dictionary(e,a,o),n.istate.mode=Xa,He)};var Kb=[0,0,255,255];Hr.prototype.inflateSync=function(n){var e,t,a,o,u;if(n==null||n.istate==null)return Sn;if(n.istate.mode!=In&&(n.istate.mode=In,n.istate.marker=0),(e=n.avail_in)==0)return lr;for(t=n.next_in_index,a=n.istate.marker;e!=0&&a<4;)n.next_in[t]==Kb[a]?a++:n.next_in[t]!=0?a=0:a=4-a,t++,e--;return n.total_in+=t-n.next_in_index,n.next_in_index=t,n.avail_in=e,n.istate.marker=a,a!=4?ut:(o=n.total_in,u=n.total_out,this.inflateReset(n),n.total_in=o,n.total_out=u,n.istate.mode=Xa,He)},Hr.prototype.inflateSyncPoint=function(n){return n==null||n.istate==null||n.istate.blocks==null?Sn:n.istate.blocks.sync_point()};var wd=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function mi(n,e,t){this.hufts=new Int32Array(nd*3),this.window=new Uint8Array(t),this.end=t,this.checkfn=e,this.mode=ea,this.reset(n,null),this.left=0,this.table=0,this.index=0,this.blens=null,this.bb=new Int32Array(1),this.tb=new Int32Array(1),this.codes=new Ka,this.last=0,this.bitk=0,this.bitb=0,this.read=0,this.write=0,this.check=0,this.inftree=new Ya}mi.prototype.reset=function(n,e){e&&(e[0]=this.check),this.mode==js&&this.codes.free(n),this.mode=ea,this.bitk=0,this.bitb=0,this.read=this.write=0,this.checkfn&&(n.adler=this.check=n._adler.adler32(0,null,0,0))},mi.prototype.proc=function(n,e){var t,a,o,u,f,h,v;for(u=n.next_in_index,f=n.avail_in,a=this.bitb,o=this.bitk,h=this.write,v=h<this.read?this.read-h-1:this.end-h;;)switch(this.mode){case ea:for(;o<3;){if(f!=0)e=He;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[u++]&255)<<o,o+=8}switch(t=a&7,this.last=t&1,t>>>1){case 0:a>>>=3,o-=3,t=o&7,a>>>=t,o-=t,this.mode=df;break;case 1:{var d=new Int32Array(1),c=new Int32Array(1),D=[],y=[];Yb(d,c,D,y),this.codes.init(d[0],c[0],D[0],0,y[0],0,n)}a>>>=3,o-=3,this.mode=js;break;case 2:a>>>=3,o-=3,this.mode=gd;break;case 3:return a>>>=3,o-=3,this.mode=In,n.msg="invalid block type",e=ut,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e)}break;case df:for(;o<32;){if(f!=0)e=He;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[u++]&255)<<o,o+=8}if((~a>>>16&65535)!=(a&65535))return this.mode=In,n.msg="invalid stored block lengths",e=ut,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);this.left=a&65535,a=o=0,this.mode=this.left!=0?pd:this.last!=0?zs:ea;break;case pd:if(f==0)return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,write=h,this.inflate_flush(n,e);if(v==0&&(h==end&&read!=0&&(h=0,v=h<this.read?this.read-h-1:this.end-h),v==0&&(this.write=h,e=this.inflate_flush(n,e),h=this.write,v=h<this.read?this.read-h-1:this.end-h,h==this.end&&this.read!=0&&(h=0,v=h<this.read?this.read-h-1:this.end-h),v==0)))return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);if(e=He,t=this.left,t>f&&(t=f),t>v&&(t=v),Vn(n.next_in,u,this.window,h,t),u+=t,f-=t,h+=t,v-=t,(this.left-=t)!=0)break;this.mode=this.last!=0?zs:ea;break;case gd:for(;o<14;){if(f!=0)e=He;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[u++]&255)<<o,o+=8}if(this.table=t=a&16383,(t&31)>29||(t>>5&31)>29)return this.mode=eu,n.msg="too many length or distance symbols",e=ut,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);if(t=258+(t&31)+(t>>5&31),this.blens==null||this.blens.length<t)this.blens=new Int32Array(t);else for(var m=0;m<t;m++)this.blens[m]=0;a>>>=14,o-=14,this.index=0;let T=_d;case _d:for(;this.index<4+(this.table>>>10);){for(;o<3;){if(f!=0)e=He;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[u++]&255)<<o,o+=8}this.blens[wd[this.index++]]=a&7,a>>>=3,o-=3}for(;this.index<19;)this.blens[wd[this.index++]]=0;if(this.bb[0]=7,t=this.inftree.inflate_trees_bits(this.blens,this.bb,this.tb,this.hufts,n),t!=He)return e=t,e==ut&&(this.blens=null,this.mode=eu),this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,write=h,this.inflate_flush(n,e);this.index=0,this.mode=vd;case vd:for(;t=this.table,this.index<258+(t&31)+(t>>5&31);){var m,I,S;for(t=this.bb[0];o<t;){if(f!=0)e=He;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[u++]&255)<<o,o+=8}if(t=this.hufts[(this.tb[0]+(a&hn[t]))*3+1],S=this.hufts[(this.tb[0]+(a&hn[t]))*3+2],S<16)a>>>=t,o-=t,this.blens[this.index++]=S;else{for(m=S==18?7:S-14,I=S==18?11:3;o<t+m;){if(f!=0)e=He;else return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);f--,a|=(n.next_in[u++]&255)<<o,o+=8}if(a>>>=t,o-=t,I+=a&hn[m],a>>>=m,o-=m,m=this.index,t=this.table,m+I>258+(t&31)+(t>>5&31)||S==16&&m<1)return this.blens=null,this.mode=eu,n.msg="invalid bit length repeat",e=ut,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);S=S==16?this.blens[m-1]:0;do this.blens[m++]=S;while(--I!=0);this.index=m}}this.tb[0]=-1;{var d=new Int32Array(1),c=new Int32Array(1),D=new Int32Array(1),y=new Int32Array(1);if(d[0]=9,c[0]=6,t=this.table,t=this.inftree.inflate_trees_dynamic(257+(t&31),1+(t>>5&31),this.blens,d,c,D,y,this.hufts,n),t!=He)return t==ut&&(this.blens=null,this.mode=In),e=t,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);this.codes.init(d[0],c[0],this.hufts,D[0],this.hufts,y[0],n)}this.mode=js;case js:if(this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,(e=this.codes.proc(this,n,e))!=mr)return this.inflate_flush(n,e);if(e=He,this.codes.free(n),u=n.next_in_index,f=n.avail_in,a=this.bitb,o=this.bitk,h=this.write,v=h<this.read?this.read-h-1:this.end-h,this.last==0){this.mode=ea;break}this.mode=zs;case zs:if(this.write=h,e=this.inflate_flush(n,e),h=this.write,v=h<this.read?this.read-h-1:this.end-h,this.read!=this.write)return this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);T=Js;case Mb:return e=mr,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);case eu:return e=ut,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e);default:return e=Sn,this.bitb=a,this.bitk=o,n.avail_in=f,n.total_in+=u-n.next_in_index,n.next_in_index=u,this.write=h,this.inflate_flush(n,e)}},mi.prototype.free=function(n){this.reset(n,null),this.window=null,this.hufts=null},mi.prototype.set_dictionary=function(n,e,t){Vn(n,e,window,0,t),this.read=this.write=t},mi.prototype.sync_point=function(){return this.mode==df},mi.prototype.inflate_flush=function(n,e){var t,a,o;return a=n.next_out_index,o=this.read,t=(o<=this.write?this.write:this.end)-o,t>n.avail_out&&(t=n.avail_out),t!=0&&e==lr&&(e=He),n.avail_out-=t,n.total_out+=t,this.checkfn!=null&&(n.adler=this.check=n._adler.adler32(this.check,this.window,o,t)),Vn(this.window,o,n.next_out,a,t),a+=t,o+=t,o==this.end&&(o=0,this.write==this.end&&(this.write=0),t=this.write-o,t>n.avail_out&&(t=n.avail_out),t!=0&&e==lr&&(e=He),n.avail_out-=t,n.total_out+=t,this.checkfn!=null&&(n.adler=this.check=n._adler.adler32(this.check,this.window,o,t)),Vn(this.window,o,n.next_out,a,t),a+=t,o+=t),n.next_out_index=a,this.read=o,e};var tu=0,bd=1,md=2,Dd=3,yd=4,xd=5,Ed=6,pf=7,Cd=8,nu=9;function Ka(){}Ka.prototype.init=function(n,e,t,a,o,u,f){this.mode=tu,this.lbits=n,this.dbits=e,this.ltree=t,this.ltree_index=a,this.dtree=o,this.dtree_index=u,this.tree=null},Ka.prototype.proc=function(n,e,t){var a,o,u,f=0,h=0,v=0,d,c,D,y;for(v=e.next_in_index,d=e.avail_in,f=n.bitb,h=n.bitk,c=n.write,D=c<n.read?n.read-c-1:n.end-c;;)switch(this.mode){case tu:if(D>=258&&d>=10&&(n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,t=this.inflate_fast(this.lbits,this.dbits,this.ltree,this.ltree_index,this.dtree,this.dtree_index,n,e),v=e.next_in_index,d=e.avail_in,f=n.bitb,h=n.bitk,c=n.write,D=c<n.read?n.read-c-1:n.end-c,t!=He)){this.mode=t==mr?pf:nu;break}this.need=this.lbits,this.tree=this.ltree,this.tree_index=this.ltree_index,this.mode=bd;case bd:for(a=this.need;h<a;){if(d!=0)t=He;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[v++]&255)<<h,h+=8}if(o=(this.tree_index+(f&hn[a]))*3,f>>>=this.tree[o+1],h-=this.tree[o+1],u=this.tree[o],u==0){this.lit=this.tree[o+2],this.mode=Ed;break}if(u&16){this.get=u&15,this.len=this.tree[o+2],this.mode=md;break}if(!(u&64)){this.need=u,this.tree_index=o/3+this.tree[o+2];break}if(u&32){this.mode=pf;break}return this.mode=nu,e.msg="invalid literal/length code",t=ut,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);case md:for(a=this.get;h<a;){if(d!=0)t=He;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[v++]&255)<<h,h+=8}this.len+=f&hn[a],f>>=a,h-=a,this.need=this.dbits,this.tree=this.dtree,this.tree_index=this.dtree_index,this.mode=Dd;case Dd:for(a=this.need;h<a;){if(d!=0)t=He;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[v++]&255)<<h,h+=8}if(o=(this.tree_index+(f&hn[a]))*3,f>>=this.tree[o+1],h-=this.tree[o+1],u=this.tree[o],u&16){this.get=u&15,this.dist=this.tree[o+2],this.mode=yd;break}if(!(u&64)){this.need=u,this.tree_index=o/3+this.tree[o+2];break}return this.mode=nu,e.msg="invalid distance code",t=ut,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);case yd:for(a=this.get;h<a;){if(d!=0)t=He;else return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);d--,f|=(e.next_in[v++]&255)<<h,h+=8}this.dist+=f&hn[a],f>>=a,h-=a,this.mode=xd;case xd:for(y=c-this.dist;y<0;)y+=n.end;for(;this.len!=0;){if(D==0&&(c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0&&(n.write=c,t=n.inflate_flush(e,t),c=n.write,D=c<n.read?n.read-c-1:n.end-c,c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0)))return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);n.window[c++]=n.window[y++],D--,y==n.end&&(y=0),this.len--}this.mode=tu;break;case Ed:if(D==0&&(c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0&&(n.write=c,t=n.inflate_flush(e,t),c=n.write,D=c<n.read?n.read-c-1:n.end-c,c==n.end&&n.read!=0&&(c=0,D=c<n.read?n.read-c-1:n.end-c),D==0)))return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);t=He,n.window[c++]=this.lit,D--,this.mode=tu;break;case pf:if(h>7&&(h-=8,d++,v--),n.write=c,t=n.inflate_flush(e,t),c=n.write,D=c<n.read?n.read-c-1:n.end-c,n.read!=n.write)return n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);this.mode=Cd;case Cd:return t=mr,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);case nu:return t=ut,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t);default:return t=Sn,n.bitb=f,n.bitk=h,e.avail_in=d,e.total_in+=v-e.next_in_index,e.next_in_index=v,n.write=c,n.inflate_flush(e,t)}},Ka.prototype.free=function(n){},Ka.prototype.inflate_fast=function(n,e,t,a,o,u,f,h){var v,d,c,D,y,m,I,S,T,N,Z,P,k,M,q,$;I=h.next_in_index,S=h.avail_in,y=f.bitb,m=f.bitk,T=f.write,N=T<f.read?f.read-T-1:f.end-T,Z=hn[n],P=hn[e];do{for(;m<20;)S--,y|=(h.next_in[I++]&255)<<m,m+=8;if(v=y&Z,d=t,c=a,$=(c+v)*3,(D=d[$])==0){y>>=d[$+1],m-=d[$+1],f.window[T++]=d[$+2],N--;continue}do{if(y>>=d[$+1],m-=d[$+1],D&16){for(D&=15,k=d[$+2]+(y&hn[D]),y>>=D,m-=D;m<15;)S--,y|=(h.next_in[I++]&255)<<m,m+=8;v=y&P,d=o,c=u,$=(c+v)*3,D=d[$];do if(y>>=d[$+1],m-=d[$+1],D&16){for(D&=15;m<D;)S--,y|=(h.next_in[I++]&255)<<m,m+=8;if(M=d[$+2]+(y&hn[D]),y>>=D,m-=D,N-=k,T>=M)q=T-M,T-q>0&&2>T-q,f.window[T++]=f.window[q++],f.window[T++]=f.window[q++],k-=2;else{q=T-M;do q+=f.end;while(q<0);if(D=f.end-q,k>D){if(k-=D,T-q>0&&D>T-q)do f.window[T++]=f.window[q++];while(--D!=0);else Vn(f.window,q,f.window,T,D),T+=D,q+=D,D=0;q=0}}do f.window[T++]=f.window[q++];while(--k!=0);break}else if(!(D&64))v+=d[$+2],v+=y&hn[D],$=(c+v)*3,D=d[$];else return h.msg="invalid distance code",k=h.avail_in-S,k=m>>3<k?m>>3:k,S+=k,I-=k,m-=k<<3,f.bitb=y,f.bitk=m,h.avail_in=S,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=T,ut;while(!0);break}if(D&64)return D&32?(k=h.avail_in-S,k=m>>3<k?m>>3:k,S+=k,I-=k,m-=k<<3,f.bitb=y,f.bitk=m,h.avail_in=S,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=T,mr):(h.msg="invalid literal/length code",k=h.avail_in-S,k=m>>3<k?m>>3:k,S+=k,I-=k,m-=k<<3,f.bitb=y,f.bitk=m,h.avail_in=S,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=T,ut);if(v+=d[$+2],v+=y&hn[D],$=(c+v)*3,(D=d[$])==0){y>>=d[$+1],m-=d[$+1],f.window[T++]=d[$+2],N--;break}}while(!0)}while(N>=258&&S>=10);return k=h.avail_in-S,k=m>>3<k?m>>3:k,S+=k,I-=k,m-=k<<3,f.bitb=y,f.bitk=m,h.avail_in=S,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=T,He};function Ya(){}Ya.prototype.huft_build=function(n,e,t,a,o,u,f,h,v,d,c){var D,y,m,I,S,T,N,Z,P,k,M,q,$,A,F;k=0,S=t;do this.c[n[e+k]]++,k++,S--;while(S!=0);if(this.c[0]==t)return f[0]=-1,h[0]=0,He;for(Z=h[0],T=1;T<=Gr&&this.c[T]==0;T++);for(N=T,Z<T&&(Z=T),S=Gr;S!=0&&this.c[S]==0;S--);for(m=S,Z>S&&(Z=S),h[0]=Z,A=1<<T;T<S;T++,A<<=1)if((A-=this.c[T])<0)return ut;if((A-=this.c[S])<0)return ut;for(this.c[S]+=A,this.x[1]=T=0,k=1,$=2;--S!=0;)this.x[$]=T+=this.c[k],$++,k++;S=0,k=0;do(T=n[e+k])!=0&&(this.v[this.x[T]++]=S),k++;while(++S<t);for(t=this.x[m],this.x[0]=S=0,k=0,I=-1,q=-Z,this.u[0]=0,M=0,F=0;N<=m;N++)for(D=this.c[N];D--!=0;){for(;N>q+Z;){if(I++,q+=Z,F=m-q,F=F>Z?Z:F,(y=1<<(T=N-q))>D+1&&(y-=D+1,$=N,T<F))for(;++T<F&&!((y<<=1)<=this.c[++$]);)y-=this.c[$];if(F=1<<T,this.hn[0]+F>nd)return ut;this.u[I]=M=this.hn[0],this.hn[0]+=F,I!=0?(this.x[I]=S,this.r[0]=T,this.r[1]=Z,T=S>>>q-Z,this.r[2]=M-this.u[I-1]-T,Vn(this.r,0,v,(this.u[I-1]+T)*3,3)):f[0]=M}for(this.r[1]=N-q,k>=t?this.r[0]=192:c[k]<a?(this.r[0]=this.v[k]<256?0:96,this.r[2]=this.v[k++]):(this.r[0]=u[this.v[k]-a]+16+64,this.r[2]=o[this.v[k++]-a]),y=1<<N-q,T=S>>>q;T<F;T+=y)Vn(this.r,0,v,(M+T)*3,3);for(T=1<<N-1;S&T;T>>>=1)S^=T;for(S^=T,P=(1<<q)-1;(S&P)!=this.x[I];)I--,q-=Z,P=(1<<q)-1}return A!=0&&m!=1?lr:He},Ya.prototype.inflate_trees_bits=function(n,e,t,a,o){var u;return this.initWorkArea(19),this.hn[0]=0,u=this.huft_build(n,0,19,19,null,null,t,e,a,this.hn,this.v),u==ut?o.msg="oversubscribed dynamic bit lengths tree":(u==lr||e[0]==0)&&(o.msg="incomplete dynamic bit lengths tree",u=ut),u},Ya.prototype.inflate_trees_dynamic=function(n,e,t,a,o,u,f,h,v){var d;return this.initWorkArea(288),this.hn[0]=0,d=this.huft_build(t,0,n,257,Hb,Zb,u,a,h,this.hn,this.v),d!=He||a[0]==0?(d==ut?v.msg="oversubscribed literal/length tree":d!=rd&&(v.msg="incomplete literal/length tree",d=ut),d):(this.initWorkArea(288),d=this.huft_build(t,n,e,0,Vb,Xb,f,o,h,this.hn,this.v),d!=He||o[0]==0&&n>257?(d==ut?v.msg="oversubscribed distance tree":d==lr?(v.msg="incomplete distance tree",d=ut):d!=rd&&(v.msg="empty distance tree with lengths",d=ut),d):He)};function Yb(n,e,t,a,o){return n[0]=Ub,e[0]=Wb,t[0]=qb,a[0]=Gb,He}Ya.prototype.initWorkArea=function(n){this.hn==null&&(this.hn=new Int32Array(1),this.v=new Int32Array(n),this.c=new Int32Array(Gr+1),this.r=new Int32Array(3),this.u=new Int32Array(Gr),this.x=new Int32Array(Gr+1)),this.v.length<n&&(this.v=new Int32Array(n));for(var e=0;e<n;e++)this.v[e]=0;for(var e=0;e<Gr+1;e++)this.c[e]=0;for(var e=0;e<3;e++)this.r[e]=0;Vn(this.c,0,this.u,0,Gr),Vn(this.c,0,this.x,0,Gr+1)};var Qb=new Uint8Array(1),Jb=typeof Qb.subarray=="function";function Vn(n,e,t,a,o){if(o!=0){if(n){if(!t)throw"Undef dest"}else throw"Undef src";e==0&&o==n.length?gf(n,t,a):Jb?gf(n.subarray(e,e+o),t,a):n.BYTES_PER_ELEMENT==1&&o>100?gf(new Uint8Array(n.buffer,n.byteOffset+e,o),t,a):jb(n,e,t,a,o)}}function jb(n,e,t,a,o){for(var u=0;u<o;++u)t[a+u]=n[e+u]}function gf(n,e,t){e.set(n,t)}function zb(n,e,t,a){e?t?n=new Uint8Array(n,e,t):n=new Uint8Array(n,e,n.byteLength-e):n=new Uint8Array(n);var o=new ta;o.inflateInit(td,!0),o.next_in=n,o.next_in_index=0,o.avail_in=n.length;for(var u=[],f=0;;){var h=new Uint8Array(32e3);o.next_out=h,o.next_out_index=0,o.avail_out=h.length;var v=o.inflate($b);if(v!=He&&v!=mr&&v!=lr)throw o.msg;if(o.avail_out!=0){var d=new Uint8Array(h.length-o.avail_out);Vn(h,0,d,0,h.length-o.avail_out),h=d}if(u.push(h),f+=h.length,v==mr||v==lr)break}if(u.length==1)return u[0].buffer;for(var c=new Uint8Array(f),D=0,y=0;y<u.length;++y){var m=u[y];Vn(m,0,c,D,m.length),D+=m.length}return c.buffer}function Ad(){}function Fd(n){n&&(this.id=n)}typeof module<"u"&&(module.exports={DASGroup:Fd,DASFeature:Ad});var em=2291137574,tm=654086024,nm=2273964779,rm=3958540679,im=1,am=2,sm=3,Bd=256,Sd=256*256,Id=256*256*256,um=256*256*256*256,om=new RegExp("^[0-9]+,[0-9]+,[0-9]+");function Nt(n,e){var t=n[e]+n[e+1]*Bd+n[e+2]*Sd+n[e+3]*Id+n[e+4]*um;return t}function Dr(){}Dr.prototype.readChromTree=function(n){var e=this;this.chromsToIDs={},this.idsToChroms={},this.chrAlias={1:"chr1",2:"chr2",3:"chr3",4:"chr4",5:"chr5",6:"chr6",7:"chr7",8:"chr8",9:"chr9",10:"chr10",11:"chr11",12:"chr12",13:"chr13",14:"chr14",15:"chr15",16:"chr16",17:"chr17",18:"chr18",19:"chr19",20:"chr20",21:"chr21",22:"chr22",X:"chrX",Y:"chrY",M:"chrM",MT:"chrM"},this.maxID=0;var t=this.unzoomedDataOffset,a=t-this.chromTreeOffset&3;t=t+4-a,this.data.slice(this.chromTreeOffset,t-this.chromTreeOffset).fetch(function(o){var u=new Uint8Array(o),f=new Int16Array(o),h=new Int32Array(o);h[0],h[1];var v=h[2];h[3],Nt(u,16);var d=32,c=function(D){var y=u[D],m=f[D/2+1];D+=4;for(var I=0;I<m;++I)if(y==0){D+=v;var S=Nt(u,D);D+=8,S-=e.chromTreeOffset,c(S)}else{for(var T="",N=0;N<v;++N){var Z=u[D++];Z!=0&&(T+=String.fromCharCode(Z))}var P=u[D+3]<<24|u[D+2]<<16|u[D+1]<<8|u[D+0];u[D+7]<<24|u[D+6]<<16|u[D+5]<<8|u[D+4],D+=8,e.chromsToIDs[T]=P,e.idsToChroms[P]=T,e.chrAlias.hasOwnProperty(T)&&(e.chromsToIDs[e.chrAlias[T]]=P,e.idsToChroms[P]=e.chrAlias[T]),e.maxID=Math.max(e.maxID,P)}};c(d),n(e)})};function Zr(n,e,t,a){this.bwg=n,this.cirTreeOffset=e,this.cirTreeLength=t,this.isSummary=a}Zr.prototype.readWigData=function(n,e,t,a){var o=this.bwg.chromsToIDs[n];if(o===void 0)return a([]);this.readWigDataById(o,e,t,a)},Zr.prototype.readWigDataById=function(n,e,t,a){var o=this;if(!this.cirHeader){this.bwg.data.slice(this.cirTreeOffset,48).fetch(function(D){o.cirHeader=D;var y=new Int32Array(o.cirHeader);o.cirBlockSize=y[1],o.readWigDataById(n,e,t,a)});return}var u=[],f=0,h=function(D,y,m,I){return(n<0||D==n)&&y<=t&&m>=e},v=function(D,y){if(o.bwg.instrument&&console.log("level="+y+"; offset="+D+"; time="+(Date.now()|0)),f+=D.length,D.length==1&&D[0]-o.cirTreeOffset==48&&o.cachedCirRoot){c(o.cachedCirRoot,0,y),--f,f==0&&o.fetchFeatures(h,u,a);return}for(var m=4+o.cirBlockSize*32,I,S=0;S<D.length;++S){var T=new rn(D[S],D[S]+m);I=I?union(I,T):T}for(var N=I.ranges(),Z=0;Z<N.length;++Z){var P=N[Z];d(D,P,y)}},d=function(D,y,m,I){y.max()-y.min(),o.bwg.data.slice(y.min(),y.max()-y.min()).fetch(function(S){for(var T=0;T<D.length;++T)y.contains(D[T])&&(c(S,D[T]-y.min(),m),D[T]-o.cirTreeOffset==48&&D[T]-y.min()==0&&(o.cachedCirRoot=S),--f,f==0&&o.fetchFeatures(h,u,a))})},c=function(D,y,m){var I=new Uint8Array(D),S=new Int16Array(D),T=new Int32Array(D),N=I[y],Z=S[y/2+1];if(y+=4,N!=0)for(var P=0;P<Z;++P){var k=y/4,M=T[k],q=T[k+1],$=T[k+2],A=T[k+3],F=Nt(I,y+16),L=Nt(I,y+24);(n<0||M<n||M==n&&q<=t)&&(n<0||$>n||$==n&&A>=e)&&u.push({offset:F,size:L}),y+=32}else{for(var G=[],P=0;P<Z;++P){var k=y/4,M=T[k],q=T[k+1],$=T[k+2],A=T[k+3],F=Nt(I,y+16);(n<0||M<n||M==n&&q<=t)&&(n<0||$>n||$==n&&A>=e)&&G.push(F),y+=24}G.length>0&&v(G,m+1)}};v([o.cirTreeOffset+48],1)},Zr.prototype.fetchFeatures=function(n,e,t){var a=this;if(e.sort(function(h,v){return(h.offset|0)-(v.offset|0)}),e.length==0)t([]);else{var o=[],u=function(h,v,d,c){c||(c={});var D=new Ad;D._chromId=h,D.segment=a.bwg.idsToChroms[h],D.min=v,D.max=d,D.type=a.bwg.type;for(var y in c)D[y]=c[y];o.push(D)},f=function(){if(e.length==0){t(o);return}else{var h=e[0];if(h.data)a.parseFeatures(h.data,u,n),e.splice(0,1),f();else{for(var v=h.offset,d=h.size,c=1;c<e.length&&e[c].offset==v+d;)d+=e[c].size,++c;a.bwg.data.slice(v,d).fetch(function(D){for(var y=0,m=0;y<d;){var I=e[m],S;if(a.bwg.uncompressBufSize>0)S=zb(D,y+2,I.size-2);else{var T=new Uint8Array(I.size);arrayCopy(new Uint8Array(D,y,I.size),0,T,0,I.size),S=T.buffer}I.data=S,y+=I.size,++m}f()})}}};f()}},Zr.prototype.parseFeatures=function(n,e,t){var a=new Uint8Array(n);if(this.isSummary)for(var o=new Int16Array(n),u=new Int32Array(n),f=new Float32Array(n),h=n.byteLength/32,v=0;v<h;++v){var d=u[v*8],c=u[v*8+1],D=u[v*8+2],y=u[v*8+3];f[v*8+4];var m=f[v*8+5],I=f[v*8+6];if(f[v*8+7],t(d,c+1,D)){var S={type:"bigwig",score:I/y,maxScore:m};this.bwg.type=="bigbed"&&(S.type="density"),e(d,c+1,D,S)}}else if(this.bwg.type=="bigwig"){var o=new Int16Array(n),u=new Int32Array(n),f=new Float32Array(n),d=u[0],T=u[1];u[2];var N=u[3],Z=u[4],P=a[20],h=o[11];if(P==sm)for(var v=0;v<h;++v){var k=f[v+6],M=T+v*N+1,q=T+v*N+Z;t(d,M,q)&&e(d,M,q,{score:k})}else if(P==am)for(var v=0;v<h;++v){var c=u[v*2+6]+1,D=c+Z-1,k=f[v*2+7];t(d,c,D)&&e(d,c,D,{score:k})}else if(P==im)for(var v=0;v<h;++v){var c=u[v*3+6]+1,D=u[v*3+7],k=f[v*3+8];c>D&&(c=D),t(d,c,D)&&e(d,c,D,{score:k})}else console.log("Currently not handling bwgType="+P)}else if(this.bwg.type=="bigbed")for(var $=0,A=this.bwg.definedFieldCount,F=this.bwg.schema;$<a.length;){var d=a[$+3]<<24|a[$+2]<<16|a[$+1]<<8|a[$+0],c=a[$+7]<<24|a[$+6]<<16|a[$+5]<<8|a[$+4],D=a[$+11]<<24|a[$+10]<<16|a[$+9]<<8|a[$+8];$+=12;for(var L="";;){var G=a[$++];if(G!=0)L+=String.fromCharCode(G);else break}var Y={},ne;if(L.length>0?ne=L.split(" "):ne=[],ne.length>0&&A>3&&(Y.label=ne[0]),ne.length>1&&A>4){var k=parseInt(ne[1]);isNaN(k)||(Y.score=k)}if(ne.length>2&&A>5&&(Y.orientation=ne[2]),ne.length>5&&A>8){var se=ne[5];om.test(se)&&(Y.itemRgb="rgb("+se+")")}if(ne.length>A-3&&F)for(var pe=A-3;pe<ne.length;++pe)Y[F.fields[pe+3].name]=ne[pe];if(t(d,c+1,D,ne))if(A<12)e(d,c+1,D,Y);else{var ke=ne[3]|0,ae=ne[4]|0,ge=ne[6]|0,_e=ne[7].split(","),Xe=ne[8].split(",");if(Y.exonFrames){var le=Y.exonFrames.split(",");Y.exonFrames=void 0}Y.type="transcript";var ue=new Fd;for(var fe in Y)ue[fe]=Y[fe];if(ue.id=ne[0],ue.segment=this.bwg.idsToChroms[d],ue.min=c+1,ue.max=D,ue.notes=[],Y.groups=[ue],ne.length>9){var Ee=Y.geneName||ne[9],ve=Ee;ne.length>10&&(ve=ne[10]),Y.geneName2&&(ve=Y.geneName2);var qe=shallowCopy(ue);qe.id=Ee,qe.label=ve,qe.type="gene",Y.groups.push(qe)}for(var ot=[],be=0;be<ge;++be){var Fe=(Xe[be]|0)+c,Ke=Fe+(_e[be]|0),he=new rn(Fe,Ke);ot.push(he)}for(var Oe=union(ot),Ye=Oe.ranges(),we=0;we<Ye.length;++we){var Ae=Ye[we];e(d,Ae.min()+1,Ae.max(),Y)}if(ae>ke){var Ce=Y.orientation=="+"?new rn(ke,ae+3):new rn(ke-3,ae),ze=intersection(Oe,Ce);if(ze){Y.type="translation";for(var De=ze.ranges(),Qe=0,At=0;De[0].min()>Ye[At].max();)At++;for(var we=0;we<De.length;++we){var vt=we;Y.orientation=="-"&&(vt=De.length-we-1);var Ae=De[vt];if(Y.readframe=Qe,le){var yt=parseInt(le[vt+At]);typeof yt=="number"&&yt>=0&&yt<=2&&(Y.readframe=yt,Y.readframeExplicit=!0)}var Qt=Ae.max()-Ae.min();Qe=(Qe+Qt)%3,e(d,Ae.min()+1,Ae.max(),Y)}}}}}else throw Error("Don't know what to do with "+this.bwg.type)},Zr.prototype.getFirstAdjacent=function(n,e,t,a){var o=this.bwg.chromsToIDs[n];if(o===void 0)return a([]);this.getFirstAdjacentById(o,e,t,a)},Zr.prototype.getFirstAdjacentById=function(n,e,t,a){var o=this;if(!this.cirHeader){this.bwg.data.slice(this.cirTreeOffset,48).fetch(function(y){o.cirHeader=y;var m=new Int32Array(o.cirHeader);o.cirBlockSize=m[1],o.getFirstAdjacentById(n,e,t,a)});return}var u=null,f=-1,h=-1,v=0,d=function(y,m){v+=y.length;for(var I=4+o.cirBlockSize*32,S,T=0;T<y.length;++T){var N=new rn(y[T],y[T]+I);S=S?union(S,N):N}for(var Z=S.ranges(),P=0;P<Z.length;++P){var k=Z[P];c(y,k)}},c=function(y,m,I,S){m.max()-m.min(),o.bwg.data.slice(m.min(),m.max()-m.min()).fetch(function(T){for(var N=0;N<y.length;++N)if(m.contains(y[N])&&(D(T,y[N]-m.min()),--v,v==0)){if(!u)return t>0&&(n!=0||e>0)?o.getFirstAdjacentById(0,0,t,a):t<0&&(n!=o.bwg.maxID||e<1e9)?o.getFirstAdjacentById(o.bwg.maxID,1e9,t,a):a([]);o.fetchFeatures(function(Z,P,k,M){return t<0&&(Z<n||k<e)||t>0&&(Z>n||P>e)},[u],function(Z){for(var P=null,k=-1,M=-1,q=0;q<Z.length;++q){var $=Z[q],A=$._chromId,F=$.min,L=$.max;(P==null||t<0&&(A>k||L>M)||t>0&&(A<k||F<M))&&(P=$,M=t<0?L:F,k=A)}return P!=null?a([P]):a([])})}})},D=function(y,m,I){var S=new Uint8Array(y),T=new Int16Array(y),N=new Int32Array(y),Z=S[m],P=T[m/2+1];if(m+=4,Z!=0)for(var k=0;k<P;++k){var M=m/4,q=N[M],$=N[M+1],A=N[M+2],F=N[M+3],L=Nt(S,m+16),G=Nt(S,m+24);(t<0&&(q<n||q==n&&$<=e)||t>0&&(A>n||A==n&&F>=e))&&(/_random/.exec(o.bwg.idsToChroms[q])||(u==null||t<0&&(A>f||A==f&&F>h)||t>0&&(q<f||q==f&&$<h))&&(u={offset:L,size:G},h=t<0?F:$,f=t<0?A:q)),m+=32}else{for(var Y=-1,ne=-1,k=0;k<P;++k){var M=m/4,q=N[M],$=N[M+1],A=N[M+2],F=N[M+3],L=N[M+4]<<32|N[M+5];(t<0&&(q<n||q==n&&$<=e)&&A>=n||t>0&&(A>n||A==n&&F>=e)&&q<=n)&&(Y<0||F>ne)&&(Y=L,ne=t<0?F:$),m+=24}Y>=0&&d([Y])}};d([o.cirTreeOffset+48])},Dr.prototype.readWigData=function(n,e,t,a){this.getUnzoomedView().readWigData(n,e,t,a)},Dr.prototype.getUnzoomedView=function(){if(!this.unzoomedView){var n=4e3,e=this.zoomLevels[0];e&&(n=this.zoomLevels[0].dataOffset-this.unzoomedIndexOffset),this.unzoomedView=new Zr(this,this.unzoomedIndexOffset,n,!1)}return this.unzoomedView},Dr.prototype.getZoomedView=function(n){var e=this.zoomLevels[n];return e.view||(e.view=new Zr(this,e.indexOffset,4e3,!0)),e.view};function fm(n,e,t){var a=new Dr;a.data=n,a.name=t,a.data.slice(0,512).salted().fetch(function(o){if(!o)return e(null,"Couldn't fetch file");var u=o,f=new Uint8Array(u),h=new Int16Array(u),v=new Int32Array(u),d=f[0]+Bd*f[1]+Sd*f[2]+Id*f[3];if(d==em)a.type="bigwig";else if(d==nm)a.type="bigbed";else return d==tm||d==rm?e(null,"Currently don't support big-endian BBI files"):e(null,"Not a supported format, magic=0x"+d.toString(16));a.version=h[2],a.numZoomLevels=h[3],a.chromTreeOffset=Nt(f,8),a.unzoomedDataOffset=Nt(f,16),a.unzoomedIndexOffset=Nt(f,24),a.fieldCount=h[16],a.definedFieldCount=h[17],a.asOffset=Nt(f,36),a.totalSummaryOffset=Nt(f,44),a.uncompressBufSize=v[13],a.extHeaderOffset=Nt(f,56),a.zoomLevels=[];for(var c=0;c<a.numZoomLevels;++c){var D=v[c*6+16],y=Nt(f,c*24+72),m=Nt(f,c*24+80);a.zoomLevels.push({reduction:D,dataOffset:y,indexOffset:m})}a.readChromTree(function(){a.getAutoSQL(function(I){return a.schema=I,e(a)})})},{timeout:5e3})}Dr.prototype._tsFetch=function(n,e,t,a,o){var u=this;if(n>=this.zoomLevels.length-1)if(!this.topLevelReductionCache)this.getZoomedView(this.zoomLevels.length-1).readWigDataById(-1,0,3e8,function(c){return u.topLevelReductionCache=c,u._tsFetch(n,e,t,a,o)});else{for(var f=[],h=this.topLevelReductionCache,v=0;v<h.length;++v)h[v]._chromId==e&&f.push(h[v]);return o(f)}else{var d;return n<0?d=this.getUnzoomedView():d=this.getZoomedView(n),d.readWigDataById(e,t,a,o)}},Dr.prototype.thresholdSearch=function(n,e,t,a,o){t=t<0?-1:1;for(var u=this,f=this.chromsToIDs[n],h=[{chrOrd:0,chr:f,zoom:u.zoomLevels.length-4,min:0,max:3e8,fromRef:!0}],v=1;v<=this.maxID+1;++v){var d=(f+t*v)%(this.maxID+1);d<0&&(d+=this.maxID+1),h.push({chrOrd:v,chr:d,zoom:u.zoomLevels.length-1,min:0,max:3e8})}function c(){if(h.length==0)return o(null);h.sort(function(y,m){var I=y.zoom-m.zoom;return I!=0||(I=y.chrOrd-m.chrOrd,I!=0)?I:y.min-m.min*t});var D=h.splice(0,1)[0];u._tsFetch(D.zoom,D.chr,D.min,D.max,function(y){var m=t>0?0:3e8;D.fromRef&&(m=e);for(var I=0;I<y.length;++I){var S=y[I],T;if(S.maxScore!=null?T=S.maxScore:T=S.score,t>0){if(T>a)if(D.zoom<0){if(S.min>m)return o(S)}else S.max>m&&h.push({chr:D.chr,chrOrd:D.chrOrd,zoom:D.zoom-2,min:S.min,max:S.max,fromRef:D.fromRef})}else if(T>a)if(D.zoom<0){if(S.max<m)return o(S)}else S.min<m&&h.push({chr:D.chr,chrOrd:D.chrOrd,zoom:D.zoom-2,min:S.min,max:S.max,fromRef:D.fromRef})}c()})}c()},Dr.prototype.getAutoSQL=function(n){if(!this.asOffset)return n(null);this.data.slice(this.asOffset,2048).fetch(function(e){for(var t=new Uint8Array(e),a="",o=0;o<t.length&&t[o]!=0;++o)a+=String.fromCharCode(t[o]);var u=/(\w+)\s+(\w+)\s+("([^"]+)")?\s+\(\s*/,f=/([\w\[\]]+)\s+(\w+)\s*;\s*("([^"]+)")?\s*/g,h=u.exec(a);if(h){var v={declType:h[1],name:h[2],comment:h[4],fields:[]};a=a.substring(h[0]);for(var d=f.exec(a);d!=null;d=f.exec(a))v.fields.push({type:d[1],name:d[2],comment:d[4]});return n(v)}})},Dr.prototype.getExtraIndices=function(n){var e=this;if(this.version<4||this.extHeaderOffset==0||this.type!="bigbed")return n(null);this.data.slice(this.extHeaderOffset,64).fetch(function(t){if(!t)return n(null,"Couldn't fetch extension header");var a=new Uint8Array(t),o=new Int16Array(t);o[0];var u=o[1],f=Nt(a,4);if(u==0)return n(null);e.data.slice(f,u*20).fetch(function(h){if(!h)return n(null,"Couldn't fetch index info");for(var v=new Uint8Array(h),d=new Int16Array(h),c=[],D=0;D<u;++D){var y=d[D*10],m=d[D*10+1],I=Nt(v,D*20+4),S=d[D*10+8],T=new kd(e,y,m,I,S);c.push(T)}n(c)})})};function kd(n,e,t,a,o){this.bbi=n,this.type=e,this.fieldCount=t,this.offset=a,this.field=o}kd.prototype.lookup=function(n,e){var t=this;this.bbi.data.slice(this.offset,32).fetch(function(a){var o=new Uint8Array(a),u=new Int32Array(a);u[0];var f=u[1],h=u[2],v=u[3];Nt(o,16);var d=32;function c(D){t.bbi.data.slice(D,4+f*(h+v)).fetch(function(y){var m=new Uint8Array(y),I=new Uint16Array(y),S=m[0],T=I[1],N=4;if(S==0){for(var Z=null,P=0;P<T;++P){for(var k="",M=0;M<h;++M){var q=m[N++];q!=0&&(k+=String.fromCharCode(q))}var $=Nt(m,N);if(N+=8,n.localeCompare(k)<0&&Z){c(Z);return}Z=$}c(Z)}else{for(var P=0;P<T;++P){for(var k="",M=0;M<h;++M){var q=m[N++];q!=0&&(k+=String.fromCharCode(q))}if(k==n){var A=Nt(m,N),F=readInt(m,N+8);return t.bbi.getUnzoomedView().fetchFeatures(function(Y,ne,se,pe){if(pe&&pe.length>t.field-3)return pe[t.field-3]==n},[{offset:A,size:F}],e)}N+=v}return e([])}})}c(t.offset+d)})};var lm="";function hm(n){return cm(Td(Rd(n)))}function _f(n){return dm(Td(Rd(n)))}function Td(n){return gm(_m(pm(n),n.length*8))}function cm(n){for(var e="0123456789abcdef",t="",a,o=0;o<n.length;o++)a=n.charCodeAt(o),t+=e.charAt(a>>>4&15)+e.charAt(a&15);return t}function dm(n){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",a=n.length,o=0;o<a;o+=3)for(var u=n.charCodeAt(o)<<16|(o+1<a?n.charCodeAt(o+1)<<8:0)|(o+2<a?n.charCodeAt(o+2):0),f=0;f<4;f++)o*8+f*6>n.length*8?t+=lm:t+=e.charAt(u>>>6*(3-f)&63);return t}function Rd(n){for(var e="",t=-1,a,o;++t<n.length;)a=n.charCodeAt(t),o=t+1<n.length?n.charCodeAt(t+1):0,55296<=a&&a<=56319&&56320<=o&&o<=57343&&(a=65536+((a&1023)<<10)+(o&1023),t++),a<=127?e+=String.fromCharCode(a):a<=2047?e+=String.fromCharCode(192|a>>>6&31,128|a&63):a<=65535?e+=String.fromCharCode(224|a>>>12&15,128|a>>>6&63,128|a&63):a<=2097151&&(e+=String.fromCharCode(240|a>>>18&7,128|a>>>12&63,128|a>>>6&63,128|a&63));return e}function pm(n){for(var e=Array(n.length>>2),t=0;t<e.length;t++)e[t]=0;for(var t=0;t<n.length*8;t+=8)e[t>>5]|=(n.charCodeAt(t/8)&255)<<24-t%32;return e}function gm(n){for(var e="",t=0;t<n.length*32;t+=8)e+=String.fromCharCode(n[t>>5]>>>24-t%32&255);return e}function _m(n,e){n[e>>5]|=128<<24-e%32,n[(e+64>>9<<4)+15]=e;for(var t=Array(80),a=1732584193,o=-271733879,u=-1732584194,f=271733878,h=-1009589776,v=0;v<n.length;v+=16){for(var d=a,c=o,D=u,y=f,m=h,I=0;I<80;I++){I<16?t[I]=n[v+I]:t[I]=vf(t[I-3]^t[I-8]^t[I-14]^t[I-16],1);var S=yr(yr(vf(a,5),vm(I,o,u,f)),yr(yr(h,t[I]),wm(I)));h=f,f=u,u=vf(o,30),o=a,a=S}a=yr(a,d),o=yr(o,c),u=yr(u,D),f=yr(f,y),h=yr(h,m)}return Array(a,o,u,f,h)}function vm(n,e,t,a){return n<20?e&t|~e&a:n<40?e^t^a:n<60?e&t|e&a|t&a:e^t^a}function wm(n){return n<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514}function yr(n,e){var t=(n&65535)+(e&65535),a=(n>>16)+(e>>16)+(t>>16);return a<<16|t&65535}function vf(n,e){return n<<e|n>>>32-e}typeof module<"u"&&(module.exports={b64_sha1:_f,hex_sha1:hm});function bm(n){var e={};for(var t in n)e[t]=n[t];return e}function Di(n,e,t,a){a||(typeof e=="object"?(a=e,e=void 0):a={}),this.url=n,this.start=e||0,t&&(this.end=t),this.opts=a}Di.prototype.slice=function(n,e){if(n<0)throw"Bad slice "+n;var t=this.start,a=this.end;return t&&n?t=t+n:t=n||t,e&&t?a=t+e-1:a=a||e-1,new Di(this.url,t,a,this.opts)};var Nd=0,$d=navigator.userAgent.indexOf("Safari")>=0&&navigator.userAgent.indexOf("Chrome")<0;Di.prototype.fetchAsText=function(n){try{var e=new XMLHttpRequest,t,a=this.url;if(($d||this.opts.salt)&&a.indexOf("?")<0&&(a=a+"?salt="+_f(""+Date.now()+","+ ++Nd)),e.open("GET",a,!0),this.end){if(this.end-this.start>1e8)throw"Monster fetch!";e.setRequestHeader("Range","bytes="+this.start+"-"+this.end),e.setRequestHeader("accept-encoding","gzip,deflate"),t=this.end-this.start+1}e.onreadystatechange=function(){if(e.readyState==4)return e.status==200||e.status==206?n(e.responseText):n(null)},this.opts.credentials&&(e.withCredentials=!0),e.send("")}catch{return n(null)}},Di.prototype.salted=function(){var n=bm(this.opts);return n.salt=!0,new Di(this.url,this.start,this.end,n)},Di.prototype.fetch=function(n,e){var t=this;e=e||{};var a=e.attempt||1,o=e.truncatedLength;if(a>3)return n(null);try{var u,f=new XMLHttpRequest,h,v=this.url;if(($d||this.opts.salt)&&v.indexOf("?")<0&&(v=v+"?salt="+_f(""+Date.now()+","+ ++Nd)),f.open("GET",v,!0),f.overrideMimeType("text/plain; charset=x-user-defined"),this.end){if(this.end-this.start>1e8)throw"Monster fetch!";f.setRequestHeader("Range","bytes="+this.start+"-"+this.end),h=this.end-this.start+1}f.responseType="arraybuffer",f.onreadystatechange=function(){if(f.readyState==4)if(u&&clearTimeout(u),f.status==200||f.status==206)if(f.response){var d=f.response.byteLength;return h&&h!=d&&(!o||d!=o)?t.fetch(n,{attempt:a+1,truncatedLength:d}):n(f.response)}else{if(f.mozResponseArrayBuffer)return n(f.mozResponseArrayBuffer);var c=f.responseText;return h&&h!=c.length&&(!o||c.length!=o)?t.fetch(n,{attempt:a+1,truncatedLength:c.length}):n(mm(f.responseText))}else return t.fetch(n,{attempt:a+1})},this.opts.credentials&&f.setRequestHeader("Authorization",this.opts.credentials),f.send("")}catch{return n(null)}};function mm(n){if(!n)return null;for(var e=new Uint8Array(n.length),t=0;t<e.length;++t)e[t]=n.charCodeAt(t);return e.buffer}/**
42
+ * Reads and gets data from bigwig or bigbed files hosted remotely. Gets DASFeature records, which vary in schema
43
+ * depending on the file.
44
+ *
45
+ * @license MIT
46
+ */class Dm{constructor(e){de(this,"url");de(this,"bigWigPromise");this.url=e,this.bigWigPromise=this.loadBigWig(e)}async loadBigWig(e){try{return new Promise((t,a)=>{fm(new Di(e),(o,u)=>{u?a(u):t(o)})})}catch(t){return console.error("Failed to dynamically load the BigWig module:",t),Promise.reject(t)}}async getData(e,t,a){const o=await this.bigWigPromise,u=a.zoomLevel===void 0||a.zoomLevel===Bb.AUTO?this._getMatchingZoomLevel(o,t):Number.parseInt(a.zoomLevel);let f=e.map(d=>this._getDataForChromosome(d,o,u));const h=await Promise.all(f),v=fn.flatten(h);for(let d of v)d.min-=1;return v}_getMatchingZoomLevel(e,t){if(!t)return-1;if(e.zoomLevels.length===1)return 0;let o=e.zoomLevels.slice().sort((u,f)=>f.reduction-u.reduction).find(u=>u.reduction<t);return e.zoomLevels.findIndex(u=>u===o)}_getDataForChromosome(e,t,a){const o=e.start+1,u=e.end;return new Promise((f,h)=>{try{a===-1?t.readWigData(e.chr,o,u,f):t.getZoomedView(a).readWigData(e.chr,o,u,f)}catch(v){h(v)}})}}let Vr={};const wf={WashU:"https://lambda.epigenomegateway.org/v3"},ym={geneannotation:async function(e){let t,a;const o=e.trackModel;o.apiConfig&&o.apiConfig.genome?t=o.apiConfig.genome:t=e.genomeName,o.apiConfig&&o.apiConfig.format in wf?a=wf[`${o.apiConfig.format}`]:a=wf.WashU;let u=`${a}/${t}/genes/${e.name}/queryRegion?chr=${e.chr}&start=${e.start}&end=${e.end}`;return(await fetch(u,{method:"GET"})).json()},snp:async function(e){const t={hg19:"https://grch37.rest.ensembl.org/overlap/region/human",hg38:"https://rest.ensembl.org/overlap/region/human"},a=e.genomeName in t?t[`${e.genomeName}`]:null;if(!a)return[];const o={"Content-Type":"application/json"};if(e.end-e.start<=3e4){const u=`${a}/${e.chr.substr(3)}:${e.start}-${e.end+"?content-type=application%2Fjson&feature=variation"}`;return fetch(u,{headers:o}).then(f=>{if(!f.ok)throw new Error("Network response was not ok");return f.json()}).catch(f=>(console.error("There was a problem with the fetch operation:",f),{data:[]}))}else return[]},bed:async function(e){return It(e,"bedOrTabix")},bedcolor:async function(e){return It(e,"bedOrTabix")},omeroidr:async function(e){return It(e,"bedOrTabix")},bedgraph:async function(e){return It(e,"bedOrTabix")},qbed:async function(e){return It(e,"bedOrTabix")},dbedgraph:async function(e){return It(e,"bedOrTabix")},boxplot:async function(e){return It(e,"big")},modbed:async function(e){return It(e,"bedOrTabix")},jaspar:async function(e){return It(e,"jaspar")},bigbed:async function(e){return It(e,"bigbed")},refbed:async function(e){return It(e,"bedOrTabix")},matplot:async function(e){return It(e,"bedOrTabix")},bigwig:async function(e){return It(e,"big")},categorical:async function(e){return It(e,"bedOrTabix")},longrange:async function(e){return It(e,"bedOrTabix")},dynseq:async function(e){return It(e,"big")},repeatmasker:async function(e){return It(e,"repeat")},biginteract:async function(e){return It(e,"big")},methylc:async function(e){return It(e,"bedOrTabix")},genomealign:function(e){return It(e,"bedOrTabix")},vcf:function(e){return It(e,"vcf")}};function It(n,e){let t=null;n.trackModel.indexUrl&&(t=n.trackModel.indexUrl),n.trackModel.id in Vr||(e==="bedOrTabix"?Vr[`${n.trackModel.id}`]=new Av(n.trackModel.url,t):e==="vcf"?Vr[`${n.trackModel.id}`]=new Fb(n.trackModel.url,t):e==="bigbed"?Vr[`${n.trackModel.id}`]=new Dm(n.trackModel.url):e==="big"?Vr[`${n.trackModel.id}`]=new hf(n.trackModel.url):e==="repeat"?Vr[`${n.trackModel.id}`]=new Db(n.trackModel.url):e==="jaspar"&&(Vr[`${n.trackModel.id}`]=new xb(n.trackModel.url)));let a=Vr[`${n.trackModel.id}`];return e in{repeat:"",jaspar:"",bigbed:""}?a.getData(n.nav,n.basesPerPixel,n.trackModel.options):a.getData(n.nav,n.trackModel.options)}var xm={exports:{}};/* @license
47
+ Papa Parse
48
+ v5.5.3
49
+ https://github.com/mholt/PapaParse
50
+ License: MIT
51
+ */(function(n,e){((t,a)=>{n.exports=a()})(wn,function t(){var a=typeof self<"u"?self:typeof window<"u"?window:a!==void 0?a:{},o,u=!a.document&&!!a.postMessage,f=a.IS_PAPA_WORKER||!1,h={},v=0,d={};function c(A){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(F){var L=M(F);L.chunkSize=parseInt(L.chunkSize),F.step||F.chunk||(L.chunkSize=null),this._handle=new S(L),(this._handle.streamer=this)._config=L}).call(this,A),this.parseChunk=function(F,L){var G=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<G){let ne=this._config.newline;ne||(Y=this._config.quoteChar||'"',ne=this._handle.guessLineEndings(F,Y)),F=[...F.split(ne).slice(G)].join(ne)}this.isFirstChunk&&$(this._config.beforeFirstChunk)&&(Y=this._config.beforeFirstChunk(F))!==void 0&&(F=Y),this.isFirstChunk=!1,this._halted=!1;var G=this._partialLine+F,Y=(this._partialLine="",this._handle.parse(G,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(F=Y.meta.cursor,G=(this._finished||(this._partialLine=G.substring(F-this._baseIndex),this._baseIndex=F),Y&&Y.data&&(this._rowCount+=Y.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),f)a.postMessage({results:Y,workerId:d.WORKER_ID,finished:G});else if($(this._config.chunk)&&!L){if(this._config.chunk(Y,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=Y=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(Y.data),this._completeResults.errors=this._completeResults.errors.concat(Y.errors),this._completeResults.meta=Y.meta),this._completed||!G||!$(this._config.complete)||Y&&Y.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),G||Y&&Y.meta.paused||this._nextChunk(),Y}this._halted=!0},this._sendError=function(F){$(this._config.error)?this._config.error(F):f&&this._config.error&&a.postMessage({workerId:d.WORKER_ID,error:F,finished:!1})}}function D(A){var F;(A=A||{}).chunkSize||(A.chunkSize=d.RemoteChunkSize),c.call(this,A),this._nextChunk=u?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(L){this._input=L,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(F=new XMLHttpRequest,this._config.withCredentials&&(F.withCredentials=this._config.withCredentials),u||(F.onload=q(this._chunkLoaded,this),F.onerror=q(this._chunkError,this)),F.open(this._config.downloadRequestBody?"POST":"GET",this._input,!u),this._config.downloadRequestHeaders){var L,G=this._config.downloadRequestHeaders;for(L in G)F.setRequestHeader(L,G[L])}var Y;this._config.chunkSize&&(Y=this._start+this._config.chunkSize-1,F.setRequestHeader("Range","bytes="+this._start+"-"+Y));try{F.send(this._config.downloadRequestBody)}catch(ne){this._chunkError(ne.message)}u&&F.status===0&&this._chunkError()}},this._chunkLoaded=function(){F.readyState===4&&(F.status<200||400<=F.status?this._chunkError():(this._start+=this._config.chunkSize||F.responseText.length,this._finished=!this._config.chunkSize||this._start>=(L=>(L=L.getResponseHeader("Content-Range"))!==null?parseInt(L.substring(L.lastIndexOf("/")+1)):-1)(F),this.parseChunk(F.responseText)))},this._chunkError=function(L){L=F.statusText||L,this._sendError(new Error(L))}}function y(A){(A=A||{}).chunkSize||(A.chunkSize=d.LocalChunkSize),c.call(this,A);var F,L,G=typeof FileReader<"u";this.stream=function(Y){this._input=Y,L=Y.slice||Y.webkitSlice||Y.mozSlice,G?((F=new FileReader).onload=q(this._chunkLoaded,this),F.onerror=q(this._chunkError,this)):F=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var Y=this._input,ne=(this._config.chunkSize&&(ne=Math.min(this._start+this._config.chunkSize,this._input.size),Y=L.call(Y,this._start,ne)),F.readAsText(Y,this._config.encoding));G||this._chunkLoaded({target:{result:ne}})},this._chunkLoaded=function(Y){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(Y.target.result)},this._chunkError=function(){this._sendError(F.error)}}function m(A){var F;c.call(this,A=A||{}),this.stream=function(L){return F=L,this._nextChunk()},this._nextChunk=function(){var L,G;if(!this._finished)return L=this._config.chunkSize,F=L?(G=F.substring(0,L),F.substring(L)):(G=F,""),this._finished=!F,this.parseChunk(G)}}function I(A){c.call(this,A=A||{});var F=[],L=!0,G=!1;this.pause=function(){c.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){c.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(Y){this._input=Y,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){G&&F.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),F.length?this.parseChunk(F.shift()):L=!0},this._streamData=q(function(Y){try{F.push(typeof Y=="string"?Y:Y.toString(this._config.encoding)),L&&(L=!1,this._checkIsFinished(),this.parseChunk(F.shift()))}catch(ne){this._streamError(ne)}},this),this._streamError=q(function(Y){this._streamCleanUp(),this._sendError(Y)},this),this._streamEnd=q(function(){this._streamCleanUp(),G=!0,this._streamData("")},this),this._streamCleanUp=q(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function S(A){var F,L,G,Y,ne=Math.pow(2,53),se=-ne,pe=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,ke=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,ae=this,ge=0,_e=0,Xe=!1,le=!1,ue=[],fe={data:[],errors:[],meta:{}};function Ee(be){return A.skipEmptyLines==="greedy"?be.join("").trim()==="":be.length===1&&be[0].length===0}function ve(){if(fe&&G&&(ot("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),G=!1),A.skipEmptyLines&&(fe.data=fe.data.filter(function(he){return!Ee(he)})),qe()){let he=function(Oe,Ye){$(A.transformHeader)&&(Oe=A.transformHeader(Oe,Ye)),ue.push(Oe)};if(fe)if(Array.isArray(fe.data[0])){for(var be=0;qe()&&be<fe.data.length;be++)fe.data[be].forEach(he);fe.data.splice(0,1)}else fe.data.forEach(he)}function Fe(he,Oe){for(var Ye=A.header?{}:[],we=0;we<he.length;we++){var Ae=we,Ce=he[we],Ce=((ze,De)=>(Qe=>(A.dynamicTypingFunction&&A.dynamicTyping[Qe]===void 0&&(A.dynamicTyping[Qe]=A.dynamicTypingFunction(Qe)),(A.dynamicTyping[Qe]||A.dynamicTyping)===!0))(ze)?De==="true"||De==="TRUE"||De!=="false"&&De!=="FALSE"&&((Qe=>{if(pe.test(Qe)&&(Qe=parseFloat(Qe),se<Qe&&Qe<ne))return 1})(De)?parseFloat(De):ke.test(De)?new Date(De):De===""?null:De):De)(Ae=A.header?we>=ue.length?"__parsed_extra":ue[we]:Ae,Ce=A.transform?A.transform(Ce,Ae):Ce);Ae==="__parsed_extra"?(Ye[Ae]=Ye[Ae]||[],Ye[Ae].push(Ce)):Ye[Ae]=Ce}return A.header&&(we>ue.length?ot("FieldMismatch","TooManyFields","Too many fields: expected "+ue.length+" fields but parsed "+we,_e+Oe):we<ue.length&&ot("FieldMismatch","TooFewFields","Too few fields: expected "+ue.length+" fields but parsed "+we,_e+Oe)),Ye}var Ke;fe&&(A.header||A.dynamicTyping||A.transform)&&(Ke=1,!fe.data.length||Array.isArray(fe.data[0])?(fe.data=fe.data.map(Fe),Ke=fe.data.length):fe.data=Fe(fe.data,0),A.header&&fe.meta&&(fe.meta.fields=ue),_e+=Ke)}function qe(){return A.header&&ue.length===0}function ot(be,Fe,Ke,he){be={type:be,code:Fe,message:Ke},he!==void 0&&(be.row=he),fe.errors.push(be)}$(A.step)&&(Y=A.step,A.step=function(be){fe=be,qe()?ve():(ve(),fe.data.length!==0&&(ge+=be.data.length,A.preview&&ge>A.preview?L.abort():(fe.data=fe.data[0],Y(fe,ae))))}),this.parse=function(be,Fe,Ke){var he=A.quoteChar||'"',he=(A.newline||(A.newline=this.guessLineEndings(be,he)),G=!1,A.delimiter?$(A.delimiter)&&(A.delimiter=A.delimiter(be),fe.meta.delimiter=A.delimiter):((he=((Oe,Ye,we,Ae,Ce)=>{var ze,De,Qe,At;Ce=Ce||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var vt=0;vt<Ce.length;vt++){for(var yt,Qt=Ce[vt],xt=0,rt=0,wt=0,Ft=(Qe=void 0,new N({comments:Ae,delimiter:Qt,newline:Ye,preview:10}).parse(Oe)),dt=0;dt<Ft.data.length;dt++)we&&Ee(Ft.data[dt])?wt++:(yt=Ft.data[dt].length,rt+=yt,Qe===void 0?Qe=yt:0<yt&&(xt+=Math.abs(yt-Qe),Qe=yt));0<Ft.data.length&&(rt/=Ft.data.length-wt),(De===void 0||xt<=De)&&(At===void 0||At<rt)&&1.99<rt&&(De=xt,ze=Qt,At=rt)}return{successful:!!(A.delimiter=ze),bestDelimiter:ze}})(be,A.newline,A.skipEmptyLines,A.comments,A.delimitersToGuess)).successful?A.delimiter=he.bestDelimiter:(G=!0,A.delimiter=d.DefaultDelimiter),fe.meta.delimiter=A.delimiter),M(A));return A.preview&&A.header&&he.preview++,F=be,L=new N(he),fe=L.parse(F,Fe,Ke),ve(),Xe?{meta:{paused:!0}}:fe||{meta:{paused:!1}}},this.paused=function(){return Xe},this.pause=function(){Xe=!0,L.abort(),F=$(A.chunk)?"":F.substring(L.getCharIndex())},this.resume=function(){ae.streamer._halted?(Xe=!1,ae.streamer.parseChunk(F,!0)):setTimeout(ae.resume,3)},this.aborted=function(){return le},this.abort=function(){le=!0,L.abort(),fe.meta.aborted=!0,$(A.complete)&&A.complete(fe),F=""},this.guessLineEndings=function(Oe,he){Oe=Oe.substring(0,1048576);var he=new RegExp(T(he)+"([^]*?)"+T(he),"gm"),Ke=(Oe=Oe.replace(he,"")).split("\r"),he=Oe.split(`
52
+ `),Oe=1<he.length&&he[0].length<Ke[0].length;if(Ke.length===1||Oe)return`
53
+ `;for(var Ye=0,we=0;we<Ke.length;we++)Ke[we][0]===`
54
+ `&&Ye++;return Ye>=Ke.length/2?`\r
55
+ `:"\r"}}function T(A){return A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N(A){var F=(A=A||{}).delimiter,L=A.newline,G=A.comments,Y=A.step,ne=A.preview,se=A.fastMode,pe=null,ke=!1,ae=A.quoteChar==null?'"':A.quoteChar,ge=ae;if(A.escapeChar!==void 0&&(ge=A.escapeChar),(typeof F!="string"||-1<d.BAD_DELIMITERS.indexOf(F))&&(F=","),G===F)throw new Error("Comment character same as delimiter");G===!0?G="#":(typeof G!="string"||-1<d.BAD_DELIMITERS.indexOf(G))&&(G=!1),L!==`
56
+ `&&L!=="\r"&&L!==`\r
57
+ `&&(L=`
58
+ `);var _e=0,Xe=!1;this.parse=function(le,ue,fe){if(typeof le!="string")throw new Error("Input must be a string");var Ee=le.length,ve=F.length,qe=L.length,ot=G.length,be=$(Y),Fe=[],Ke=[],he=[],Oe=_e=0;if(!le)return xt();if(se||se!==!1&&le.indexOf(ae)===-1){for(var Ye=le.split(L),we=0;we<Ye.length;we++){if(he=Ye[we],_e+=he.length,we!==Ye.length-1)_e+=L.length;else if(fe)return xt();if(!G||he.substring(0,ot)!==G){if(be){if(Fe=[],At(he.split(F)),rt(),Xe)return xt()}else At(he.split(F));if(ne&&ne<=we)return Fe=Fe.slice(0,ne),xt(!0)}}return xt()}for(var Ae=le.indexOf(F,_e),Ce=le.indexOf(L,_e),ze=new RegExp(T(ge)+T(ae),"g"),De=le.indexOf(ae,_e);;)if(le[_e]===ae)for(De=_e,_e++;;){if((De=le.indexOf(ae,De+1))===-1)return fe||Ke.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Fe.length,index:_e}),yt();if(De===Ee-1)return yt(le.substring(_e,De).replace(ze,ae));if(ae===ge&&le[De+1]===ge)De++;else if(ae===ge||De===0||le[De-1]!==ge){Ae!==-1&&Ae<De+1&&(Ae=le.indexOf(F,De+1));var Qe=vt((Ce=Ce!==-1&&Ce<De+1?le.indexOf(L,De+1):Ce)===-1?Ae:Math.min(Ae,Ce));if(le.substr(De+1+Qe,ve)===F){he.push(le.substring(_e,De).replace(ze,ae)),le[_e=De+1+Qe+ve]!==ae&&(De=le.indexOf(ae,_e)),Ae=le.indexOf(F,_e),Ce=le.indexOf(L,_e);break}if(Qe=vt(Ce),le.substring(De+1+Qe,De+1+Qe+qe)===L){if(he.push(le.substring(_e,De).replace(ze,ae)),Qt(De+1+Qe+qe),Ae=le.indexOf(F,_e),De=le.indexOf(ae,_e),be&&(rt(),Xe))return xt();if(ne&&Fe.length>=ne)return xt(!0);break}Ke.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Fe.length,index:_e}),De++}}else if(G&&he.length===0&&le.substring(_e,_e+ot)===G){if(Ce===-1)return xt();_e=Ce+qe,Ce=le.indexOf(L,_e),Ae=le.indexOf(F,_e)}else if(Ae!==-1&&(Ae<Ce||Ce===-1))he.push(le.substring(_e,Ae)),_e=Ae+ve,Ae=le.indexOf(F,_e);else{if(Ce===-1)break;if(he.push(le.substring(_e,Ce)),Qt(Ce+qe),be&&(rt(),Xe))return xt();if(ne&&Fe.length>=ne)return xt(!0)}return yt();function At(wt){Fe.push(wt),Oe=_e}function vt(wt){var Ft=0;return Ft=wt!==-1&&(wt=le.substring(De+1,wt))&&wt.trim()===""?wt.length:Ft}function yt(wt){return fe||(wt===void 0&&(wt=le.substring(_e)),he.push(wt),_e=Ee,At(he),be&&rt()),xt()}function Qt(wt){_e=wt,At(he),he=[],Ce=le.indexOf(L,_e)}function xt(wt){if(A.header&&!ue&&Fe.length&&!ke){var Ft=Fe[0],dt=Object.create(null),Ar=new Set(Ft);let E=!1;for(let _=0;_<Ft.length;_++){let w=Ft[_];if(dt[w=$(A.transformHeader)?A.transformHeader(w,_):w]){let R,W=dt[w];for(;R=w+"_"+W,W++,Ar.has(R););Ar.add(R),Ft[_]=R,dt[w]++,E=!0,(pe=pe===null?{}:pe)[R]=w}else dt[w]=1,Ft[_]=w;Ar.add(w)}E&&console.warn("Duplicate headers found and renamed."),ke=!0}return{data:Fe,errors:Ke,meta:{delimiter:F,linebreak:L,aborted:Xe,truncated:!!wt,cursor:Oe+(ue||0),renamedHeaders:pe}}}function rt(){Y(xt()),Fe=[],Ke=[]}},this.abort=function(){Xe=!0},this.getCharIndex=function(){return _e}}function Z(A){var F=A.data,L=h[F.workerId],G=!1;if(F.error)L.userError(F.error,F.file);else if(F.results&&F.results.data){var Y={abort:function(){G=!0,P(F.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if($(L.userStep)){for(var ne=0;ne<F.results.data.length&&(L.userStep({data:F.results.data[ne],errors:F.results.errors,meta:F.results.meta},Y),!G);ne++);delete F.results}else $(L.userChunk)&&(L.userChunk(F.results,Y,F.file),delete F.results)}F.finished&&!G&&P(F.workerId,F.results)}function P(A,F){var L=h[A];$(L.userComplete)&&L.userComplete(F),L.terminate(),delete h[A]}function k(){throw new Error("Not implemented.")}function M(A){if(typeof A!="object"||A===null)return A;var F,L=Array.isArray(A)?[]:{};for(F in A)L[F]=M(A[F]);return L}function q(A,F){return function(){A.apply(F,arguments)}}function $(A){return typeof A=="function"}return d.parse=function(A,F){var L=(F=F||{}).dynamicTyping||!1;if($(L)&&(F.dynamicTypingFunction=L,L={}),F.dynamicTyping=L,F.transform=!!$(F.transform)&&F.transform,!F.worker||!d.WORKERS_SUPPORTED)return L=null,d.NODE_STREAM_INPUT,typeof A=="string"?(A=(G=>G.charCodeAt(0)!==65279?G:G.slice(1))(A),L=new(F.download?D:m)(F)):A.readable===!0&&$(A.read)&&$(A.on)?L=new I(F):(a.File&&A instanceof File||A instanceof Object)&&(L=new y(F)),L.stream(A);(L=(()=>{var G;return!!d.WORKERS_SUPPORTED&&(G=(()=>{var Y=a.URL||a.webkitURL||null,ne=t.toString();return d.BLOB_URL||(d.BLOB_URL=Y.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",ne,")();"],{type:"text/javascript"})))})(),(G=new a.Worker(G)).onmessage=Z,G.id=v++,h[G.id]=G)})()).userStep=F.step,L.userChunk=F.chunk,L.userComplete=F.complete,L.userError=F.error,F.step=$(F.step),F.chunk=$(F.chunk),F.complete=$(F.complete),F.error=$(F.error),delete F.worker,L.postMessage({input:A,config:F,workerId:L.id})},d.unparse=function(A,F){var L=!1,G=!0,Y=",",ne=`\r
59
+ `,se='"',pe=se+se,ke=!1,ae=null,ge=!1,_e=((()=>{if(typeof F=="object"){if(typeof F.delimiter!="string"||d.BAD_DELIMITERS.filter(function(ue){return F.delimiter.indexOf(ue)!==-1}).length||(Y=F.delimiter),typeof F.quotes!="boolean"&&typeof F.quotes!="function"&&!Array.isArray(F.quotes)||(L=F.quotes),typeof F.skipEmptyLines!="boolean"&&typeof F.skipEmptyLines!="string"||(ke=F.skipEmptyLines),typeof F.newline=="string"&&(ne=F.newline),typeof F.quoteChar=="string"&&(se=F.quoteChar),typeof F.header=="boolean"&&(G=F.header),Array.isArray(F.columns)){if(F.columns.length===0)throw new Error("Option columns is empty");ae=F.columns}F.escapeChar!==void 0&&(pe=F.escapeChar+se),F.escapeFormulae instanceof RegExp?ge=F.escapeFormulae:typeof F.escapeFormulae=="boolean"&&F.escapeFormulae&&(ge=/^[=+\-@\t\r].*$/)}})(),new RegExp(T(se),"g"));if(typeof A=="string"&&(A=JSON.parse(A)),Array.isArray(A)){if(!A.length||Array.isArray(A[0]))return Xe(null,A,ke);if(typeof A[0]=="object")return Xe(ae||Object.keys(A[0]),A,ke)}else if(typeof A=="object")return typeof A.data=="string"&&(A.data=JSON.parse(A.data)),Array.isArray(A.data)&&(A.fields||(A.fields=A.meta&&A.meta.fields||ae),A.fields||(A.fields=Array.isArray(A.data[0])?A.fields:typeof A.data[0]=="object"?Object.keys(A.data[0]):[]),Array.isArray(A.data[0])||typeof A.data[0]=="object"||(A.data=[A.data])),Xe(A.fields||[],A.data||[],ke);throw new Error("Unable to serialize unrecognized input");function Xe(ue,fe,Ee){var ve="",qe=(typeof ue=="string"&&(ue=JSON.parse(ue)),typeof fe=="string"&&(fe=JSON.parse(fe)),Array.isArray(ue)&&0<ue.length),ot=!Array.isArray(fe[0]);if(qe&&G){for(var be=0;be<ue.length;be++)0<be&&(ve+=Y),ve+=le(ue[be],be);0<fe.length&&(ve+=ne)}for(var Fe=0;Fe<fe.length;Fe++){var Ke=(qe?ue:fe[Fe]).length,he=!1,Oe=qe?Object.keys(fe[Fe]).length===0:fe[Fe].length===0;if(Ee&&!qe&&(he=Ee==="greedy"?fe[Fe].join("").trim()==="":fe[Fe].length===1&&fe[Fe][0].length===0),Ee==="greedy"&&qe){for(var Ye=[],we=0;we<Ke;we++){var Ae=ot?ue[we]:we;Ye.push(fe[Fe][Ae])}he=Ye.join("").trim()===""}if(!he){for(var Ce=0;Ce<Ke;Ce++){0<Ce&&!Oe&&(ve+=Y);var ze=qe&&ot?ue[Ce]:Ce;ve+=le(fe[Fe][ze],Ce)}Fe<fe.length-1&&(!Ee||0<Ke&&!Oe)&&(ve+=ne)}}return ve}function le(ue,fe){var Ee,ve;return ue==null?"":ue.constructor===Date?JSON.stringify(ue).slice(1,25):(ve=!1,ge&&typeof ue=="string"&&ge.test(ue)&&(ue="'"+ue,ve=!0),Ee=ue.toString().replace(_e,pe),(ve=ve||L===!0||typeof L=="function"&&L(ue,fe)||Array.isArray(L)&&L[fe]||((qe,ot)=>{for(var be=0;be<ot.length;be++)if(-1<qe.indexOf(ot[be]))return!0;return!1})(Ee,d.BAD_DELIMITERS)||-1<Ee.indexOf(Y)||Ee.charAt(0)===" "||Ee.charAt(Ee.length-1)===" ")?se+Ee+se:Ee)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
60
+ `,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!u&&!!a.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=N,d.ParserHandle=S,d.NetworkStreamer=D,d.FileStreamer=y,d.StringStreamer=m,d.ReadableStreamStreamer=I,a.jQuery&&((o=a.jQuery).fn.parse=function(A){var F=A.config||{},L=[];return this.each(function(ne){if(!(o(this).prop("tagName").toUpperCase()==="INPUT"&&o(this).attr("type").toLowerCase()==="file"&&a.FileReader)||!this.files||this.files.length===0)return!0;for(var se=0;se<this.files.length;se++)L.push({file:this.files[se],inputElem:this,instanceConfig:o.extend({},F)})}),G(),this;function G(){if(L.length===0)$(A.complete)&&A.complete();else{var ne,se,pe,ke,ae=L[0];if($(A.before)){var ge=A.before(ae.file,ae.inputElem);if(typeof ge=="object"){if(ge.action==="abort")return ne="AbortError",se=ae.file,pe=ae.inputElem,ke=ge.reason,void($(A.error)&&A.error({name:ne},se,pe,ke));if(ge.action==="skip")return void Y();typeof ge.config=="object"&&(ae.instanceConfig=o.extend(ae.instanceConfig,ge.config))}else if(ge==="skip")return void Y()}var _e=ae.instanceConfig.complete;ae.instanceConfig.complete=function(Xe){$(_e)&&_e(Xe,ae.file,ae.inputElem),Y()},d.parse(ae.file,ae.instanceConfig)}}function Y(){L.splice(0,1),G()}}),f&&(a.onmessage=function(A){A=A.data,d.WORKER_ID===void 0&&A&&(d.WORKER_ID=A.workerId),typeof A.input=="string"?a.postMessage({workerId:d.WORKER_ID,results:d.parse(A.input,A.config),finished:!0}):(a.File&&A.input instanceof File||A.input instanceof Object)&&(A=d.parse(A.input,A.config))&&a.postMessage({workerId:d.WORKER_ID,results:A,finished:!0})}),(D.prototype=Object.create(c.prototype)).constructor=D,(y.prototype=Object.create(c.prototype)).constructor=y,(m.prototype=Object.create(m.prototype)).constructor=m,(I.prototype=Object.create(c.prototype)).constructor=I,d})})(xm);var Em=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Cm=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Am=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,bf={Space_Separator:Em,ID_Start:Cm,ID_Continue:Am},kt={isSpaceSeparator(n){return typeof n=="string"&&bf.Space_Separator.test(n)},isIdStartChar(n){return typeof n=="string"&&(n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="$"||n==="_"||bf.ID_Start.test(n))},isIdContinueChar(n){return typeof n=="string"&&(n>="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"||n==="$"||n==="_"||n==="‌"||n==="‍"||bf.ID_Continue.test(n))},isDigit(n){return typeof n=="string"&&/[0-9]/.test(n)},isHexDigit(n){return typeof n=="string"&&/[0-9A-Fa-f]/.test(n)}};let mf,Yt,xr,ru,Xr,Xn,Mt,Df,Qa;var Fm=function(e,t){mf=String(e),Yt="start",xr=[],ru=0,Xr=1,Xn=0,Mt=void 0,Df=void 0,Qa=void 0;do Mt=Bm(),km[Yt]();while(Mt.type!=="eof");return typeof t=="function"?yf({"":Qa},"",t):Qa};function yf(n,e,t){const a=n[e];if(a!=null&&typeof a=="object")if(Array.isArray(a))for(let o=0;o<a.length;o++){const u=String(o),f=yf(a,u,t);f===void 0?delete a[u]:Object.defineProperty(a,u,{value:f,writable:!0,enumerable:!0,configurable:!0})}else for(const o in a){const u=yf(a,o,t);u===void 0?delete a[o]:Object.defineProperty(a,o,{value:u,writable:!0,enumerable:!0,configurable:!0})}return t.call(n,e,a)}let Ne,Se,Ja,Er,Me;function Bm(){for(Ne="default",Se="",Ja=!1,Er=1;;){Me=Cr();const n=Ld[Ne]();if(n)return n}}function Cr(){if(mf[ru])return String.fromCodePoint(mf.codePointAt(ru))}function ee(){const n=Cr();return n===`
61
+ `?(Xr++,Xn=0):n?Xn+=n.length:Xn++,n&&(ru+=n.length),n}const Ld={default(){switch(Me){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
62
+ `:case"\r":case"\u2028":case"\u2029":ee();return;case"/":ee(),Ne="comment";return;case void 0:return ee(),ht("eof")}if(kt.isSpaceSeparator(Me)){ee();return}return Ld[Yt]()},comment(){switch(Me){case"*":ee(),Ne="multiLineComment";return;case"/":ee(),Ne="singleLineComment";return}throw ct(ee())},multiLineComment(){switch(Me){case"*":ee(),Ne="multiLineCommentAsterisk";return;case void 0:throw ct(ee())}ee()},multiLineCommentAsterisk(){switch(Me){case"*":ee();return;case"/":ee(),Ne="default";return;case void 0:throw ct(ee())}ee(),Ne="multiLineComment"},singleLineComment(){switch(Me){case`
63
+ `:case"\r":case"\u2028":case"\u2029":ee(),Ne="default";return;case void 0:return ee(),ht("eof")}ee()},value(){switch(Me){case"{":case"[":return ht("punctuator",ee());case"n":return ee(),yi("ull"),ht("null",null);case"t":return ee(),yi("rue"),ht("boolean",!0);case"f":return ee(),yi("alse"),ht("boolean",!1);case"-":case"+":ee()==="-"&&(Er=-1),Ne="sign";return;case".":Se=ee(),Ne="decimalPointLeading";return;case"0":Se=ee(),Ne="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":Se=ee(),Ne="decimalInteger";return;case"I":return ee(),yi("nfinity"),ht("numeric",1/0);case"N":return ee(),yi("aN"),ht("numeric",NaN);case'"':case"'":Ja=ee()==='"',Se="",Ne="string";return}throw ct(ee())},identifierNameStartEscape(){if(Me!=="u")throw ct(ee());ee();const n=xf();switch(n){case"$":case"_":break;default:if(!kt.isIdStartChar(n))throw Od();break}Se+=n,Ne="identifierName"},identifierName(){switch(Me){case"$":case"_":case"‌":case"‍":Se+=ee();return;case"\\":ee(),Ne="identifierNameEscape";return}if(kt.isIdContinueChar(Me)){Se+=ee();return}return ht("identifier",Se)},identifierNameEscape(){if(Me!=="u")throw ct(ee());ee();const n=xf();switch(n){case"$":case"_":case"‌":case"‍":break;default:if(!kt.isIdContinueChar(n))throw Od();break}Se+=n,Ne="identifierName"},sign(){switch(Me){case".":Se=ee(),Ne="decimalPointLeading";return;case"0":Se=ee(),Ne="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":Se=ee(),Ne="decimalInteger";return;case"I":return ee(),yi("nfinity"),ht("numeric",Er*(1/0));case"N":return ee(),yi("aN"),ht("numeric",NaN)}throw ct(ee())},zero(){switch(Me){case".":Se+=ee(),Ne="decimalPoint";return;case"e":case"E":Se+=ee(),Ne="decimalExponent";return;case"x":case"X":Se+=ee(),Ne="hexadecimal";return}return ht("numeric",Er*0)},decimalInteger(){switch(Me){case".":Se+=ee(),Ne="decimalPoint";return;case"e":case"E":Se+=ee(),Ne="decimalExponent";return}if(kt.isDigit(Me)){Se+=ee();return}return ht("numeric",Er*Number(Se))},decimalPointLeading(){if(kt.isDigit(Me)){Se+=ee(),Ne="decimalFraction";return}throw ct(ee())},decimalPoint(){switch(Me){case"e":case"E":Se+=ee(),Ne="decimalExponent";return}if(kt.isDigit(Me)){Se+=ee(),Ne="decimalFraction";return}return ht("numeric",Er*Number(Se))},decimalFraction(){switch(Me){case"e":case"E":Se+=ee(),Ne="decimalExponent";return}if(kt.isDigit(Me)){Se+=ee();return}return ht("numeric",Er*Number(Se))},decimalExponent(){switch(Me){case"+":case"-":Se+=ee(),Ne="decimalExponentSign";return}if(kt.isDigit(Me)){Se+=ee(),Ne="decimalExponentInteger";return}throw ct(ee())},decimalExponentSign(){if(kt.isDigit(Me)){Se+=ee(),Ne="decimalExponentInteger";return}throw ct(ee())},decimalExponentInteger(){if(kt.isDigit(Me)){Se+=ee();return}return ht("numeric",Er*Number(Se))},hexadecimal(){if(kt.isHexDigit(Me)){Se+=ee(),Ne="hexadecimalInteger";return}throw ct(ee())},hexadecimalInteger(){if(kt.isHexDigit(Me)){Se+=ee();return}return ht("numeric",Er*Number(Se))},string(){switch(Me){case"\\":ee(),Se+=Sm();return;case'"':if(Ja)return ee(),ht("string",Se);Se+=ee();return;case"'":if(!Ja)return ee(),ht("string",Se);Se+=ee();return;case`
64
+ `:case"\r":throw ct(ee());case"\u2028":case"\u2029":Tm(Me);break;case void 0:throw ct(ee())}Se+=ee()},start(){switch(Me){case"{":case"[":return ht("punctuator",ee())}Ne="value"},beforePropertyName(){switch(Me){case"$":case"_":Se=ee(),Ne="identifierName";return;case"\\":ee(),Ne="identifierNameStartEscape";return;case"}":return ht("punctuator",ee());case'"':case"'":Ja=ee()==='"',Ne="string";return}if(kt.isIdStartChar(Me)){Se+=ee(),Ne="identifierName";return}throw ct(ee())},afterPropertyName(){if(Me===":")return ht("punctuator",ee());throw ct(ee())},beforePropertyValue(){Ne="value"},afterPropertyValue(){switch(Me){case",":case"}":return ht("punctuator",ee())}throw ct(ee())},beforeArrayValue(){if(Me==="]")return ht("punctuator",ee());Ne="value"},afterArrayValue(){switch(Me){case",":case"]":return ht("punctuator",ee())}throw ct(ee())},end(){throw ct(ee())}};function ht(n,e){return{type:n,value:e,line:Xr,column:Xn}}function yi(n){for(const e of n){if(Cr()!==e)throw ct(ee());ee()}}function Sm(){switch(Cr()){case"b":return ee(),"\b";case"f":return ee(),"\f";case"n":return ee(),`
65
+ `;case"r":return ee(),"\r";case"t":return ee()," ";case"v":return ee(),"\v";case"0":if(ee(),kt.isDigit(Cr()))throw ct(ee());return"\0";case"x":return ee(),Im();case"u":return ee(),xf();case`
66
+ `:case"\u2028":case"\u2029":return ee(),"";case"\r":return ee(),Cr()===`
67
+ `&&ee(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw ct(ee());case void 0:throw ct(ee())}return ee()}function Im(){let n="",e=Cr();if(!kt.isHexDigit(e)||(n+=ee(),e=Cr(),!kt.isHexDigit(e)))throw ct(ee());return n+=ee(),String.fromCodePoint(parseInt(n,16))}function xf(){let n="",e=4;for(;e-- >0;){const t=Cr();if(!kt.isHexDigit(t))throw ct(ee());n+=ee()}return String.fromCodePoint(parseInt(n,16))}const km={start(){if(Mt.type==="eof")throw xi();Ef()},beforePropertyName(){switch(Mt.type){case"identifier":case"string":Df=Mt.value,Yt="afterPropertyName";return;case"punctuator":iu();return;case"eof":throw xi()}},afterPropertyName(){if(Mt.type==="eof")throw xi();Yt="beforePropertyValue"},beforePropertyValue(){if(Mt.type==="eof")throw xi();Ef()},beforeArrayValue(){if(Mt.type==="eof")throw xi();if(Mt.type==="punctuator"&&Mt.value==="]"){iu();return}Ef()},afterPropertyValue(){if(Mt.type==="eof")throw xi();switch(Mt.value){case",":Yt="beforePropertyName";return;case"}":iu()}},afterArrayValue(){if(Mt.type==="eof")throw xi();switch(Mt.value){case",":Yt="beforeArrayValue";return;case"]":iu()}},end(){}};function Ef(){let n;switch(Mt.type){case"punctuator":switch(Mt.value){case"{":n={};break;case"[":n=[];break}break;case"null":case"boolean":case"numeric":case"string":n=Mt.value;break}if(Qa===void 0)Qa=n;else{const e=xr[xr.length-1];Array.isArray(e)?e.push(n):Object.defineProperty(e,Df,{value:n,writable:!0,enumerable:!0,configurable:!0})}if(n!==null&&typeof n=="object")xr.push(n),Array.isArray(n)?Yt="beforeArrayValue":Yt="beforePropertyName";else{const e=xr[xr.length-1];e==null?Yt="end":Array.isArray(e)?Yt="afterArrayValue":Yt="afterPropertyValue"}}function iu(){xr.pop();const n=xr[xr.length-1];n==null?Yt="end":Array.isArray(n)?Yt="afterArrayValue":Yt="afterPropertyValue"}function ct(n){return au(n===void 0?`JSON5: invalid end of input at ${Xr}:${Xn}`:`JSON5: invalid character '${Pd(n)}' at ${Xr}:${Xn}`)}function xi(){return au(`JSON5: invalid end of input at ${Xr}:${Xn}`)}function Od(){return Xn-=5,au(`JSON5: invalid identifier character at ${Xr}:${Xn}`)}function Tm(n){console.warn(`JSON5: '${Pd(n)}' in strings is not valid ECMAScript; consider escaping`)}function Pd(n){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[n])return e[n];if(n<" "){const t=n.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return n}function au(n){const e=new SyntaxError(n);return e.lineNumber=Xr,e.columnNumber=Xn,e}var Rm=function(e,t,a){const o=[];let u="",f,h,v="",d;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(a=t.space,d=t.quote,t=t.replacer),typeof t=="function")h=t;else if(Array.isArray(t)){f=[];for(const S of t){let T;typeof S=="string"?T=S:(typeof S=="number"||S instanceof String||S instanceof Number)&&(T=String(S)),T!==void 0&&f.indexOf(T)<0&&f.push(T)}}return a instanceof Number?a=Number(a):a instanceof String&&(a=String(a)),typeof a=="number"?a>0&&(a=Math.min(10,Math.floor(a)),v=" ".substr(0,a)):typeof a=="string"&&(v=a.substr(0,10)),c("",{"":e});function c(S,T){let N=T[S];switch(N!=null&&(typeof N.toJSON5=="function"?N=N.toJSON5(S):typeof N.toJSON=="function"&&(N=N.toJSON(S))),h&&(N=h.call(T,S,N)),N instanceof Number?N=Number(N):N instanceof String?N=String(N):N instanceof Boolean&&(N=N.valueOf()),N){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof N=="string")return D(N);if(typeof N=="number")return String(N);if(typeof N=="object")return Array.isArray(N)?I(N):y(N)}function D(S){const T={"'":.1,'"':.2},N={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let Z="";for(let k=0;k<S.length;k++){const M=S[k];switch(M){case"'":case'"':T[M]++,Z+=M;continue;case"\0":if(kt.isDigit(S[k+1])){Z+="\\x00";continue}}if(N[M]){Z+=N[M];continue}if(M<" "){let q=M.charCodeAt(0).toString(16);Z+="\\x"+("00"+q).substring(q.length);continue}Z+=M}const P=d||Object.keys(T).reduce((k,M)=>T[k]<T[M]?k:M);return Z=Z.replace(new RegExp(P,"g"),N[P]),P+Z+P}function y(S){if(o.indexOf(S)>=0)throw TypeError("Converting circular structure to JSON5");o.push(S);let T=u;u=u+v;let N=f||Object.keys(S),Z=[];for(const k of N){const M=c(k,S);if(M!==void 0){let q=m(k)+":";v!==""&&(q+=" "),q+=M,Z.push(q)}}let P;if(Z.length===0)P="{}";else{let k;if(v==="")k=Z.join(","),P="{"+k+"}";else{let M=`,
68
+ `+u;k=Z.join(M),P=`{
69
+ `+u+k+`,
70
+ `+T+"}"}}return o.pop(),u=T,P}function m(S){if(S.length===0)return D(S);const T=String.fromCodePoint(S.codePointAt(0));if(!kt.isIdStartChar(T))return D(S);for(let N=T.length;N<S.length;N++)if(!kt.isIdContinueChar(String.fromCodePoint(S.codePointAt(N))))return D(S);return S}function I(S){if(o.indexOf(S)>=0)throw TypeError("Converting circular structure to JSON5");o.push(S);let T=u;u=u+v;let N=[];for(let P=0;P<S.length;P++){const k=c(String(P),S);N.push(k!==void 0?k:"null")}let Z;if(N.length===0)Z="[]";else if(v==="")Z="["+N.join(",")+"]";else{let P=`,
71
+ `+u,k=N.join(P);Z=`[
72
+ `+u+k+`,
73
+ `+T+"]"}return o.pop(),u=T,Z}},Nm={parse:Fm,stringify:Rm};class kn{constructor(e,t=0,a){de(this,"relativeStart");de(this,"relativeEnd");if(this.feature=e,a===void 0&&(a=e.locus.end-e.locus.start),a<t)throw new RangeError("End cannot be less than start");this.feature=e,this.relativeStart=t,this.relativeEnd=a}get start(){return console.error("FeatureSegment has no prop `start`. Use `relativeStart` instead."),this.relativeStart}get end(){return console.error("FeatureSegment has no prop `end`. Use `relativeEnd` instead."),this.relativeEnd}toOpenInterval(){return new je(this.relativeStart,this.relativeEnd)}getName(){return this.feature.getName()}getLength(){return this.relativeEnd-this.relativeStart}getLocus(){const e=this.feature.locus;return new Ct(e.chr,e.start+this.relativeStart,e.start+this.relativeEnd)}getOverlap(e){if(this.feature!==e.feature)return null;const t=this.toOpenInterval().getOverlap(e.toOpenInterval());return t?new kn(this.feature,t.start,t.end):null}getGenomeOverlap(e){const t=this.feature.getLocus(),o=this.getLocus().getOverlap(e);if(!o)return null;const u=o.start-t.start,f=o.end-t.start;return new kn(this.feature,u,f)}toString(){return`${this.getName()}:${this.relativeStart+1}-${this.relativeEnd}`}toStringWithOther(e){return`${this.getName()}:${this.relativeStart+1}-${e.getName()}:${e.relativeEnd}`}}const Md="";class Kn{constructor(e,t){de(this,"_name");de(this,"_features");de(this,"_sortedFeatureStarts");de(this,"_minCoordinateForFeature");de(this,"_featuresForChr");de(this,"_totalBases");this._name=e,this._features=t,this._minCoordinateForFeature=new Map,this._sortedFeatureStarts=[],this._featuresForChr=fn.groupBy(t,a=>a.getLocus().chr),this._totalBases=0;for(const a of t){if(this._minCoordinateForFeature.has(a))throw new Error(`Duplicate feature "${a.getName()}" detected. Features must be unique.`);this._minCoordinateForFeature.set(a,this._totalBases),this._sortedFeatureStarts.push(this._totalBases),this._totalBases+=a.getLength()}}static makeGap(e,t="Gap"){return new zn(t,new Ct(Md,0,Math.round(e)))}static isGapFeature(e){return e.getLocus().chr===Md}_flipIfReverseStrand(e){if(e.feature.getIsReverseStrand())return new kn(e.feature,t(e.relativeEnd),t(e.relativeStart));return e;function t(a){return e.feature.getLength()-a}}getName(){return this._name}getFeatures(){return this._features.slice()}getTotalBases(){return this._totalBases}getIsValidBase(e){return 0<=e&&e<this._totalBases}getFeatureStart(e){const t=this._minCoordinateForFeature.get(e);if(t===void 0)throw new RangeError(`Feature "${e.getName()}" not in this navigation context`);return t}convertBaseToFeatureCoordinate(e){if(!this.getIsValidBase(e))throw new RangeError(`Base number ${e} is invalid. Valid bases in this context: [0, ${this.getTotalBases()})`);const t=fn.sortedLastIndex(this._sortedFeatureStarts,e)-1,a=this._features[t],o=e-this._sortedFeatureStarts[t];return new kn(a,o,o+1)}convertFeatureSegmentToContextCoordinates(e){e=this._flipIfReverseStrand(e);const t=this.getFeatureStart(e.feature);return new je(t+e.relativeStart,t+e.relativeEnd)}convertGenomeIntervalToBases(e){const t=this._featuresForChr[e.chr]||[],a=[];for(const o of t){const u=new kn(o).getGenomeOverlap(e);u&&a.push(this.convertFeatureSegmentToContextCoordinates(u))}return a}toGaplessCoordinate(e){const t=this.convertBaseToFeatureCoordinate(e),a=this._features.findIndex(f=>f===t.feature),o=this._features.slice(0,a).filter(Kn.isGapFeature);let u=fn.sumBy(o,f=>f.getLength());return Kn.isGapFeature(t.feature)&&(u+=t.relativeStart),e-u}parse(e){const t=this._features.find(u=>u.getName()===e);if(t){const u=this.convertFeatureSegmentToContextCoordinates(new kn(t)),f=.5*(u.start+u.end);return new je(f-3,f+3)}const a=Ct.parse(e),o=this.convertGenomeIntervalToBases(a)[0];if(o)return o;throw new RangeError("Location unavailable in this context")}getFeaturesInInterval(e,t,a=!0){const o=new je(e,t),u=[];for(const f of this._features){if(!a&&Kn.isGapFeature(f))continue;const h=this.getFeatureStart(f),v=h+f.getLength(),d=new je(h,v).getOverlap(o);if(d){const c=d.start-h,D=d.end-h,y=new kn(f,c,D);u.push(this._flipIfReverseStrand(y))}else if(u.length>0)break}return u}getLociInInterval(e,t){const o=this.getFeaturesInInterval(e,t,!1).map(u=>u.getLocus());return Ct.mergeOverlaps(o)}hasFeatureWithName(e){return this._features.some(t=>t.name===e.name)}}var Ud=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function $m(n,e){return!!(n===e||Ud(n)&&Ud(e))}function Lm(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!$m(n[t],e[t]))return!1;return!0}function Om(n,e){e===void 0&&(e=Lm);var t=null;function a(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];if(t&&t.lastThis===this&&e(o,t.lastArgs))return t.lastResult;var f=n.apply(this,o);return t={lastResult:f,lastArgs:o,lastThis:this},f}return a.clear=function(){t=null},a}const ja="-";function su(n){return fn.sumBy(n,e=>e===ja?0:1)}function Wd(n,e,t=!1){const a=[],o=new RegExp(ja+"+","g");let u;for(;(u=o.exec(n))!==null;)v(!0,u.index,u[0].length,e);if(t)return a;let f=0;const h=a.slice();for(const d of h)v(!1,f,d.index-f),f=d.index+d.length;return v(!1,f,n.length-f),a;function v(d,c,D,y=0){D>y&&a.push({isGap:d,index:c,length:D})}}function Cf(n,e,t=!1){const a=t?-1:1,o=[];let u=e;for(const f of n)o.push(u),f!==ja&&(u+=a);return o}class Pm{constructor(e){de(this,"sequence");de(this,"_currentIndex");this.sequence=e,this._currentIndex=-1}reset(){this._currentIndex=0}getCurrentIndex(){return this._currentIndex}getIndexOfNextBase(){do this._currentIndex++;while(this.sequence.charAt(this._currentIndex)===ja);return this._currentIndex}hasNextBase(){return this._currentIndex<this.sequence.length-1}advanceN(e){let t=this._currentIndex;for(let a=0;a<e;a++)t=this.getIndexOfNextBase();return t}}class Af extends kn{constructor(t,a,o){super(t,a,o);de(this,"feature");de(this,"sequenceInterval");this.feature=t;const u=new Pm(t.targetSeq),f=u.advanceN(this.relativeStart+1),h=u.advanceN(this.getLength());this.sequenceInterval=new je(f,h)}static fromFeatureSegment(t){return new Af(t.feature,t.relativeStart,t.relativeEnd)}getTargetSequence(){const[t,a]=this.sequenceInterval;return this.feature.targetSeq.substring(t,a)}getQueryLocus(){const{queryStrand:t,queryLocus:a}=this.feature;return new Ct(a.chr,t==="+"?Math.min(a.start+this.relativeStart,a.end):Math.max(0,a.end-this.relativeEnd),t==="+"?Math.min(a.start+this.relativeEnd,a.end):a.end-this.relativeStart)}getQueryLocusFine(){const{querySeq:t,queryLocus:a}=this.feature,o=su(t.substring(0,this.sequenceInterval.start)),u=su(this.getQuerySequence());if(this.feature.getIsReverseStrandQuery()){const f=a.end-o;return new Ct(a.chr,f-u,f)}else{const f=a.start+o;return new Ct(a.chr,f,f+u)}}getQuerySequence(){const[t,a]=this.sequenceInterval;return this.feature.querySeq.substring(t,a)}}function Mm(n,e=!1){const t=n>=1e3?Math.floor(n):Math.round(n);return t>=75e4?`${(t/1e6).toFixed(1)} Mb`:t>=1e4?`${(t/1e3).toFixed(1)} Kb`:t>0?`${t} bp`:e?"<1 bp":"0 bp"}class qd{constructor(e){de(this,"_baseNavContext");de(this,"_gaps");de(this,"_cumulativeGapBases");this._baseNavContext=e,this._cumulativeGapBases=[]}setGaps(e){this._gaps=e.slice().sort((a,o)=>a.contextBase-o.contextBase),this._cumulativeGapBases=[];let t=0;for(const a of this._gaps)this._cumulativeGapBases.push(t),t+=a.length;this._cumulativeGapBases.push(t)}build(){const e=this._baseNavContext.getFeatures(),t=new Map;for(let f=0;f<e.length;f++)t.set(e[f],f);const a=[];let o=-1,u=0;for(const f of this._gaps){const h=this._baseNavContext.convertBaseToFeatureCoordinate(f.contextBase),v=h.feature,d=t.get(v),c=h.relativeStart;a.push(...e.slice(o+1,d)),d===o&&u>0&&a.pop(),u=u>c?0:u;const D=new kn(v,u,c).getLocus(),y=new kn(v,c).getLocus();D.getLength()>0&&a.push(new zn(v.getName(),D,v.getStrand())),a.push(Kn.makeGap(f.length,`${Mm(f.length)} gap`)),y.getLength()>0&&a.push(new zn(v.getName(),y,v.getStrand())),o=d,u=c}return a.push(...e.slice(o+1)),new Kn(this._baseNavContext.getName(),a)}convertOldCoordinates(e){const t=fn.sortedIndexBy(this._gaps,{contextBase:e},"contextBase"),a=this._cumulativeGapBases[t]||0;return e+a}}class Ei{constructor(e,t){de(this,"_viewRegion");de(this,"_drawWidth");de(this,"_pixelsPerBase");de(this,"_basesPerPixel");this._viewRegion=e,this._drawWidth=t,this._pixelsPerBase=t/e.getWidth(),this._basesPerPixel=e.getWidth()/t}getDrawWidth(){return this._drawWidth}basesToXWidth(e){return e*this._pixelsPerBase}xWidthToBases(e){return e*this._basesPerPixel}baseToX(e){return(e-this._viewRegion.getContextCoordinates().start)*this._pixelsPerBase}xToBase(e){return e*this._basesPerPixel+this._viewRegion.getContextCoordinates().start}baseSpanToXSpan(e){const t=this.baseToX(e.start),a=this.baseToX(e.end);return new je(t,a)}baseSpanToXCenter(e){const t=this.baseSpanToXSpan(e),a=Math.round((t.start+t.end)/2);return new je(a,a)}xToSegmentCoordinate(e){const t=Math.floor(this.xToBase(e));return this._viewRegion.getNavigationContext().convertBaseToFeatureCoordinate(t)}}class Um{constructor(e,t,a){de(this,"interaction");de(this,"xSpan1");de(this,"xSpan2");this.interaction=e,t.start<=a.start?(this.xSpan1=t,this.xSpan2=a):(this.xSpan1=a,this.xSpan2=t)}getWidth(){const e=this.xSpan1.start;return Math.max(this.xSpan1.end,this.xSpan2.end)-e}generateKey(){return""+this.xSpan1.start+this.xSpan1.end+this.xSpan2.start+this.xSpan2.end}}class Wm{placeFeatures(e,t,a,o=!1){const u=new Ei(t,a),f=t.getContextCoordinates(),h=t.getNavigationContext(),v=[];for(const d of e)for(let c of d.computeNavContextCoordinates(h))if(c=c.getOverlap(f),c){const D=o?u.baseSpanToXCenter(c):u.baseSpanToXSpan(c),{visiblePart:y,isReverse:m}=this._locatePlacement(d,h,c);v.push({feature:d,visiblePart:y,contextLocation:c,xSpan:D,isReverse:m})}return v}_locatePlacement(e,t,a){const o=t.convertBaseToFeatureCoordinate(a.start),u=o.getLocus().start,f=o.feature.getIsReverseStrand();let h;f?h=u-a.getLength()+1:h=u;const v=h-e.getLocus().start,d=Math.max(0,v);return{visiblePart:new kn(e,d,d+a.getLength()),isReverse:f}}placeFeatureSegments(e,t){const a=e.xSpan.getLength()/e.contextLocation.getLength(),o=[];for(let u of t)if(u=u.getOverlap(e.visiblePart),u){const h=(u.relativeStart-e.visiblePart.relativeStart)*a,v=u.getLength()*a;let d;e.isReverse?d=e.xSpan.end-h-v:d=e.xSpan.start+h,o.push({segment:u,xSpan:new je(d,d+v)})}return o}placeInteractions(e,t,a){const o=new Ei(t,a),u=t.getContextCoordinates(),f=t.getNavigationContext(),h=[];for(const v of e){let d=f.convertGenomeIntervalToBases(v.locus1),c=f.convertGenomeIntervalToBases(v.locus2);d=d.map(D=>D.getOverlap(u)),c=c.map(D=>D.getOverlap(u));for(const D of d)for(const y of c)if(D&&y){const m=o.baseSpanToXSpan(D),I=o.baseSpanToXSpan(y);h.push(new Um(v,m,I))}}return h}placeGraphNodes(e,t,a){const o=new Ei(t,a),u=t.getContextCoordinates(),f=t.getNavigationContext(),h=[],v=[];for(const d of e)for(let c of d.computeNavContextCoordinates(f))if(c=c.getOverlap(u),c){const D=o.baseSpanToXSpan(c),{visiblePart:y,isReverse:m}=this._locatePlacement(d,f,c);h.push({feature:d,visiblePart:y,contextLocation:c,xSpan:D,isReverse:m})}else v.push(d);return{placements:h,nodesOutOfView:v}}}const qm=10,Ff=5,Gd=.99,Gm=200,Hm=5,Zm=new Wm;class Vm{constructor(e){de(this,"primaryGenome");this.primaryGenome=e,this.multiAlign=Om(this.multiAlign)}multiAlign(e,t){const{visRegion:a,visWidth:o,viewWindowRegion:u}=e,h=new Ei(a,o).xWidthToBases(1)<qm;let v;if(h){const d=t,{newRecordsArray:c,allGaps:D}=this.refineRecordsArray(d,e);v=c;const y=this.calculatePrimaryVis(D,e);return v.reduce((m,I)=>({...m,[I.query]:I.isBigChain?this.alignRough(I.id,I.query,I.records,e):this.alignFine(I.id,I.query,I.records,e,y,D)}),{})}else return v=t,v.reduce((d,c)=>({...d,[c.query]:this.alignRough(c.id,c.query,c.records,e)}),{})}calculatePrimaryVis(e,t){const{visRegion:a,viewWindow:o,viewWindowRegion:u}=t,f=a.getNavigationContext(),h=new qd(f);h.setGaps(e);const v=h.build(),d=S(a),c=S(u),D=o.getLength()/c.getWidth(),y=d.getWidth()*D,I=new Ei(d,y).baseSpanToXSpan(c.getContextCoordinates());return{visRegion:d,visWidth:y,viewWindowRegion:c,viewWindow:I};function S(T){const[N,Z]=T.getContextCoordinates();return new Ni(v,h.convertOldCoordinates(N),h.convertOldCoordinates(Z))}}refineRecordsArray(e,t){const a=Gd,o=[],u={};for(const d of e){const c=this._computeContextLocations(d.records,t),y=this._getPrimaryGenomeGaps(c,a).reduce((m,I)=>({...m,[I.contextBase]:I.length}),{});o.push({recordsObj:d,placements:c,primaryGapsObj:y});for(const m of Object.keys(y))m in u?u[m]=Math.max(u[m],y[m]):u[m]=y[m]}const f=[];for(const d of Object.keys(u))f.push({contextBase:Number(d),length:u[d]});if(f.sort((d,c)=>d.contextBase-c.contextBase),o.length>1)for(const d of o){const c=[];for(const D of Object.keys(u))if(D in d.primaryGapsObj){const y=u[D]-d.primaryGapsObj[D];y>0&&c.push({contextBase:Number(D),length:y})}else c.push({contextBase:Number(D),length:u[D]});c.sort((D,y)=>y.contextBase-D.contextBase);for(const D of c){const y="-".repeat(D.length),m=D.contextBase,I=d.placements.filter(S=>S.contextSpan.start<m&&S.contextSpan.end>m)[0];if(I){const S=I.visiblePart.getTargetSequence(),T=v(S,m-I.contextSpan.start),N=I.visiblePart.sequenceInterval.start+T,Z=I.record.targetSeq,P=I.record.querySeq;I.record.targetSeq=Z.slice(0,N)+y+Z.slice(N),I.record.querySeq=P.slice(0,N)+y+P.slice(N)}}d.recordsObj.records=d.placements.map(D=>D.record)}return{newRecordsArray:o.map(d=>d.recordsObj),allGaps:f};function v(d,c){let D=0;for(const y of d)if(D++,y!==ja&&c--,c===0)break;return D}}alignFine(e,t,a,o,u,f){const{visRegion:h,visWidth:v}=u,d=new Ei(h,v),c=Gd,D=o.visRegion.getNavigationContext(),y=this._computeContextLocations(a,o),m=new qd(D);m.setGaps(f);for(const P of y){const k=P.contextSpan,M=P.visiblePart,q=new je(m.convertOldCoordinates(k.start),m.convertOldCoordinates(k.end)),$=d.baseSpanToXSpan(q),A=M.getTargetSequence(),F=M.getQuerySequence();P.contextSpan=q,P.targetXSpan=$,P.queryXSpan=$,P.targetSegments=this._placeSequenceSegments(A,c,$.start,d),P.querySegments=this._placeSequenceSegments(F,c,$.start,d)}const I=[],S=new Bf(Ff),T=new Bf(Ff);for(let P=1;P<y.length;P++){const k=y[P-1],M=y[P],q=k.targetXSpan.end,$=M.targetXSpan.start,A=k.record.locus.chr,F=k.record.locus.end,L=k.record.queryLocus.chr,G=k.record.queryStrand,Y=G==="+"?k.record.queryLocus.end:k.record.queryLocus.start,ne=M.record.locus.chr,se=M.record.locus.start,pe=M.record.queryLocus.chr,ke=M.record.queryStrand,ae=ke==="+"?M.record.queryLocus.start:M.record.queryLocus.end;let ge;L===pe?G==="+"&&ke==="+"?(ge=ae>=Y?"":"overlap ",ge+=Ji(Math.abs(ae-Y))):G==="-"&&ke==="-"?(ge=Y>=ae?"":"overlap ",ge+=Ji(Math.abs(Y-ae))):ge="reverse direction":ge="not connected";const _e=(q+$)/2,Xe=(k.queryXSpan.end+M.queryXSpan.start)/2,le=A===ne?Ji(se-F):"not connected",fe=.5*(le.length*5),Ee=_e-fe,ve=_e+fe,qe=Ee<=q||ve>=$,ot=qe?S.place(new je(Ee,ve)):new je(Ee,ve),be=new je(q,$),Ke=.5*(ge.length*5),he=Xe-Ke,Oe=Xe+Ke,Ye=he<=k.queryXSpan.end||Oe>=M.queryXSpan.start,we=Ye?T.place(new je(he,Oe)):new je(he,Oe),Ae=new je(k.queryXSpan.end,M.queryXSpan.start);I.push({targetGapText:le,targetXSpan:be,targetTextXSpan:ot,queryGapText:ge,queryXSpan:Ae,queryTextXSpan:we,shiftTarget:qe,shiftQuery:Ye})}const N=this._getQueryPieces(y),Z=this._makeQueryGenomeRegion(N,v,d);return{id:e,isFineMode:!0,primaryVisData:u,queryRegion:Z,drawData:y,drawGapText:I,primaryGenome:this.primaryGenome,queryGenome:t,basesPerPixel:d.xWidthToBases(1),navContextBuilder:m}}alignRough(e,t,a,o){const{visRegion:u,visWidth:f}=o,h=new Ei(u,f),v=h.xWidthToBases(Gm),c=a.reduce((S,T)=>S+(T.getIsReverseStrandQuery()?-1*T.getLength():T.getLength()),0)<0?"-":"+",D=this._computeContextLocations(a,o);let y=Ct.mergeAdvanced(D,v,S=>S.visiblePart.getQueryLocus());y=y.sort((S,T)=>T.locus.getLength()-S.locus.getLength());const m=new Bf(Ff),I=[];for(const S of y){const T=S.locus,N=S.sources,Z=h.basesToXWidth(T.getLength()),P=.5*Z;if(Z<Hm)continue;const k=Xm(N.map(se=>se.targetXSpan)),M=Math.min(...N.map(se=>se.targetXSpan.start)),q=Math.max(...N.map(se=>se.targetXSpan.end)),$=new je(M,q),A=k-P,F=k+P,L=m.place(new je(A,F)),G=N.map(se=>se.record.queryLocus),Y=c==="-",ne=this._placeInternalLoci(T,G,L,Y,h);for(let se=0;se<G.length;se++)N[se].queryXSpan=ne[se];I.push({queryFeature:new zn(void 0,T,c),targetXSpan:$,queryXSpan:L,segments:N})}return{id:e,isFineMode:!1,primaryVisData:o,queryRegion:this._makeQueryGenomeRegion(I,f,h),drawData:I,plotStrand:c,primaryGenome:this.primaryGenome,queryGenome:t,basesPerPixel:h.xWidthToBases(1)}}_computeContextLocations(e,t){const{visRegion:a,visWidth:o}=t;return Zm.placeFeatures(e,a,o).map(u=>({record:u.feature,visiblePart:Af.fromFeatureSegment(u.visiblePart),contextSpan:u.contextLocation,targetXSpan:u.xSpan,queryXSpan:null}))}_getPrimaryGenomeGaps(e,t){const a=[];for(const o of e){const{visiblePart:u,contextSpan:f}=o,h=Wd(u.getTargetSequence(),t,!0),v=Cf(u.getTargetSequence(),f.start);for(const d of h)a.push({contextBase:v[d.index],length:d.length})}return a}_placeSequenceSegments(e,t,a,o){const u=Wd(e,t);u.sort((h,v)=>h.index-v.index);let f=a;for(const h of u){const v=h.isGap?h.length:su(e.substr(h.index,h.length)),d=o.basesToXWidth(v);h.xSpan=new je(f,f+d),f+=d}return u}_getQueryPieces(e){const t=[];for(const a of e){const{record:o,visiblePart:u}=a,f=o.getIsReverseStrandQuery(),h=u.getQuerySequence();let v;f?v=Cf(h,u.getQueryLocusFine().end,!0):v=Cf(h,u.getQueryLocusFine().start);const d=o.queryLocus.chr;for(const c of a.querySegments){const{isGap:D,index:y,length:m,xSpan:I}=c;if(D)continue;const S=v[y],T=su(h.substr(y,m));let N;f?N=new Ct(d,S-T,S):N=new Ct(d,S,S+T),t.push({queryFeature:new zn(void 0,N,o.queryStrand),queryXSpan:I})}}return t}_makeQueryGenomeRegion(e,t,a){const o=e.slice().sort((d,c)=>d.queryXSpan.start-c.queryXSpan.start),u=[];let f=0,h=new Ct("",-1,-1);for(const d of o){const{queryXSpan:c,queryFeature:D}=d,y=D.getLocus(),m=c.start-f,I=Math.round(a.xWidthToBases(m));if(I>=1){const S=Km(y,h)?`${Ji(I)} gap`:void 0;u.push(Kn.makeGap(I,S))}u.push(D),f=c.end,h=y}const v=Math.round(a.xWidthToBases(t-f));return v>0&&u.push(Kn.makeGap(v)),new Ni(new Kn("",u))}_placeInternalLoci(e,t,a,o,u){const f=[];if(o)for(const h of t){const v=h.start-e.start,d=u.basesToXWidth(v),c=a.end-d,D=u.basesToXWidth(h.getLength()),y=c<a.end?c:a.end,m=c-D>a.start?c-D:a.start;f.push(new je(m,y))}else for(const h of t){const v=h.start-e.start,d=u.basesToXWidth(v),c=a.start+d,D=u.basesToXWidth(h.getLength()),y=c>a.start?c:a.start,m=c+D<a.end?c+D:a.end;f.push(new je(y,m))}return f}}class Bf{constructor(e=0){de(this,"leftExtent");de(this,"rightExtent");de(this,"margin");de(this,"_placements");this.leftExtent=1/0,this.rightExtent=-1/0,this.margin=e,this._placements=[]}place(e){let t=e;if(this._placements.some(a=>a.getOverlap(e)!=null)){const a=.5*(e.start+e.end);t=Math.abs(a-this.leftExtent)<Math.abs(a-this.rightExtent)?new je(this.leftExtent-e.getLength(),this.leftExtent):new je(this.rightExtent,this.rightExtent+e.getLength())}return this._placements.push(t),t.start<this.leftExtent&&(this.leftExtent=t.start-this.margin),t.end>this.rightExtent&&(this.rightExtent=t.end+this.margin),t}retrievePlacements(){return this._placements}}function Xm(n){const e=fn.sumBy(n,a=>.5*a.getLength()*(a.start+a.end)),t=fn.sumBy(n,a=>a.getLength());return e/t}function Km(n,e){return n.chr!==e.chr?!1:n.end===e.start||e.end===n.start}async function Ym(n){const e=n.regionExpandLoci,t=n.trackToFetch,a=n.genomicLoci,o={},u={},f={},h=n.useFineModeNav,v=n.primaryGenName,d=n.initGenomicLoci;f[`${v}`]={genomicLoci:a,regionExpandLoci:e,initGenomicLoci:d};const c=t,D=[e];c.length>0&&await y(n.visData.visRegion,c);async function y(I,S){let T=[];for(let L of n.visData.visRegion._navContext._features){let G=new Ct(L.locus.chr,L.locus.start,L.locus.end);T.push(new zn(L.name,G))}let N=new Kn(n.visData.visRegion._navContext._name,T),Z=new Ni(N,I._startBase,I._endBase),P=[];for(let L of n.visData.viewWindowRegion._navContext._features){let G=new Ct(L.locus.chr,L.locus.start,L.locus.end);P.push(new zn(L.name,G))}let k=new Kn(n.visData.viewWindowRegion._navContext._name,P),M=new Ni(k,n.visData.viewWindowRegion._startBase,n.visData.viewWindowRegion._endBase),q={visWidth:n.visData.visWidth,visRegion:Z,viewWindow:new je(n.windowWidth,n.windowWidth*2),viewWindowRegion:M};await Promise.all(S.map(async(L,G)=>{let Y;await Promise.all(D.map(async(ne,se)=>{try{const pe=await ym.genomealign({nav:ne,options:{height:40,isCombineStrands:!1,colorsForContext:{CG:{color:"rgb(100,139,216)",background:"#d9d9d9"},CHG:{color:"rgb(255,148,77)",background:"#ffe0cc"},CHH:{color:"rgb(255,0,255)",background:"#ffe5ff"}},depthColor:"#525252",depthFilter:0,maxMethyl:1,label:""},url:L.url,trackModel:L});let ke=[];for(const ae of pe){let ge=Nm.parse("{"+ae[3]+"}");ae[3]=ge,ke.push(new yg(ae))}Y=ke,u[`${L.id}`]=""}catch{Y={error:`Error processing genome align track with id ${L.id}: Error`}}})),o[`${L.id}`]={name:L.name,records:Y,query:L.querygenome,id:L.id,trackModel:L,metadata:L.metadata,isBigChain:!1}}));let $=[];for(const L in o)"error"in o[L].records||$.push(o[L]);let F=new Vm(n.primaryGenName).multiAlign(q,$);for(let L in F){let G;if(!h){G=[].concat.apply([],F[`${L}`].drawData.map(ue=>ue.segments));const se=G.map(ue=>ue.record.queryStrand),pe=G.map(ue=>ue.targetXSpan),ke=G.map(ue=>ue.queryXSpan),ae=G.map(ue=>ue.visiblePart.getLocus().toString()),ge=G.map(ue=>ue.visiblePart.getQueryLocus().toString()),_e=G.map(ue=>Ji(ue.visiblePart.getLength())),Xe=G.map(ue=>Ji(ue.visiblePart.getQueryLocus().getLength()));let le={};le={strandList:se,targetXSpanList:pe,queryXSpanList:ke,targetLocusList:ae,queryLocusList:ge,lengthList:_e,queryLengthList:Xe},F[`${L}`]={...F[`${L}`],...le}}for(let se=0;se<F[`${L}`].drawData.length;se++){let pe=F[`${L}`].drawData[se],ke={};const{targetXSpan:ae}=pe;if(h){const ge=pe.visiblePart.getTargetSequence(),_e=pe.visiblePart.getQuerySequence(),Xe=ae.getLength()/ge.length,le=pe.visiblePart.getLocus().toString(),ue=pe.visiblePart.getQueryLocus().toString(),fe=pe.visiblePart.getQueryLocusFine(),Ee=pe.targetSegments.filter(ot=>!ot.isGap),ve=pe.querySegments.filter(ot=>!ot.isGap),qe=pe.record.getIsReverseStrandQuery();ke={targetSequence:ge,querySequence:_e,nonGapsQuery:ve,baseWidth:Xe,targetLocus:le,queryLocus:ue,nonGapsTarget:Ee,isReverseStrandQuery:qe,queryLocusFine:fe}}else ke={estimatedLabelWidth:pe.queryFeature.toString().length};F[`${L}`].drawData[se]={...pe,...ke}}let Y=[],ne=F[`${L}`].queryRegion._navContext._featuresForChr;for(let se in ne)if(se!==""){let pe=m(ne[`${se}`][0].name).start,ke=m(ne[`${se}`][ne[`${se}`].length-1].name).end;Y.push({chr:se,start:pe,end:ke})}f[`${v}`].primaryVisData=F[`${L}`].primaryVisData,f[`${L}`]={queryGenomicCoord:new Array(Y),id:F[`${L}`].id,queryRegion:F[`${L}`].queryRegion},o[`${F[`${L}`].id}`].records=F[`${L}`]}}function m(I){const[S,T]=I.split(":"),[N,Z]=T.split("-"),P=S.slice(3),k=parseInt(N,10),M=parseInt(Z,10);return{chr:P,start:k,end:M}}return{fetchResults:o,navData:{...n,genomicFetchCoord:f,trackToDrawId:u,regionSetStartBp:n.visData.visRegion._endBase-n.visData.visRegion._startBase===n.bpRegionSize?0:null}}}typeof self<"u"&&"postMessage"in self&&"onmessage"in self&&typeof self.importScripts<"u"&&(self.onmessage=async n=>{try{const e=await Ym(n.data);postMessage(e)}catch(e){console.error("Worker error:",e),postMessage({error:e instanceof Error?e.message:"Unknown error"})}})})();