wuepgg3-track 2.1.5 → 3.0.0

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.
Files changed (45) hide show
  1. package/dist/{SharedSystems-DtNL-LrX.mjs → SharedSystems-lo30UJjL.mjs} +3 -3
  2. package/dist/{WebGLRenderer-DlWk4aSQ.mjs → WebGLRenderer-Dg7VLLw-.mjs} +18 -16
  3. package/dist/{WebGPURenderer-DlIhGb58.mjs → WebGPURenderer-FuA3tJ-C.mjs} +33 -30
  4. package/dist/{browserAll-Ch9OEf2Q.mjs → browserAll-DHo9VyBB.mjs} +10 -9
  5. package/dist/{colorToUniform-DLzITdSX.mjs → colorToUniform-BgG3nLnP.mjs} +26 -26
  6. package/dist/components/GenomeView/TrackComponents/DynseqComponents/DynseqTrackComponents.d.ts +0 -8
  7. package/dist/components/GenomeView/TrackComponents/GroupedTrackManager.d.ts +0 -3
  8. package/dist/components/GenomeView/TrackComponents/InteractionComponents/ArcDisplay.d.ts +1 -0
  9. package/dist/components/GenomeView/TrackComponents/InteractionComponents/CubicCurveDisplay.d.ts +1 -0
  10. package/dist/components/GenomeView/TrackComponents/InteractionComponents/SquareDisplay.d.ts +1 -0
  11. package/dist/components/GenomeView/TrackComponents/MethylcComponents/MethylCTrackComputation.d.ts +1 -7
  12. package/dist/components/GenomeView/TrackComponents/QBedComponents/QBedTrackComponents.d.ts +1 -1
  13. package/dist/components/GenomeView/TrackComponents/bedComponents/FiberTrackComponent.d.ts +5 -2
  14. package/dist/components/GenomeView/TrackComponents/commonComponents/numerical/MatplotTrackComponent.d.ts +2 -1
  15. package/dist/components/GenomeView/TrackComponents/commonComponents/numerical/NumericalAggregator.d.ts +1 -2
  16. package/dist/components/GenomeView/TrackComponents/commonComponents/numerical/NumericalTrack.d.ts +1 -1
  17. package/dist/components/GenomeView/TrackComponents/commonComponents/stats/BoxplotTrackComponents.d.ts +0 -12
  18. package/dist/components/GenomeView/TrackComponents/displayModeComponentMap.d.ts +1 -0
  19. package/dist/getRemoteData/BigSourceWorkerGmod.d.ts +5 -3
  20. package/dist/{index-DY2k589f.mjs → index-3ZU44zAW.mjs} +46243 -48121
  21. package/dist/index.es.js +44 -43
  22. package/dist/index.umd.js +252 -257
  23. package/dist/{init-CW9ApwVm.mjs → init-DTztoKjk.mjs} +4 -2
  24. package/dist/models/FeatureAggregator.d.ts +16 -1
  25. package/dist/models/FeatureArranger.d.ts +8 -18
  26. package/dist/models/Rmskv2Feature.d.ts +32 -0
  27. package/dist/models/getXSpan/FeaturePlacer.d.ts +48 -8
  28. package/dist/style.css +1 -1
  29. package/dist/track-container/index.d.ts +1 -1
  30. package/dist/trackConfigs/config-menu-models.tsx/Rmskv2TrackConfig.d.ts +4 -0
  31. package/dist/trackConfigs/config-menu-models.tsx/getTrackConfig.d.ts +2 -0
  32. package/dist/types/track-container.d.ts +3 -0
  33. package/dist/webworkerAll-BIMQLOM-.mjs +2 -0
  34. package/package.json +1 -1
  35. package/dist/assets/fetchDataWorker-B2Xfx9L6.js +0 -59
  36. package/dist/assets/fetchGenomeAlignWorker-CsrbJZgd.js +0 -72
  37. package/dist/getRemoteData/BigSourceWorker.d.ts +0 -47
  38. package/dist/getRemoteData/RepeatSource.d.ts +0 -8
  39. package/dist/getRemoteData/vendor/bbi-js/main/bigwig.d.ts +0 -1
  40. package/dist/getRemoteData/vendor/bbi-js/utils/bin.d.ts +0 -12
  41. package/dist/getRemoteData/vendor/bbi-js/utils/das.d.ts +0 -6
  42. package/dist/getRemoteData/vendor/bbi-js/utils/jszlib.d.ts +0 -1
  43. package/dist/getRemoteData/vendor/bbi-js/utils/sha1.d.ts +0 -1
  44. package/dist/getRemoteData/vendor/bbi-js/utils/spans.d.ts +0 -13
  45. package/dist/webworkerAll-CItaxILk.mjs +0 -2
@@ -1,72 +0,0 @@
1
- var EF=Object.defineProperty;var AF=(vn,wn,fr)=>wn in vn?EF(vn,wn,{enumerable:!0,configurable:!0,writable:!0,value:fr}):vn[wn]=fr;var ge=(vn,wn,fr)=>AF(vn,typeof wn!="symbol"?wn+"":wn,fr);(function(){"use strict";var vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fr={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
- */fr.exports,function(e,n){(function(){var t,a="4.17.21",o=200,s="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,F=2,k=1,L=2,G=4,P=8,T=16,$=32,q=64,N=128,C=256,S=512,O=30,W="...",V=800,te=16,ie=1,le=2,Fe=3,ae=1/0,pe=9007199254740991,_e=17976931348623157e292,Xe=NaN,he=4294967295,se=he-1,fe=he>>>1,Ee=[["ary",N],["bind",k],["bindKey",L],["curry",P],["curryRight",T],["flip",S],["partial",$],["partialRight",q],["rearg",C]],ve="[object Arguments]",qe="[object Array]",ot="[object AsyncFunction]",me="[object Boolean]",Be="[object Date]",Ve="[object DOMException]",ce="[object Error]",Me="[object Function]",Ke="[object GeneratorFunction]",we="[object Map]",Ce="[object Number]",Ae="[object Null]",je="[object Object]",De="[object Promise]",Qe="[object Proxy]",At="[object RegExp]",vt="[object Set]",xt="[object String]",Yt="[object Symbol]",yt="[object Undefined]",nt="[object WeakMap]",wt="[object WeakSet]",Ft="[object ArrayBuffer]",dt="[object DataView]",Dr="[object Float32Array]",E="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",R="[object Int32Array]",H="[object Uint8Array]",K="[object Uint8ClampedArray]",J="[object Uint16Array]",ke="[object Uint32Array]",mt=/\b__p \+= '';/g,ft=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ze=/&(?:amp|lt|gt|quot|#39);/g,Gd=/[&<>"']/g,Kb=RegExp(ze.source),Yb=RegExp(Gd.source),Qb=/<%-([\s\S]+?)%>/g,Jb=/<%([\s\S]+?)%>/g,Hd=/<%=([\s\S]+?)%>/g,jb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zb=/^\w*$/,eD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Af=/[\\^$.*+?()[\]{}|]/g,tD=RegExp(Af.source),Ff=/^\s+/,nD=/\s/,rD=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,iD=/\{\n\/\* \[wrapped with (.+)\] \*/,aD=/,? & /,uD=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,sD=/[()=,{}\[\]\/\s]/,oD=/\\(\\)?/g,fD=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zd=/\w*$/,lD=/^[-+]0x[0-9a-f]+$/i,hD=/^0b[01]+$/i,cD=/^\[object .+?Constructor\]$/,dD=/^0o[0-7]+$/i,gD=/^(?:0|[1-9]\d*)$/,pD=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ts=/($^)/,_D=/['\n\r\u2028\u2029\\]/g,ns="\\ud800-\\udfff",vD="\\u0300-\\u036f",wD="\\ufe20-\\ufe2f",mD="\\u20d0-\\u20ff",Xd=vD+wD+mD,Vd="\\u2700-\\u27bf",Kd="a-z\\xdf-\\xf6\\xf8-\\xff",bD="\\xac\\xb1\\xd7\\xf7",DD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",xD="\\u2000-\\u206f",yD=" \\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",Yd="A-Z\\xc0-\\xd6\\xd8-\\xde",Qd="\\ufe0e\\ufe0f",Jd=bD+DD+xD+yD,Cf="['’]",ED="["+ns+"]",jd="["+Jd+"]",rs="["+Xd+"]",zd="\\d+",AD="["+Vd+"]",e1="["+Kd+"]",t1="[^"+ns+Jd+zd+Vd+Kd+Yd+"]",Bf="\\ud83c[\\udffb-\\udfff]",FD="(?:"+rs+"|"+Bf+")",n1="[^"+ns+"]",Sf="(?:\\ud83c[\\udde6-\\uddff]){2}",If="[\\ud800-\\udbff][\\udc00-\\udfff]",zi="["+Yd+"]",r1="\\u200d",i1="(?:"+e1+"|"+t1+")",CD="(?:"+zi+"|"+t1+")",a1="(?:"+Cf+"(?:d|ll|m|re|s|t|ve))?",u1="(?:"+Cf+"(?:D|LL|M|RE|S|T|VE))?",s1=FD+"?",o1="["+Qd+"]?",BD="(?:"+r1+"(?:"+[n1,Sf,If].join("|")+")"+o1+s1+")*",SD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ID="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",f1=o1+s1+BD,TD="(?:"+[AD,Sf,If].join("|")+")"+f1,kD="(?:"+[n1+rs+"?",rs,Sf,If,ED].join("|")+")",RD=RegExp(Cf,"g"),LD=RegExp(rs,"g"),Tf=RegExp(Bf+"(?="+Bf+")|"+kD+f1,"g"),ND=RegExp([zi+"?"+e1+"+"+a1+"(?="+[jd,zi,"$"].join("|")+")",CD+"+"+u1+"(?="+[jd,zi+i1,"$"].join("|")+")",zi+"?"+i1+"+"+a1,zi+"+"+u1,ID,SD,zd,TD].join("|"),"g"),OD=RegExp("["+r1+ns+Xd+Qd+"]"),MD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,PD=["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"],$D=-1,gt={};gt[Dr]=gt[E]=gt[_]=gt[w]=gt[R]=gt[H]=gt[K]=gt[J]=gt[ke]=!0,gt[ve]=gt[qe]=gt[Ft]=gt[me]=gt[dt]=gt[Be]=gt[ce]=gt[Me]=gt[we]=gt[Ce]=gt[je]=gt[At]=gt[vt]=gt[xt]=gt[nt]=!1;var lt={};lt[ve]=lt[qe]=lt[Ft]=lt[dt]=lt[me]=lt[Be]=lt[Dr]=lt[E]=lt[_]=lt[w]=lt[R]=lt[we]=lt[Ce]=lt[je]=lt[At]=lt[vt]=lt[xt]=lt[Yt]=lt[H]=lt[K]=lt[J]=lt[ke]=!0,lt[ce]=lt[Me]=lt[nt]=!1;var UD={À:"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"},WD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qD={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},GD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HD=parseFloat,ZD=parseInt,l1=typeof vn=="object"&&vn&&vn.Object===Object&&vn,XD=typeof self=="object"&&self&&self.Object===Object&&self,qt=l1||XD||Function("return this")(),kf=n&&!n.nodeType&&n,Di=kf&&!0&&e&&!e.nodeType&&e,h1=Di&&Di.exports===kf,Rf=h1&&l1.process,Tn=function(){try{var Z=Di&&Di.require&&Di.require("util").types;return Z||Rf&&Rf.binding&&Rf.binding("util")}catch{}}(),c1=Tn&&Tn.isArrayBuffer,d1=Tn&&Tn.isDate,g1=Tn&&Tn.isMap,p1=Tn&&Tn.isRegExp,_1=Tn&&Tn.isSet,v1=Tn&&Tn.isTypedArray;function hn(Z,Q,Y){switch(Y.length){case 0:return Z.call(Q);case 1:return Z.call(Q,Y[0]);case 2:return Z.call(Q,Y[0],Y[1]);case 3:return Z.call(Q,Y[0],Y[1],Y[2])}return Z.apply(Q,Y)}function VD(Z,Q,Y,oe){for(var Se=-1,Je=Z==null?0:Z.length;++Se<Je;){var Ot=Z[Se];Q(oe,Ot,Y(Ot),Z)}return oe}function kn(Z,Q){for(var Y=-1,oe=Z==null?0:Z.length;++Y<oe&&Q(Z[Y],Y,Z)!==!1;);return Z}function KD(Z,Q){for(var Y=Z==null?0:Z.length;Y--&&Q(Z[Y],Y,Z)!==!1;);return Z}function w1(Z,Q){for(var Y=-1,oe=Z==null?0:Z.length;++Y<oe;)if(!Q(Z[Y],Y,Z))return!1;return!0}function Hr(Z,Q){for(var Y=-1,oe=Z==null?0:Z.length,Se=0,Je=[];++Y<oe;){var Ot=Z[Y];Q(Ot,Y,Z)&&(Je[Se++]=Ot)}return Je}function is(Z,Q){var Y=Z==null?0:Z.length;return!!Y&&ea(Z,Q,0)>-1}function Lf(Z,Q,Y){for(var oe=-1,Se=Z==null?0:Z.length;++oe<Se;)if(Y(Q,Z[oe]))return!0;return!1}function Dt(Z,Q){for(var Y=-1,oe=Z==null?0:Z.length,Se=Array(oe);++Y<oe;)Se[Y]=Q(Z[Y],Y,Z);return Se}function Zr(Z,Q){for(var Y=-1,oe=Q.length,Se=Z.length;++Y<oe;)Z[Se+Y]=Q[Y];return Z}function Nf(Z,Q,Y,oe){var Se=-1,Je=Z==null?0:Z.length;for(oe&&Je&&(Y=Z[++Se]);++Se<Je;)Y=Q(Y,Z[Se],Se,Z);return Y}function YD(Z,Q,Y,oe){var Se=Z==null?0:Z.length;for(oe&&Se&&(Y=Z[--Se]);Se--;)Y=Q(Y,Z[Se],Se,Z);return Y}function Of(Z,Q){for(var Y=-1,oe=Z==null?0:Z.length;++Y<oe;)if(Q(Z[Y],Y,Z))return!0;return!1}var QD=Mf("length");function JD(Z){return Z.split("")}function jD(Z){return Z.match(uD)||[]}function m1(Z,Q,Y){var oe;return Y(Z,function(Se,Je,Ot){if(Q(Se,Je,Ot))return oe=Je,!1}),oe}function as(Z,Q,Y,oe){for(var Se=Z.length,Je=Y+(oe?1:-1);oe?Je--:++Je<Se;)if(Q(Z[Je],Je,Z))return Je;return-1}function ea(Z,Q,Y){return Q===Q?lx(Z,Q,Y):as(Z,b1,Y)}function zD(Z,Q,Y,oe){for(var Se=Y-1,Je=Z.length;++Se<Je;)if(oe(Z[Se],Q))return Se;return-1}function b1(Z){return Z!==Z}function D1(Z,Q){var Y=Z==null?0:Z.length;return Y?$f(Z,Q)/Y:Xe}function Mf(Z){return function(Q){return Q==null?t:Q[Z]}}function Pf(Z){return function(Q){return Z==null?t:Z[Q]}}function x1(Z,Q,Y,oe,Se){return Se(Z,function(Je,Ot,rt){Y=oe?(oe=!1,Je):Q(Y,Je,Ot,rt)}),Y}function ex(Z,Q){var Y=Z.length;for(Z.sort(Q);Y--;)Z[Y]=Z[Y].value;return Z}function $f(Z,Q){for(var Y,oe=-1,Se=Z.length;++oe<Se;){var Je=Q(Z[oe]);Je!==t&&(Y=Y===t?Je:Y+Je)}return Y}function Uf(Z,Q){for(var Y=-1,oe=Array(Z);++Y<Z;)oe[Y]=Q(Y);return oe}function tx(Z,Q){return Dt(Q,function(Y){return[Y,Z[Y]]})}function y1(Z){return Z&&Z.slice(0,C1(Z)+1).replace(Ff,"")}function cn(Z){return function(Q){return Z(Q)}}function Wf(Z,Q){return Dt(Q,function(Y){return Z[Y]})}function Ka(Z,Q){return Z.has(Q)}function E1(Z,Q){for(var Y=-1,oe=Z.length;++Y<oe&&ea(Q,Z[Y],0)>-1;);return Y}function A1(Z,Q){for(var Y=Z.length;Y--&&ea(Q,Z[Y],0)>-1;);return Y}function nx(Z,Q){for(var Y=Z.length,oe=0;Y--;)Z[Y]===Q&&++oe;return oe}var rx=Pf(UD),ix=Pf(WD);function ax(Z){return"\\"+GD[Z]}function ux(Z,Q){return Z==null?t:Z[Q]}function ta(Z){return OD.test(Z)}function sx(Z){return MD.test(Z)}function ox(Z){for(var Q,Y=[];!(Q=Z.next()).done;)Y.push(Q.value);return Y}function qf(Z){var Q=-1,Y=Array(Z.size);return Z.forEach(function(oe,Se){Y[++Q]=[Se,oe]}),Y}function F1(Z,Q){return function(Y){return Z(Q(Y))}}function Xr(Z,Q){for(var Y=-1,oe=Z.length,Se=0,Je=[];++Y<oe;){var Ot=Z[Y];(Ot===Q||Ot===c)&&(Z[Y]=c,Je[Se++]=Y)}return Je}function us(Z){var Q=-1,Y=Array(Z.size);return Z.forEach(function(oe){Y[++Q]=oe}),Y}function fx(Z){var Q=-1,Y=Array(Z.size);return Z.forEach(function(oe){Y[++Q]=[oe,oe]}),Y}function lx(Z,Q,Y){for(var oe=Y-1,Se=Z.length;++oe<Se;)if(Z[oe]===Q)return oe;return-1}function hx(Z,Q,Y){for(var oe=Y+1;oe--;)if(Z[oe]===Q)return oe;return oe}function na(Z){return ta(Z)?dx(Z):QD(Z)}function Zn(Z){return ta(Z)?gx(Z):JD(Z)}function C1(Z){for(var Q=Z.length;Q--&&nD.test(Z.charAt(Q)););return Q}var cx=Pf(qD);function dx(Z){for(var Q=Tf.lastIndex=0;Tf.test(Z);)++Q;return Q}function gx(Z){return Z.match(Tf)||[]}function px(Z){return Z.match(ND)||[]}var _x=function Z(Q){Q=Q==null?qt:ra.defaults(qt.Object(),Q,ra.pick(qt,PD));var Y=Q.Array,oe=Q.Date,Se=Q.Error,Je=Q.Function,Ot=Q.Math,rt=Q.Object,Gf=Q.RegExp,vx=Q.String,Rn=Q.TypeError,ss=Y.prototype,wx=Je.prototype,ia=rt.prototype,os=Q["__core-js_shared__"],fs=wx.toString,tt=ia.hasOwnProperty,mx=0,B1=function(){var i=/[^.]+$/.exec(os&&os.keys&&os.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),ls=ia.toString,bx=fs.call(rt),Dx=qt._,xx=Gf("^"+fs.call(tt).replace(Af,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hs=h1?Q.Buffer:t,Vr=Q.Symbol,cs=Q.Uint8Array,S1=hs?hs.allocUnsafe:t,ds=F1(rt.getPrototypeOf,rt),I1=rt.create,T1=ia.propertyIsEnumerable,gs=ss.splice,k1=Vr?Vr.isConcatSpreadable:t,Ya=Vr?Vr.iterator:t,xi=Vr?Vr.toStringTag:t,ps=function(){try{var i=Ci(rt,"defineProperty");return i({},"",{}),i}catch{}}(),yx=Q.clearTimeout!==qt.clearTimeout&&Q.clearTimeout,Ex=oe&&oe.now!==qt.Date.now&&oe.now,Ax=Q.setTimeout!==qt.setTimeout&&Q.setTimeout,_s=Ot.ceil,vs=Ot.floor,Hf=rt.getOwnPropertySymbols,Fx=hs?hs.isBuffer:t,R1=Q.isFinite,Cx=ss.join,Bx=F1(rt.keys,rt),Mt=Ot.max,Ht=Ot.min,Sx=oe.now,Ix=Q.parseInt,L1=Ot.random,Tx=ss.reverse,Zf=Ci(Q,"DataView"),Qa=Ci(Q,"Map"),Xf=Ci(Q,"Promise"),aa=Ci(Q,"Set"),Ja=Ci(Q,"WeakMap"),ja=Ci(rt,"create"),ws=Ja&&new Ja,ua={},kx=Bi(Zf),Rx=Bi(Qa),Lx=Bi(Xf),Nx=Bi(aa),Ox=Bi(Ja),ms=Vr?Vr.prototype:t,za=ms?ms.valueOf:t,N1=ms?ms.toString:t;function A(i){if(Ct(i)&&!Te(i)&&!(i instanceof Ue)){if(i instanceof Ln)return i;if(tt.call(i,"__wrapped__"))return Og(i)}return new Ln(i)}var sa=function(){function i(){}return function(u){if(!Et(u))return{};if(I1)return I1(u);i.prototype=u;var l=new i;return i.prototype=t,l}}();function bs(){}function Ln(i,u){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}A.templateSettings={escape:Qb,evaluate:Jb,interpolate:Hd,variable:"",imports:{_:A}},A.prototype=bs.prototype,A.prototype.constructor=A,Ln.prototype=sa(bs.prototype),Ln.prototype.constructor=Ln;function Ue(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function Mx(){var i=new Ue(this.__wrapped__);return i.__actions__=rn(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=rn(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=rn(this.__views__),i}function Px(){if(this.__filtered__){var i=new Ue(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function $x(){var i=this.__wrapped__.value(),u=this.__dir__,l=Te(i),p=u<0,x=l?i.length:0,B=Jy(0,x,this.__views__),M=B.start,U=B.end,X=U-M,j=p?U:M-1,z=this.__iteratees__,ne=z.length,ue=0,de=Ht(X,this.__takeCount__);if(!l||!p&&x==X&&de==X)return ag(i,this.__actions__);var xe=[];e:for(;X--&&ue<de;){j+=u;for(var Ne=-1,ye=i[j];++Ne<ne;){var Pe=z[Ne],Ge=Pe.iteratee,pn=Pe.type,jt=Ge(ye);if(pn==le)ye=jt;else if(!jt){if(pn==ie)continue e;break e}}xe[ue++]=ye}return xe}Ue.prototype=sa(bs.prototype),Ue.prototype.constructor=Ue;function yi(i){var u=-1,l=i==null?0:i.length;for(this.clear();++u<l;){var p=i[u];this.set(p[0],p[1])}}function Ux(){this.__data__=ja?ja(null):{},this.size=0}function Wx(i){var u=this.has(i)&&delete this.__data__[i];return this.size-=u?1:0,u}function qx(i){var u=this.__data__;if(ja){var l=u[i];return l===v?t:l}return tt.call(u,i)?u[i]:t}function Gx(i){var u=this.__data__;return ja?u[i]!==t:tt.call(u,i)}function Hx(i,u){var l=this.__data__;return this.size+=this.has(i)?0:1,l[i]=ja&&u===t?v:u,this}yi.prototype.clear=Ux,yi.prototype.delete=Wx,yi.prototype.get=qx,yi.prototype.has=Gx,yi.prototype.set=Hx;function xr(i){var u=-1,l=i==null?0:i.length;for(this.clear();++u<l;){var p=i[u];this.set(p[0],p[1])}}function Zx(){this.__data__=[],this.size=0}function Xx(i){var u=this.__data__,l=Ds(u,i);if(l<0)return!1;var p=u.length-1;return l==p?u.pop():gs.call(u,l,1),--this.size,!0}function Vx(i){var u=this.__data__,l=Ds(u,i);return l<0?t:u[l][1]}function Kx(i){return Ds(this.__data__,i)>-1}function Yx(i,u){var l=this.__data__,p=Ds(l,i);return p<0?(++this.size,l.push([i,u])):l[p][1]=u,this}xr.prototype.clear=Zx,xr.prototype.delete=Xx,xr.prototype.get=Vx,xr.prototype.has=Kx,xr.prototype.set=Yx;function yr(i){var u=-1,l=i==null?0:i.length;for(this.clear();++u<l;){var p=i[u];this.set(p[0],p[1])}}function Qx(){this.size=0,this.__data__={hash:new yi,map:new(Qa||xr),string:new yi}}function Jx(i){var u=Rs(this,i).delete(i);return this.size-=u?1:0,u}function jx(i){return Rs(this,i).get(i)}function zx(i){return Rs(this,i).has(i)}function ey(i,u){var l=Rs(this,i),p=l.size;return l.set(i,u),this.size+=l.size==p?0:1,this}yr.prototype.clear=Qx,yr.prototype.delete=Jx,yr.prototype.get=jx,yr.prototype.has=zx,yr.prototype.set=ey;function Ei(i){var u=-1,l=i==null?0:i.length;for(this.__data__=new yr;++u<l;)this.add(i[u])}function ty(i){return this.__data__.set(i,v),this}function ny(i){return this.__data__.has(i)}Ei.prototype.add=Ei.prototype.push=ty,Ei.prototype.has=ny;function Xn(i){var u=this.__data__=new xr(i);this.size=u.size}function ry(){this.__data__=new xr,this.size=0}function iy(i){var u=this.__data__,l=u.delete(i);return this.size=u.size,l}function ay(i){return this.__data__.get(i)}function uy(i){return this.__data__.has(i)}function sy(i,u){var l=this.__data__;if(l instanceof xr){var p=l.__data__;if(!Qa||p.length<o-1)return p.push([i,u]),this.size=++l.size,this;l=this.__data__=new yr(p)}return l.set(i,u),this.size=l.size,this}Xn.prototype.clear=ry,Xn.prototype.delete=iy,Xn.prototype.get=ay,Xn.prototype.has=uy,Xn.prototype.set=sy;function O1(i,u){var l=Te(i),p=!l&&Si(i),x=!l&&!p&&jr(i),B=!l&&!p&&!x&&ha(i),M=l||p||x||B,U=M?Uf(i.length,vx):[],X=U.length;for(var j in i)(u||tt.call(i,j))&&!(M&&(j=="length"||x&&(j=="offset"||j=="parent")||B&&(j=="buffer"||j=="byteLength"||j=="byteOffset")||Cr(j,X)))&&U.push(j);return U}function M1(i){var u=i.length;return u?i[rl(0,u-1)]:t}function oy(i,u){return Ls(rn(i),Ai(u,0,i.length))}function fy(i){return Ls(rn(i))}function Vf(i,u,l){(l!==t&&!Vn(i[u],l)||l===t&&!(u in i))&&Er(i,u,l)}function eu(i,u,l){var p=i[u];(!(tt.call(i,u)&&Vn(p,l))||l===t&&!(u in i))&&Er(i,u,l)}function Ds(i,u){for(var l=i.length;l--;)if(Vn(i[l][0],u))return l;return-1}function ly(i,u,l,p){return Kr(i,function(x,B,M){u(p,x,l(x),M)}),p}function P1(i,u){return i&&sr(u,$t(u),i)}function hy(i,u){return i&&sr(u,un(u),i)}function Er(i,u,l){u=="__proto__"&&ps?ps(i,u,{configurable:!0,enumerable:!0,value:l,writable:!0}):i[u]=l}function Kf(i,u){for(var l=-1,p=u.length,x=Y(p),B=i==null;++l<p;)x[l]=B?t:Bl(i,u[l]);return x}function Ai(i,u,l){return i===i&&(l!==t&&(i=i<=l?i:l),u!==t&&(i=i>=u?i:u)),i}function Nn(i,u,l,p,x,B){var M,U=u&D,X=u&y,j=u&m;if(l&&(M=x?l(i,p,x,B):l(i)),M!==t)return M;if(!Et(i))return i;var z=Te(i);if(z){if(M=zy(i),!U)return rn(i,M)}else{var ne=Zt(i),ue=ne==Me||ne==Ke;if(jr(i))return og(i,U);if(ne==je||ne==ve||ue&&!x){if(M=X||ue?{}:Cg(i),!U)return X?qy(i,hy(M,i)):Wy(i,P1(M,i))}else{if(!lt[ne])return x?i:{};M=e8(i,ne,U)}}B||(B=new Xn);var de=B.get(i);if(de)return de;B.set(i,M),np(i)?i.forEach(function(ye){M.add(Nn(ye,u,l,ye,i,B))}):ep(i)&&i.forEach(function(ye,Pe){M.set(Pe,Nn(ye,u,l,Pe,i,B))});var xe=j?X?gl:dl:X?un:$t,Ne=z?t:xe(i);return kn(Ne||i,function(ye,Pe){Ne&&(Pe=ye,ye=i[Pe]),eu(M,Pe,Nn(ye,u,l,Pe,i,B))}),M}function cy(i){var u=$t(i);return function(l){return $1(l,i,u)}}function $1(i,u,l){var p=l.length;if(i==null)return!p;for(i=rt(i);p--;){var x=l[p],B=u[x],M=i[x];if(M===t&&!(x in i)||!B(M))return!1}return!0}function U1(i,u,l){if(typeof i!="function")throw new Rn(f);return su(function(){i.apply(t,l)},u)}function tu(i,u,l,p){var x=-1,B=is,M=!0,U=i.length,X=[],j=u.length;if(!U)return X;l&&(u=Dt(u,cn(l))),p?(B=Lf,M=!1):u.length>=o&&(B=Ka,M=!1,u=new Ei(u));e:for(;++x<U;){var z=i[x],ne=l==null?z:l(z);if(z=p||z!==0?z:0,M&&ne===ne){for(var ue=j;ue--;)if(u[ue]===ne)continue e;X.push(z)}else B(u,ne,p)||X.push(z)}return X}var Kr=dg(ur),W1=dg(Qf,!0);function dy(i,u){var l=!0;return Kr(i,function(p,x,B){return l=!!u(p,x,B),l}),l}function xs(i,u,l){for(var p=-1,x=i.length;++p<x;){var B=i[p],M=u(B);if(M!=null&&(U===t?M===M&&!gn(M):l(M,U)))var U=M,X=B}return X}function gy(i,u,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:ip(p);l<p;)i[l++]=u;return i}function q1(i,u){var l=[];return Kr(i,function(p,x,B){u(p,x,B)&&l.push(p)}),l}function Gt(i,u,l,p,x){var B=-1,M=i.length;for(l||(l=n8),x||(x=[]);++B<M;){var U=i[B];u>0&&l(U)?u>1?Gt(U,u-1,l,p,x):Zr(x,U):p||(x[x.length]=U)}return x}var Yf=gg(),G1=gg(!0);function ur(i,u){return i&&Yf(i,u,$t)}function Qf(i,u){return i&&G1(i,u,$t)}function ys(i,u){return Hr(u,function(l){return Br(i[l])})}function Fi(i,u){u=Qr(u,i);for(var l=0,p=u.length;i!=null&&l<p;)i=i[or(u[l++])];return l&&l==p?i:t}function H1(i,u,l){var p=u(i);return Te(i)?p:Zr(p,l(i))}function Qt(i){return i==null?i===t?yt:Ae:xi&&xi in rt(i)?Qy(i):f8(i)}function Jf(i,u){return i>u}function py(i,u){return i!=null&&tt.call(i,u)}function _y(i,u){return i!=null&&u in rt(i)}function vy(i,u,l){return i>=Ht(u,l)&&i<Mt(u,l)}function jf(i,u,l){for(var p=l?Lf:is,x=i[0].length,B=i.length,M=B,U=Y(B),X=1/0,j=[];M--;){var z=i[M];M&&u&&(z=Dt(z,cn(u))),X=Ht(z.length,X),U[M]=!l&&(u||x>=120&&z.length>=120)?new Ei(M&&z):t}z=i[0];var ne=-1,ue=U[0];e:for(;++ne<x&&j.length<X;){var de=z[ne],xe=u?u(de):de;if(de=l||de!==0?de:0,!(ue?Ka(ue,xe):p(j,xe,l))){for(M=B;--M;){var Ne=U[M];if(!(Ne?Ka(Ne,xe):p(i[M],xe,l)))continue e}ue&&ue.push(xe),j.push(de)}}return j}function wy(i,u,l,p){return ur(i,function(x,B,M){u(p,l(x),B,M)}),p}function nu(i,u,l){u=Qr(u,i),i=Tg(i,u);var p=i==null?i:i[or(Mn(u))];return p==null?t:hn(p,i,l)}function Z1(i){return Ct(i)&&Qt(i)==ve}function my(i){return Ct(i)&&Qt(i)==Ft}function by(i){return Ct(i)&&Qt(i)==Be}function ru(i,u,l,p,x){return i===u?!0:i==null||u==null||!Ct(i)&&!Ct(u)?i!==i&&u!==u:Dy(i,u,l,p,ru,x)}function Dy(i,u,l,p,x,B){var M=Te(i),U=Te(u),X=M?qe:Zt(i),j=U?qe:Zt(u);X=X==ve?je:X,j=j==ve?je:j;var z=X==je,ne=j==je,ue=X==j;if(ue&&jr(i)){if(!jr(u))return!1;M=!0,z=!1}if(ue&&!z)return B||(B=new Xn),M||ha(i)?Eg(i,u,l,p,x,B):Ky(i,u,X,l,p,x,B);if(!(l&I)){var de=z&&tt.call(i,"__wrapped__"),xe=ne&&tt.call(u,"__wrapped__");if(de||xe){var Ne=de?i.value():i,ye=xe?u.value():u;return B||(B=new Xn),x(Ne,ye,l,p,B)}}return ue?(B||(B=new Xn),Yy(i,u,l,p,x,B)):!1}function xy(i){return Ct(i)&&Zt(i)==we}function zf(i,u,l,p){var x=l.length,B=x,M=!p;if(i==null)return!B;for(i=rt(i);x--;){var U=l[x];if(M&&U[2]?U[1]!==i[U[0]]:!(U[0]in i))return!1}for(;++x<B;){U=l[x];var X=U[0],j=i[X],z=U[1];if(M&&U[2]){if(j===t&&!(X in i))return!1}else{var ne=new Xn;if(p)var ue=p(j,z,X,i,u,ne);if(!(ue===t?ru(z,j,I|F,p,ne):ue))return!1}}return!0}function X1(i){if(!Et(i)||i8(i))return!1;var u=Br(i)?xx:cD;return u.test(Bi(i))}function yy(i){return Ct(i)&&Qt(i)==At}function Ey(i){return Ct(i)&&Zt(i)==vt}function Ay(i){return Ct(i)&&Us(i.length)&&!!gt[Qt(i)]}function V1(i){return typeof i=="function"?i:i==null?sn:typeof i=="object"?Te(i)?Q1(i[0],i[1]):Y1(i):pp(i)}function el(i){if(!uu(i))return Bx(i);var u=[];for(var l in rt(i))tt.call(i,l)&&l!="constructor"&&u.push(l);return u}function Fy(i){if(!Et(i))return o8(i);var u=uu(i),l=[];for(var p in i)p=="constructor"&&(u||!tt.call(i,p))||l.push(p);return l}function tl(i,u){return i<u}function K1(i,u){var l=-1,p=an(i)?Y(i.length):[];return Kr(i,function(x,B,M){p[++l]=u(x,B,M)}),p}function Y1(i){var u=_l(i);return u.length==1&&u[0][2]?Sg(u[0][0],u[0][1]):function(l){return l===i||zf(l,i,u)}}function Q1(i,u){return wl(i)&&Bg(u)?Sg(or(i),u):function(l){var p=Bl(l,i);return p===t&&p===u?Sl(l,i):ru(u,p,I|F)}}function Es(i,u,l,p,x){i!==u&&Yf(u,function(B,M){if(x||(x=new Xn),Et(B))Cy(i,u,M,l,Es,p,x);else{var U=p?p(bl(i,M),B,M+"",i,u,x):t;U===t&&(U=B),Vf(i,M,U)}},un)}function Cy(i,u,l,p,x,B,M){var U=bl(i,l),X=bl(u,l),j=M.get(X);if(j){Vf(i,l,j);return}var z=B?B(U,X,l+"",i,u,M):t,ne=z===t;if(ne){var ue=Te(X),de=!ue&&jr(X),xe=!ue&&!de&&ha(X);z=X,ue||de||xe?Te(U)?z=U:Tt(U)?z=rn(U):de?(ne=!1,z=og(X,!0)):xe?(ne=!1,z=fg(X,!0)):z=[]:ou(X)||Si(X)?(z=U,Si(U)?z=ap(U):(!Et(U)||Br(U))&&(z=Cg(X))):ne=!1}ne&&(M.set(X,z),x(z,X,p,B,M),M.delete(X)),Vf(i,l,z)}function J1(i,u){var l=i.length;if(l)return u+=u<0?l:0,Cr(u,l)?i[u]:t}function j1(i,u,l){u.length?u=Dt(u,function(B){return Te(B)?function(M){return Fi(M,B.length===1?B[0]:B)}:B}):u=[sn];var p=-1;u=Dt(u,cn(be()));var x=K1(i,function(B,M,U){var X=Dt(u,function(j){return j(B)});return{criteria:X,index:++p,value:B}});return ex(x,function(B,M){return Uy(B,M,l)})}function By(i,u){return z1(i,u,function(l,p){return Sl(i,p)})}function z1(i,u,l){for(var p=-1,x=u.length,B={};++p<x;){var M=u[p],U=Fi(i,M);l(U,M)&&iu(B,Qr(M,i),U)}return B}function Sy(i){return function(u){return Fi(u,i)}}function nl(i,u,l,p){var x=p?zD:ea,B=-1,M=u.length,U=i;for(i===u&&(u=rn(u)),l&&(U=Dt(i,cn(l)));++B<M;)for(var X=0,j=u[B],z=l?l(j):j;(X=x(U,z,X,p))>-1;)U!==i&&gs.call(U,X,1),gs.call(i,X,1);return i}function eg(i,u){for(var l=i?u.length:0,p=l-1;l--;){var x=u[l];if(l==p||x!==B){var B=x;Cr(x)?gs.call(i,x,1):ul(i,x)}}return i}function rl(i,u){return i+vs(L1()*(u-i+1))}function Iy(i,u,l,p){for(var x=-1,B=Mt(_s((u-i)/(l||1)),0),M=Y(B);B--;)M[p?B:++x]=i,i+=l;return M}function il(i,u){var l="";if(!i||u<1||u>pe)return l;do u%2&&(l+=i),u=vs(u/2),u&&(i+=i);while(u);return l}function Oe(i,u){return Dl(Ig(i,u,sn),i+"")}function Ty(i){return M1(ca(i))}function ky(i,u){var l=ca(i);return Ls(l,Ai(u,0,l.length))}function iu(i,u,l,p){if(!Et(i))return i;u=Qr(u,i);for(var x=-1,B=u.length,M=B-1,U=i;U!=null&&++x<B;){var X=or(u[x]),j=l;if(X==="__proto__"||X==="constructor"||X==="prototype")return i;if(x!=M){var z=U[X];j=p?p(z,X,U):t,j===t&&(j=Et(z)?z:Cr(u[x+1])?[]:{})}eu(U,X,j),U=U[X]}return i}var tg=ws?function(i,u){return ws.set(i,u),i}:sn,Ry=ps?function(i,u){return ps(i,"toString",{configurable:!0,enumerable:!1,value:Tl(u),writable:!0})}:sn;function Ly(i){return Ls(ca(i))}function On(i,u,l){var p=-1,x=i.length;u<0&&(u=-u>x?0:x+u),l=l>x?x:l,l<0&&(l+=x),x=u>l?0:l-u>>>0,u>>>=0;for(var B=Y(x);++p<x;)B[p]=i[p+u];return B}function Ny(i,u){var l;return Kr(i,function(p,x,B){return l=u(p,x,B),!l}),!!l}function As(i,u,l){var p=0,x=i==null?p:i.length;if(typeof u=="number"&&u===u&&x<=fe){for(;p<x;){var B=p+x>>>1,M=i[B];M!==null&&!gn(M)&&(l?M<=u:M<u)?p=B+1:x=B}return x}return al(i,u,sn,l)}function al(i,u,l,p){var x=0,B=i==null?0:i.length;if(B===0)return 0;u=l(u);for(var M=u!==u,U=u===null,X=gn(u),j=u===t;x<B;){var z=vs((x+B)/2),ne=l(i[z]),ue=ne!==t,de=ne===null,xe=ne===ne,Ne=gn(ne);if(M)var ye=p||xe;else j?ye=xe&&(p||ue):U?ye=xe&&ue&&(p||!de):X?ye=xe&&ue&&!de&&(p||!Ne):de||Ne?ye=!1:ye=p?ne<=u:ne<u;ye?x=z+1:B=z}return Ht(B,se)}function ng(i,u){for(var l=-1,p=i.length,x=0,B=[];++l<p;){var M=i[l],U=u?u(M):M;if(!l||!Vn(U,X)){var X=U;B[x++]=M===0?0:M}}return B}function rg(i){return typeof i=="number"?i:gn(i)?Xe:+i}function dn(i){if(typeof i=="string")return i;if(Te(i))return Dt(i,dn)+"";if(gn(i))return N1?N1.call(i):"";var u=i+"";return u=="0"&&1/i==-ae?"-0":u}function Yr(i,u,l){var p=-1,x=is,B=i.length,M=!0,U=[],X=U;if(l)M=!1,x=Lf;else if(B>=o){var j=u?null:Xy(i);if(j)return us(j);M=!1,x=Ka,X=new Ei}else X=u?[]:U;e:for(;++p<B;){var z=i[p],ne=u?u(z):z;if(z=l||z!==0?z:0,M&&ne===ne){for(var ue=X.length;ue--;)if(X[ue]===ne)continue e;u&&X.push(ne),U.push(z)}else x(X,ne,l)||(X!==U&&X.push(ne),U.push(z))}return U}function ul(i,u){return u=Qr(u,i),i=Tg(i,u),i==null||delete i[or(Mn(u))]}function ig(i,u,l,p){return iu(i,u,l(Fi(i,u)),p)}function Fs(i,u,l,p){for(var x=i.length,B=p?x:-1;(p?B--:++B<x)&&u(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 ag(i,u){var l=i;return l instanceof Ue&&(l=l.value()),Nf(u,function(p,x){return x.func.apply(x.thisArg,Zr([p],x.args))},l)}function sl(i,u,l){var p=i.length;if(p<2)return p?Yr(i[0]):[];for(var x=-1,B=Y(p);++x<p;)for(var M=i[x],U=-1;++U<p;)U!=x&&(B[x]=tu(B[x]||M,i[U],u,l));return Yr(Gt(B,1),u,l)}function ug(i,u,l){for(var p=-1,x=i.length,B=u.length,M={};++p<x;){var U=p<B?u[p]:t;l(M,i[p],U)}return M}function ol(i){return Tt(i)?i:[]}function fl(i){return typeof i=="function"?i:sn}function Qr(i,u){return Te(i)?i:wl(i,u)?[i]:Ng(et(i))}var Oy=Oe;function Jr(i,u,l){var p=i.length;return l=l===t?p:l,!u&&l>=p?i:On(i,u,l)}var sg=yx||function(i){return qt.clearTimeout(i)};function og(i,u){if(u)return i.slice();var l=i.length,p=S1?S1(l):new i.constructor(l);return i.copy(p),p}function ll(i){var u=new i.constructor(i.byteLength);return new cs(u).set(new cs(i)),u}function My(i,u){var l=u?ll(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.byteLength)}function Py(i){var u=new i.constructor(i.source,Zd.exec(i));return u.lastIndex=i.lastIndex,u}function $y(i){return za?rt(za.call(i)):{}}function fg(i,u){var l=u?ll(i.buffer):i.buffer;return new i.constructor(l,i.byteOffset,i.length)}function lg(i,u){if(i!==u){var l=i!==t,p=i===null,x=i===i,B=gn(i),M=u!==t,U=u===null,X=u===u,j=gn(u);if(!U&&!j&&!B&&i>u||B&&M&&X&&!U&&!j||p&&M&&X||!l&&X||!x)return 1;if(!p&&!B&&!j&&i<u||j&&l&&x&&!p&&!B||U&&l&&x||!M&&x||!X)return-1}return 0}function Uy(i,u,l){for(var p=-1,x=i.criteria,B=u.criteria,M=x.length,U=l.length;++p<M;){var X=lg(x[p],B[p]);if(X){if(p>=U)return X;var j=l[p];return X*(j=="desc"?-1:1)}}return i.index-u.index}function hg(i,u,l,p){for(var x=-1,B=i.length,M=l.length,U=-1,X=u.length,j=Mt(B-M,0),z=Y(X+j),ne=!p;++U<X;)z[U]=u[U];for(;++x<M;)(ne||x<B)&&(z[l[x]]=i[x]);for(;j--;)z[U++]=i[x++];return z}function cg(i,u,l,p){for(var x=-1,B=i.length,M=-1,U=l.length,X=-1,j=u.length,z=Mt(B-U,0),ne=Y(z+j),ue=!p;++x<z;)ne[x]=i[x];for(var de=x;++X<j;)ne[de+X]=u[X];for(;++M<U;)(ue||x<B)&&(ne[de+l[M]]=i[x++]);return ne}function rn(i,u){var l=-1,p=i.length;for(u||(u=Y(p));++l<p;)u[l]=i[l];return u}function sr(i,u,l,p){var x=!l;l||(l={});for(var B=-1,M=u.length;++B<M;){var U=u[B],X=p?p(l[U],i[U],U,l,i):t;X===t&&(X=i[U]),x?Er(l,U,X):eu(l,U,X)}return l}function Wy(i,u){return sr(i,vl(i),u)}function qy(i,u){return sr(i,Ag(i),u)}function Cs(i,u){return function(l,p){var x=Te(l)?VD:ly,B=u?u():{};return x(l,i,be(p,2),B)}}function oa(i){return Oe(function(u,l){var p=-1,x=l.length,B=x>1?l[x-1]:t,M=x>2?l[2]:t;for(B=i.length>3&&typeof B=="function"?(x--,B):t,M&&Jt(l[0],l[1],M)&&(B=x<3?t:B,x=1),u=rt(u);++p<x;){var U=l[p];U&&i(u,U,p,B)}return u})}function dg(i,u){return function(l,p){if(l==null)return l;if(!an(l))return i(l,p);for(var x=l.length,B=u?x:-1,M=rt(l);(u?B--:++B<x)&&p(M[B],B,M)!==!1;);return l}}function gg(i){return function(u,l,p){for(var x=-1,B=rt(u),M=p(u),U=M.length;U--;){var X=M[i?U:++x];if(l(B[X],X,B)===!1)break}return u}}function Gy(i,u,l){var p=u&k,x=au(i);function B(){var M=this&&this!==qt&&this instanceof B?x:i;return M.apply(p?l:this,arguments)}return B}function pg(i){return function(u){u=et(u);var l=ta(u)?Zn(u):t,p=l?l[0]:u.charAt(0),x=l?Jr(l,1).join(""):u.slice(1);return p[i]()+x}}function fa(i){return function(u){return Nf(dp(cp(u).replace(RD,"")),i,"")}}function au(i){return function(){var u=arguments;switch(u.length){case 0:return new i;case 1:return new i(u[0]);case 2:return new i(u[0],u[1]);case 3:return new i(u[0],u[1],u[2]);case 4:return new i(u[0],u[1],u[2],u[3]);case 5:return new i(u[0],u[1],u[2],u[3],u[4]);case 6:return new i(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new i(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var l=sa(i.prototype),p=i.apply(l,u);return Et(p)?p:l}}function Hy(i,u,l){var p=au(i);function x(){for(var B=arguments.length,M=Y(B),U=B,X=la(x);U--;)M[U]=arguments[U];var j=B<3&&M[0]!==X&&M[B-1]!==X?[]:Xr(M,X);if(B-=j.length,B<l)return bg(i,u,Bs,x.placeholder,t,M,j,t,t,l-B);var z=this&&this!==qt&&this instanceof x?p:i;return hn(z,this,M)}return x}function _g(i){return function(u,l,p){var x=rt(u);if(!an(u)){var B=be(l,3);u=$t(u),l=function(U){return B(x[U],U,x)}}var M=i(u,l,p);return M>-1?x[B?u[M]:M]:t}}function vg(i){return Fr(function(u){var l=u.length,p=l,x=Ln.prototype.thru;for(i&&u.reverse();p--;){var B=u[p];if(typeof B!="function")throw new Rn(f);if(x&&!M&&ks(B)=="wrapper")var M=new Ln([],!0)}for(p=M?p:l;++p<l;){B=u[p];var U=ks(B),X=U=="wrapper"?pl(B):t;X&&ml(X[0])&&X[1]==(N|P|$|C)&&!X[4].length&&X[9]==1?M=M[ks(X[0])].apply(M,X[3]):M=B.length==1&&ml(B)?M[U]():M.thru(B)}return function(){var j=arguments,z=j[0];if(M&&j.length==1&&Te(z))return M.plant(z).value();for(var ne=0,ue=l?u[ne].apply(this,j):z;++ne<l;)ue=u[ne].call(this,ue);return ue}})}function Bs(i,u,l,p,x,B,M,U,X,j){var z=u&N,ne=u&k,ue=u&L,de=u&(P|T),xe=u&S,Ne=ue?t:au(i);function ye(){for(var Pe=arguments.length,Ge=Y(Pe),pn=Pe;pn--;)Ge[pn]=arguments[pn];if(de)var jt=la(ye),_n=nx(Ge,jt);if(p&&(Ge=hg(Ge,p,x,de)),B&&(Ge=cg(Ge,B,M,de)),Pe-=_n,de&&Pe<j){var kt=Xr(Ge,jt);return bg(i,u,Bs,ye.placeholder,l,Ge,kt,U,X,j-Pe)}var Kn=ne?l:this,Ir=ue?Kn[i]:i;return Pe=Ge.length,U?Ge=l8(Ge,U):xe&&Pe>1&&Ge.reverse(),z&&X<Pe&&(Ge.length=X),this&&this!==qt&&this instanceof ye&&(Ir=Ne||au(Ir)),Ir.apply(Kn,Ge)}return ye}function wg(i,u){return function(l,p){return wy(l,i,u(p),{})}}function Ss(i,u){return function(l,p){var x;if(l===t&&p===t)return u;if(l!==t&&(x=l),p!==t){if(x===t)return p;typeof l=="string"||typeof p=="string"?(l=dn(l),p=dn(p)):(l=rg(l),p=rg(p)),x=i(l,p)}return x}}function hl(i){return Fr(function(u){return u=Dt(u,cn(be())),Oe(function(l){var p=this;return i(u,function(x){return hn(x,p,l)})})})}function Is(i,u){u=u===t?" ":dn(u);var l=u.length;if(l<2)return l?il(u,i):u;var p=il(u,_s(i/na(u)));return ta(u)?Jr(Zn(p),0,i).join(""):p.slice(0,i)}function Zy(i,u,l,p){var x=u&k,B=au(i);function M(){for(var U=-1,X=arguments.length,j=-1,z=p.length,ne=Y(z+X),ue=this&&this!==qt&&this instanceof M?B:i;++j<z;)ne[j]=p[j];for(;X--;)ne[j++]=arguments[++U];return hn(ue,x?l:this,ne)}return M}function mg(i){return function(u,l,p){return p&&typeof p!="number"&&Jt(u,l,p)&&(l=p=t),u=Sr(u),l===t?(l=u,u=0):l=Sr(l),p=p===t?u<l?1:-1:Sr(p),Iy(u,l,p,i)}}function Ts(i){return function(u,l){return typeof u=="string"&&typeof l=="string"||(u=Pn(u),l=Pn(l)),i(u,l)}}function bg(i,u,l,p,x,B,M,U,X,j){var z=u&P,ne=z?M:t,ue=z?t:M,de=z?B:t,xe=z?t:B;u|=z?$:q,u&=~(z?q:$),u&G||(u&=-4);var Ne=[i,u,x,de,ne,xe,ue,U,X,j],ye=l.apply(t,Ne);return ml(i)&&kg(ye,Ne),ye.placeholder=p,Rg(ye,i,u)}function cl(i){var u=Ot[i];return function(l,p){if(l=Pn(l),p=p==null?0:Ht(Re(p),292),p&&R1(l)){var x=(et(l)+"e").split("e"),B=u(x[0]+"e"+(+x[1]+p));return x=(et(B)+"e").split("e"),+(x[0]+"e"+(+x[1]-p))}return u(l)}}var Xy=aa&&1/us(new aa([,-0]))[1]==ae?function(i){return new aa(i)}:Ll;function Dg(i){return function(u){var l=Zt(u);return l==we?qf(u):l==vt?fx(u):tx(u,i(u))}}function Ar(i,u,l,p,x,B,M,U){var X=u&L;if(!X&&typeof i!="function")throw new Rn(f);var j=p?p.length:0;if(j||(u&=-97,p=x=t),M=M===t?M:Mt(Re(M),0),U=U===t?U:Re(U),j-=x?x.length:0,u&q){var z=p,ne=x;p=x=t}var ue=X?t:pl(i),de=[i,u,l,p,x,z,ne,B,M,U];if(ue&&s8(de,ue),i=de[0],u=de[1],l=de[2],p=de[3],x=de[4],U=de[9]=de[9]===t?X?0:i.length:Mt(de[9]-j,0),!U&&u&(P|T)&&(u&=-25),!u||u==k)var xe=Gy(i,u,l);else u==P||u==T?xe=Hy(i,u,U):(u==$||u==(k|$))&&!x.length?xe=Zy(i,u,l,p):xe=Bs.apply(t,de);var Ne=ue?tg:kg;return Rg(Ne(xe,de),i,u)}function xg(i,u,l,p){return i===t||Vn(i,ia[l])&&!tt.call(p,l)?u:i}function yg(i,u,l,p,x,B){return Et(i)&&Et(u)&&(B.set(u,i),Es(i,u,t,yg,B),B.delete(u)),i}function Vy(i){return ou(i)?t:i}function Eg(i,u,l,p,x,B){var M=l&I,U=i.length,X=u.length;if(U!=X&&!(M&&X>U))return!1;var j=B.get(i),z=B.get(u);if(j&&z)return j==u&&z==i;var ne=-1,ue=!0,de=l&F?new Ei:t;for(B.set(i,u),B.set(u,i);++ne<U;){var xe=i[ne],Ne=u[ne];if(p)var ye=M?p(Ne,xe,ne,u,i,B):p(xe,Ne,ne,i,u,B);if(ye!==t){if(ye)continue;ue=!1;break}if(de){if(!Of(u,function(Pe,Ge){if(!Ka(de,Ge)&&(xe===Pe||x(xe,Pe,l,p,B)))return de.push(Ge)})){ue=!1;break}}else if(!(xe===Ne||x(xe,Ne,l,p,B))){ue=!1;break}}return B.delete(i),B.delete(u),ue}function Ky(i,u,l,p,x,B,M){switch(l){case dt:if(i.byteLength!=u.byteLength||i.byteOffset!=u.byteOffset)return!1;i=i.buffer,u=u.buffer;case Ft:return!(i.byteLength!=u.byteLength||!B(new cs(i),new cs(u)));case me:case Be:case Ce:return Vn(+i,+u);case ce:return i.name==u.name&&i.message==u.message;case At:case xt:return i==u+"";case we:var U=qf;case vt:var X=p&I;if(U||(U=us),i.size!=u.size&&!X)return!1;var j=M.get(i);if(j)return j==u;p|=F,M.set(i,u);var z=Eg(U(i),U(u),p,x,B,M);return M.delete(i),z;case Yt:if(za)return za.call(i)==za.call(u)}return!1}function Yy(i,u,l,p,x,B){var M=l&I,U=dl(i),X=U.length,j=dl(u),z=j.length;if(X!=z&&!M)return!1;for(var ne=X;ne--;){var ue=U[ne];if(!(M?ue in u:tt.call(u,ue)))return!1}var de=B.get(i),xe=B.get(u);if(de&&xe)return de==u&&xe==i;var Ne=!0;B.set(i,u),B.set(u,i);for(var ye=M;++ne<X;){ue=U[ne];var Pe=i[ue],Ge=u[ue];if(p)var pn=M?p(Ge,Pe,ue,u,i,B):p(Pe,Ge,ue,i,u,B);if(!(pn===t?Pe===Ge||x(Pe,Ge,l,p,B):pn)){Ne=!1;break}ye||(ye=ue=="constructor")}if(Ne&&!ye){var jt=i.constructor,_n=u.constructor;jt!=_n&&"constructor"in i&&"constructor"in u&&!(typeof jt=="function"&&jt instanceof jt&&typeof _n=="function"&&_n instanceof _n)&&(Ne=!1)}return B.delete(i),B.delete(u),Ne}function Fr(i){return Dl(Ig(i,t,$g),i+"")}function dl(i){return H1(i,$t,vl)}function gl(i){return H1(i,un,Ag)}var pl=ws?function(i){return ws.get(i)}:Ll;function ks(i){for(var u=i.name+"",l=ua[u],p=tt.call(ua,u)?l.length:0;p--;){var x=l[p],B=x.func;if(B==null||B==i)return x.name}return u}function la(i){var u=tt.call(A,"placeholder")?A:i;return u.placeholder}function be(){var i=A.iteratee||kl;return i=i===kl?V1:i,arguments.length?i(arguments[0],arguments[1]):i}function Rs(i,u){var l=i.__data__;return r8(u)?l[typeof u=="string"?"string":"hash"]:l.map}function _l(i){for(var u=$t(i),l=u.length;l--;){var p=u[l],x=i[p];u[l]=[p,x,Bg(x)]}return u}function Ci(i,u){var l=ux(i,u);return X1(l)?l:t}function Qy(i){var u=tt.call(i,xi),l=i[xi];try{i[xi]=t;var p=!0}catch{}var x=ls.call(i);return p&&(u?i[xi]=l:delete i[xi]),x}var vl=Hf?function(i){return i==null?[]:(i=rt(i),Hr(Hf(i),function(u){return T1.call(i,u)}))}:Nl,Ag=Hf?function(i){for(var u=[];i;)Zr(u,vl(i)),i=ds(i);return u}:Nl,Zt=Qt;(Zf&&Zt(new Zf(new ArrayBuffer(1)))!=dt||Qa&&Zt(new Qa)!=we||Xf&&Zt(Xf.resolve())!=De||aa&&Zt(new aa)!=vt||Ja&&Zt(new Ja)!=nt)&&(Zt=function(i){var u=Qt(i),l=u==je?i.constructor:t,p=l?Bi(l):"";if(p)switch(p){case kx:return dt;case Rx:return we;case Lx:return De;case Nx:return vt;case Ox:return nt}return u});function Jy(i,u,l){for(var p=-1,x=l.length;++p<x;){var B=l[p],M=B.size;switch(B.type){case"drop":i+=M;break;case"dropRight":u-=M;break;case"take":u=Ht(u,i+M);break;case"takeRight":i=Mt(i,u-M);break}}return{start:i,end:u}}function jy(i){var u=i.match(iD);return u?u[1].split(aD):[]}function Fg(i,u,l){u=Qr(u,i);for(var p=-1,x=u.length,B=!1;++p<x;){var M=or(u[p]);if(!(B=i!=null&&l(i,M)))break;i=i[M]}return B||++p!=x?B:(x=i==null?0:i.length,!!x&&Us(x)&&Cr(M,x)&&(Te(i)||Si(i)))}function zy(i){var u=i.length,l=new i.constructor(u);return u&&typeof i[0]=="string"&&tt.call(i,"index")&&(l.index=i.index,l.input=i.input),l}function Cg(i){return typeof i.constructor=="function"&&!uu(i)?sa(ds(i)):{}}function e8(i,u,l){var p=i.constructor;switch(u){case Ft:return ll(i);case me:case Be:return new p(+i);case dt:return My(i,l);case Dr:case E:case _:case w:case R:case H:case K:case J:case ke:return fg(i,l);case we:return new p;case Ce:case xt:return new p(i);case At:return Py(i);case vt:return new p;case Yt:return $y(i)}}function t8(i,u){var l=u.length;if(!l)return i;var p=l-1;return u[p]=(l>1?"& ":"")+u[p],u=u.join(l>2?", ":" "),i.replace(rD,`{
9
- /* [wrapped with `+u+`] */
10
- `)}function n8(i){return Te(i)||Si(i)||!!(k1&&i&&i[k1])}function Cr(i,u){var l=typeof i;return u=u??pe,!!u&&(l=="number"||l!="symbol"&&gD.test(i))&&i>-1&&i%1==0&&i<u}function Jt(i,u,l){if(!Et(l))return!1;var p=typeof u;return(p=="number"?an(l)&&Cr(u,l.length):p=="string"&&u in l)?Vn(l[u],i):!1}function wl(i,u){if(Te(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||gn(i)?!0:zb.test(i)||!jb.test(i)||u!=null&&i in rt(u)}function r8(i){var u=typeof i;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?i!=="__proto__":i===null}function ml(i){var u=ks(i),l=A[u];if(typeof l!="function"||!(u in Ue.prototype))return!1;if(i===l)return!0;var p=pl(l);return!!p&&i===p[0]}function i8(i){return!!B1&&B1 in i}var a8=os?Br:Ol;function uu(i){var u=i&&i.constructor,l=typeof u=="function"&&u.prototype||ia;return i===l}function Bg(i){return i===i&&!Et(i)}function Sg(i,u){return function(l){return l==null?!1:l[i]===u&&(u!==t||i in rt(l))}}function u8(i){var u=Ps(i,function(p){return l.size===d&&l.clear(),p}),l=u.cache;return u}function s8(i,u){var l=i[1],p=u[1],x=l|p,B=x<(k|L|N),M=p==N&&l==P||p==N&&l==C&&i[7].length<=u[8]||p==(N|C)&&u[7].length<=u[8]&&l==P;if(!(B||M))return i;p&k&&(i[2]=u[2],x|=l&k?0:G);var U=u[3];if(U){var X=i[3];i[3]=X?hg(X,U,u[4]):U,i[4]=X?Xr(i[3],c):u[4]}return U=u[5],U&&(X=i[5],i[5]=X?cg(X,U,u[6]):U,i[6]=X?Xr(i[5],c):u[6]),U=u[7],U&&(i[7]=U),p&N&&(i[8]=i[8]==null?u[8]:Ht(i[8],u[8])),i[9]==null&&(i[9]=u[9]),i[0]=u[0],i[1]=x,i}function o8(i){var u=[];if(i!=null)for(var l in rt(i))u.push(l);return u}function f8(i){return ls.call(i)}function Ig(i,u,l){return u=Mt(u===t?i.length-1:u,0),function(){for(var p=arguments,x=-1,B=Mt(p.length-u,0),M=Y(B);++x<B;)M[x]=p[u+x];x=-1;for(var U=Y(u+1);++x<u;)U[x]=p[x];return U[u]=l(M),hn(i,this,U)}}function Tg(i,u){return u.length<2?i:Fi(i,On(u,0,-1))}function l8(i,u){for(var l=i.length,p=Ht(u.length,l),x=rn(i);p--;){var B=u[p];i[p]=Cr(B,l)?x[B]:t}return i}function bl(i,u){if(!(u==="constructor"&&typeof i[u]=="function")&&u!="__proto__")return i[u]}var kg=Lg(tg),su=Ax||function(i,u){return qt.setTimeout(i,u)},Dl=Lg(Ry);function Rg(i,u,l){var p=u+"";return Dl(i,t8(p,h8(jy(p),l)))}function Lg(i){var u=0,l=0;return function(){var p=Sx(),x=te-(p-l);if(l=p,x>0){if(++u>=V)return arguments[0]}else u=0;return i.apply(t,arguments)}}function Ls(i,u){var l=-1,p=i.length,x=p-1;for(u=u===t?p:u;++l<u;){var B=rl(l,x),M=i[B];i[B]=i[l],i[l]=M}return i.length=u,i}var Ng=u8(function(i){var u=[];return i.charCodeAt(0)===46&&u.push(""),i.replace(eD,function(l,p,x,B){u.push(x?B.replace(oD,"$1"):p||l)}),u});function or(i){if(typeof i=="string"||gn(i))return i;var u=i+"";return u=="0"&&1/i==-ae?"-0":u}function Bi(i){if(i!=null){try{return fs.call(i)}catch{}try{return i+""}catch{}}return""}function h8(i,u){return kn(Ee,function(l){var p="_."+l[0];u&l[1]&&!is(i,p)&&i.push(p)}),i.sort()}function Og(i){if(i instanceof Ue)return i.clone();var u=new Ln(i.__wrapped__,i.__chain__);return u.__actions__=rn(i.__actions__),u.__index__=i.__index__,u.__values__=i.__values__,u}function c8(i,u,l){(l?Jt(i,u,l):u===t)?u=1:u=Mt(Re(u),0);var p=i==null?0:i.length;if(!p||u<1)return[];for(var x=0,B=0,M=Y(_s(p/u));x<p;)M[B++]=On(i,x,x+=u);return M}function d8(i){for(var u=-1,l=i==null?0:i.length,p=0,x=[];++u<l;){var B=i[u];B&&(x[p++]=B)}return x}function g8(){var i=arguments.length;if(!i)return[];for(var u=Y(i-1),l=arguments[0],p=i;p--;)u[p-1]=arguments[p];return Zr(Te(l)?rn(l):[l],Gt(u,1))}var p8=Oe(function(i,u){return Tt(i)?tu(i,Gt(u,1,Tt,!0)):[]}),_8=Oe(function(i,u){var l=Mn(u);return Tt(l)&&(l=t),Tt(i)?tu(i,Gt(u,1,Tt,!0),be(l,2)):[]}),v8=Oe(function(i,u){var l=Mn(u);return Tt(l)&&(l=t),Tt(i)?tu(i,Gt(u,1,Tt,!0),t,l):[]});function w8(i,u,l){var p=i==null?0:i.length;return p?(u=l||u===t?1:Re(u),On(i,u<0?0:u,p)):[]}function m8(i,u,l){var p=i==null?0:i.length;return p?(u=l||u===t?1:Re(u),u=p-u,On(i,0,u<0?0:u)):[]}function b8(i,u){return i&&i.length?Fs(i,be(u,3),!0,!0):[]}function D8(i,u){return i&&i.length?Fs(i,be(u,3),!0):[]}function x8(i,u,l,p){var x=i==null?0:i.length;return x?(l&&typeof l!="number"&&Jt(i,u,l)&&(l=0,p=x),gy(i,u,l,p)):[]}function Mg(i,u,l){var p=i==null?0:i.length;if(!p)return-1;var x=l==null?0:Re(l);return x<0&&(x=Mt(p+x,0)),as(i,be(u,3),x)}function Pg(i,u,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?Mt(p+x,0):Ht(x,p-1)),as(i,be(u,3),x,!0)}function $g(i){var u=i==null?0:i.length;return u?Gt(i,1):[]}function y8(i){var u=i==null?0:i.length;return u?Gt(i,ae):[]}function E8(i,u){var l=i==null?0:i.length;return l?(u=u===t?1:Re(u),Gt(i,u)):[]}function A8(i){for(var u=-1,l=i==null?0:i.length,p={};++u<l;){var x=i[u];p[x[0]]=x[1]}return p}function Ug(i){return i&&i.length?i[0]:t}function F8(i,u,l){var p=i==null?0:i.length;if(!p)return-1;var x=l==null?0:Re(l);return x<0&&(x=Mt(p+x,0)),ea(i,u,x)}function C8(i){var u=i==null?0:i.length;return u?On(i,0,-1):[]}var B8=Oe(function(i){var u=Dt(i,ol);return u.length&&u[0]===i[0]?jf(u):[]}),S8=Oe(function(i){var u=Mn(i),l=Dt(i,ol);return u===Mn(l)?u=t:l.pop(),l.length&&l[0]===i[0]?jf(l,be(u,2)):[]}),I8=Oe(function(i){var u=Mn(i),l=Dt(i,ol);return u=typeof u=="function"?u:t,u&&l.pop(),l.length&&l[0]===i[0]?jf(l,t,u):[]});function T8(i,u){return i==null?"":Cx.call(i,u)}function Mn(i){var u=i==null?0:i.length;return u?i[u-1]:t}function k8(i,u,l){var p=i==null?0:i.length;if(!p)return-1;var x=p;return l!==t&&(x=Re(l),x=x<0?Mt(p+x,0):Ht(x,p-1)),u===u?hx(i,u,x):as(i,b1,x,!0)}function R8(i,u){return i&&i.length?J1(i,Re(u)):t}var L8=Oe(Wg);function Wg(i,u){return i&&i.length&&u&&u.length?nl(i,u):i}function N8(i,u,l){return i&&i.length&&u&&u.length?nl(i,u,be(l,2)):i}function O8(i,u,l){return i&&i.length&&u&&u.length?nl(i,u,t,l):i}var M8=Fr(function(i,u){var l=i==null?0:i.length,p=Kf(i,u);return eg(i,Dt(u,function(x){return Cr(x,l)?+x:x}).sort(lg)),p});function P8(i,u){var l=[];if(!(i&&i.length))return l;var p=-1,x=[],B=i.length;for(u=be(u,3);++p<B;){var M=i[p];u(M,p,i)&&(l.push(M),x.push(p))}return eg(i,x),l}function xl(i){return i==null?i:Tx.call(i)}function $8(i,u,l){var p=i==null?0:i.length;return p?(l&&typeof l!="number"&&Jt(i,u,l)?(u=0,l=p):(u=u==null?0:Re(u),l=l===t?p:Re(l)),On(i,u,l)):[]}function U8(i,u){return As(i,u)}function W8(i,u,l){return al(i,u,be(l,2))}function q8(i,u){var l=i==null?0:i.length;if(l){var p=As(i,u);if(p<l&&Vn(i[p],u))return p}return-1}function G8(i,u){return As(i,u,!0)}function H8(i,u,l){return al(i,u,be(l,2),!0)}function Z8(i,u){var l=i==null?0:i.length;if(l){var p=As(i,u,!0)-1;if(Vn(i[p],u))return p}return-1}function X8(i){return i&&i.length?ng(i):[]}function V8(i,u){return i&&i.length?ng(i,be(u,2)):[]}function K8(i){var u=i==null?0:i.length;return u?On(i,1,u):[]}function Y8(i,u,l){return i&&i.length?(u=l||u===t?1:Re(u),On(i,0,u<0?0:u)):[]}function Q8(i,u,l){var p=i==null?0:i.length;return p?(u=l||u===t?1:Re(u),u=p-u,On(i,u<0?0:u,p)):[]}function J8(i,u){return i&&i.length?Fs(i,be(u,3),!1,!0):[]}function j8(i,u){return i&&i.length?Fs(i,be(u,3)):[]}var z8=Oe(function(i){return Yr(Gt(i,1,Tt,!0))}),eE=Oe(function(i){var u=Mn(i);return Tt(u)&&(u=t),Yr(Gt(i,1,Tt,!0),be(u,2))}),tE=Oe(function(i){var u=Mn(i);return u=typeof u=="function"?u:t,Yr(Gt(i,1,Tt,!0),t,u)});function nE(i){return i&&i.length?Yr(i):[]}function rE(i,u){return i&&i.length?Yr(i,be(u,2)):[]}function iE(i,u){return u=typeof u=="function"?u:t,i&&i.length?Yr(i,t,u):[]}function yl(i){if(!(i&&i.length))return[];var u=0;return i=Hr(i,function(l){if(Tt(l))return u=Mt(l.length,u),!0}),Uf(u,function(l){return Dt(i,Mf(l))})}function qg(i,u){if(!(i&&i.length))return[];var l=yl(i);return u==null?l:Dt(l,function(p){return hn(u,t,p)})}var aE=Oe(function(i,u){return Tt(i)?tu(i,u):[]}),uE=Oe(function(i){return sl(Hr(i,Tt))}),sE=Oe(function(i){var u=Mn(i);return Tt(u)&&(u=t),sl(Hr(i,Tt),be(u,2))}),oE=Oe(function(i){var u=Mn(i);return u=typeof u=="function"?u:t,sl(Hr(i,Tt),t,u)}),fE=Oe(yl);function lE(i,u){return ug(i||[],u||[],eu)}function hE(i,u){return ug(i||[],u||[],iu)}var cE=Oe(function(i){var u=i.length,l=u>1?i[u-1]:t;return l=typeof l=="function"?(i.pop(),l):t,qg(i,l)});function Gg(i){var u=A(i);return u.__chain__=!0,u}function dE(i,u){return u(i),i}function Ns(i,u){return u(i)}var gE=Fr(function(i){var u=i.length,l=u?i[0]:0,p=this.__wrapped__,x=function(B){return Kf(B,i)};return u>1||this.__actions__.length||!(p instanceof Ue)||!Cr(l)?this.thru(x):(p=p.slice(l,+l+(u?1:0)),p.__actions__.push({func:Ns,args:[x],thisArg:t}),new Ln(p,this.__chain__).thru(function(B){return u&&!B.length&&B.push(t),B}))});function pE(){return Gg(this)}function _E(){return new Ln(this.value(),this.__chain__)}function vE(){this.__values__===t&&(this.__values__=rp(this.value()));var i=this.__index__>=this.__values__.length,u=i?t:this.__values__[this.__index__++];return{done:i,value:u}}function wE(){return this}function mE(i){for(var u,l=this;l instanceof bs;){var p=Og(l);p.__index__=0,p.__values__=t,u?x.__wrapped__=p:u=p;var x=p;l=l.__wrapped__}return x.__wrapped__=i,u}function bE(){var i=this.__wrapped__;if(i instanceof Ue){var u=i;return this.__actions__.length&&(u=new Ue(this)),u=u.reverse(),u.__actions__.push({func:Ns,args:[xl],thisArg:t}),new Ln(u,this.__chain__)}return this.thru(xl)}function DE(){return ag(this.__wrapped__,this.__actions__)}var xE=Cs(function(i,u,l){tt.call(i,l)?++i[l]:Er(i,l,1)});function yE(i,u,l){var p=Te(i)?w1:dy;return l&&Jt(i,u,l)&&(u=t),p(i,be(u,3))}function EE(i,u){var l=Te(i)?Hr:q1;return l(i,be(u,3))}var AE=_g(Mg),FE=_g(Pg);function CE(i,u){return Gt(Os(i,u),1)}function BE(i,u){return Gt(Os(i,u),ae)}function SE(i,u,l){return l=l===t?1:Re(l),Gt(Os(i,u),l)}function Hg(i,u){var l=Te(i)?kn:Kr;return l(i,be(u,3))}function Zg(i,u){var l=Te(i)?KD:W1;return l(i,be(u,3))}var IE=Cs(function(i,u,l){tt.call(i,l)?i[l].push(u):Er(i,l,[u])});function TE(i,u,l,p){i=an(i)?i:ca(i),l=l&&!p?Re(l):0;var x=i.length;return l<0&&(l=Mt(x+l,0)),Ws(i)?l<=x&&i.indexOf(u,l)>-1:!!x&&ea(i,u,l)>-1}var kE=Oe(function(i,u,l){var p=-1,x=typeof u=="function",B=an(i)?Y(i.length):[];return Kr(i,function(M){B[++p]=x?hn(u,M,l):nu(M,u,l)}),B}),RE=Cs(function(i,u,l){Er(i,l,u)});function Os(i,u){var l=Te(i)?Dt:K1;return l(i,be(u,3))}function LE(i,u,l,p){return i==null?[]:(Te(u)||(u=u==null?[]:[u]),l=p?t:l,Te(l)||(l=l==null?[]:[l]),j1(i,u,l))}var NE=Cs(function(i,u,l){i[l?0:1].push(u)},function(){return[[],[]]});function OE(i,u,l){var p=Te(i)?Nf:x1,x=arguments.length<3;return p(i,be(u,4),l,x,Kr)}function ME(i,u,l){var p=Te(i)?YD:x1,x=arguments.length<3;return p(i,be(u,4),l,x,W1)}function PE(i,u){var l=Te(i)?Hr:q1;return l(i,$s(be(u,3)))}function $E(i){var u=Te(i)?M1:Ty;return u(i)}function UE(i,u,l){(l?Jt(i,u,l):u===t)?u=1:u=Re(u);var p=Te(i)?oy:ky;return p(i,u)}function WE(i){var u=Te(i)?fy:Ly;return u(i)}function qE(i){if(i==null)return 0;if(an(i))return Ws(i)?na(i):i.length;var u=Zt(i);return u==we||u==vt?i.size:el(i).length}function GE(i,u,l){var p=Te(i)?Of:Ny;return l&&Jt(i,u,l)&&(u=t),p(i,be(u,3))}var HE=Oe(function(i,u){if(i==null)return[];var l=u.length;return l>1&&Jt(i,u[0],u[1])?u=[]:l>2&&Jt(u[0],u[1],u[2])&&(u=[u[0]]),j1(i,Gt(u,1),[])}),Ms=Ex||function(){return qt.Date.now()};function ZE(i,u){if(typeof u!="function")throw new Rn(f);return i=Re(i),function(){if(--i<1)return u.apply(this,arguments)}}function Xg(i,u,l){return u=l?t:u,u=i&&u==null?i.length:u,Ar(i,N,t,t,t,t,u)}function Vg(i,u){var l;if(typeof u!="function")throw new Rn(f);return i=Re(i),function(){return--i>0&&(l=u.apply(this,arguments)),i<=1&&(u=t),l}}var El=Oe(function(i,u,l){var p=k;if(l.length){var x=Xr(l,la(El));p|=$}return Ar(i,p,u,l,x)}),Kg=Oe(function(i,u,l){var p=k|L;if(l.length){var x=Xr(l,la(Kg));p|=$}return Ar(u,p,i,l,x)});function Yg(i,u,l){u=l?t:u;var p=Ar(i,P,t,t,t,t,t,u);return p.placeholder=Yg.placeholder,p}function Qg(i,u,l){u=l?t:u;var p=Ar(i,T,t,t,t,t,t,u);return p.placeholder=Qg.placeholder,p}function Jg(i,u,l){var p,x,B,M,U,X,j=0,z=!1,ne=!1,ue=!0;if(typeof i!="function")throw new Rn(f);u=Pn(u)||0,Et(l)&&(z=!!l.leading,ne="maxWait"in l,B=ne?Mt(Pn(l.maxWait)||0,u):B,ue="trailing"in l?!!l.trailing:ue);function de(kt){var Kn=p,Ir=x;return p=x=t,j=kt,M=i.apply(Ir,Kn),M}function xe(kt){return j=kt,U=su(Pe,u),z?de(kt):M}function Ne(kt){var Kn=kt-X,Ir=kt-j,_p=u-Kn;return ne?Ht(_p,B-Ir):_p}function ye(kt){var Kn=kt-X,Ir=kt-j;return X===t||Kn>=u||Kn<0||ne&&Ir>=B}function Pe(){var kt=Ms();if(ye(kt))return Ge(kt);U=su(Pe,Ne(kt))}function Ge(kt){return U=t,ue&&p?de(kt):(p=x=t,M)}function pn(){U!==t&&sg(U),j=0,p=X=x=U=t}function jt(){return U===t?M:Ge(Ms())}function _n(){var kt=Ms(),Kn=ye(kt);if(p=arguments,x=this,X=kt,Kn){if(U===t)return xe(X);if(ne)return sg(U),U=su(Pe,u),de(X)}return U===t&&(U=su(Pe,u)),M}return _n.cancel=pn,_n.flush=jt,_n}var XE=Oe(function(i,u){return U1(i,1,u)}),VE=Oe(function(i,u,l){return U1(i,Pn(u)||0,l)});function KE(i){return Ar(i,S)}function Ps(i,u){if(typeof i!="function"||u!=null&&typeof u!="function")throw new Rn(f);var l=function(){var p=arguments,x=u?u.apply(this,p):p[0],B=l.cache;if(B.has(x))return B.get(x);var M=i.apply(this,p);return l.cache=B.set(x,M)||B,M};return l.cache=new(Ps.Cache||yr),l}Ps.Cache=yr;function $s(i){if(typeof i!="function")throw new Rn(f);return function(){var u=arguments;switch(u.length){case 0:return!i.call(this);case 1:return!i.call(this,u[0]);case 2:return!i.call(this,u[0],u[1]);case 3:return!i.call(this,u[0],u[1],u[2])}return!i.apply(this,u)}}function YE(i){return Vg(2,i)}var QE=Oy(function(i,u){u=u.length==1&&Te(u[0])?Dt(u[0],cn(be())):Dt(Gt(u,1),cn(be()));var l=u.length;return Oe(function(p){for(var x=-1,B=Ht(p.length,l);++x<B;)p[x]=u[x].call(this,p[x]);return hn(i,this,p)})}),Al=Oe(function(i,u){var l=Xr(u,la(Al));return Ar(i,$,t,u,l)}),jg=Oe(function(i,u){var l=Xr(u,la(jg));return Ar(i,q,t,u,l)}),JE=Fr(function(i,u){return Ar(i,C,t,t,t,u)});function jE(i,u){if(typeof i!="function")throw new Rn(f);return u=u===t?u:Re(u),Oe(i,u)}function zE(i,u){if(typeof i!="function")throw new Rn(f);return u=u==null?0:Mt(Re(u),0),Oe(function(l){var p=l[u],x=Jr(l,0,u);return p&&Zr(x,p),hn(i,this,x)})}function e3(i,u,l){var p=!0,x=!0;if(typeof i!="function")throw new Rn(f);return Et(l)&&(p="leading"in l?!!l.leading:p,x="trailing"in l?!!l.trailing:x),Jg(i,u,{leading:p,maxWait:u,trailing:x})}function t3(i){return Xg(i,1)}function n3(i,u){return Al(fl(u),i)}function r3(){if(!arguments.length)return[];var i=arguments[0];return Te(i)?i:[i]}function i3(i){return Nn(i,m)}function a3(i,u){return u=typeof u=="function"?u:t,Nn(i,m,u)}function u3(i){return Nn(i,D|m)}function s3(i,u){return u=typeof u=="function"?u:t,Nn(i,D|m,u)}function o3(i,u){return u==null||$1(i,u,$t(u))}function Vn(i,u){return i===u||i!==i&&u!==u}var f3=Ts(Jf),l3=Ts(function(i,u){return i>=u}),Si=Z1(function(){return arguments}())?Z1:function(i){return Ct(i)&&tt.call(i,"callee")&&!T1.call(i,"callee")},Te=Y.isArray,h3=c1?cn(c1):my;function an(i){return i!=null&&Us(i.length)&&!Br(i)}function Tt(i){return Ct(i)&&an(i)}function c3(i){return i===!0||i===!1||Ct(i)&&Qt(i)==me}var jr=Fx||Ol,d3=d1?cn(d1):by;function g3(i){return Ct(i)&&i.nodeType===1&&!ou(i)}function p3(i){if(i==null)return!0;if(an(i)&&(Te(i)||typeof i=="string"||typeof i.splice=="function"||jr(i)||ha(i)||Si(i)))return!i.length;var u=Zt(i);if(u==we||u==vt)return!i.size;if(uu(i))return!el(i).length;for(var l in i)if(tt.call(i,l))return!1;return!0}function _3(i,u){return ru(i,u)}function v3(i,u,l){l=typeof l=="function"?l:t;var p=l?l(i,u):t;return p===t?ru(i,u,t,l):!!p}function Fl(i){if(!Ct(i))return!1;var u=Qt(i);return u==ce||u==Ve||typeof i.message=="string"&&typeof i.name=="string"&&!ou(i)}function w3(i){return typeof i=="number"&&R1(i)}function Br(i){if(!Et(i))return!1;var u=Qt(i);return u==Me||u==Ke||u==ot||u==Qe}function zg(i){return typeof i=="number"&&i==Re(i)}function Us(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=pe}function Et(i){var u=typeof i;return i!=null&&(u=="object"||u=="function")}function Ct(i){return i!=null&&typeof i=="object"}var ep=g1?cn(g1):xy;function m3(i,u){return i===u||zf(i,u,_l(u))}function b3(i,u,l){return l=typeof l=="function"?l:t,zf(i,u,_l(u),l)}function D3(i){return tp(i)&&i!=+i}function x3(i){if(a8(i))throw new Se(s);return X1(i)}function y3(i){return i===null}function E3(i){return i==null}function tp(i){return typeof i=="number"||Ct(i)&&Qt(i)==Ce}function ou(i){if(!Ct(i)||Qt(i)!=je)return!1;var u=ds(i);if(u===null)return!0;var l=tt.call(u,"constructor")&&u.constructor;return typeof l=="function"&&l instanceof l&&fs.call(l)==bx}var Cl=p1?cn(p1):yy;function A3(i){return zg(i)&&i>=-pe&&i<=pe}var np=_1?cn(_1):Ey;function Ws(i){return typeof i=="string"||!Te(i)&&Ct(i)&&Qt(i)==xt}function gn(i){return typeof i=="symbol"||Ct(i)&&Qt(i)==Yt}var ha=v1?cn(v1):Ay;function F3(i){return i===t}function C3(i){return Ct(i)&&Zt(i)==nt}function B3(i){return Ct(i)&&Qt(i)==wt}var S3=Ts(tl),I3=Ts(function(i,u){return i<=u});function rp(i){if(!i)return[];if(an(i))return Ws(i)?Zn(i):rn(i);if(Ya&&i[Ya])return ox(i[Ya]());var u=Zt(i),l=u==we?qf:u==vt?us:ca;return l(i)}function Sr(i){if(!i)return i===0?i:0;if(i=Pn(i),i===ae||i===-ae){var u=i<0?-1:1;return u*_e}return i===i?i:0}function Re(i){var u=Sr(i),l=u%1;return u===u?l?u-l:u:0}function ip(i){return i?Ai(Re(i),0,he):0}function Pn(i){if(typeof i=="number")return i;if(gn(i))return Xe;if(Et(i)){var u=typeof i.valueOf=="function"?i.valueOf():i;i=Et(u)?u+"":u}if(typeof i!="string")return i===0?i:+i;i=y1(i);var l=hD.test(i);return l||dD.test(i)?ZD(i.slice(2),l?2:8):lD.test(i)?Xe:+i}function ap(i){return sr(i,un(i))}function T3(i){return i?Ai(Re(i),-pe,pe):i===0?i:0}function et(i){return i==null?"":dn(i)}var k3=oa(function(i,u){if(uu(u)||an(u)){sr(u,$t(u),i);return}for(var l in u)tt.call(u,l)&&eu(i,l,u[l])}),up=oa(function(i,u){sr(u,un(u),i)}),qs=oa(function(i,u,l,p){sr(u,un(u),i,p)}),R3=oa(function(i,u,l,p){sr(u,$t(u),i,p)}),L3=Fr(Kf);function N3(i,u){var l=sa(i);return u==null?l:P1(l,u)}var O3=Oe(function(i,u){i=rt(i);var l=-1,p=u.length,x=p>2?u[2]:t;for(x&&Jt(u[0],u[1],x)&&(p=1);++l<p;)for(var B=u[l],M=un(B),U=-1,X=M.length;++U<X;){var j=M[U],z=i[j];(z===t||Vn(z,ia[j])&&!tt.call(i,j))&&(i[j]=B[j])}return i}),M3=Oe(function(i){return i.push(t,yg),hn(sp,t,i)});function P3(i,u){return m1(i,be(u,3),ur)}function $3(i,u){return m1(i,be(u,3),Qf)}function U3(i,u){return i==null?i:Yf(i,be(u,3),un)}function W3(i,u){return i==null?i:G1(i,be(u,3),un)}function q3(i,u){return i&&ur(i,be(u,3))}function G3(i,u){return i&&Qf(i,be(u,3))}function H3(i){return i==null?[]:ys(i,$t(i))}function Z3(i){return i==null?[]:ys(i,un(i))}function Bl(i,u,l){var p=i==null?t:Fi(i,u);return p===t?l:p}function X3(i,u){return i!=null&&Fg(i,u,py)}function Sl(i,u){return i!=null&&Fg(i,u,_y)}var V3=wg(function(i,u,l){u!=null&&typeof u.toString!="function"&&(u=ls.call(u)),i[u]=l},Tl(sn)),K3=wg(function(i,u,l){u!=null&&typeof u.toString!="function"&&(u=ls.call(u)),tt.call(i,u)?i[u].push(l):i[u]=[l]},be),Y3=Oe(nu);function $t(i){return an(i)?O1(i):el(i)}function un(i){return an(i)?O1(i,!0):Fy(i)}function Q3(i,u){var l={};return u=be(u,3),ur(i,function(p,x,B){Er(l,u(p,x,B),p)}),l}function J3(i,u){var l={};return u=be(u,3),ur(i,function(p,x,B){Er(l,x,u(p,x,B))}),l}var j3=oa(function(i,u,l){Es(i,u,l)}),sp=oa(function(i,u,l,p){Es(i,u,l,p)}),z3=Fr(function(i,u){var l={};if(i==null)return l;var p=!1;u=Dt(u,function(B){return B=Qr(B,i),p||(p=B.length>1),B}),sr(i,gl(i),l),p&&(l=Nn(l,D|y|m,Vy));for(var x=u.length;x--;)ul(l,u[x]);return l});function eA(i,u){return op(i,$s(be(u)))}var tA=Fr(function(i,u){return i==null?{}:By(i,u)});function op(i,u){if(i==null)return{};var l=Dt(gl(i),function(p){return[p]});return u=be(u),z1(i,l,function(p,x){return u(p,x[0])})}function nA(i,u,l){u=Qr(u,i);var p=-1,x=u.length;for(x||(x=1,i=t);++p<x;){var B=i==null?t:i[or(u[p])];B===t&&(p=x,B=l),i=Br(B)?B.call(i):B}return i}function rA(i,u,l){return i==null?i:iu(i,u,l)}function iA(i,u,l,p){return p=typeof p=="function"?p:t,i==null?i:iu(i,u,l,p)}var fp=Dg($t),lp=Dg(un);function aA(i,u,l){var p=Te(i),x=p||jr(i)||ha(i);if(u=be(u,4),l==null){var B=i&&i.constructor;x?l=p?new B:[]:Et(i)?l=Br(B)?sa(ds(i)):{}:l={}}return(x?kn:ur)(i,function(M,U,X){return u(l,M,U,X)}),l}function uA(i,u){return i==null?!0:ul(i,u)}function sA(i,u,l){return i==null?i:ig(i,u,fl(l))}function oA(i,u,l,p){return p=typeof p=="function"?p:t,i==null?i:ig(i,u,fl(l),p)}function ca(i){return i==null?[]:Wf(i,$t(i))}function fA(i){return i==null?[]:Wf(i,un(i))}function lA(i,u,l){return l===t&&(l=u,u=t),l!==t&&(l=Pn(l),l=l===l?l:0),u!==t&&(u=Pn(u),u=u===u?u:0),Ai(Pn(i),u,l)}function hA(i,u,l){return u=Sr(u),l===t?(l=u,u=0):l=Sr(l),i=Pn(i),vy(i,u,l)}function cA(i,u,l){if(l&&typeof l!="boolean"&&Jt(i,u,l)&&(u=l=t),l===t&&(typeof u=="boolean"?(l=u,u=t):typeof i=="boolean"&&(l=i,i=t)),i===t&&u===t?(i=0,u=1):(i=Sr(i),u===t?(u=i,i=0):u=Sr(u)),i>u){var p=i;i=u,u=p}if(l||i%1||u%1){var x=L1();return Ht(i+x*(u-i+HD("1e-"+((x+"").length-1))),u)}return rl(i,u)}var dA=fa(function(i,u,l){return u=u.toLowerCase(),i+(l?hp(u):u)});function hp(i){return Il(et(i).toLowerCase())}function cp(i){return i=et(i),i&&i.replace(pD,rx).replace(LD,"")}function gA(i,u,l){i=et(i),u=dn(u);var p=i.length;l=l===t?p:Ai(Re(l),0,p);var x=l;return l-=u.length,l>=0&&i.slice(l,x)==u}function pA(i){return i=et(i),i&&Yb.test(i)?i.replace(Gd,ix):i}function _A(i){return i=et(i),i&&tD.test(i)?i.replace(Af,"\\$&"):i}var vA=fa(function(i,u,l){return i+(l?"-":"")+u.toLowerCase()}),wA=fa(function(i,u,l){return i+(l?" ":"")+u.toLowerCase()}),mA=pg("toLowerCase");function bA(i,u,l){i=et(i),u=Re(u);var p=u?na(i):0;if(!u||p>=u)return i;var x=(u-p)/2;return Is(vs(x),l)+i+Is(_s(x),l)}function DA(i,u,l){i=et(i),u=Re(u);var p=u?na(i):0;return u&&p<u?i+Is(u-p,l):i}function xA(i,u,l){i=et(i),u=Re(u);var p=u?na(i):0;return u&&p<u?Is(u-p,l)+i:i}function yA(i,u,l){return l||u==null?u=0:u&&(u=+u),Ix(et(i).replace(Ff,""),u||0)}function EA(i,u,l){return(l?Jt(i,u,l):u===t)?u=1:u=Re(u),il(et(i),u)}function AA(){var i=arguments,u=et(i[0]);return i.length<3?u:u.replace(i[1],i[2])}var FA=fa(function(i,u,l){return i+(l?"_":"")+u.toLowerCase()});function CA(i,u,l){return l&&typeof l!="number"&&Jt(i,u,l)&&(u=l=t),l=l===t?he:l>>>0,l?(i=et(i),i&&(typeof u=="string"||u!=null&&!Cl(u))&&(u=dn(u),!u&&ta(i))?Jr(Zn(i),0,l):i.split(u,l)):[]}var BA=fa(function(i,u,l){return i+(l?" ":"")+Il(u)});function SA(i,u,l){return i=et(i),l=l==null?0:Ai(Re(l),0,i.length),u=dn(u),i.slice(l,l+u.length)==u}function IA(i,u,l){var p=A.templateSettings;l&&Jt(i,u,l)&&(u=t),i=et(i),u=qs({},u,p,xg);var x=qs({},u.imports,p.imports,xg),B=$t(x),M=Wf(x,B),U,X,j=0,z=u.interpolate||ts,ne="__p += '",ue=Gf((u.escape||ts).source+"|"+z.source+"|"+(z===Hd?fD:ts).source+"|"+(u.evaluate||ts).source+"|$","g"),de="//# sourceURL="+(tt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$D+"]")+`
11
- `;i.replace(ue,function(ye,Pe,Ge,pn,jt,_n){return Ge||(Ge=pn),ne+=i.slice(j,_n).replace(_D,ax),Pe&&(U=!0,ne+=`' +
12
- __e(`+Pe+`) +
13
- '`),jt&&(X=!0,ne+=`';
14
- `+jt+`;
15
- __p += '`),Ge&&(ne+=`' +
16
- ((__t = (`+Ge+`)) == null ? '' : __t) +
17
- '`),j=_n+ye.length,ye}),ne+=`';
18
- `;var xe=tt.call(u,"variable")&&u.variable;if(!xe)ne=`with (obj) {
19
- `+ne+`
20
- }
21
- `;else if(sD.test(xe))throw new Se(h);ne=(X?ne.replace(mt,""):ne).replace(ft,"$1").replace(bt,"$1;"),ne="function("+(xe||"obj")+`) {
22
- `+(xe?"":`obj || (obj = {});
23
- `)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(X?`, __j = Array.prototype.join;
24
- function print() { __p += __j.call(arguments, '') }
25
- `:`;
26
- `)+ne+`return __p
27
- }`;var Ne=gp(function(){return Je(B,de+"return "+ne).apply(t,M)});if(Ne.source=ne,Fl(Ne))throw Ne;return Ne}function TA(i){return et(i).toLowerCase()}function kA(i){return et(i).toUpperCase()}function RA(i,u,l){if(i=et(i),i&&(l||u===t))return y1(i);if(!i||!(u=dn(u)))return i;var p=Zn(i),x=Zn(u),B=E1(p,x),M=A1(p,x)+1;return Jr(p,B,M).join("")}function LA(i,u,l){if(i=et(i),i&&(l||u===t))return i.slice(0,C1(i)+1);if(!i||!(u=dn(u)))return i;var p=Zn(i),x=A1(p,Zn(u))+1;return Jr(p,0,x).join("")}function NA(i,u,l){if(i=et(i),i&&(l||u===t))return i.replace(Ff,"");if(!i||!(u=dn(u)))return i;var p=Zn(i),x=E1(p,Zn(u));return Jr(p,x).join("")}function OA(i,u){var l=O,p=W;if(Et(u)){var x="separator"in u?u.separator:x;l="length"in u?Re(u.length):l,p="omission"in u?dn(u.omission):p}i=et(i);var B=i.length;if(ta(i)){var M=Zn(i);B=M.length}if(l>=B)return i;var U=l-na(p);if(U<1)return p;var X=M?Jr(M,0,U).join(""):i.slice(0,U);if(x===t)return X+p;if(M&&(U+=X.length-U),Cl(x)){if(i.slice(U).search(x)){var j,z=X;for(x.global||(x=Gf(x.source,et(Zd.exec(x))+"g")),x.lastIndex=0;j=x.exec(z);)var ne=j.index;X=X.slice(0,ne===t?U:ne)}}else if(i.indexOf(dn(x),U)!=U){var ue=X.lastIndexOf(x);ue>-1&&(X=X.slice(0,ue))}return X+p}function MA(i){return i=et(i),i&&Kb.test(i)?i.replace(ze,cx):i}var PA=fa(function(i,u,l){return i+(l?" ":"")+u.toUpperCase()}),Il=pg("toUpperCase");function dp(i,u,l){return i=et(i),u=l?t:u,u===t?sx(i)?px(i):jD(i):i.match(u)||[]}var gp=Oe(function(i,u){try{return hn(i,t,u)}catch(l){return Fl(l)?l:new Se(l)}}),$A=Fr(function(i,u){return kn(u,function(l){l=or(l),Er(i,l,El(i[l],i))}),i});function UA(i){var u=i==null?0:i.length,l=be();return i=u?Dt(i,function(p){if(typeof p[1]!="function")throw new Rn(f);return[l(p[0]),p[1]]}):[],Oe(function(p){for(var x=-1;++x<u;){var B=i[x];if(hn(B[0],this,p))return hn(B[1],this,p)}})}function WA(i){return cy(Nn(i,D))}function Tl(i){return function(){return i}}function qA(i,u){return i==null||i!==i?u:i}var GA=vg(),HA=vg(!0);function sn(i){return i}function kl(i){return V1(typeof i=="function"?i:Nn(i,D))}function ZA(i){return Y1(Nn(i,D))}function XA(i,u){return Q1(i,Nn(u,D))}var VA=Oe(function(i,u){return function(l){return nu(l,i,u)}}),KA=Oe(function(i,u){return function(l){return nu(i,l,u)}});function Rl(i,u,l){var p=$t(u),x=ys(u,p);l==null&&!(Et(u)&&(x.length||!p.length))&&(l=u,u=i,i=this,x=ys(u,$t(u)));var B=!(Et(l)&&"chain"in l)||!!l.chain,M=Br(i);return kn(x,function(U){var X=u[U];i[U]=X,M&&(i.prototype[U]=function(){var j=this.__chain__;if(B||j){var z=i(this.__wrapped__),ne=z.__actions__=rn(this.__actions__);return ne.push({func:X,args:arguments,thisArg:i}),z.__chain__=j,z}return X.apply(i,Zr([this.value()],arguments))})}),i}function YA(){return qt._===this&&(qt._=Dx),this}function Ll(){}function QA(i){return i=Re(i),Oe(function(u){return J1(u,i)})}var JA=hl(Dt),jA=hl(w1),zA=hl(Of);function pp(i){return wl(i)?Mf(or(i)):Sy(i)}function eF(i){return function(u){return i==null?t:Fi(i,u)}}var tF=mg(),nF=mg(!0);function Nl(){return[]}function Ol(){return!1}function rF(){return{}}function iF(){return""}function aF(){return!0}function uF(i,u){if(i=Re(i),i<1||i>pe)return[];var l=he,p=Ht(i,he);u=be(u),i-=he;for(var x=Uf(p,u);++l<i;)u(l);return x}function sF(i){return Te(i)?Dt(i,or):gn(i)?[i]:rn(Ng(et(i)))}function oF(i){var u=++mx;return et(i)+u}var fF=Ss(function(i,u){return i+u},0),lF=cl("ceil"),hF=Ss(function(i,u){return i/u},1),cF=cl("floor");function dF(i){return i&&i.length?xs(i,sn,Jf):t}function gF(i,u){return i&&i.length?xs(i,be(u,2),Jf):t}function pF(i){return D1(i,sn)}function _F(i,u){return D1(i,be(u,2))}function vF(i){return i&&i.length?xs(i,sn,tl):t}function wF(i,u){return i&&i.length?xs(i,be(u,2),tl):t}var mF=Ss(function(i,u){return i*u},1),bF=cl("round"),DF=Ss(function(i,u){return i-u},0);function xF(i){return i&&i.length?$f(i,sn):0}function yF(i,u){return i&&i.length?$f(i,be(u,2)):0}return A.after=ZE,A.ary=Xg,A.assign=k3,A.assignIn=up,A.assignInWith=qs,A.assignWith=R3,A.at=L3,A.before=Vg,A.bind=El,A.bindAll=$A,A.bindKey=Kg,A.castArray=r3,A.chain=Gg,A.chunk=c8,A.compact=d8,A.concat=g8,A.cond=UA,A.conforms=WA,A.constant=Tl,A.countBy=xE,A.create=N3,A.curry=Yg,A.curryRight=Qg,A.debounce=Jg,A.defaults=O3,A.defaultsDeep=M3,A.defer=XE,A.delay=VE,A.difference=p8,A.differenceBy=_8,A.differenceWith=v8,A.drop=w8,A.dropRight=m8,A.dropRightWhile=b8,A.dropWhile=D8,A.fill=x8,A.filter=EE,A.flatMap=CE,A.flatMapDeep=BE,A.flatMapDepth=SE,A.flatten=$g,A.flattenDeep=y8,A.flattenDepth=E8,A.flip=KE,A.flow=GA,A.flowRight=HA,A.fromPairs=A8,A.functions=H3,A.functionsIn=Z3,A.groupBy=IE,A.initial=C8,A.intersection=B8,A.intersectionBy=S8,A.intersectionWith=I8,A.invert=V3,A.invertBy=K3,A.invokeMap=kE,A.iteratee=kl,A.keyBy=RE,A.keys=$t,A.keysIn=un,A.map=Os,A.mapKeys=Q3,A.mapValues=J3,A.matches=ZA,A.matchesProperty=XA,A.memoize=Ps,A.merge=j3,A.mergeWith=sp,A.method=VA,A.methodOf=KA,A.mixin=Rl,A.negate=$s,A.nthArg=QA,A.omit=z3,A.omitBy=eA,A.once=YE,A.orderBy=LE,A.over=JA,A.overArgs=QE,A.overEvery=jA,A.overSome=zA,A.partial=Al,A.partialRight=jg,A.partition=NE,A.pick=tA,A.pickBy=op,A.property=pp,A.propertyOf=eF,A.pull=L8,A.pullAll=Wg,A.pullAllBy=N8,A.pullAllWith=O8,A.pullAt=M8,A.range=tF,A.rangeRight=nF,A.rearg=JE,A.reject=PE,A.remove=P8,A.rest=jE,A.reverse=xl,A.sampleSize=UE,A.set=rA,A.setWith=iA,A.shuffle=WE,A.slice=$8,A.sortBy=HE,A.sortedUniq=X8,A.sortedUniqBy=V8,A.split=CA,A.spread=zE,A.tail=K8,A.take=Y8,A.takeRight=Q8,A.takeRightWhile=J8,A.takeWhile=j8,A.tap=dE,A.throttle=e3,A.thru=Ns,A.toArray=rp,A.toPairs=fp,A.toPairsIn=lp,A.toPath=sF,A.toPlainObject=ap,A.transform=aA,A.unary=t3,A.union=z8,A.unionBy=eE,A.unionWith=tE,A.uniq=nE,A.uniqBy=rE,A.uniqWith=iE,A.unset=uA,A.unzip=yl,A.unzipWith=qg,A.update=sA,A.updateWith=oA,A.values=ca,A.valuesIn=fA,A.without=aE,A.words=dp,A.wrap=n3,A.xor=uE,A.xorBy=sE,A.xorWith=oE,A.zip=fE,A.zipObject=lE,A.zipObjectDeep=hE,A.zipWith=cE,A.entries=fp,A.entriesIn=lp,A.extend=up,A.extendWith=qs,Rl(A,A),A.add=fF,A.attempt=gp,A.camelCase=dA,A.capitalize=hp,A.ceil=lF,A.clamp=lA,A.clone=i3,A.cloneDeep=u3,A.cloneDeepWith=s3,A.cloneWith=a3,A.conformsTo=o3,A.deburr=cp,A.defaultTo=qA,A.divide=hF,A.endsWith=gA,A.eq=Vn,A.escape=pA,A.escapeRegExp=_A,A.every=yE,A.find=AE,A.findIndex=Mg,A.findKey=P3,A.findLast=FE,A.findLastIndex=Pg,A.findLastKey=$3,A.floor=cF,A.forEach=Hg,A.forEachRight=Zg,A.forIn=U3,A.forInRight=W3,A.forOwn=q3,A.forOwnRight=G3,A.get=Bl,A.gt=f3,A.gte=l3,A.has=X3,A.hasIn=Sl,A.head=Ug,A.identity=sn,A.includes=TE,A.indexOf=F8,A.inRange=hA,A.invoke=Y3,A.isArguments=Si,A.isArray=Te,A.isArrayBuffer=h3,A.isArrayLike=an,A.isArrayLikeObject=Tt,A.isBoolean=c3,A.isBuffer=jr,A.isDate=d3,A.isElement=g3,A.isEmpty=p3,A.isEqual=_3,A.isEqualWith=v3,A.isError=Fl,A.isFinite=w3,A.isFunction=Br,A.isInteger=zg,A.isLength=Us,A.isMap=ep,A.isMatch=m3,A.isMatchWith=b3,A.isNaN=D3,A.isNative=x3,A.isNil=E3,A.isNull=y3,A.isNumber=tp,A.isObject=Et,A.isObjectLike=Ct,A.isPlainObject=ou,A.isRegExp=Cl,A.isSafeInteger=A3,A.isSet=np,A.isString=Ws,A.isSymbol=gn,A.isTypedArray=ha,A.isUndefined=F3,A.isWeakMap=C3,A.isWeakSet=B3,A.join=T8,A.kebabCase=vA,A.last=Mn,A.lastIndexOf=k8,A.lowerCase=wA,A.lowerFirst=mA,A.lt=S3,A.lte=I3,A.max=dF,A.maxBy=gF,A.mean=pF,A.meanBy=_F,A.min=vF,A.minBy=wF,A.stubArray=Nl,A.stubFalse=Ol,A.stubObject=rF,A.stubString=iF,A.stubTrue=aF,A.multiply=mF,A.nth=R8,A.noConflict=YA,A.noop=Ll,A.now=Ms,A.pad=bA,A.padEnd=DA,A.padStart=xA,A.parseInt=yA,A.random=cA,A.reduce=OE,A.reduceRight=ME,A.repeat=EA,A.replace=AA,A.result=nA,A.round=bF,A.runInContext=Z,A.sample=$E,A.size=qE,A.snakeCase=FA,A.some=GE,A.sortedIndex=U8,A.sortedIndexBy=W8,A.sortedIndexOf=q8,A.sortedLastIndex=G8,A.sortedLastIndexBy=H8,A.sortedLastIndexOf=Z8,A.startCase=BA,A.startsWith=SA,A.subtract=DF,A.sum=xF,A.sumBy=yF,A.template=IA,A.times=uF,A.toFinite=Sr,A.toInteger=Re,A.toLength=ip,A.toLower=TA,A.toNumber=Pn,A.toSafeInteger=T3,A.toString=et,A.toUpper=kA,A.trim=RA,A.trimEnd=LA,A.trimStart=NA,A.truncate=OA,A.unescape=MA,A.uniqueId=oF,A.upperCase=PA,A.upperFirst=Il,A.each=Hg,A.eachRight=Zg,A.first=Ug,Rl(A,function(){var i={};return ur(A,function(u,l){tt.call(A.prototype,l)||(i[l]=u)}),i}(),{chain:!1}),A.VERSION=a,kn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){A[i].placeholder=A}),kn(["drop","take"],function(i,u){Ue.prototype[i]=function(l){l=l===t?1:Mt(Re(l),0);var p=this.__filtered__&&!u?new Ue(this):this.clone();return p.__filtered__?p.__takeCount__=Ht(l,p.__takeCount__):p.__views__.push({size:Ht(l,he),type:i+(p.__dir__<0?"Right":"")}),p},Ue.prototype[i+"Right"]=function(l){return this.reverse()[i](l).reverse()}}),kn(["filter","map","takeWhile"],function(i,u){var l=u+1,p=l==ie||l==Fe;Ue.prototype[i]=function(x){var B=this.clone();return B.__iteratees__.push({iteratee:be(x,3),type:l}),B.__filtered__=B.__filtered__||p,B}}),kn(["head","last"],function(i,u){var l="take"+(u?"Right":"");Ue.prototype[i]=function(){return this[l](1).value()[0]}}),kn(["initial","tail"],function(i,u){var l="drop"+(u?"":"Right");Ue.prototype[i]=function(){return this.__filtered__?new Ue(this):this[l](1)}}),Ue.prototype.compact=function(){return this.filter(sn)},Ue.prototype.find=function(i){return this.filter(i).head()},Ue.prototype.findLast=function(i){return this.reverse().find(i)},Ue.prototype.invokeMap=Oe(function(i,u){return typeof i=="function"?new Ue(this):this.map(function(l){return nu(l,i,u)})}),Ue.prototype.reject=function(i){return this.filter($s(be(i)))},Ue.prototype.slice=function(i,u){i=Re(i);var l=this;return l.__filtered__&&(i>0||u<0)?new Ue(l):(i<0?l=l.takeRight(-i):i&&(l=l.drop(i)),u!==t&&(u=Re(u),l=u<0?l.dropRight(-u):l.take(u-i)),l)},Ue.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ue.prototype.toArray=function(){return this.take(he)},ur(Ue.prototype,function(i,u){var l=/^(?:filter|find|map|reject)|While$/.test(u),p=/^(?:head|last)$/.test(u),x=A[p?"take"+(u=="last"?"Right":""):u],B=p||/^find/.test(u);x&&(A.prototype[u]=function(){var M=this.__wrapped__,U=p?[1]:arguments,X=M instanceof Ue,j=U[0],z=X||Te(M),ne=function(Pe){var Ge=x.apply(A,Zr([Pe],U));return p&&ue?Ge[0]:Ge};z&&l&&typeof j=="function"&&j.length!=1&&(X=z=!1);var ue=this.__chain__,de=!!this.__actions__.length,xe=B&&!ue,Ne=X&&!de;if(!B&&z){M=Ne?M:new Ue(this);var ye=i.apply(M,U);return ye.__actions__.push({func:Ns,args:[ne],thisArg:t}),new Ln(ye,ue)}return xe&&Ne?i.apply(this,U):(ye=this.thru(ne),xe?p?ye.value()[0]:ye.value():ye)})}),kn(["pop","push","shift","sort","splice","unshift"],function(i){var u=ss[i],l=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",p=/^(?:pop|shift)$/.test(i);A.prototype[i]=function(){var x=arguments;if(p&&!this.__chain__){var B=this.value();return u.apply(Te(B)?B:[],x)}return this[l](function(M){return u.apply(Te(M)?M:[],x)})}}),ur(Ue.prototype,function(i,u){var l=A[u];if(l){var p=l.name+"";tt.call(ua,p)||(ua[p]=[]),ua[p].push({name:u,func:l})}}),ua[Bs(t,L).name]=[{name:"wrapper",func:t}],Ue.prototype.clone=Mx,Ue.prototype.reverse=Px,Ue.prototype.value=$x,A.prototype.at=gE,A.prototype.chain=pE,A.prototype.commit=_E,A.prototype.next=vE,A.prototype.plant=mE,A.prototype.reverse=bE,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=DE,A.prototype.first=A.prototype.head,Ya&&(A.prototype[Ya]=wE),A},ra=_x();Di?((Di.exports=ra)._=ra,kf._=ra):qt._=ra}).call(vn)}(fr,fr.exports);var vp=fr.exports,on=wn(vp);class Ye{constructor(n,t){if(this.start=n,this.end=t,t<n)throw new RangeError("End cannot be less than start");this.start=n,this.end=t}serialize(){return this}static deserialize(n){return new Ye(n.start,n.end)}*[Symbol.iterator](){yield this.start,yield this.end}getOverlap(n){const t=Math.max(this.start,n.start),a=Math.min(this.end,n.end);return t<a?new Ye(t,a):null}getLength(){return this.end-this.start}toString(){return`[${this.start}, ${this.end})`}}class it extends Ye{constructor(n,t,a){super(t,a),this.chr=n,this.start=t,this.end=a}static parse(n){const t=n.replace(/,/g,"").match(/([\w:.]+)\W+(\d+)\W+(\d+)/),a=n.includes(":")?1:0;if(t){const o=t[1],s=Math.max(Number.parseInt(t[2],10)-a,0),f=Number.parseInt(t[3],10);return new it(o,s,f)}else throw new RangeError("Could not parse interval")}static mergeAdvanced(n,t,a){const o=on.groupBy(n,f=>a(f).chr),s=[];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++}s.push({locus:new it(f,c,D),sources:h.slice(d,y)}),d=y}}return s}static mergeOverlaps(n,t=2e3){return it.mergeAdvanced(n,t,on.identity).map(o=>o.locus)}serialize(){return this}static deserialize(n){return new it(n.chr,n.start,n.end)}*[Symbol.iterator](){yield this.start,yield this.end}getLength(){return this.end-this.start}getOverlap(n){if(this.chr!==n.chr)return null;{const t=this.toOpenInterval().getOverlap(n);return t?new it(this.chr,t.start,t.end):null}}toString(){return`${this.chr}:${this.start}-${this.end}`}toOpenInterval(){return new Ye(this.start,this.end)}toStringWithOther(n){return`${this.chr}:${this.start}-${n.chr}:${n.end}`}}const wp="+",mp="-";class Yn{constructor(n,t,a="",o=null){ge(this,"name");ge(this,"score");ge(this,"id");ge(this,"sequence");ge(this,"variant");ge(this,"value");this.locus=t,this.strand=a,this.name=n===void 0?t.toString():n,this.locus=t,this.strand=a,this.value=o}serialize(){return{name:this.name,locus:this.getLocus().serialize(),strand:this.strand}}static deserialize(n){return new Yn(n.name,it.deserialize(n.locus),n.strand)}getName(){return this.name}getLocus(){return this.locus}getLength(){return this.locus.getLength()}getStrand(){return this.strand}getIsForwardStrand(){return this.strand===wp}getIsReverseStrand(){return this.strand===mp}getHasStrand(){return this.getIsForwardStrand()||this.getIsReverseStrand()}computeNavContextCoordinates(n){return n.convertGenomeIntervalToBases(this.getLocus())}}const bp="-";class Dp extends Yn{constructor(t){const a=new it(t.chr,t.start,t.end);super(t[3].id,a,t.strand);ge(this,"queryLocus");ge(this,"targetSeq");ge(this,"querySeq");ge(this,"queryStrand");const{chr:o,start:s,stop:f,strand:h,targetseq:v,queryseq:d}=t[3].genomealign;this.queryLocus=new it(o,s,f),this.querySeq=d||"",this.targetSeq=v||"",this.queryStrand=h}getIsReverseStrandQuery(){return this.queryStrand===bp}}const fu=0;class Ii{constructor(n,t=fu,a){ge(this,"_navContext");ge(this,"_startBase");ge(this,"_endBase");this._navContext=n,a===void 0&&(a=n.getTotalBases()),this.setRegion(t,a)}clone(){return new Ii(this._navContext,this._startBase,this._endBase)}getNavigationContext(){return this._navContext}getWidth(){return this._endBase-this._startBase}getContextCoordinates(){return new Ye(this._startBase,this._endBase)}getFeatureSegments(n=!0){return this._navContext.getFeaturesInInterval(this._startBase,this._endBase,n)}getGenomeIntervals(){return this._navContext.getLociInInterval(this._startBase,this._endBase)}setRegion(n,t){if(!Number.isFinite(n)||!Number.isFinite(t))throw new RangeError("Start and end must be well-defined");if(t<n)throw new RangeError("Start must be less than or equal to end");const a=t-n,o=this._navContext.getTotalBases();return n<fu?t=fu+a:t>o&&(n=o-a),this._startBase=Math.round(Math.max(fu,n)),this._endBase=Math.round(Math.min(t,o)),this}pan(n){return this.setRegion(this._startBase+n,this._endBase+n),this}panLeft(){const n=this.getWidth();return this.pan(-n)}panRight(){const n=this.getWidth();return this.pan(n)}zoom(n,t=.5){if(n<=0)throw new RangeError("Zoom factor must be greater than 0");const a=this.getWidth()*n,o=this.getWidth()*t+this._startBase,s=a*t+this._startBase,f=o-s,h=this._startBase+f,v=this._startBase+a+f;return this.setRegion(h,v),this}currentRegionAsString(){const n=this.getFeatureSegments();if(n.length===1)return n[0].toString();{const t=n[0],a=n[n.length-1];return t.toStringWithOther(a)}}}let xp=class{},yp=class{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(n=new xp){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(n),n.aborted?this.handleAborted(n):typeof n.addEventListener=="function"&&n.addEventListener("abort",()=>{this.handleAborted(n)})}handleAborted(n){this.signals.delete(n),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}},Ep=class{constructor(){this.callbacks=new Set}addCallback(n=()=>{}){this.callbacks.add(n),n(this.currentMessage)}callback(n){this.currentMessage=n;for(const t of this.callbacks)t(n)}},Ap=class Ml{constructor({fill:n,cache:t}){if(typeof n!="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=n}static isAbortException(n){return n.name==="AbortError"||n.code==="ERR_ABORTED"||n.message==="AbortError: aborted"||n.message==="Error: aborted"}evict(n,t){this.cache.get(n)===t&&this.cache.delete(n)}fill(n,t,a,o){const s=new yp,f=new Ep;f.addCallback(o);const h={aborter:s,promise:this.fillCallback(t,s.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(n,h)}),h.promise.then(()=>{h.settled=!0},()=>{h.settled=!0,this.evict(n,h)}).catch(v=>{throw console.error(v),v}),this.cache.set(n,h)}static checkSinglePromise(n,t){function a(){if(t!=null&&t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return n.then(o=>(a(),o),o=>{throw a(),o})}has(n){return this.cache.has(n)}get(n,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 s=this.cache.get(n);return s?s.aborted&&!s.settled?(this.evict(n,s),this.get(n,t,a,o)):s.settled?s.promise:(s.aborter.addSignal(a),s.statusReporter.addCallback(o),Ml.checkSinglePromise(s.promise,a)):(this.fill(n,t,a,o),Ml.checkSinglePromise(this.cache.get(n).promise,a))}delete(n){const t=this.cache.get(n);t&&(t.settled||t.aborter.abort(),this.cache.delete(n))}clear(){const n=this.cache.keys();let t=0;for(let a=n.next();!a.done;a=n.next())this.delete(a.value),t+=1;return t}};class Fp{constructor(n={}){if(!(n.maxSize&&n.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=n.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(n,t){this.cache.set(n,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n)){const t=this.oldCache.get(n);return this.oldCache.delete(n),this._set(n,t),t}}set(n,t){return this.cache.has(n)?this.cache.set(n,t):this._set(n,t),this}has(n){return this.cache.has(n)||this.oldCache.has(n)}peek(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n))return this.oldCache.get(n)}delete(n){const t=this.cache.delete(n);return t&&this._size--,this.oldCache.delete(n)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[n]of this)yield n}*values(){for(const[,n]of this)yield n}*[Symbol.iterator](){for(const n of this.cache)yield n;for(const n of this.oldCache){const[t]=n;this.cache.has(t)||(yield n)}}get size(){let n=0;for(const t of this.oldCache.keys())this.cache.has(t)||n++;return this._size+n}}var Cp=Fp,Pl=wn(Cp),$l={},lu={};lu.byteLength=Ip,lu.toByteArray=kp,lu.fromByteArray=Np;for(var Qn=[],mn=[],Bp=typeof Uint8Array<"u"?Uint8Array:Array,Hs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ti=0,Sp=Hs.length;Ti<Sp;++Ti)Qn[Ti]=Hs[Ti],mn[Hs.charCodeAt(Ti)]=Ti;mn[45]=62,mn[95]=63;function Ul(e){var n=e.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=n);var a=t===n?0:4-t%4;return[t,a]}function Ip(e){var n=Ul(e),t=n[0],a=n[1];return(t+a)*3/4-a}function Tp(e,n,t){return(n+t)*3/4-t}function kp(e){var n,t=Ul(e),a=t[0],o=t[1],s=new Bp(Tp(e,a,o)),f=0,h=o>0?a-4:a,v;for(v=0;v<h;v+=4)n=mn[e.charCodeAt(v)]<<18|mn[e.charCodeAt(v+1)]<<12|mn[e.charCodeAt(v+2)]<<6|mn[e.charCodeAt(v+3)],s[f++]=n>>16&255,s[f++]=n>>8&255,s[f++]=n&255;return o===2&&(n=mn[e.charCodeAt(v)]<<2|mn[e.charCodeAt(v+1)]>>4,s[f++]=n&255),o===1&&(n=mn[e.charCodeAt(v)]<<10|mn[e.charCodeAt(v+1)]<<4|mn[e.charCodeAt(v+2)]>>2,s[f++]=n>>8&255,s[f++]=n&255),s}function Rp(e){return Qn[e>>18&63]+Qn[e>>12&63]+Qn[e>>6&63]+Qn[e&63]}function Lp(e,n,t){for(var a,o=[],s=n;s<t;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),o.push(Rp(a));return o.join("")}function Np(e){for(var n,t=e.length,a=t%3,o=[],s=16383,f=0,h=t-a;f<h;f+=s)o.push(Lp(e,f,f+s>h?h:f+s));return a===1?(n=e[t-1],o.push(Qn[n>>2]+Qn[n<<4&63]+"==")):a===2&&(n=(e[t-2]<<8)+e[t-1],o.push(Qn[n>>10]+Qn[n>>4&63]+Qn[n<<2&63]+"=")),o.join("")}var Zs={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Zs.read=function(e,n,t,a,o){var s,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=e[n+D];for(D+=y,s=m&(1<<-c)-1,m>>=-c,c+=h;c>0;s=s*256+e[n+D],D+=y,c-=8);for(f=s&(1<<-c)-1,s>>=-c,c+=a;c>0;f=f*256+e[n+D],D+=y,c-=8);if(s===0)s=1-d;else{if(s===v)return f?NaN:(m?-1:1)*(1/0);f=f+Math.pow(2,a),s=s-d}return(m?-1:1)*f*Math.pow(2,s-a)},Zs.write=function(e,n,t,a,o,s){var f,h,v,d=s*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:s-1,I=a?1:-1,F=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(h=isNaN(n)?1:0,f=c):(f=Math.floor(Math.log(n)/Math.LN2),n*(v=Math.pow(2,-f))<1&&(f--,v*=2),f+D>=1?n+=y/v:n+=y*Math.pow(2,1-D),n*v>=2&&(f++,v/=2),f+D>=c?(h=0,f=c):f+D>=1?(h=(n*v-1)*Math.pow(2,o),f=f+D):(h=n*Math.pow(2,D-1)*Math.pow(2,o),f=0));o>=8;e[t+m]=h&255,m+=I,h/=256,o-=8);for(f=f<<o|h,d+=o;d>0;e[t+m]=f&255,m+=I,f/=256,d-=8);e[t+m-I]|=F*128};/*!
28
- * The buffer module from node.js, for the browser.
29
- *
30
- * @author Feross Aboukhadijeh <https://feross.org>
31
- * @license MIT
32
- */(function(e){const n=lu,t=Zs,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=$,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:s,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 s(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,s.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 s(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 F(E,_);if(f.isView(E))return L(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(nt(E,f)||E&&nt(E.buffer,f)||typeof h<"u"&&(nt(E,h)||E&&nt(E.buffer,h)))return G(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 H=P(E);if(H)return H;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,s.prototype),Object.setPrototypeOf(c,s);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:T(E)|0)}c.allocUnsafe=function(E){return I(E)},c.allocUnsafeSlow=function(E){return I(E)};function F(E,_){if((typeof _!="string"||_==="")&&(_="utf8"),!c.isEncoding(_))throw new TypeError("Unknown encoding: "+_);const w=q(E,_)|0;let R=d(w);const H=R.write(E,_);return H!==w&&(R=R.slice(0,H)),R}function k(E){const _=E.length<0?0:T(E.length)|0,w=d(_);for(let R=0;R<_;R+=1)w[R]=E[R]&255;return w}function L(E){if(nt(E,s)){const _=new s(E);return G(_.buffer,_.byteOffset,_.byteLength)}return k(E)}function G(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 s(E):w===void 0?R=new s(E,_):R=new s(E,_,w),Object.setPrototypeOf(R,c.prototype),R}function P(E){if(c.isBuffer(E)){const _=T(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):k(E);if(E.type==="Buffer"&&Array.isArray(E.data))return k(E.data)}function T(E){if(E>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return E|0}function $(E){return+E!=E&&(E=0),c.alloc(+E)}c.isBuffer=function(_){return _!=null&&_._isBuffer===!0&&_!==c.prototype},c.compare=function(_,w){if(nt(_,s)&&(_=c.from(_,_.offset,_.byteLength)),nt(w,s)&&(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,H=w.length;for(let K=0,J=Math.min(R,H);K<J;++K)if(_[K]!==w[K]){R=_[K],H=w[K];break}return R<H?-1:H<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 H=c.allocUnsafe(w);let K=0;for(R=0;R<_.length;++R){let J=_[R];if(nt(J,s))K+J.length>H.length?(c.isBuffer(J)||(J=c.from(J)),J.copy(H,K)):s.prototype.set.call(H,J,K);else if(c.isBuffer(J))J.copy(H,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=J.length}return H};function q(E,_){if(c.isBuffer(E))return E.length;if(f.isView(E)||nt(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 H=!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 Yt(E).length;default:if(H)return R?-1:At(E).length;_=(""+_).toLowerCase(),H=!0}}c.byteLength=q;function N(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 se(this,_,w);case"utf8":case"utf-8":return ae(this,_,w);case"ascii":return Xe(this,_,w);case"latin1":case"binary":return he(this,_,w);case"base64":return Fe(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 C(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)C(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)C(this,w,w+3),C(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)C(this,w,w+7),C(this,w+1,w+6),C(this,w+2,w+5),C(this,w+3,w+4);return this},c.prototype.toString=function(){const _=this.length;return _===0?"":arguments.length===0?ae(this,0,_):N.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=e.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,H,K){if(nt(_,s)&&(_=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),H===void 0&&(H=0),K===void 0&&(K=this.length),w<0||R>_.length||H<0||K>this.length)throw new RangeError("out of range index");if(H>=K&&w>=R)return 0;if(H>=K)return-1;if(w>=R)return 1;if(w>>>=0,R>>>=0,H>>>=0,K>>>=0,this===_)return 0;let J=K-H,ke=R-w;const mt=Math.min(J,ke),ft=this.slice(H,K),bt=_.slice(w,R);for(let ze=0;ze<mt;++ze)if(ft[ze]!==bt[ze]){J=ft[ze],ke=bt[ze];break}return J<ke?-1:ke<J?1:0};function S(E,_,w,R,H){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=H?0:E.length-1),w<0&&(w=E.length+w),w>=E.length){if(H)return-1;w=E.length-1}else if(w<0)if(H)w=0;else return-1;if(typeof _=="string"&&(_=c.from(_,R)),c.isBuffer(_))return _.length===0?-1:O(E,_,w,R,H);if(typeof _=="number")return _=_&255,typeof s.prototype.indexOf=="function"?H?s.prototype.indexOf.call(E,_,w):s.prototype.lastIndexOf.call(E,_,w):O(E,[_],w,R,H);throw new TypeError("val must be string, number or Buffer")}function O(E,_,w,R,H){let K=1,J=E.length,ke=_.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;K=2,J/=2,ke/=2,w/=2}function mt(bt,ze){return K===1?bt[ze]:bt.readUInt16BE(ze*K)}let ft;if(H){let bt=-1;for(ft=w;ft<J;ft++)if(mt(E,ft)===mt(_,bt===-1?0:ft-bt)){if(bt===-1&&(bt=ft),ft-bt+1===ke)return bt*K}else bt!==-1&&(ft-=ft-bt),bt=-1}else for(w+ke>J&&(w=J-ke),ft=w;ft>=0;ft--){let bt=!0;for(let ze=0;ze<ke;ze++)if(mt(E,ft+ze)!==mt(_,ze)){bt=!1;break}if(bt)return ft}return-1}c.prototype.includes=function(_,w,R){return this.indexOf(_,w,R)!==-1},c.prototype.indexOf=function(_,w,R){return S(this,_,w,R,!0)},c.prototype.lastIndexOf=function(_,w,R){return S(this,_,w,R,!1)};function W(E,_,w,R){w=Number(w)||0;const H=E.length-w;R?(R=Number(R),R>H&&(R=H)):R=H;const K=_.length;R>K/2&&(R=K/2);let J;for(J=0;J<R;++J){const ke=parseInt(_.substr(J*2,2),16);if(wt(ke))return J;E[w+J]=ke}return J}function V(E,_,w,R){return yt(At(_,E.length-w),E,w,R)}function te(E,_,w,R){return yt(vt(_),E,w,R)}function ie(E,_,w,R){return yt(Yt(_),E,w,R)}function le(E,_,w,R){return yt(xt(_,E.length-w),E,w,R)}c.prototype.write=function(_,w,R,H){if(w===void 0)H="utf8",R=this.length,w=0;else if(R===void 0&&typeof w=="string")H=w,R=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(R)?(R=R>>>0,H===void 0&&(H="utf8")):(H=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-w;if((R===void 0||R>K)&&(R=K),_.length>0&&(R<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let J=!1;for(;;)switch(H){case"hex":return W(this,_,w,R);case"utf8":case"utf-8":return V(this,_,w,R);case"ascii":case"latin1":case"binary":return te(this,_,w,R);case"base64":return ie(this,_,w,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,_,w,R);default:if(J)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),J=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fe(E,_,w){return _===0&&w===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(_,w))}function ae(E,_,w){w=Math.min(E.length,w);const R=[];let H=_;for(;H<w;){const K=E[H];let J=null,ke=K>239?4:K>223?3:K>191?2:1;if(H+ke<=w){let mt,ft,bt,ze;switch(ke){case 1:K<128&&(J=K);break;case 2:mt=E[H+1],(mt&192)===128&&(ze=(K&31)<<6|mt&63,ze>127&&(J=ze));break;case 3:mt=E[H+1],ft=E[H+2],(mt&192)===128&&(ft&192)===128&&(ze=(K&15)<<12|(mt&63)<<6|ft&63,ze>2047&&(ze<55296||ze>57343)&&(J=ze));break;case 4:mt=E[H+1],ft=E[H+2],bt=E[H+3],(mt&192)===128&&(ft&192)===128&&(bt&192)===128&&(ze=(K&15)<<18|(mt&63)<<12|(ft&63)<<6|bt&63,ze>65535&&ze<1114112&&(J=ze))}}J===null?(J=65533,ke=1):J>65535&&(J-=65536,R.push(J>>>10&1023|55296),J=56320|J&1023),R.push(J),H+=ke}return _e(R)}const pe=4096;function _e(E){const _=E.length;if(_<=pe)return String.fromCharCode.apply(String,E);let w="",R=0;for(;R<_;)w+=String.fromCharCode.apply(String,E.slice(R,R+=pe));return w}function Xe(E,_,w){let R="";w=Math.min(E.length,w);for(let H=_;H<w;++H)R+=String.fromCharCode(E[H]&127);return R}function he(E,_,w){let R="";w=Math.min(E.length,w);for(let H=_;H<w;++H)R+=String.fromCharCode(E[H]);return R}function se(E,_,w){const R=E.length;(!_||_<0)&&(_=0),(!w||w<0||w>R)&&(w=R);let H="";for(let K=_;K<w;++K)H+=Ft[E[K]];return H}function fe(E,_,w){const R=E.slice(_,w);let H="";for(let K=0;K<R.length-1;K+=2)H+=String.fromCharCode(R[K]+R[K+1]*256);return H}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 H=this.subarray(_,w);return Object.setPrototypeOf(H,c.prototype),H};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 H=this[_],K=1,J=0;for(;++J<w&&(K*=256);)H+=this[_+J]*K;return H},c.prototype.readUintBE=c.prototype.readUIntBE=function(_,w,R){_=_>>>0,w=w>>>0,R||Ee(_,w,this.length);let H=this[_+--w],K=1;for(;w>0&&(K*=256);)H+=this[_+--w]*K;return H},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,Ae(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&je(_,this.length-8);const H=w+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24,K=this[++_]+this[++_]*2**8+this[++_]*2**16+R*2**24;return BigInt(H)+(BigInt(K)<<BigInt(32))}),c.prototype.readBigUInt64BE=dt(function(_){_=_>>>0,Ae(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&je(_,this.length-8);const H=w*2**24+this[++_]*2**16+this[++_]*2**8+this[++_],K=this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+R;return(BigInt(H)<<BigInt(32))+BigInt(K)}),c.prototype.readIntLE=function(_,w,R){_=_>>>0,w=w>>>0,R||Ee(_,w,this.length);let H=this[_],K=1,J=0;for(;++J<w&&(K*=256);)H+=this[_+J]*K;return K*=128,H>=K&&(H-=Math.pow(2,8*w)),H},c.prototype.readIntBE=function(_,w,R){_=_>>>0,w=w>>>0,R||Ee(_,w,this.length);let H=w,K=1,J=this[_+--H];for(;H>0&&(K*=256);)J+=this[_+--H]*K;return K*=128,J>=K&&(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,Ae(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&je(_,this.length-8);const H=this[_+4]+this[_+5]*2**8+this[_+6]*2**16+(R<<24);return(BigInt(H)<<BigInt(32))+BigInt(w+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24)}),c.prototype.readBigInt64BE=dt(function(_){_=_>>>0,Ae(_,"offset");const w=this[_],R=this[_+7];(w===void 0||R===void 0)&&je(_,this.length-8);const H=(w<<24)+this[++_]*2**16+this[++_]*2**8+this[++_];return(BigInt(H)<<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,H,K){if(!c.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>H||_<K)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,H){if(_=+_,w=w>>>0,R=R>>>0,!H){const ke=Math.pow(2,8*R)-1;ve(this,_,w,R,ke,0)}let K=1,J=0;for(this[w]=_&255;++J<R&&(K*=256);)this[w+J]=_/K&255;return w+R},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(_,w,R,H){if(_=+_,w=w>>>0,R=R>>>0,!H){const ke=Math.pow(2,8*R)-1;ve(this,_,w,R,ke,0)}let K=R-1,J=1;for(this[w+K]=_&255;--K>=0&&(J*=256);)this[w+K]=_/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,H){Ce(_,R,H,E,w,7);let K=Number(_&BigInt(4294967295));E[w++]=K,K=K>>8,E[w++]=K,K=K>>8,E[w++]=K,K=K>>8,E[w++]=K;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,H){Ce(_,R,H,E,w,7);let K=Number(_&BigInt(4294967295));E[w+7]=K,K=K>>8,E[w+6]=K,K=K>>8,E[w+5]=K,K=K>>8,E[w+4]=K;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,H){if(_=+_,w=w>>>0,!H){const mt=Math.pow(2,8*R-1);ve(this,_,w,R,mt-1,-mt)}let K=0,J=1,ke=0;for(this[w]=_&255;++K<R&&(J*=256);)_<0&&ke===0&&this[w+K-1]!==0&&(ke=1),this[w+K]=(_/J>>0)-ke&255;return w+R},c.prototype.writeIntBE=function(_,w,R,H){if(_=+_,w=w>>>0,!H){const mt=Math.pow(2,8*R-1);ve(this,_,w,R,mt-1,-mt)}let K=R-1,J=1,ke=0;for(this[w+K]=_&255;--K>=0&&(J*=256);)_<0&&ke===0&&this[w+K+1]!==0&&(ke=1),this[w+K]=(_/J>>0)-ke&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 me(E,_,w,R,H,K){if(w+R>E.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function Be(E,_,w,R,H){return _=+_,w=w>>>0,H||me(E,_,w,4),t.write(E,_,w,R,23,4),w+4}c.prototype.writeFloatLE=function(_,w,R){return Be(this,_,w,!0,R)},c.prototype.writeFloatBE=function(_,w,R){return Be(this,_,w,!1,R)};function Ve(E,_,w,R,H){return _=+_,w=w>>>0,H||me(E,_,w,8),t.write(E,_,w,R,52,8),w+8}c.prototype.writeDoubleLE=function(_,w,R){return Ve(this,_,w,!0,R)},c.prototype.writeDoubleBE=function(_,w,R){return Ve(this,_,w,!1,R)},c.prototype.copy=function(_,w,R,H){if(!c.isBuffer(_))throw new TypeError("argument should be a Buffer");if(R||(R=0),!H&&H!==0&&(H=this.length),w>=_.length&&(w=_.length),w||(w=0),H>0&&H<R&&(H=R),H===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(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),_.length-w<H-R&&(H=_.length-w+R);const K=H-R;return this===_&&typeof s.prototype.copyWithin=="function"?this.copyWithin(w,R,H):s.prototype.set.call(_,this.subarray(R,H),w),K},c.prototype.fill=function(_,w,R,H){if(typeof _=="string"){if(typeof w=="string"?(H=w,w=0,R=this.length):typeof R=="string"&&(H=R,R=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!c.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(_.length===1){const J=_.charCodeAt(0);(H==="utf8"&&J<128||H==="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 K;if(typeof _=="number")for(K=w;K<R;++K)this[K]=_;else{const J=c.isBuffer(_)?_:c.from(_,H),ke=J.length;if(ke===0)throw new TypeError('The value "'+_+'" is invalid for argument "value"');for(K=0;K<R-w;++K)this[K+w]=J[K%ke]}return this};const ce={};function Me(E,_,w){ce[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(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}Me("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Me("ERR_INVALID_ARG_TYPE",function(E,_){return`The "${E}" argument must be of type number. Received type ${typeof _}`},TypeError),Me("ERR_OUT_OF_RANGE",function(E,_,w){let R=`The value of "${E}" is out of range.`,H=w;return Number.isInteger(w)&&Math.abs(w)>2**32?H=Ke(String(w)):typeof w=="bigint"&&(H=String(w),(w>BigInt(2)**BigInt(32)||w<-(BigInt(2)**BigInt(32)))&&(H=Ke(H)),H+="n"),R+=` It must be ${_}. Received ${H}`,R},RangeError);function Ke(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){Ae(_,"offset"),(E[_]===void 0||E[_+w]===void 0)&&je(_,E.length-(w+1))}function Ce(E,_,w,R,H,K){if(E>w||E<_){const J=typeof _=="bigint"?"n":"";let ke;throw _===0||_===BigInt(0)?ke=`>= 0${J} and < 2${J} ** ${(K+1)*8}${J}`:ke=`>= -(2${J} ** ${(K+1)*8-1}${J}) and < 2 ** ${(K+1)*8-1}${J}`,new ce.ERR_OUT_OF_RANGE("value",ke,E)}we(R,H,K)}function Ae(E,_){if(typeof E!="number")throw new ce.ERR_INVALID_ARG_TYPE(_,"number",E)}function je(E,_,w){throw Math.floor(E)!==E?(Ae(E,w),new ce.ERR_OUT_OF_RANGE("offset","an integer",E)):_<0?new ce.ERR_BUFFER_OUT_OF_BOUNDS:new ce.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 H=null;const K=[];for(let J=0;J<R;++J){if(w=E.charCodeAt(J),w>55295&&w<57344){if(!H){if(w>56319){(_-=3)>-1&&K.push(239,191,189);continue}else if(J+1===R){(_-=3)>-1&&K.push(239,191,189);continue}H=w;continue}if(w<56320){(_-=3)>-1&&K.push(239,191,189),H=w;continue}w=(H-55296<<10|w-56320)+65536}else H&&(_-=3)>-1&&K.push(239,191,189);if(H=null,w<128){if((_-=1)<0)break;K.push(w)}else if(w<2048){if((_-=2)<0)break;K.push(w>>6|192,w&63|128)}else if(w<65536){if((_-=3)<0)break;K.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((_-=4)<0)break;K.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return K}function vt(E){const _=[];for(let w=0;w<E.length;++w)_.push(E.charCodeAt(w)&255);return _}function xt(E,_){let w,R,H;const K=[];for(let J=0;J<E.length&&!((_-=2)<0);++J)w=E.charCodeAt(J),R=w>>8,H=w%256,K.push(H),K.push(R);return K}function Yt(E){return n.toByteArray(Qe(E))}function yt(E,_,w,R){let H;for(H=0;H<R&&!(H+w>=_.length||H>=E.length);++H)_[H+w]=E[H];return H}function nt(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 H=0;H<16;++H)_[R+H]=E[w]+E[H]}return _}();function dt(E){return typeof BigInt>"u"?Dr:E}function Dr(){throw new Error("BigInt not supported")}})($l);const zr=$l.Buffer;var hu={};function Wl(e){return(typeof e=="object"&&e!==null&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}let Tr=class{async getBufferFromResponse(n){const t=await n.arrayBuffer();return zr.from(t)}constructor(n,t={}){this.baseOverrides={},this.url=n;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(n,t){let a;try{a=await this.fetchImplementation(n,t)}catch(o){if(`${o}`.includes("Failed to fetch")){console.warn(`generic-filehandle: refetching ${n} to attempt to work around chrome CORS header caching bug`);try{a=await this.fetchImplementation(n,{...t,cache:"reload"})}catch(s){throw new Error(`${Wl(s)} fetching ${n}`,{cause:s})}}else throw new Error(`${Wl(o)} fetching ${n}`,{cause:o})}return a}async read(n,t=0,a,o=0,s={}){const{headers:f={},signal:h,overrides:v={}}=s;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(n,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:n}}throw d.status===200?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${d.status} fetching ${this.url}`)}async readFile(n={}){let t,a;typeof n=="string"?(t=n,a={}):(t=n.encoding,a=n,delete a.encoding);const{headers:o={},signal:s,overrides:f={}}=a,h=await this.fetch(this.url,{headers:o,method:"GET",redirect:"follow",mode:"cors",signal:s,...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 n=zr.allocUnsafe(10);if(await this.read(n,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}};function ql(e){const n=new FileReader;return new Promise((t,a)=>{n.onerror=()=>{n.abort(),a(new Error("problem reading blob"))},n.onabort=()=>{a(new Error("blob reading was aborted"))},n.onload=()=>{n.result&&typeof n.result!="string"?t(n.result):a(new Error("unknown error reading blob"))},n.readAsArrayBuffer(e)})}function Op(e){const n=new FileReader;return new Promise((t,a)=>{n.onerror=()=>{n.abort(),a(new Error("problem reading blob"))},n.onabort=()=>{a(new Error("blob reading was aborted"))},n.onload=()=>{n.result&&typeof n.result=="string"?t(n.result):a(new Error("unknown error reading blob"))},n.readAsText(e)})}class Gl{constructor(n){this.blob=n,this.size=n.size}async read(n,t=0,a,o=0){if(!a)return{bytesRead:0,buffer:n};const s=o,f=s+a,h=await ql(this.blob.slice(s,f)),v=zr.from(h);return{bytesRead:v.copy(n,t),buffer:v}}async readFile(n){const t=typeof n=="string"?n:n==null?void 0:n.encoding;if(t==="utf8")return Op(this.blob);if(t)throw new Error(`unsupported encoding: ${t}`);const a=await ql(this.blob);return zr.from(a)}async stat(){return{size:this.size}}async close(){}}var lr={};(function(e){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(s,f){return Object.prototype.hasOwnProperty.call(s,f)}e.assign=function(s){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)&&(s[v]=h[v])}}return s},e.shrinkBuf=function(s,f){return s.length===f?s:s.subarray?s.subarray(0,f):(s.length=f,s)};var a={arraySet:function(s,f,h,v,d){if(f.subarray&&s.subarray){s.set(f.subarray(h,h+v),d);return}for(var c=0;c<v;c++)s[d+c]=f[h+c]},flattenChunks:function(s){var f,h,v,d,c,D;for(v=0,f=0,h=s.length;f<h;f++)v+=s[f].length;for(D=new Uint8Array(v),d=0,f=0,h=s.length;f<h;f++)c=s[f],D.set(c,d),d+=c.length;return D}},o={arraySet:function(s,f,h,v,d){for(var c=0;c<v;c++)s[d+c]=f[h+c]},flattenChunks:function(s){return[].concat.apply([],s)}};e.setTyped=function(s){s?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,a)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(n)})(lr);var da={},Jn={},ki={},Mp=lr,Pp=4,Hl=0,Zl=1,$p=2;function Ri(e){for(var n=e.length;--n>=0;)e[n]=0}var Up=0,Xl=1,Wp=2,qp=3,Gp=258,Xs=29,ga=256,pa=ga+1+Xs,Li=30,Vs=19,Vl=2*pa+1,ei=15,Ks=16,Hp=7,Ys=256,Kl=16,Yl=17,Ql=18,Qs=[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],cu=[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],Zp=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Jl=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Xp=512,hr=new Array((pa+2)*2);Ri(hr);var _a=new Array(Li*2);Ri(_a);var va=new Array(Xp);Ri(va);var wa=new Array(Gp-qp+1);Ri(wa);var Js=new Array(Xs);Ri(Js);var du=new Array(Li);Ri(du);function js(e,n,t,a,o){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=a,this.max_length=o,this.has_stree=e&&e.length}var jl,zl,e0;function zs(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}function t0(e){return e<256?va[e]:va[256+(e>>>7)]}function ma(e,n){e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255}function zt(e,n,t){e.bi_valid>Ks-t?(e.bi_buf|=n<<e.bi_valid&65535,ma(e,e.bi_buf),e.bi_buf=n>>Ks-e.bi_valid,e.bi_valid+=t-Ks):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=t)}function jn(e,n,t){zt(e,t[n*2],t[n*2+1])}function n0(e,n){var t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1}function Vp(e){e.bi_valid===16?(ma(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Kp(e,n){var t=n.dyn_tree,a=n.max_code,o=n.stat_desc.static_tree,s=n.stat_desc.has_stree,f=n.stat_desc.extra_bits,h=n.stat_desc.extra_base,v=n.stat_desc.max_length,d,c,D,y,m,I,F=0;for(y=0;y<=ei;y++)e.bl_count[y]=0;for(t[e.heap[e.heap_max]*2+1]=0,d=e.heap_max+1;d<Vl;d++)c=e.heap[d],y=t[t[c*2+1]*2+1]+1,y>v&&(y=v,F++),t[c*2+1]=y,!(c>a)&&(e.bl_count[y]++,m=0,c>=h&&(m=f[c-h]),I=t[c*2],e.opt_len+=I*(y+m),s&&(e.static_len+=I*(o[c*2+1]+m)));if(F!==0){do{for(y=v-1;e.bl_count[y]===0;)y--;e.bl_count[y]--,e.bl_count[y+1]+=2,e.bl_count[v]--,F-=2}while(F>0);for(y=v;y!==0;y--)for(c=e.bl_count[y];c!==0;)D=e.heap[--d],!(D>a)&&(t[D*2+1]!==y&&(e.opt_len+=(y-t[D*2+1])*t[D*2],t[D*2+1]=y),c--)}}function r0(e,n,t){var a=new Array(ei+1),o=0,s,f;for(s=1;s<=ei;s++)a[s]=o=o+t[s-1]<<1;for(f=0;f<=n;f++){var h=e[f*2+1];h!==0&&(e[f*2]=n0(a[h]++,h))}}function Yp(){var e,n,t,a,o,s=new Array(ei+1);for(t=0,a=0;a<Xs-1;a++)for(Js[a]=t,e=0;e<1<<Qs[a];e++)wa[t++]=a;for(wa[t-1]=a,o=0,a=0;a<16;a++)for(du[a]=o,e=0;e<1<<cu[a];e++)va[o++]=a;for(o>>=7;a<Li;a++)for(du[a]=o<<7,e=0;e<1<<cu[a]-7;e++)va[256+o++]=a;for(n=0;n<=ei;n++)s[n]=0;for(e=0;e<=143;)hr[e*2+1]=8,e++,s[8]++;for(;e<=255;)hr[e*2+1]=9,e++,s[9]++;for(;e<=279;)hr[e*2+1]=7,e++,s[7]++;for(;e<=287;)hr[e*2+1]=8,e++,s[8]++;for(r0(hr,pa+1,s),e=0;e<Li;e++)_a[e*2+1]=5,_a[e*2]=n0(e,5);jl=new js(hr,Qs,ga+1,pa,ei),zl=new js(_a,cu,0,Li,ei),e0=new js(new Array(0),Zp,0,Vs,Hp)}function i0(e){var n;for(n=0;n<pa;n++)e.dyn_ltree[n*2]=0;for(n=0;n<Li;n++)e.dyn_dtree[n*2]=0;for(n=0;n<Vs;n++)e.bl_tree[n*2]=0;e.dyn_ltree[Ys*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function a0(e){e.bi_valid>8?ma(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Qp(e,n,t,a){a0(e),ma(e,t),ma(e,~t),Mp.arraySet(e.pending_buf,e.window,n,t,e.pending),e.pending+=t}function u0(e,n,t,a){var o=n*2,s=t*2;return e[o]<e[s]||e[o]===e[s]&&a[n]<=a[t]}function eo(e,n,t){for(var a=e.heap[t],o=t<<1;o<=e.heap_len&&(o<e.heap_len&&u0(n,e.heap[o+1],e.heap[o],e.depth)&&o++,!u0(n,a,e.heap[o],e.depth));)e.heap[t]=e.heap[o],t=o,o<<=1;e.heap[t]=a}function s0(e,n,t){var a,o,s=0,f,h;if(e.last_lit!==0)do a=e.pending_buf[e.d_buf+s*2]<<8|e.pending_buf[e.d_buf+s*2+1],o=e.pending_buf[e.l_buf+s],s++,a===0?jn(e,o,n):(f=wa[o],jn(e,f+ga+1,n),h=Qs[f],h!==0&&(o-=Js[f],zt(e,o,h)),a--,f=t0(a),jn(e,f,t),h=cu[f],h!==0&&(a-=du[f],zt(e,a,h)));while(s<e.last_lit);jn(e,Ys,n)}function to(e,n){var t=n.dyn_tree,a=n.stat_desc.static_tree,o=n.stat_desc.has_stree,s=n.stat_desc.elems,f,h,v=-1,d;for(e.heap_len=0,e.heap_max=Vl,f=0;f<s;f++)t[f*2]!==0?(e.heap[++e.heap_len]=v=f,e.depth[f]=0):t[f*2+1]=0;for(;e.heap_len<2;)d=e.heap[++e.heap_len]=v<2?++v:0,t[d*2]=1,e.depth[d]=0,e.opt_len--,o&&(e.static_len-=a[d*2+1]);for(n.max_code=v,f=e.heap_len>>1;f>=1;f--)eo(e,t,f);d=s;do f=e.heap[1],e.heap[1]=e.heap[e.heap_len--],eo(e,t,1),h=e.heap[1],e.heap[--e.heap_max]=f,e.heap[--e.heap_max]=h,t[d*2]=t[f*2]+t[h*2],e.depth[d]=(e.depth[f]>=e.depth[h]?e.depth[f]:e.depth[h])+1,t[f*2+1]=t[h*2+1]=d,e.heap[1]=d++,eo(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Kp(e,n),r0(t,v,e.bl_count)}function o0(e,n,t){var a,o=-1,s,f=n[0*2+1],h=0,v=7,d=4;for(f===0&&(v=138,d=3),n[(t+1)*2+1]=65535,a=0;a<=t;a++)s=f,f=n[(a+1)*2+1],!(++h<v&&s===f)&&(h<d?e.bl_tree[s*2]+=h:s!==0?(s!==o&&e.bl_tree[s*2]++,e.bl_tree[Kl*2]++):h<=10?e.bl_tree[Yl*2]++:e.bl_tree[Ql*2]++,h=0,o=s,f===0?(v=138,d=3):s===f?(v=6,d=3):(v=7,d=4))}function f0(e,n,t){var a,o=-1,s,f=n[0*2+1],h=0,v=7,d=4;for(f===0&&(v=138,d=3),a=0;a<=t;a++)if(s=f,f=n[(a+1)*2+1],!(++h<v&&s===f)){if(h<d)do jn(e,s,e.bl_tree);while(--h!==0);else s!==0?(s!==o&&(jn(e,s,e.bl_tree),h--),jn(e,Kl,e.bl_tree),zt(e,h-3,2)):h<=10?(jn(e,Yl,e.bl_tree),zt(e,h-3,3)):(jn(e,Ql,e.bl_tree),zt(e,h-11,7));h=0,o=s,f===0?(v=138,d=3):s===f?(v=6,d=3):(v=7,d=4)}}function Jp(e){var n;for(o0(e,e.dyn_ltree,e.l_desc.max_code),o0(e,e.dyn_dtree,e.d_desc.max_code),to(e,e.bl_desc),n=Vs-1;n>=3&&e.bl_tree[Jl[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n}function jp(e,n,t,a){var o;for(zt(e,n-257,5),zt(e,t-1,5),zt(e,a-4,4),o=0;o<a;o++)zt(e,e.bl_tree[Jl[o]*2+1],3);f0(e,e.dyn_ltree,n-1),f0(e,e.dyn_dtree,t-1)}function zp(e){var n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return Hl;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Zl;for(t=32;t<ga;t++)if(e.dyn_ltree[t*2]!==0)return Zl;return Hl}var l0=!1;function e_(e){l0||(Yp(),l0=!0),e.l_desc=new zs(e.dyn_ltree,jl),e.d_desc=new zs(e.dyn_dtree,zl),e.bl_desc=new zs(e.bl_tree,e0),e.bi_buf=0,e.bi_valid=0,i0(e)}function h0(e,n,t,a){zt(e,(Up<<1)+(a?1:0),3),Qp(e,n,t)}function t_(e){zt(e,Xl<<1,3),jn(e,Ys,hr),Vp(e)}function n_(e,n,t,a){var o,s,f=0;e.level>0?(e.strm.data_type===$p&&(e.strm.data_type=zp(e)),to(e,e.l_desc),to(e,e.d_desc),f=Jp(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=t+5,t+4<=o&&n!==-1?h0(e,n,t,a):e.strategy===Pp||s===o?(zt(e,(Xl<<1)+(a?1:0),3),s0(e,hr,_a)):(zt(e,(Wp<<1)+(a?1:0),3),jp(e,e.l_desc.max_code+1,e.d_desc.max_code+1,f+1),s0(e,e.dyn_ltree,e.dyn_dtree)),i0(e),a&&a0(e)}function r_(e,n,t){return e.pending_buf[e.d_buf+e.last_lit*2]=n>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=n&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(wa[t]+ga+1)*2]++,e.dyn_dtree[t0(n)*2]++),e.last_lit===e.lit_bufsize-1}ki._tr_init=e_,ki._tr_stored_block=h0,ki._tr_flush_block=n_,ki._tr_tally=r_,ki._tr_align=t_;function i_(e,n,t,a){for(var o=e&65535|0,s=e>>>16&65535|0,f=0;t!==0;){f=t>2e3?2e3:t,t-=f;do o=o+n[a++]|0,s=s+o|0;while(--f);o%=65521,s%=65521}return o|s<<16|0}var c0=i_;function a_(){for(var e,n=[],t=0;t<256;t++){e=t;for(var a=0;a<8;a++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n}var u_=a_();function s_(e,n,t,a){var o=u_,s=a+t;e^=-1;for(var f=a;f<s;f++)e=e>>>8^o[(e^n[f])&255];return e^-1}var d0=s_,no={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=lr,bn=ki,g0=c0,kr=d0,o_=no,ti=0,f_=1,l_=3,Rr=4,p0=5,zn=0,_0=1,Dn=-2,h_=-3,ro=-5,c_=-1,d_=1,gu=2,g_=3,p_=4,__=0,v_=2,pu=8,w_=9,m_=15,b_=8,D_=29,x_=256,io=x_+1+D_,y_=30,E_=19,A_=2*io+1,F_=15,We=3,Lr=258,$n=Lr+We+1,C_=32,_u=42,ao=69,vu=73,wu=91,mu=103,ni=113,ba=666,Lt=1,Da=2,ri=3,Ni=4,B_=3;function Nr(e,n){return e.msg=o_[n],n}function v0(e){return(e<<1)-(e>4?9:0)}function Or(e){for(var n=e.length;--n>=0;)e[n]=0}function Mr(e){var n=e.state,t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(Xt.arraySet(e.output,n.pending_buf,n.pending_out,t,e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))}function Ut(e,n){bn._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,Mr(e.strm)}function Ze(e,n){e.pending_buf[e.pending++]=n}function xa(e,n){e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255}function S_(e,n,t,a){var o=e.avail_in;return o>a&&(o=a),o===0?0:(e.avail_in-=o,Xt.arraySet(n,e.input,e.next_in,o,t),e.state.wrap===1?e.adler=g0(e.adler,n,o,t):e.state.wrap===2&&(e.adler=kr(e.adler,n,o,t)),e.next_in+=o,e.total_in+=o,o)}function w0(e,n){var t=e.max_chain_length,a=e.strstart,o,s,f=e.prev_length,h=e.nice_match,v=e.strstart>e.w_size-$n?e.strstart-(e.w_size-$n):0,d=e.window,c=e.w_mask,D=e.prev,y=e.strstart+Lr,m=d[a+f-1],I=d[a+f];e.prev_length>=e.good_match&&(t>>=2),h>e.lookahead&&(h=e.lookahead);do if(o=n,!(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(s=Lr-(y-a),a=y-Lr,s>f){if(e.match_start=n,f=s,s>=h)break;m=d[a+f-1],I=d[a+f]}}while((n=D[n&c])>v&&--t!==0);return f<=e.lookahead?f:e.lookahead}function ii(e){var n=e.w_size,t,a,o,s,f;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-$n)){Xt.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,a=e.hash_size,t=a;do o=e.head[--t],e.head[t]=o>=n?o-n:0;while(--a);a=n,t=a;do o=e.prev[--t],e.prev[t]=o>=n?o-n:0;while(--a);s+=n}if(e.strm.avail_in===0)break;if(a=S_(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=a,e.lookahead+e.insert>=We)for(f=e.strstart-e.insert,e.ins_h=e.window[f],e.ins_h=(e.ins_h<<e.hash_shift^e.window[f+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[f+We-1])&e.hash_mask,e.prev[f&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=f,f++,e.insert--,!(e.lookahead+e.insert<We)););}while(e.lookahead<$n&&e.strm.avail_in!==0)}function I_(e,n){var t=65535;for(t>e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ii(e),e.lookahead===0&&n===ti)return Lt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+t;if((e.strstart===0||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,Ut(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-$n&&(Ut(e,!1),e.strm.avail_out===0))return Lt}return e.insert=0,n===Rr?(Ut(e,!0),e.strm.avail_out===0?ri:Ni):(e.strstart>e.block_start&&(Ut(e,!1),e.strm.avail_out===0),Lt)}function uo(e,n){for(var t,a;;){if(e.lookahead<$n){if(ii(e),e.lookahead<$n&&n===ti)return Lt;if(e.lookahead===0)break}if(t=0,e.lookahead>=We&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+We-1])&e.hash_mask,t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-$n&&(e.match_length=w0(e,t)),e.match_length>=We)if(a=bn._tr_tally(e,e.strstart-e.match_start,e.match_length-We),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=We){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+We-1])&e.hash_mask,t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else a=bn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(a&&(Ut(e,!1),e.strm.avail_out===0))return Lt}return e.insert=e.strstart<We-1?e.strstart:We-1,n===Rr?(Ut(e,!0),e.strm.avail_out===0?ri:Ni):e.last_lit&&(Ut(e,!1),e.strm.avail_out===0)?Lt:Da}function Oi(e,n){for(var t,a,o;;){if(e.lookahead<$n){if(ii(e),e.lookahead<$n&&n===ti)return Lt;if(e.lookahead===0)break}if(t=0,e.lookahead>=We&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+We-1])&e.hash_mask,t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=We-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-$n&&(e.match_length=w0(e,t),e.match_length<=5&&(e.strategy===d_||e.match_length===We&&e.strstart-e.match_start>4096)&&(e.match_length=We-1)),e.prev_length>=We&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-We,a=bn._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-We),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=o&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+We-1])&e.hash_mask,t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=We-1,e.strstart++,a&&(Ut(e,!1),e.strm.avail_out===0))return Lt}else if(e.match_available){if(a=bn._tr_tally(e,0,e.window[e.strstart-1]),a&&Ut(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Lt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(a=bn._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<We-1?e.strstart:We-1,n===Rr?(Ut(e,!0),e.strm.avail_out===0?ri:Ni):e.last_lit&&(Ut(e,!1),e.strm.avail_out===0)?Lt:Da}function T_(e,n){for(var t,a,o,s,f=e.window;;){if(e.lookahead<=Lr){if(ii(e),e.lookahead<=Lr&&n===ti)return Lt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=We&&e.strstart>0&&(o=e.strstart-1,a=f[o],a===f[++o]&&a===f[++o]&&a===f[++o])){s=e.strstart+Lr;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<s);e.match_length=Lr-(s-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=We?(t=bn._tr_tally(e,1,e.match_length-We),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=bn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(Ut(e,!1),e.strm.avail_out===0))return Lt}return e.insert=0,n===Rr?(Ut(e,!0),e.strm.avail_out===0?ri:Ni):e.last_lit&&(Ut(e,!1),e.strm.avail_out===0)?Lt:Da}function k_(e,n){for(var t;;){if(e.lookahead===0&&(ii(e),e.lookahead===0)){if(n===ti)return Lt;break}if(e.match_length=0,t=bn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(Ut(e,!1),e.strm.avail_out===0))return Lt}return e.insert=0,n===Rr?(Ut(e,!0),e.strm.avail_out===0?ri:Ni):e.last_lit&&(Ut(e,!1),e.strm.avail_out===0)?Lt:Da}function er(e,n,t,a,o){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=a,this.func=o}var Mi;Mi=[new er(0,0,0,0,I_),new er(4,4,8,4,uo),new er(4,5,16,8,uo),new er(4,6,32,32,uo),new er(4,4,16,16,Oi),new er(8,16,32,32,Oi),new er(8,16,128,128,Oi),new er(8,32,128,256,Oi),new er(32,128,258,1024,Oi),new er(32,258,258,4096,Oi)];function R_(e){e.window_size=2*e.w_size,Or(e.head),e.max_lazy_match=Mi[e.level].max_lazy,e.good_match=Mi[e.level].good_length,e.nice_match=Mi[e.level].nice_length,e.max_chain_length=Mi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=We-1,e.match_available=0,e.ins_h=0}function L_(){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=pu,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(A_*2),this.dyn_dtree=new Xt.Buf16((2*y_+1)*2),this.bl_tree=new Xt.Buf16((2*E_+1)*2),Or(this.dyn_ltree),Or(this.dyn_dtree),Or(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Xt.Buf16(F_+1),this.heap=new Xt.Buf16(2*io+1),Or(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Xt.Buf16(2*io+1),Or(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 m0(e){var n;return!e||!e.state?Nr(e,Dn):(e.total_in=e.total_out=0,e.data_type=v_,n=e.state,n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?_u:ni,e.adler=n.wrap===2?0:1,n.last_flush=ti,bn._tr_init(n),zn)}function b0(e){var n=m0(e);return n===zn&&R_(e.state),n}function N_(e,n){return!e||!e.state||e.state.wrap!==2?Dn:(e.state.gzhead=n,zn)}function D0(e,n,t,a,o,s){if(!e)return Dn;var f=1;if(n===c_&&(n=6),a<0?(f=0,a=-a):a>15&&(f=2,a-=16),o<1||o>w_||t!==pu||a<8||a>15||n<0||n>9||s<0||s>p_)return Nr(e,Dn);a===8&&(a=9);var h=new L_;return e.state=h,h.strm=e,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=n,h.strategy=s,h.method=t,b0(e)}function O_(e,n){return D0(e,n,pu,m_,b_,__)}function M_(e,n){var t,a,o,s;if(!e||!e.state||n>p0||n<0)return e?Nr(e,Dn):Dn;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===ba&&n!==Rr)return Nr(e,e.avail_out===0?ro:Dn);if(a.strm=e,t=a.last_flush,a.last_flush=n,a.status===_u)if(a.wrap===2)e.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>=gu||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&&(e.adler=kr(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=ao):(Ze(a,0),Ze(a,0),Ze(a,0),Ze(a,0),Ze(a,0),Ze(a,a.level===9?2:a.strategy>=gu||a.level<2?4:0),Ze(a,B_),a.status=ni);else{var f=pu+(a.w_bits-8<<4)<<8,h=-1;a.strategy>=gu||a.level<2?h=0:a.level<6?h=1:a.level===6?h=2:h=3,f|=h<<6,a.strstart!==0&&(f|=C_),f+=31-f%31,a.status=ni,xa(a,f),a.strstart!==0&&(xa(a,e.adler>>>16),xa(a,e.adler&65535)),e.adler=1}if(a.status===ao)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&&(e.adler=kr(e.adler,a.pending_buf,a.pending-o,o)),Mr(e),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&&(e.adler=kr(e.adler,a.pending_buf,a.pending-o,o)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=vu)}else a.status=vu;if(a.status===vu)if(a.gzhead.name){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=kr(e.adler,a.pending_buf,a.pending-o,o)),Mr(e),o=a.pending,a.pending===a.pending_buf_size)){s=1;break}a.gzindex<a.gzhead.name.length?s=a.gzhead.name.charCodeAt(a.gzindex++)&255:s=0,Ze(a,s)}while(s!==0);a.gzhead.hcrc&&a.pending>o&&(e.adler=kr(e.adler,a.pending_buf,a.pending-o,o)),s===0&&(a.gzindex=0,a.status=wu)}else a.status=wu;if(a.status===wu)if(a.gzhead.comment){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=kr(e.adler,a.pending_buf,a.pending-o,o)),Mr(e),o=a.pending,a.pending===a.pending_buf_size)){s=1;break}a.gzindex<a.gzhead.comment.length?s=a.gzhead.comment.charCodeAt(a.gzindex++)&255:s=0,Ze(a,s)}while(s!==0);a.gzhead.hcrc&&a.pending>o&&(e.adler=kr(e.adler,a.pending_buf,a.pending-o,o)),s===0&&(a.status=mu)}else a.status=mu;if(a.status===mu&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&Mr(e),a.pending+2<=a.pending_buf_size&&(Ze(a,e.adler&255),Ze(a,e.adler>>8&255),e.adler=0,a.status=ni)):a.status=ni),a.pending!==0){if(Mr(e),e.avail_out===0)return a.last_flush=-1,zn}else if(e.avail_in===0&&v0(n)<=v0(t)&&n!==Rr)return Nr(e,ro);if(a.status===ba&&e.avail_in!==0)return Nr(e,ro);if(e.avail_in!==0||a.lookahead!==0||n!==ti&&a.status!==ba){var v=a.strategy===gu?k_(a,n):a.strategy===g_?T_(a,n):Mi[a.level].func(a,n);if((v===ri||v===Ni)&&(a.status=ba),v===Lt||v===ri)return e.avail_out===0&&(a.last_flush=-1),zn;if(v===Da&&(n===f_?bn._tr_align(a):n!==p0&&(bn._tr_stored_block(a,0,0,!1),n===l_&&(Or(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),Mr(e),e.avail_out===0))return a.last_flush=-1,zn}return n!==Rr?zn:a.wrap<=0?_0:(a.wrap===2?(Ze(a,e.adler&255),Ze(a,e.adler>>8&255),Ze(a,e.adler>>16&255),Ze(a,e.adler>>24&255),Ze(a,e.total_in&255),Ze(a,e.total_in>>8&255),Ze(a,e.total_in>>16&255),Ze(a,e.total_in>>24&255)):(xa(a,e.adler>>>16),xa(a,e.adler&65535)),Mr(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?zn:_0)}function P_(e){var n;return!e||!e.state?Dn:(n=e.state.status,n!==_u&&n!==ao&&n!==vu&&n!==wu&&n!==mu&&n!==ni&&n!==ba?Nr(e,Dn):(e.state=null,n===ni?Nr(e,h_):zn))}function $_(e,n){var t=n.length,a,o,s,f,h,v,d,c;if(!e||!e.state||(a=e.state,f=a.wrap,f===2||f===1&&a.status!==_u||a.lookahead))return Dn;for(f===1&&(e.adler=g0(e.adler,n,t,0)),a.wrap=0,t>=a.w_size&&(f===0&&(Or(a.head),a.strstart=0,a.block_start=0,a.insert=0),c=new Xt.Buf8(a.w_size),Xt.arraySet(c,n,t-a.w_size,a.w_size,0),n=c,t=a.w_size),h=e.avail_in,v=e.next_in,d=e.input,e.avail_in=t,e.next_in=0,e.input=n,ii(a);a.lookahead>=We;){o=a.strstart,s=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(--s);a.strstart=o,a.lookahead=We-1,ii(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,e.next_in=v,e.input=d,e.avail_in=h,a.wrap=f,zn}Jn.deflateInit=O_,Jn.deflateInit2=D0,Jn.deflateReset=b0,Jn.deflateResetKeep=m0,Jn.deflateSetHeader=N_,Jn.deflate=M_,Jn.deflateEnd=P_,Jn.deflateSetDictionary=$_,Jn.deflateInfo="pako deflate (from Nodeca project)";var ai={},bu=lr,x0=!0,y0=!0;try{String.fromCharCode.apply(null,[0])}catch{x0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{y0=!1}for(var ya=new bu.Buf8(256),Pr=0;Pr<256;Pr++)ya[Pr]=Pr>=252?6:Pr>=248?5:Pr>=240?4:Pr>=224?3:Pr>=192?2:1;ya[254]=ya[254]=1,ai.string2buf=function(e){var n,t,a,o,s,f=e.length,h=0;for(o=0;o<f;o++)t=e.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=e.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(n=new bu.Buf8(h),s=0,o=0;s<h;o++)t=e.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=e.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),t<128?n[s++]=t:t<2048?(n[s++]=192|t>>>6,n[s++]=128|t&63):t<65536?(n[s++]=224|t>>>12,n[s++]=128|t>>>6&63,n[s++]=128|t&63):(n[s++]=240|t>>>18,n[s++]=128|t>>>12&63,n[s++]=128|t>>>6&63,n[s++]=128|t&63);return n};function E0(e,n){if(n<65534&&(e.subarray&&y0||!e.subarray&&x0))return String.fromCharCode.apply(null,bu.shrinkBuf(e,n));for(var t="",a=0;a<n;a++)t+=String.fromCharCode(e[a]);return t}ai.buf2binstring=function(e){return E0(e,e.length)},ai.binstring2buf=function(e){for(var n=new bu.Buf8(e.length),t=0,a=n.length;t<a;t++)n[t]=e.charCodeAt(t);return n},ai.buf2string=function(e,n){var t,a,o,s,f=n||e.length,h=new Array(f*2);for(a=0,t=0;t<f;){if(o=e[t++],o<128){h[a++]=o;continue}if(s=ya[o],s>4){h[a++]=65533,t+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&t<f;)o=o<<6|e[t++]&63,s--;if(s>1){h[a++]=65533;continue}o<65536?h[a++]=o:(o-=65536,h[a++]=55296|o>>10&1023,h[a++]=56320|o&1023)}return E0(h,a)},ai.utf8border=function(e,n){var t;for(n=n||e.length,n>e.length&&(n=e.length),t=n-1;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+ya[e[t]]>n?t:n};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 A0=U_,Ea=Jn,Aa=lr,so=ai,oo=no,W_=A0,F0=Object.prototype.toString,q_=0,fo=4,Pi=0,C0=1,B0=2,G_=-1,H_=0,Z_=8;function ui(e){if(!(this instanceof ui))return new ui(e);this.options=Aa.assign({level:G_,method:Z_,chunkSize:16384,windowBits:15,memLevel:8,strategy:H_,to:""},e||{});var n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W_,this.strm.avail_out=0;var t=Ea.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==Pi)throw new Error(oo[t]);if(n.header&&Ea.deflateSetHeader(this.strm,n.header),n.dictionary){var a;if(typeof n.dictionary=="string"?a=so.string2buf(n.dictionary):F0.call(n.dictionary)==="[object ArrayBuffer]"?a=new Uint8Array(n.dictionary):a=n.dictionary,t=Ea.deflateSetDictionary(this.strm,a),t!==Pi)throw new Error(oo[t]);this._dict_set=!0}}ui.prototype.push=function(e,n){var t=this.strm,a=this.options.chunkSize,o,s;if(this.ended)return!1;s=n===~~n?n:n===!0?fo:q_,typeof e=="string"?t.input=so.string2buf(e):F0.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Aa.Buf8(a),t.next_out=0,t.avail_out=a),o=Ea.deflate(t,s),o!==C0&&o!==Pi)return this.onEnd(o),this.ended=!0,!1;(t.avail_out===0||t.avail_in===0&&(s===fo||s===B0))&&(this.options.to==="string"?this.onData(so.buf2binstring(Aa.shrinkBuf(t.output,t.next_out))):this.onData(Aa.shrinkBuf(t.output,t.next_out)))}while((t.avail_in>0||t.avail_out===0)&&o!==C0);return s===fo?(o=Ea.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Pi):(s===B0&&(this.onEnd(Pi),t.avail_out=0),!0)},ui.prototype.onData=function(e){this.chunks.push(e)},ui.prototype.onEnd=function(e){e===Pi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Aa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function lo(e,n){var t=new ui(n);if(t.push(e,!0),t.err)throw t.msg||oo[t.err];return t.result}function X_(e,n){return n=n||{},n.raw=!0,lo(e,n)}function V_(e,n){return n=n||{},n.gzip=!0,lo(e,n)}da.Deflate=ui,da.deflate=lo,da.deflateRaw=X_,da.gzip=V_;var Fa={},Un={},Du=30,K_=12,Y_=function(n,t){var a,o,s,f,h,v,d,c,D,y,m,I,F,k,L,G,P,T,$,q,N,C,S,O,W;a=n.state,o=n.next_in,O=n.input,s=o+(n.avail_in-5),f=n.next_out,W=n.output,h=f-(t-n.avail_out),v=f+(n.avail_out-257),d=a.dmax,c=a.wsize,D=a.whave,y=a.wnext,m=a.window,I=a.hold,F=a.bits,k=a.lencode,L=a.distcode,G=(1<<a.lenbits)-1,P=(1<<a.distbits)-1;e:do{F<15&&(I+=O[o++]<<F,F+=8,I+=O[o++]<<F,F+=8),T=k[I&G];t:for(;;){if($=T>>>24,I>>>=$,F-=$,$=T>>>16&255,$===0)W[f++]=T&65535;else if($&16){q=T&65535,$&=15,$&&(F<$&&(I+=O[o++]<<F,F+=8),q+=I&(1<<$)-1,I>>>=$,F-=$),F<15&&(I+=O[o++]<<F,F+=8,I+=O[o++]<<F,F+=8),T=L[I&P];n:for(;;){if($=T>>>24,I>>>=$,F-=$,$=T>>>16&255,$&16){if(N=T&65535,$&=15,F<$&&(I+=O[o++]<<F,F+=8,F<$&&(I+=O[o++]<<F,F+=8)),N+=I&(1<<$)-1,N>d){n.msg="invalid distance too far back",a.mode=Du;break e}if(I>>>=$,F-=$,$=f-h,N>$){if($=N-$,$>D&&a.sane){n.msg="invalid distance too far back",a.mode=Du;break e}if(C=0,S=m,y===0){if(C+=c-$,$<q){q-=$;do W[f++]=m[C++];while(--$);C=f-N,S=W}}else if(y<$){if(C+=c+y-$,$-=y,$<q){q-=$;do W[f++]=m[C++];while(--$);if(C=0,y<q){$=y,q-=$;do W[f++]=m[C++];while(--$);C=f-N,S=W}}}else if(C+=y-$,$<q){q-=$;do W[f++]=m[C++];while(--$);C=f-N,S=W}for(;q>2;)W[f++]=S[C++],W[f++]=S[C++],W[f++]=S[C++],q-=3;q&&(W[f++]=S[C++],q>1&&(W[f++]=S[C++]))}else{C=f-N;do W[f++]=W[C++],W[f++]=W[C++],W[f++]=W[C++],q-=3;while(q>2);q&&(W[f++]=W[C++],q>1&&(W[f++]=W[C++]))}}else if($&64){n.msg="invalid distance code",a.mode=Du;break e}else{T=L[(T&65535)+(I&(1<<$)-1)];continue n}break}}else if($&64)if($&32){a.mode=K_;break e}else{n.msg="invalid literal/length code",a.mode=Du;break e}else{T=k[(T&65535)+(I&(1<<$)-1)];continue t}break}}while(o<s&&f<v);q=F>>3,o-=q,F-=q<<3,I&=(1<<F)-1,n.next_in=o,n.next_out=f,n.avail_in=o<s?5+(s-o):5-(o-s),n.avail_out=f<v?257+(v-f):257-(f-v),a.hold=I,a.bits=F},S0=lr,$i=15,I0=852,T0=592,k0=0,ho=1,R0=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(n,t,a,o,s,f,h,v){var d=v.bits,c=0,D=0,y=0,m=0,I=0,F=0,k=0,L=0,G=0,P=0,T,$,q,N,C,S=null,O=0,W,V=new S0.Buf16($i+1),te=new S0.Buf16($i+1),ie=null,le=0,Fe,ae,pe;for(c=0;c<=$i;c++)V[c]=0;for(D=0;D<o;D++)V[t[a+D]]++;for(I=d,m=$i;m>=1&&V[m]===0;m--);if(I>m&&(I=m),m===0)return s[f++]=1<<24|64<<16|0,s[f++]=1<<24|64<<16|0,v.bits=1,0;for(y=1;y<m&&V[y]===0;y++);for(I<y&&(I=y),L=1,c=1;c<=$i;c++)if(L<<=1,L-=V[c],L<0)return-1;if(L>0&&(n===k0||m!==1))return-1;for(te[1]=0,c=1;c<$i;c++)te[c+1]=te[c]+V[c];for(D=0;D<o;D++)t[a+D]!==0&&(h[te[t[a+D]]++]=D);if(n===k0?(S=ie=h,W=19):n===ho?(S=Q_,O-=257,ie=J_,le-=257,W=256):(S=j_,ie=z_,W=-1),P=0,D=0,c=y,C=f,F=I,k=0,q=-1,G=1<<I,N=G-1,n===ho&&G>I0||n===R0&&G>T0)return 1;for(;;){Fe=c-k,h[D]<W?(ae=0,pe=h[D]):h[D]>W?(ae=ie[le+h[D]],pe=S[O+h[D]]):(ae=96,pe=0),T=1<<c-k,$=1<<F,y=$;do $-=T,s[C+(P>>k)+$]=Fe<<24|ae<<16|pe|0;while($!==0);for(T=1<<c-1;P&T;)T>>=1;if(T!==0?(P&=T-1,P+=T):P=0,D++,--V[c]===0){if(c===m)break;c=t[a+h[D]]}if(c>I&&(P&N)!==q){for(k===0&&(k=I),C+=y,F=c-k,L=1<<F;F+k<m&&(L-=V[F+k],!(L<=0));)F++,L<<=1;if(G+=1<<F,n===ho&&G>I0||n===R0&&G>T0)return 1;q=P&N,s[q]=I<<24|F<<16|C-f|0}}return P!==0&&(s[C+P]=c-k<<24|64<<16|0),v.bits=I,0},fn=lr,co=c0,tr=d0,t2=Y_,Ca=e2,n2=0,L0=1,N0=2,O0=4,r2=5,xu=6,si=0,i2=1,a2=2,xn=-2,M0=-3,P0=-4,u2=-5,$0=8,U0=1,W0=2,q0=3,G0=4,H0=5,Z0=6,X0=7,V0=8,K0=9,Y0=10,yu=11,cr=12,go=13,Q0=14,po=15,J0=16,j0=17,z0=18,eh=19,Eu=20,Au=21,th=22,nh=23,rh=24,ih=25,ah=26,_o=27,uh=28,sh=29,pt=30,oh=31,s2=32,o2=852,f2=592,l2=15,h2=l2;function fh(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&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 fn.Buf16(320),this.work=new fn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function lh(e){var n;return!e||!e.state?xn:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=U0,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new fn.Buf32(o2),n.distcode=n.distdyn=new fn.Buf32(f2),n.sane=1,n.back=-1,si)}function hh(e){var n;return!e||!e.state?xn:(n=e.state,n.wsize=0,n.whave=0,n.wnext=0,lh(e))}function ch(e,n){var t,a;return!e||!e.state||(a=e.state,n<0?(t=0,n=-n):(t=(n>>4)+1,n<48&&(n&=15)),n&&(n<8||n>15))?xn:(a.window!==null&&a.wbits!==n&&(a.window=null),a.wrap=t,a.wbits=n,hh(e))}function dh(e,n){var t,a;return e?(a=new c2,e.state=a,a.window=null,t=ch(e,n),t!==si&&(e.state=null),t):xn}function d2(e){return dh(e,h2)}var gh=!0,vo,wo;function g2(e){if(gh){var n;for(vo=new fn.Buf32(512),wo=new fn.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Ca(L0,e.lens,0,288,vo,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Ca(N0,e.lens,0,32,wo,0,e.work,{bits:5}),gh=!1}e.lencode=vo,e.lenbits=9,e.distcode=wo,e.distbits=5}function ph(e,n,t,a){var o,s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new fn.Buf8(s.wsize)),a>=s.wsize?(fn.arraySet(s.window,n,t-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>a&&(o=a),fn.arraySet(s.window,n,t-a,o,s.wnext),a-=o,a?(fn.arraySet(s.window,n,t-a,a,0),s.wnext=a,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function p2(e,n){var t,a,o,s,f,h,v,d,c,D,y,m,I,F,k=0,L,G,P,T,$,q,N,C,S=new fn.Buf8(4),O,W,V=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return xn;t=e.state,t.mode===cr&&(t.mode=go),f=e.next_out,o=e.output,v=e.avail_out,s=e.next_in,a=e.input,h=e.avail_in,d=t.hold,c=t.bits,D=h,y=v,C=si;e:for(;;)switch(t.mode){case U0:if(t.wrap===0){t.mode=go;break}for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&2&&d===35615){t.check=0,S[0]=d&255,S[1]=d>>>8&255,t.check=tr(t.check,S,2,0),d=0,c=0,t.mode=W0;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){e.msg="incorrect header check",t.mode=pt;break}if((d&15)!==$0){e.msg="unknown compression method",t.mode=pt;break}if(d>>>=4,c-=4,N=(d&15)+8,t.wbits===0)t.wbits=N;else if(N>t.wbits){e.msg="invalid window size",t.mode=pt;break}t.dmax=1<<N,e.adler=t.check=1,t.mode=d&512?Y0:cr,d=0,c=0;break;case W0:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.flags=d,(t.flags&255)!==$0){e.msg="unknown compression method",t.mode=pt;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=pt;break}t.head&&(t.head.text=d>>8&1),t.flags&512&&(S[0]=d&255,S[1]=d>>>8&255,t.check=tr(t.check,S,2,0)),d=0,c=0,t.mode=q0;case q0:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.time=d),t.flags&512&&(S[0]=d&255,S[1]=d>>>8&255,S[2]=d>>>16&255,S[3]=d>>>24&255,t.check=tr(t.check,S,4,0)),d=0,c=0,t.mode=G0;case G0:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.xflags=d&255,t.head.os=d>>8),t.flags&512&&(S[0]=d&255,S[1]=d>>>8&255,t.check=tr(t.check,S,2,0)),d=0,c=0,t.mode=H0;case H0:if(t.flags&1024){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.length=d,t.head&&(t.head.extra_len=d),t.flags&512&&(S[0]=d&255,S[1]=d>>>8&255,t.check=tr(t.check,S,2,0)),d=0,c=0}else t.head&&(t.head.extra=null);t.mode=Z0;case Z0:if(t.flags&1024&&(m=t.length,m>h&&(m=h),m&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),fn.arraySet(t.head.extra,a,s,m,N)),t.flags&512&&(t.check=tr(t.check,a,m,s)),h-=m,s+=m,t.length-=m),t.length))break e;t.length=0,t.mode=X0;case X0:if(t.flags&2048){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&(t.check=tr(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=V0;case V0:if(t.flags&4096){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.comment+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&(t.check=tr(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.comment=null);t.mode=K0;case K0:if(t.flags&512){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d!==(t.check&65535)){e.msg="header crc mismatch",t.mode=pt;break}d=0,c=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=cr;break;case Y0:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}e.adler=t.check=fh(d),d=0,c=0,t.mode=yu;case yu:if(t.havedict===0)return e.next_out=f,e.avail_out=v,e.next_in=s,e.avail_in=h,t.hold=d,t.bits=c,a2;e.adler=t.check=1,t.mode=cr;case cr:if(n===r2||n===xu)break e;case go:if(t.last){d>>>=c&7,c-=c&7,t.mode=_o;break}for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}switch(t.last=d&1,d>>>=1,c-=1,d&3){case 0:t.mode=Q0;break;case 1:if(g2(t),t.mode=Eu,n===xu){d>>>=2,c-=2;break e}break;case 2:t.mode=j0;break;case 3:e.msg="invalid block type",t.mode=pt}d>>>=2,c-=2;break;case Q0:for(d>>>=c&7,c-=c&7;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if((d&65535)!==(d>>>16^65535)){e.msg="invalid stored block lengths",t.mode=pt;break}if(t.length=d&65535,d=0,c=0,t.mode=po,n===xu)break e;case po:t.mode=J0;case J0:if(m=t.length,m){if(m>h&&(m=h),m>v&&(m=v),m===0)break e;fn.arraySet(o,a,s,m,f),h-=m,s+=m,v-=m,f+=m,t.length-=m;break}t.mode=cr;break;case j0:for(;c<14;){if(h===0)break e;h--,d+=a[s++]<<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){e.msg="too many length or distance symbols",t.mode=pt;break}t.have=0,t.mode=z0;case z0:for(;t.have<t.ncode;){for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.lens[V[t.have++]]=d&7,d>>>=3,c-=3}for(;t.have<19;)t.lens[V[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,O={bits:t.lenbits},C=Ca(n2,t.lens,0,19,t.lencode,0,t.work,O),t.lenbits=O.bits,C){e.msg="invalid code lengths set",t.mode=pt;break}t.have=0,t.mode=eh;case eh:for(;t.have<t.nlen+t.ndist;){for(;k=t.lencode[d&(1<<t.lenbits)-1],L=k>>>24,G=k>>>16&255,P=k&65535,!(L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(P<16)d>>>=L,c-=L,t.lens[t.have++]=P;else{if(P===16){for(W=L+2;c<W;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d>>>=L,c-=L,t.have===0){e.msg="invalid bit length repeat",t.mode=pt;break}N=t.lens[t.have-1],m=3+(d&3),d>>>=2,c-=2}else if(P===17){for(W=L+3;c<W;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=L,c-=L,N=0,m=3+(d&7),d>>>=3,c-=3}else{for(W=L+7;c<W;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=L,c-=L,N=0,m=11+(d&127),d>>>=7,c-=7}if(t.have+m>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=pt;break}for(;m--;)t.lens[t.have++]=N}}if(t.mode===pt)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=pt;break}if(t.lenbits=9,O={bits:t.lenbits},C=Ca(L0,t.lens,0,t.nlen,t.lencode,0,t.work,O),t.lenbits=O.bits,C){e.msg="invalid literal/lengths set",t.mode=pt;break}if(t.distbits=6,t.distcode=t.distdyn,O={bits:t.distbits},C=Ca(N0,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,O),t.distbits=O.bits,C){e.msg="invalid distances set",t.mode=pt;break}if(t.mode=Eu,n===xu)break e;case Eu:t.mode=Au;case Au:if(h>=6&&v>=258){e.next_out=f,e.avail_out=v,e.next_in=s,e.avail_in=h,t.hold=d,t.bits=c,t2(e,y),f=e.next_out,o=e.output,v=e.avail_out,s=e.next_in,a=e.input,h=e.avail_in,d=t.hold,c=t.bits,t.mode===cr&&(t.back=-1);break}for(t.back=0;k=t.lencode[d&(1<<t.lenbits)-1],L=k>>>24,G=k>>>16&255,P=k&65535,!(L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(G&&!(G&240)){for(T=L,$=G,q=P;k=t.lencode[q+((d&(1<<T+$)-1)>>T)],L=k>>>24,G=k>>>16&255,P=k&65535,!(T+L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=T,c-=T,t.back+=T}if(d>>>=L,c-=L,t.back+=L,t.length=P,G===0){t.mode=ah;break}if(G&32){t.back=-1,t.mode=cr;break}if(G&64){e.msg="invalid literal/length code",t.mode=pt;break}t.extra=G&15,t.mode=th;case th:if(t.extra){for(W=t.extra;c<W;){if(h===0)break e;h--,d+=a[s++]<<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=nh;case nh:for(;k=t.distcode[d&(1<<t.distbits)-1],L=k>>>24,G=k>>>16&255,P=k&65535,!(L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(!(G&240)){for(T=L,$=G,q=P;k=t.distcode[q+((d&(1<<T+$)-1)>>T)],L=k>>>24,G=k>>>16&255,P=k&65535,!(T+L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=T,c-=T,t.back+=T}if(d>>>=L,c-=L,t.back+=L,G&64){e.msg="invalid distance code",t.mode=pt;break}t.offset=P,t.extra=G&15,t.mode=rh;case rh:if(t.extra){for(W=t.extra;c<W;){if(h===0)break e;h--,d+=a[s++]<<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){e.msg="invalid distance too far back",t.mode=pt;break}t.mode=ih;case ih:if(v===0)break e;if(m=y-v,t.offset>m){if(m=t.offset-m,m>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=pt;break}m>t.wnext?(m-=t.wnext,I=t.wsize-m):I=t.wnext-m,m>t.length&&(m=t.length),F=t.window}else F=o,I=f-t.offset,m=t.length;m>v&&(m=v),v-=m,t.length-=m;do o[f++]=F[I++];while(--m);t.length===0&&(t.mode=Au);break;case ah:if(v===0)break e;o[f++]=t.length,v--,t.mode=Au;break;case _o:if(t.wrap){for(;c<32;){if(h===0)break e;h--,d|=a[s++]<<c,c+=8}if(y-=v,e.total_out+=y,t.total+=y,y&&(e.adler=t.check=t.flags?tr(t.check,o,y,f-y):co(t.check,o,y,f-y)),y=v,(t.flags?d:fh(d))!==t.check){e.msg="incorrect data check",t.mode=pt;break}d=0,c=0}t.mode=uh;case uh:if(t.wrap&&t.flags){for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=pt;break}d=0,c=0}t.mode=sh;case sh:C=i2;break e;case pt:C=M0;break e;case oh:return P0;case s2:default:return xn}return e.next_out=f,e.avail_out=v,e.next_in=s,e.avail_in=h,t.hold=d,t.bits=c,(t.wsize||y!==e.avail_out&&t.mode<pt&&(t.mode<_o||n!==O0))&&ph(e,e.output,e.next_out,y-e.avail_out),D-=e.avail_in,y-=e.avail_out,e.total_in+=D,e.total_out+=y,t.total+=y,t.wrap&&y&&(e.adler=t.check=t.flags?tr(t.check,o,y,e.next_out-y):co(t.check,o,y,e.next_out-y)),e.data_type=t.bits+(t.last?64:0)+(t.mode===cr?128:0)+(t.mode===Eu||t.mode===po?256:0),(D===0&&y===0||n===O0)&&C===si&&(C=u2),C}function _2(e){if(!e||!e.state)return xn;var n=e.state;return n.window&&(n.window=null),e.state=null,si}function v2(e,n){var t;return!e||!e.state||(t=e.state,!(t.wrap&2))?xn:(t.head=n,n.done=!1,si)}function w2(e,n){var t=n.length,a,o,s;return!e||!e.state||(a=e.state,a.wrap!==0&&a.mode!==yu)?xn:a.mode===yu&&(o=1,o=co(o,n,t,0),o!==a.check)?M0:(s=ph(e,n,t,t),s?(a.mode=oh,P0):(a.havedict=1,si))}Un.inflateReset=hh,Un.inflateReset2=ch,Un.inflateResetKeep=lh,Un.inflateInit=d2,Un.inflateInit2=dh,Un.inflate=p2,Un.inflateEnd=_2,Un.inflateGetHeader=v2,Un.inflateSetDictionary=w2,Un.inflateInfo="pako inflate (from Nodeca project)";var _h={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 m2(){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 b2=m2,Ui=Un,Ba=lr,Fu=ai,Bt=_h,mo=no,D2=A0,x2=b2,vh=Object.prototype.toString;function oi(e){if(!(this instanceof oi))return new oi(e);this.options=Ba.assign({chunkSize:16384,windowBits:0,to:""},e||{});var n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15||(n.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new D2,this.strm.avail_out=0;var t=Ui.inflateInit2(this.strm,n.windowBits);if(t!==Bt.Z_OK)throw new Error(mo[t]);if(this.header=new x2,Ui.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Fu.string2buf(n.dictionary):vh.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=Ui.inflateSetDictionary(this.strm,n.dictionary),t!==Bt.Z_OK)))throw new Error(mo[t])}oi.prototype.push=function(e,n){var t=this.strm,a=this.options.chunkSize,o=this.options.dictionary,s,f,h,v,d,c=!1;if(this.ended)return!1;f=n===~~n?n:n===!0?Bt.Z_FINISH:Bt.Z_NO_FLUSH,typeof e=="string"?t.input=Fu.binstring2buf(e):vh.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Ba.Buf8(a),t.next_out=0,t.avail_out=a),s=Ui.inflate(t,Bt.Z_NO_FLUSH),s===Bt.Z_NEED_DICT&&o&&(s=Ui.inflateSetDictionary(this.strm,o)),s===Bt.Z_BUF_ERROR&&c===!0&&(s=Bt.Z_OK,c=!1),s!==Bt.Z_STREAM_END&&s!==Bt.Z_OK)return this.onEnd(s),this.ended=!0,!1;t.next_out&&(t.avail_out===0||s===Bt.Z_STREAM_END||t.avail_in===0&&(f===Bt.Z_FINISH||f===Bt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(h=Fu.utf8border(t.output,t.next_out),v=t.next_out-h,d=Fu.buf2string(t.output,h),t.next_out=v,t.avail_out=a-v,v&&Ba.arraySet(t.output,t.output,h,v,0),this.onData(d)):this.onData(Ba.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)&&s!==Bt.Z_STREAM_END);return s===Bt.Z_STREAM_END&&(f=Bt.Z_FINISH),f===Bt.Z_FINISH?(s=Ui.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===Bt.Z_OK):(f===Bt.Z_SYNC_FLUSH&&(this.onEnd(Bt.Z_OK),t.avail_out=0),!0)},oi.prototype.onData=function(e){this.chunks.push(e)},oi.prototype.onEnd=function(e){e===Bt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ba.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function bo(e,n){var t=new oi(n);if(t.push(e,!0),t.err)throw t.msg||mo[t.err];return t.result}function y2(e,n){return n=n||{},n.raw=!0,bo(e,n)}Fa.Inflate=oi,Fa.inflate=bo,Fa.inflateRaw=y2,Fa.ungzip=bo;var E2=lr.assign,A2=da,F2=Fa,C2=_h,wh={};E2(wh,A2,F2,C2);var Cu=wh;async function Do(e){try{let n,t=0,a=0;const o=[];let s=0,f;do{const v=e.subarray(t);if(f=new Cu.Inflate,{strm:n}=f,f.push(v,Cu.Z_SYNC_FLUSH),f.err)throw new Error(f.msg);t+=n.next_in,o[a]=f.result,s+=o[a].length,a+=1}while(n.avail_in);const h=new Uint8Array(s);for(let v=0,d=0;v<o.length;v++)h.set(o[v],d),d+=o[v].length;return zr.from(h)}catch(n){throw/incorrect header check/.exec(`${n}`)?new Error("problem decompressing block: incorrect gzip header check"):n}}async function B2(e,n){try{let t;const{minv:a,maxv:o}=n;let s=a.blockPosition,f=a.dataPosition;const h=[],v=[],d=[];let c=0,D=0;do{const I=e.subarray(s-a.blockPosition),F=new Cu.Inflate;if({strm:t}=F,F.push(I,Cu.Z_SYNC_FLUSH),F.err)throw new Error(F.msg);const k=F.result;h.push(k);let L=k.length;v.push(s),d.push(f),h.length===1&&a.dataPosition&&(h[0]=h[0].subarray(a.dataPosition),L=h[0].length);const G=s;if(s+=t.next_in,f+=L,G>=o.blockPosition){h[D]=h[D].subarray(0,o.blockPosition===a.blockPosition?o.dataPosition-a.dataPosition+1:o.dataPosition+1),v.push(s),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,F=0;I<h.length;I++)y.set(h[I],F),F+=h[I].length;return{buffer:zr.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,yn=null;try{yn=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(e,n,t){this.low=e|0,this.high=n|0,this.unsigned=!!t}at.prototype.__isLong__,Object.defineProperty(at.prototype,"__isLong__",{value:!0});function en(e){return(e&&e.__isLong__)===!0}at.isLong=en;var mh={},bh={};function fi(e,n){var t,a,o;return n?(e>>>=0,(o=0<=e&&e<256)&&(a=bh[e],a)?a:(t=ut(e,(e|0)<0?-1:0,!0),o&&(bh[e]=t),t)):(e|=0,(o=-128<=e&&e<128)&&(a=mh[e],a)?a:(t=ut(e,e<0?-1:0,!1),o&&(mh[e]=t),t))}at.fromInt=fi;function En(e,n){if(isNaN(e))return n?li:An;if(n){if(e<0)return li;if(e>=xh)return Ch}else{if(e<=-yh)return tn;if(e+1>=yh)return Fh}return e<0?En(-e,n).neg():ut(e%Wi|0,e/Wi|0,n)}at.fromNumber=En;function ut(e,n,t){return new at(e,n,t)}at.fromBits=ut;var Bu=Math.pow;function xo(e,n,t){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return An;if(typeof n=="number"?(t=n,n=!1):n=!!n,t=t||10,t<2||36<t)throw RangeError("radix");var a;if((a=e.indexOf("-"))>0)throw Error("interior hyphen");if(a===0)return xo(e.substring(1),n,t).neg();for(var o=En(Bu(t,8)),s=An,f=0;f<e.length;f+=8){var h=Math.min(8,e.length-f),v=parseInt(e.substring(f,f+h),t);if(h<8){var d=En(Bu(t,h));s=s.mul(d).add(En(v))}else s=s.mul(o),s=s.add(En(v))}return s.unsigned=n,s}at.fromString=xo;function Wn(e,n){return typeof e=="number"?En(e,n):typeof e=="string"?xo(e,n):ut(e.low,e.high,typeof n=="boolean"?n:e.unsigned)}at.fromValue=Wn;var Dh=65536,I2=1<<24,Wi=Dh*Dh,xh=Wi*Wi,yh=xh/2,Eh=fi(I2),An=fi(0);at.ZERO=An;var li=fi(0,!0);at.UZERO=li;var qi=fi(1);at.ONE=qi;var Ah=fi(1,!0);at.UONE=Ah;var yo=fi(-1);at.NEG_ONE=yo;var Fh=ut(-1,2147483647,!1);at.MAX_VALUE=Fh;var Ch=ut(-1,-1,!0);at.MAX_UNSIGNED_VALUE=Ch;var tn=ut(0,-2147483648,!1);at.MIN_VALUE=tn;var re=at.prototype;re.toInt=function(){return this.unsigned?this.low>>>0:this.low},re.toNumber=function(){return this.unsigned?(this.high>>>0)*Wi+(this.low>>>0):this.high*Wi+(this.low>>>0)},re.toString=function(n){if(n=n||10,n<2||36<n)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(tn)){var t=En(n),a=this.div(t),o=a.mul(t).sub(this);return a.toString(n)+o.toInt().toString(n)}else return"-"+this.neg().toString(n);for(var s=En(Bu(n,6),this.unsigned),f=this,h="";;){var v=f.div(s),d=f.sub(v.mul(s)).toInt()>>>0,c=d.toString(n);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(tn)?64:this.neg().getNumBitsAbs();for(var n=this.high!=0?this.high:this.low,t=31;t>0&&!(n&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(n){return en(n)||(n=Wn(n)),this.unsigned!==n.unsigned&&this.high>>>31===1&&n.high>>>31===1?!1:this.high===n.high&&this.low===n.low},re.eq=re.equals,re.notEquals=function(n){return!this.eq(n)},re.neq=re.notEquals,re.ne=re.notEquals,re.lessThan=function(n){return this.comp(n)<0},re.lt=re.lessThan,re.lessThanOrEqual=function(n){return this.comp(n)<=0},re.lte=re.lessThanOrEqual,re.le=re.lessThanOrEqual,re.greaterThan=function(n){return this.comp(n)>0},re.gt=re.greaterThan,re.greaterThanOrEqual=function(n){return this.comp(n)>=0},re.gte=re.greaterThanOrEqual,re.ge=re.greaterThanOrEqual,re.compare=function(n){if(en(n)||(n=Wn(n)),this.eq(n))return 0;var t=this.isNegative(),a=n.isNegative();return t&&!a?-1:!t&&a?1:this.unsigned?n.high>>>0>this.high>>>0||n.high===this.high&&n.low>>>0>this.low>>>0?-1:1:this.sub(n).isNegative()?-1:1},re.comp=re.compare,re.negate=function(){return!this.unsigned&&this.eq(tn)?tn:this.not().add(qi)},re.neg=re.negate,re.add=function(n){en(n)||(n=Wn(n));var t=this.high>>>16,a=this.high&65535,o=this.low>>>16,s=this.low&65535,f=n.high>>>16,h=n.high&65535,v=n.low>>>16,d=n.low&65535,c=0,D=0,y=0,m=0;return m+=s+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,ut(y<<16|m,c<<16|D,this.unsigned)},re.subtract=function(n){return en(n)||(n=Wn(n)),this.add(n.neg())},re.sub=re.subtract,re.multiply=function(n){if(this.isZero())return An;if(en(n)||(n=Wn(n)),yn){var t=yn.mul(this.low,this.high,n.low,n.high);return ut(t,yn.get_high(),this.unsigned)}if(n.isZero())return An;if(this.eq(tn))return n.isOdd()?tn:An;if(n.eq(tn))return this.isOdd()?tn:An;if(this.isNegative())return n.isNegative()?this.neg().mul(n.neg()):this.neg().mul(n).neg();if(n.isNegative())return this.mul(n.neg()).neg();if(this.lt(Eh)&&n.lt(Eh))return En(this.toNumber()*n.toNumber(),this.unsigned);var a=this.high>>>16,o=this.high&65535,s=this.low>>>16,f=this.low&65535,h=n.high>>>16,v=n.high&65535,d=n.low>>>16,c=n.low&65535,D=0,y=0,m=0,I=0;return I+=f*c,m+=I>>>16,I&=65535,m+=s*c,y+=m>>>16,m&=65535,m+=f*d,y+=m>>>16,m&=65535,y+=o*c,D+=y>>>16,y&=65535,y+=s*d,D+=y>>>16,y&=65535,y+=f*v,D+=y>>>16,y&=65535,D+=a*c+o*d+s*v+f*h,D&=65535,ut(m<<16|I,D<<16|y,this.unsigned)},re.mul=re.multiply,re.divide=function(n){if(en(n)||(n=Wn(n)),n.isZero())throw Error("division by zero");if(yn){if(!this.unsigned&&this.high===-2147483648&&n.low===-1&&n.high===-1)return this;var t=(this.unsigned?yn.div_u:yn.div_s)(this.low,this.high,n.low,n.high);return ut(t,yn.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?li:An;var a,o,s;if(this.unsigned){if(n.unsigned||(n=n.toUnsigned()),n.gt(this))return li;if(n.gt(this.shru(1)))return Ah;s=li}else{if(this.eq(tn)){if(n.eq(qi)||n.eq(yo))return tn;if(n.eq(tn))return qi;var f=this.shr(1);return a=f.div(n).shl(1),a.eq(An)?n.isNegative()?qi:yo:(o=this.sub(n.mul(a)),s=a.add(o.div(n)),s)}else if(n.eq(tn))return this.unsigned?li:An;if(this.isNegative())return n.isNegative()?this.neg().div(n.neg()):this.neg().div(n).neg();if(n.isNegative())return this.div(n.neg()).neg();s=An}for(o=this;o.gte(n);){a=Math.max(1,Math.floor(o.toNumber()/n.toNumber()));for(var h=Math.ceil(Math.log(a)/Math.LN2),v=h<=48?1:Bu(2,h-48),d=En(a),c=d.mul(n);c.isNegative()||c.gt(o);)a-=v,d=En(a,this.unsigned),c=d.mul(n);d.isZero()&&(d=qi),s=s.add(d),o=o.sub(c)}return s},re.div=re.divide,re.modulo=function(n){if(en(n)||(n=Wn(n)),yn){var t=(this.unsigned?yn.rem_u:yn.rem_s)(this.low,this.high,n.low,n.high);return ut(t,yn.get_high(),this.unsigned)}return this.sub(this.div(n).mul(n))},re.mod=re.modulo,re.rem=re.modulo,re.not=function(){return ut(~this.low,~this.high,this.unsigned)},re.and=function(n){return en(n)||(n=Wn(n)),ut(this.low&n.low,this.high&n.high,this.unsigned)},re.or=function(n){return en(n)||(n=Wn(n)),ut(this.low|n.low,this.high|n.high,this.unsigned)},re.xor=function(n){return en(n)||(n=Wn(n)),ut(this.low^n.low,this.high^n.high,this.unsigned)},re.shiftLeft=function(n){return en(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?ut(this.low<<n,this.high<<n|this.low>>>32-n,this.unsigned):ut(0,this.low<<n-32,this.unsigned)},re.shl=re.shiftLeft,re.shiftRight=function(n){return en(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?ut(this.low>>>n|this.high<<32-n,this.high>>n,this.unsigned):ut(this.high>>n-32,this.high>=0?0:-1,this.unsigned)},re.shr=re.shiftRight,re.shiftRightUnsigned=function(n){if(en(n)&&(n=n.toInt()),n&=63,n===0)return this;var t=this.high;if(n<32){var a=this.low;return ut(a>>>n|t<<32-n,t>>>n,this.unsigned)}else return n===32?ut(t,0,this.unsigned):ut(t>>>n-32,0,this.unsigned)},re.shru=re.shiftRightUnsigned,re.shr_u=re.shiftRightUnsigned,re.toSigned=function(){return this.unsigned?ut(this.low,this.high,!1):this},re.toUnsigned=function(){return this.unsigned?this:ut(this.low,this.high,!0)},re.toBytes=function(n){return n?this.toBytesLE():this.toBytesBE()},re.toBytesLE=function(){var n=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,n&255,n>>>8&255,n>>>16&255,n>>>24]},re.toBytesBE=function(){var n=this.high,t=this.low;return[n>>>24,n>>>16&255,n>>>8&255,n&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},at.fromBytes=function(n,t,a){return a?at.fromBytesLE(n,t):at.fromBytesBE(n,t)},at.fromBytesLE=function(n,t){return new at(n[0]|n[1]<<8|n[2]<<16|n[3]<<24,n[4]|n[5]<<8|n[6]<<16|n[7]<<24,t)},at.fromBytesBE=function(n,t){return new at(n[4]<<24|n[5]<<16|n[6]<<8|n[7],n[0]<<24|n[1]<<16|n[2]<<8|n[3],t)};var Bh=wn(S2);function Sh(e){if(e.greaterThan(Number.MAX_SAFE_INTEGER)||e.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return e.toNumber()}let T2=class extends Error{};function Sa(e){if(e&&e.aborted){if(typeof DOMException<"u")throw new DOMException("aborted","AbortError");{const n=new T2("aborted");throw n.code="ERR_ABORTED",n}}}function k2(e,n){return n.minv.blockPosition-e.maxv.blockPosition<65e3&&n.maxv.blockPosition-e.minv.blockPosition<5e6}function Ih(e,n){const t=[];let a=null;return e.length===0?e:(e.sort(function(o,s){const f=o.minv.blockPosition-s.minv.blockPosition;return f!==0?f:o.minv.dataPosition-s.minv.dataPosition}),e.forEach(o=>{(!n||o.maxv.compareTo(n)>0)&&(a===null?(t.push(o),a=o):k2(a,o)?o.maxv.compareTo(a.maxv)>0&&(a.maxv=o.maxv):(t.push(o),a=o))}),t)}class Eo{constructor(n,t){this.blockPosition=n,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(n){return this.blockPosition-n.blockPosition||this.dataPosition-n.dataPosition}}function Gi(e,n=0,t=!1){if(t)throw new Error("big-endian virtual file offsets not implemented");return new Eo(e[n+7]*1099511627776+e[n+6]*4294967296+e[n+5]*16777216+e[n+4]*65536+e[n+3]*256+e[n+2],e[n+1]<<8|e[n])}class Su{constructor(n,t,a,o=void 0){this.minv=n,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(n){return this.minv.compareTo(n.minv)||this.maxv.compareTo(n.maxv)||this.bin-n.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}class Th{constructor({filehandle:n,renameRefSeqs:t=a=>a}){this.filehandle=n,this.renameRefSeq=t}async getMetadata(n={}){const{indices:t,...a}=await this.parse(n);return a}_findFirstData(n,t){return n?n.compareTo(t)>0?t:n:t}async parse(n={}){return this.parseP||(this.parseP=this._parse(n).catch(t=>{throw this.parseP=void 0,t})),this.parseP}async hasRefSeq(n,t={}){var a;return!!(!((a=(await this.parse(t)).indices[n])===null||a===void 0)&&a.binIndex)}}const R2=21578324,kh=14;function L2(e,n){return e+=1,n-=1,[[0,0],[1+(e>>26),1+(n>>26)],[9+(e>>23),9+(n>>23)],[73+(e>>20),73+(n>>20)],[585+(e>>17),585+(n>>17)],[4681+(e>>14),4681+(n>>14)]]}class Ia extends Th{async lineCount(n,t={}){const a=await this.parse(t),o=a.refNameToId[n];if(o===void 0||!a.indices[o])return-1;const{stats:f}=a.indices[o];return f?f.lineCount:-1}async _parse(n={}){const t=await this.filehandle.readFile(n),a=await Do(t);if(Sa(n.signal),a.readUInt32LE(0)!==R2)throw new Error("Not a TBI file");const o=a.readInt32LE(4),s=a.readInt32LE(8),f=s&65536?"zero-based-half-open":"1-based-closed",v={0:"generic",1:"SAM",2:"VCF"}[s&15];if(!v)throw new Error(`invalid Tabix preset format flags ${s}`);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,F=a.readInt32LE(28),k=a.readInt32LE(32),{refNameToId:L,refIdToName:G}=this._parseNameBytes(a.slice(36,36+k));let P=36+k,T;return{indices:new Array(o).fill(0).map(()=>{const q=a.readInt32LE(P);P+=4;const N={};let C;for(let W=0;W<q;W+=1){const V=a.readUInt32LE(P);if(P+=4,V>y+1)throw new Error("tabix index contains too many bins, please use a CSI index");if(V===y+1){const te=a.readInt32LE(P);P+=4,te===2&&(C=this.parsePseudoBin(a,P)),P+=16*te}else{const te=a.readInt32LE(P);P+=4;const ie=new Array(te);for(let le=0;le<te;le+=1){const Fe=Gi(a,P),ae=Gi(a,P+8);P+=16,T=this._findFirstData(T,Fe),ie[le]=new Su(Fe,ae,V)}N[V]=ie}}const S=a.readInt32LE(P);P+=4;const O=new Array(S);for(let W=0;W<S;W+=1)O[W]=Gi(a,P),P+=8,T=this._findFirstData(T,O[W]);return{binIndex:N,linearIndex:O,stats:C}}),metaChar:I,maxBinNumber:y,maxRefLength:m,skipLines:F,firstDataLine:T,columnNumbers:d,coordinateType:f,format:v,refIdToName:G,refNameToId:L,maxBlockSize:65536}}parsePseudoBin(n,t){return{lineCount:Sh(Bh.fromBytesLE(n.slice(t+16,t+24),!0))}}_parseNameBytes(n){let t=0,a=0;const o=[],s={};for(let f=0;f<n.length;f+=1)if(!n[f]){if(a<f){let h=n.toString("utf8",a,f);h=this.renameRefSeq(h),o[t]=h,s[h]=t}a=f+1,t+=1}return{refNameToId:s,refIdToName:o}}async blocksForRange(n,t,a,o={}){t<0&&(t=0);const s=await this.parse(o),f=s.refNameToId[n];if(f===void 0)return[];const h=s.indices[f];if(!h)return[];(h.linearIndex.length?h.linearIndex[t>>kh>=h.linearIndex.length?h.linearIndex.length-1:t>>kh]:new Eo(0,0))||console.warn("querying outside of possible tabix range");const d=L2(t,a),c=[];for(const[F,k]of d)for(let L=F;L<=k;L++)if(h.binIndex[L])for(const G of h.binIndex[L])c.push(new Su(G.minv,G.maxv,L));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 F=m;F<=I;++F){const k=h.linearIndex[F];k&&(!y||k.compareTo(y)<0)&&(y=k)}return Ih(c,y)}}const N2=21582659,O2=38359875;function M2(e,n){return e*2**n}function Rh(e,n){return Math.floor(e/2**n)}class Ao extends Th{constructor(n){super(n),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(n,t={}){const a=await this.parse(t),o=a.refNameToId[n];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(n,t){const a=n.readInt32LE(t),o=a&65536?"zero-based-half-open":"1-based-closed",s={0:"generic",1:"SAM",2:"VCF"}[a&15];if(!s)throw new Error(`invalid Tabix preset format flags ${a}`);const f={ref:n.readInt32LE(t+4),start:n.readInt32LE(t+8),end:n.readInt32LE(t+12)},h=n.readInt32LE(t+16),v=h?String.fromCharCode(h):null,d=n.readInt32LE(t+20),c=n.readInt32LE(t+24),{refIdToName:D,refNameToId:y}=this._parseNameBytes(n.slice(t+28,t+28+c));return{refIdToName:D,refNameToId:y,skipLines:d,metaChar:v,columnNumbers:f,format:s,coordinateType:o}}_parseNameBytes(n){let t=0,a=0;const o=[],s={};for(let f=0;f<n.length;f+=1)if(!n[f]){if(a<f){let h=n.toString("utf8",a,f);h=this.renameRefSeq(h),o[t]=h,s[h]=t}a=f+1,t+=1}return{refNameToId:s,refIdToName:o}}async _parse(n={}){const t=await Do(await this.filehandle.readFile(n));let a;if(t.readUInt32LE(0)===N2)a=1;else if(t.readUInt32LE(0)===O2)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),s=t.readInt32LE(12),f=s&&s>=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+s);let v,d=16+s+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 F=t.readUInt32LE(d);if(F>this.maxBinNumber)m=this.parsePseudoBin(t,d+4),d+=48;else{const k=Gi(t,d+4);v=this._findFirstData(v,k);const L=t.readInt32LE(d+12);d+=16;const G=new Array(L);for(let P=0;P<L;P+=1){const T=Gi(t,d),$=Gi(t,d+8);d+=16,G[P]=new Su(T,$,F)}y[F]=G}}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(n,t){return{lineCount:Sh(Bh.fromBytesLE(n.slice(t+28,t+36),!0))}}async blocksForRange(n,t,a,o={}){t<0&&(t=0);const s=await this.parse(o),f=s.refNameToId[n];if(f===void 0)return[];const h=s.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 Su(m.minv,m.maxv,y));return Ih(d,new Eo(0,0))}reg2bins(n,t){n-=1,n<1&&(n=1),t>2**50&&(t=2**34),t-=1;let a=0,o=0,s=this.minShift+this.depth*3;const f=[];for(;a<=this.depth;s-=3,o+=M2(1,a*3),a+=1){const h=o+Rh(n,s),v=o+Rh(t,s);if(v-h+f.length>this.maxBinNumber)throw new Error(`query ${n}-${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(e){return/^[\u0000-\u007F]*$/.test(e)}const Hi=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;class Lh{constructor({path:n,filehandle:t,url:a,tbiPath:o,tbiUrl:s,tbiFilehandle:f,csiPath:h,csiUrl:v,csiFilehandle:d,renameRefSeqs:c=y=>y,chunkCacheSize:D=5*2**20}){if(t)this.filehandle=t;else if(n)this.filehandle=new hu(n);else if(a)this.filehandle=new Tr(a);else throw new TypeError("must provide either filehandle or path");if(f)this.index=new Ia({filehandle:f,renameRefSeqs:c});else if(d)this.index=new Ao({filehandle:d,renameRefSeqs:c});else if(o)this.index=new Ia({filehandle:new hu(o),renameRefSeqs:c});else if(h)this.index=new Ao({filehandle:new hu(h),renameRefSeqs:c});else if(n)this.index=new Ia({filehandle:new hu(`${n}.tbi`),renameRefSeqs:c});else if(v)this.index=new Ao({filehandle:new Tr(v)});else if(s)this.index=new Ia({filehandle:new Tr(s)});else if(a)this.index=new Ia({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 Ap({cache:new Pl({maxSize:Math.floor(D/65536)}),fill:(y,m)=>this.readChunk(y,{signal:m})})}async getLines(n,t,a,o){var s,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);Sa(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(n,D,y,v);Sa(h);for(const I of m){const{buffer:F,cpositions:k,dpositions:L}=await this.chunkCache.get(I.toString(),I,h);Sa(h);let G=0,P=0;const T=(s=Hi==null?void 0:Hi.decode(F))!==null&&s!==void 0?s:F.toString(),$=F.length<5e8&&P2(T);for(;G<T.length;){let q,N;if($){if(N=T.indexOf(`
33
- `,G),N===-1)break;q=T.slice(G,N)}else{if(N=F.indexOf(`
34
- `,G),N===-1)break;const O=F.slice(G,N);q=(f=Hi==null?void 0:Hi.decode(O))!==null&&f!==void 0?f:O.toString()}if(L){for(;G+I.minv.dataPosition>=L[P++];);P--}const{startCoordinate:C,overlaps:S}=this.checkLine(c,n,D,y,q);if(S)d(q,k[P]*256+(G-L[P])+I.minv.dataPosition+1);else if(C!==void 0&&C>=y)return;G=N+1}}}async getMetadata(n={}){return this.index.getMetadata(n)}async getHeaderBuffer(n={}){const{firstDataLine:t,metaChar:a,maxBlockSize:o}=await this.getMetadata(n);Sa(n.signal);const s=((t==null?void 0:t.blockPosition)||0)+o,f=await this._readRegion(0,s,n),h=await Do(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(n={}){return(await this.getHeaderBuffer(n)).toString("utf8")}async getReferenceSequenceNames(n={}){return(await this.getMetadata(n)).refIdToName}checkLine(n,t,a,o,s){const{columnNumbers:f,metaChar:h,coordinateType:v,format:d}=n;if(h&&s.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,F=0,k="",L=-1/0;const G=s.length;for(let P=0;P<G+1;P++)if(s[P]===" "||P===G){if(I===c){if(this.renameRefSeq(s.slice(F,P))!==t)return{overlaps:!1}}else if(I===D){if(L=parseInt(s.slice(F,P),10),v==="1-based-closed"&&(L-=1),L>=o)return{startCoordinate:L,overlaps:!1};if((y===0||y===D)&&L+1<=a)return{startCoordinate:L,overlaps:!1}}else if(d==="VCF"&&I===4)k=s.slice(F,P);else if(I===y&&(d==="VCF"?this._getVcfEnd(L,k,s.slice(F,P)):Number.parseInt(s.slice(F,P),10))<=a)return{overlaps:!1};if(F=P+1,I+=1,I>m)break}return{startCoordinate:L,overlaps:!0}}_getVcfEnd(n,t,a){let o=n+t.length;const s=a.includes("SVTYPE=TRA");if(a[0]!=="."&&!s){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(s)return n+1;return o}async lineCount(n,t={}){return this.index.lineCount(n,t)}async _readRegion(n,t,a={}){const o=zr.alloc(t),{bytesRead:s,buffer:f}=await this.filehandle.read(o,0,t,n,a);return f.subarray(0,s)}async readChunk(n,t={}){const a=await this._readRegion(n.minv.blockPosition,n.fetchedSize(),t);return B2(a,n)}}const Nh=globalThis||void 0||self;var Wt=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Nh<"u"&&Nh||{},Vt={searchParams:"URLSearchParams"in Wt,iterable:"Symbol"in Wt&&"iterator"in Symbol,blob:"FileReader"in Wt&&"Blob"in Wt&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Wt,arrayBuffer:"ArrayBuffer"in Wt};function $2(e){return e&&DataView.prototype.isPrototypeOf(e)}if(Vt.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(e){return e&&U2.indexOf(Object.prototype.toString.call(e))>-1};function Zi(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Fo(e){return typeof e!="string"&&(e=String(e)),e}function Co(e){var n={next:function(){var t=e.shift();return{done:t===void 0,value:t}}};return Vt.iterable&&(n[Symbol.iterator]=function(){return n}),n}function Nt(e){this.map={},e instanceof Nt?e.forEach(function(n,t){this.append(t,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}Nt.prototype.append=function(e,n){e=Zi(e),n=Fo(n);var t=this.map[e];this.map[e]=t?t+", "+n:n},Nt.prototype.delete=function(e){delete this.map[Zi(e)]},Nt.prototype.get=function(e){return e=Zi(e),this.has(e)?this.map[e]:null},Nt.prototype.has=function(e){return this.map.hasOwnProperty(Zi(e))},Nt.prototype.set=function(e,n){this.map[Zi(e)]=Fo(n)},Nt.prototype.forEach=function(e,n){for(var t in this.map)this.map.hasOwnProperty(t)&&e.call(n,this.map[t],t,this)},Nt.prototype.keys=function(){var e=[];return this.forEach(function(n,t){e.push(t)}),Co(e)},Nt.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Co(e)},Nt.prototype.entries=function(){var e=[];return this.forEach(function(n,t){e.push([t,n])}),Co(e)},Vt.iterable&&(Nt.prototype[Symbol.iterator]=Nt.prototype.entries);function Bo(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function Oh(e){return new Promise(function(n,t){e.onload=function(){n(e.result)},e.onerror=function(){t(e.error)}})}function q2(e){var n=new FileReader,t=Oh(n);return n.readAsArrayBuffer(e),t}function G2(e){var n=new FileReader,t=Oh(n),a=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=a?a[1]:"utf-8";return n.readAsText(e,o),t}function H2(e){for(var n=new Uint8Array(e),t=new Array(n.length),a=0;a<n.length;a++)t[a]=String.fromCharCode(n[a]);return t.join("")}function Mh(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function Ph(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Vt.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Vt.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Vt.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Vt.arrayBuffer&&Vt.blob&&$2(e)?(this._bodyArrayBuffer=Mh(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Vt.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||W2(e))?this._bodyArrayBuffer=Mh(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Vt.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Vt.blob&&(this.blob=function(){var e=Bo(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Bo(this);return e||(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(Vt.blob)return this.blob().then(q2);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=Bo(this);if(e)return e;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)},Vt.formData&&(this.formData=function(){return this.text().then(V2)}),this.json=function(){return this.text().then(JSON.parse)},this}var Z2=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function X2(e){var n=e.toUpperCase();return Z2.indexOf(n)>-1?n:e}function hi(e,n){if(!(this instanceof hi))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n=n||{};var t=n.body;if(e instanceof hi){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new Nt(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!t&&e._bodyInit!=null&&(t=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new Nt(n.headers)),this.method=X2(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||function(){if("AbortController"in Wt){var s=new AbortController;return s.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")&&(n.cache==="no-store"||n.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()}}}hi.prototype.clone=function(){return new hi(this,{body:this._bodyInit})};function V2(e){var n=new FormData;return e.trim().split("&").forEach(function(t){if(t){var a=t.split("="),o=a.shift().replace(/\+/g," "),s=a.join("=").replace(/\+/g," ");n.append(decodeURIComponent(o),decodeURIComponent(s))}}),n}function K2(e){var n=new Nt,t=e.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(":"),s=o.shift().trim();if(s){var f=o.join(":").trim();try{n.append(s,f)}catch(h){console.warn("Response "+h.message)}}}),n}Ph.call(hi.prototype);function nr(e,n){if(!(this instanceof nr))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.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=n.statusText===void 0?"":""+n.statusText,this.headers=new Nt(n.headers),this.url=n.url||"",this._initBody(e)}Ph.call(nr.prototype),nr.prototype.clone=function(){return new nr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Nt(this.headers),url:this.url})},nr.error=function(){var e=new nr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var Y2=[301,302,303,307,308];nr.redirect=function(e,n){if(Y2.indexOf(n)===-1)throw new RangeError("Invalid status code");return new nr(null,{status:n,headers:{location:e}})};var ci=Wt.DOMException;try{new ci}catch{ci=function(n,t){this.message=n,this.name=t;var a=Error(n);this.stack=a.stack},ci.prototype=Object.create(Error.prototype),ci.prototype.constructor=ci}function $h(e,n){return new Promise(function(t,a){var o=new hi(e,n);if(o.signal&&o.signal.aborted)return a(new ci("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var d={statusText:s.statusText,headers:K2(s.getAllResponseHeaders()||"")};o.url.indexOf("file://")===0&&(s.status<200||s.status>599)?d.status=200:d.status=s.status,d.url="responseURL"in s?s.responseURL:d.headers.get("X-Request-URL");var c="response"in s?s.response:s.responseText;setTimeout(function(){t(new nr(c,d))},0)},s.onerror=function(){setTimeout(function(){a(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){a(new TypeError("Network request timed out"))},0)},s.onabort=function(){setTimeout(function(){a(new ci("Aborted","AbortError"))},0)};function h(d){try{return d===""&&Wt.location.href?Wt.location.href:d}catch{return d}}if(s.open(o.method,h(o.url),!0),o.credentials==="include"?s.withCredentials=!0:o.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(Vt.blob?s.responseType="blob":Vt.arrayBuffer&&(s.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof Nt||Wt.Headers&&n.headers instanceof Wt.Headers)){var v=[];Object.getOwnPropertyNames(n.headers).forEach(function(d){v.push(Zi(d)),s.setRequestHeader(d,Fo(n.headers[d]))}),o.headers.forEach(function(d,c){v.indexOf(c)===-1&&s.setRequestHeader(c,d)})}else o.headers.forEach(function(d,c){s.setRequestHeader(c,d)});o.signal&&(o.signal.addEventListener("abort",f),s.onreadystatechange=function(){s.readyState===4&&o.signal.removeEventListener("abort",f)}),s.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}$h.polyfill=!0,Wt.fetch||(Wt.fetch=$h,Wt.Headers=Nt,Wt.Request=hi,Wt.Response=nr);var Q2=self.fetch.bind(self),So=wn(Q2),J2={rgb2hsl:Ta,rgb2hsv:Iu,rgb2hwb:ka,rgb2cmyk:Ra,rgb2keyword:La,rgb2xyz:Io,rgb2lab:To,rgb2lch:j2,hsl2rgb:Tu,hsl2hsv:z2,hsl2hwb:ev,hsl2cmyk:tv,hsl2keyword:nv,hsv2rgb:ku,hsv2hsl:rv,hsv2hwb:iv,hsv2cmyk:av,hsv2keyword:uv,hwb2rgb:Na,hwb2hsl:sv,hwb2hsv:ov,hwb2cmyk:fv,hwb2keyword:lv,cmyk2rgb:Oa,cmyk2hsl:hv,cmyk2hsv:cv,cmyk2hwb:dv,cmyk2keyword:gv,keyword2rgb:di,keyword2hsl:wv,keyword2hsv:mv,keyword2hwb:bv,keyword2cmyk:Dv,keyword2lab:xv,keyword2xyz:yv,xyz2rgb:Uh,xyz2lab:Wh,xyz2lch:pv,lab2xyz:ko,lab2rgb:qh,lab2lch:Ro,lch2lab:Lo,lch2xyz:_v,lch2rgb:vv};function Ta(e){var n=e[0]/255,t=e[1]/255,a=e[2]/255,o=Math.min(n,t,a),s=Math.max(n,t,a),f=s-o,h,v,d;return s==o?h=0:n==s?h=(t-a)/f:t==s?h=2+(a-n)/f:a==s&&(h=4+(n-t)/f),h=Math.min(h*60,360),h<0&&(h+=360),d=(o+s)/2,s==o?v=0:d<=.5?v=f/(s+o):v=f/(2-s-o),[h,v*100,d*100]}function Iu(e){var n=e[0],t=e[1],a=e[2],o=Math.min(n,t,a),s=Math.max(n,t,a),f=s-o,h,v,d;return s==0?v=0:v=f/s*1e3/10,s==o?h=0:n==s?h=(t-a)/f:t==s?h=2+(a-n)/f:a==s&&(h=4+(n-t)/f),h=Math.min(h*60,360),h<0&&(h+=360),d=s/255*1e3/10,[h,v,d]}function ka(e){var n=e[0],t=e[1],s=e[2],a=Ta(e)[0],o=1/255*Math.min(n,Math.min(t,s)),s=1-1/255*Math.max(n,Math.max(t,s));return[a,o*100,s*100]}function Ra(e){var n=e[0]/255,t=e[1]/255,a=e[2]/255,o,s,f,h;return h=Math.min(1-n,1-t,1-a),o=(1-n-h)/(1-h)||0,s=(1-t-h)/(1-h)||0,f=(1-a-h)/(1-h)||0,[o*100,s*100,f*100,h*100]}function La(e){return Gh[JSON.stringify(e)]}function Io(e){var n=e[0]/255,t=e[1]/255,a=e[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/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=n*.4124+t*.3576+a*.1805,s=n*.2126+t*.7152+a*.0722,f=n*.0193+t*.1192+a*.9505;return[o*100,s*100,f*100]}function To(e){var n=Io(e),t=n[0],a=n[1],o=n[2],s,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,s=116*a-16,f=500*(t-a),h=200*(a-o),[s,f,h]}function j2(e){return Ro(To(e))}function Tu(e){var n=e[0]/360,t=e[1]/100,a=e[2]/100,o,s,f,h,v;if(t==0)return v=a*255,[v,v,v];a<.5?s=a*(1+t):s=a+t-a*t,o=2*a-s,h=[0,0,0];for(var d=0;d<3;d++)f=n+1/3*-(d-1),f<0&&f++,f>1&&f--,6*f<1?v=o+(s-o)*6*f:2*f<1?v=s:3*f<2?v=o+(s-o)*(2/3-f)*6:v=o,h[d]=v*255;return h}function z2(e){var n=e[0],t=e[1]/100,a=e[2]/100,o,s;return a===0?[0,0,0]:(a*=2,t*=a<=1?a:2-a,s=(a+t)/2,o=2*t/(a+t),[n,o*100,s*100])}function ev(e){return ka(Tu(e))}function tv(e){return Ra(Tu(e))}function nv(e){return La(Tu(e))}function ku(e){var n=e[0]/60,t=e[1]/100,v=e[2]/100,a=Math.floor(n)%6,o=n-Math.floor(n),s=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,s];case 1:return[f,v,s];case 2:return[s,v,h];case 3:return[s,f,v];case 4:return[h,s,v];case 5:return[v,s,f]}}function rv(e){var n=e[0],t=e[1]/100,a=e[2]/100,o,s;return s=(2-t)*a,o=t*a,o/=s<=1?s:2-s,o=o||0,s/=2,[n,o*100,s*100]}function iv(e){return ka(ku(e))}function av(e){return Ra(ku(e))}function uv(e){return La(ku(e))}function Na(e){var n=e[0]/360,t=e[1]/100,a=e[2]/100,o=t+a,s,f,h,v;switch(o>1&&(t/=o,a/=o),s=Math.floor(6*n),f=1-a,h=6*n-s,s&1&&(h=1-h),v=t+h*(f-t),s){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 sv(e){return Ta(Na(e))}function ov(e){return Iu(Na(e))}function fv(e){return Ra(Na(e))}function lv(e){return La(Na(e))}function Oa(e){var n=e[0]/100,t=e[1]/100,a=e[2]/100,o=e[3]/100,s,f,h;return s=1-Math.min(1,n*(1-o)+o),f=1-Math.min(1,t*(1-o)+o),h=1-Math.min(1,a*(1-o)+o),[s*255,f*255,h*255]}function hv(e){return Ta(Oa(e))}function cv(e){return Iu(Oa(e))}function dv(e){return ka(Oa(e))}function gv(e){return La(Oa(e))}function Uh(e){var n=e[0]/100,t=e[1]/100,a=e[2]/100,o,s,f;return o=n*3.2406+t*-1.5372+a*-.4986,s=n*-.9689+t*1.8758+a*.0415,f=n*.0557+t*-.204+a*1.057,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=s*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),s=Math.min(Math.max(0,s),1),f=Math.min(Math.max(0,f),1),[o*255,s*255,f*255]}function Wh(e){var n=e[0],t=e[1],a=e[2],o,s,f;return n/=95.047,t/=100,a/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+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,s=500*(n-t),f=200*(t-a),[o,s,f]}function pv(e){return Ro(Wh(e))}function ko(e){var n=e[0],t=e[1],a=e[2],o,s,f,h;return n<=8?(s=n*100/903.3,h=7.787*(s/100)+16/116):(s=100*Math.pow((n+16)/116,3),h=Math.pow(s/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,s,f]}function Ro(e){var n=e[0],t=e[1],a=e[2],o,s,f;return o=Math.atan2(a,t),s=o*360/2/Math.PI,s<0&&(s+=360),f=Math.sqrt(t*t+a*a),[n,f,s]}function qh(e){return Uh(ko(e))}function Lo(e){var n=e[0],t=e[1],a=e[2],o,s,f;return f=a/360*2*Math.PI,o=t*Math.cos(f),s=t*Math.sin(f),[n,o,s]}function _v(e){return ko(Lo(e))}function vv(e){return qh(Lo(e))}function di(e){return No[e]}function wv(e){return Ta(di(e))}function mv(e){return Iu(di(e))}function bv(e){return ka(di(e))}function Dv(e){return Ra(di(e))}function xv(e){return To(di(e))}function yv(e){return Io(di(e))}var No={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]},Gh={};for(var Hh in No)Gh[JSON.stringify(No[Hh])]=Hh;var Oo=J2,Xi=function(){return new Pa};for(var Ma in Oo){Xi[Ma+"Raw"]=function(e){return function(n){return typeof n=="number"&&(n=Array.prototype.slice.call(arguments)),Oo[e](n)}}(Ma);var Zh=/(\w+)2(\w+)/.exec(Ma),Mo=Zh[1],Ev=Zh[2];Xi[Mo]=Xi[Mo]||{},Xi[Mo][Ev]=Xi[Ma]=function(e){return function(n){typeof n=="number"&&(n=Array.prototype.slice.call(arguments));var t=Oo[e](n);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}}(Ma)}var Pa=function(){this.convs={}};Pa.prototype.routeSpace=function(e,n){var t=n[0];return t===void 0?this.getValues(e):(typeof t=="number"&&(t=Array.prototype.slice.call(n)),this.setValues(e,t))},Pa.prototype.setValues=function(e,n){return this.space=e,this.convs={},this.convs[e]=n,this},Pa.prototype.getValues=function(e){var n=this.convs[e];if(!n){var t=this.space,a=this.convs[t];n=Xi[t][e](a),this.convs[e]=n}return n},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(e){Pa.prototype[e]=function(n){return this.routeSpace(e,arguments)}});function Av(e,n){if(e.length<=n)return e;const t=[];for(let a=0;a<n;a++){const o=a/n,s=Math.ceil(o*e.length);t.push(e[s])}return t}function Vi(e,n=!1){const t=e>=1e3?Math.floor(e):Math.round(e);return t>=75e4?`${(t/1e6).toFixed(1)} Mb`:t>=1e4?`${(t/1e3).toFixed(1)} Kb`:t>0?`${t} bp`:n?"<1 bp":"0 bp"}class Fv{constructor(n,t=null,a=1e5){ge(this,"url");ge(this,"indexUrl");ge(this,"dataLimit");ge(this,"tabix");ge(this,"getData",async(n,t,a)=>{const o=n.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)}),s=await Promise.all(o);return a&&a.ensemblStyle&&n.forEach((f,h)=>{s[h].forEach(v=>v.chr=f.chr)}),on.flatten(s)});ge(this,"getDataForLocus",async(n,t,a)=>{const o=[];await this.tabix.getLines(n,t,a,f=>o.push(f));let s;return o.length>this.dataLimit?s=Av(o,this.dataLimit):s=o,s.map(this._parseLine)});ge(this,"_parseLine",n=>{const t=n.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=n,this.indexUrl=t||n+".tbi",this.dataLimit=a,this.tabix=new Lh({filehandle:new Tr(n,{fetch:So}),tbiFilehandle:new Tr(this.indexUrl,{fetch:So})})}}const Xh=BigInt(32);function Cv(e,n,t){const a=+!!t,o=+!t;return BigInt(e.getInt32(n,t)*o+e.getInt32(n+4,t)*a)<<Xh|BigInt(e.getUint32(n,t)*a+e.getUint32(n+4,t)*o)}function Bv(e,n,t){const a=e.getUint32(n,t),o=e.getUint32(n+4,t),s=+!!t,f=+!t;return BigInt(a*f+o*s)<<Xh|BigInt(a*s+o*f)}"getBigInt64"in DataView||(DataView.prototype.getBigInt64=function(e,n){return Cv(this,e,n)}),"getBigUint64"in DataView||(DataView.prototype.getBigUint64=function(e,n){return Bv(this,e,n)});function Vh(e){return(typeof e=="object"&&e!==null&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}class Kh{constructor(n,t={}){this.baseOverrides={},this.url=n;const a=t.fetch||globalThis.fetch.bind(globalThis);t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=a}async fetch(n,t){let a;try{a=await this.fetchImplementation(n,t)}catch(o){if(`${o}`.includes("Failed to fetch")){console.warn(`generic-filehandle: refetching ${n} to attempt to work around chrome CORS header caching bug`);try{a=await this.fetchImplementation(n,{...t,cache:"reload"})}catch(s){throw new Error(`${Vh(s)} fetching ${n}`,{cause:s})}}else throw new Error(`${Vh(o)} fetching ${n}`,{cause:o})}return a}async read(n,t,a={}){const{headers:o={},signal:s,overrides:f={}}=a;n<1/0?o.range=`bytes=${t}-${t+n}`:n===1/0&&t!==0&&(o.range=`bytes=${t}-`);const h=await this.fetch(this.url,{...this.baseOverrides,...f,headers:{...o,...f.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:s});if(!h.ok)throw new Error(`HTTP ${h.status} fetching ${this.url}`);if(h.status===200&&t===0||h.status===206){const v=await h.arrayBuffer(),d=h.headers.get("content-range"),c=/\/(\d+)$/.exec(d||"");return c!=null&&c[1]&&(this._stat={size:parseInt(c[1],10)}),new Uint8Array(v.slice(0,n))}throw h.status===200?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${h.status} fetching ${this.url}`)}async readFile(n={}){let t,a;typeof n=="string"?(t=n,a={}):(t=n.encoding,a=n,delete a.encoding);const{headers:o={},signal:s,overrides:f={}}=a,h=await this.fetch(this.url,{headers:o,method:"GET",redirect:"follow",mode:"cors",signal:s,...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 new Uint8Array(await h.arrayBuffer())}async stat(){if(!this._stat&&(await this.read(10,0),!this._stat))throw new Error(`unable to determine size of file at ${this.url}`);return this._stat}async close(){}}class Sv{readFile(){throw new Error("unimplemented")}read(){throw new Error("unimplemented")}close(){throw new Error("unimplemented")}}var Po=function(e,n){return Po=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])},Po(e,n)};function $o(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Po(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}function Yh(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],a=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function Uo(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var a=t.call(e),o,s=[],f;try{for(;(n===void 0||n-- >0)&&!(o=a.next()).done;)s.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 s}function Wo(e,n,t){if(t||arguments.length===2)for(var a=0,o=n.length,s;a<o;a++)(s||!(a in n))&&(s||(s=Array.prototype.slice.call(n,0,a)),s[a]=n[a]);return e.concat(s||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;function rr(e){return typeof e=="function"}function Qh(e){var n=function(a){Error.call(a),a.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var qo=Qh(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
36
- `+t.map(function(a,o){return o+1+") "+a.toString()}).join(`
37
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Jh(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var Go=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,a,o,s;if(!this.closed){this.closed=!0;var f=this._parentage;if(f)if(this._parentage=null,Array.isArray(f))try{for(var h=Yh(f),v=h.next();!v.done;v=h.next()){var d=v.value;d.remove(this)}}catch(F){n={error:F}}finally{try{v&&!v.done&&(t=h.return)&&t.call(h)}finally{if(n)throw n.error}}else f.remove(this);var c=this.initialTeardown;if(rr(c))try{c()}catch(F){s=F instanceof qo?F.errors:[F]}var D=this._finalizers;if(D){this._finalizers=null;try{for(var y=Yh(D),m=y.next();!m.done;m=y.next()){var I=m.value;try{zh(I)}catch(F){s=s??[],F instanceof qo?s=Wo(Wo([],Uo(s)),Uo(F.errors)):s.push(F)}}}catch(F){a={error:F}}finally{try{m&&!m.done&&(o=y.return)&&o.call(y)}finally{if(a)throw a.error}}}if(s)throw new qo(s)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)zh(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&Jh(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&Jh(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}();Go.EMPTY;function jh(e){return e instanceof Go||e&&"closed"in e&&rr(e.remove)&&rr(e.add)&&rr(e.unsubscribe)}function zh(e){rr(e)?e():e.unsubscribe()}var Iv={Promise:void 0},Tv={setTimeout:function(e,n){for(var t=[],a=2;a<arguments.length;a++)t[a-2]=arguments[a];return setTimeout.apply(void 0,Wo([e,n],Uo(t)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function kv(e){Tv.setTimeout(function(){throw e})}function ec(){}function Rv(e){e()}var Ho=function(e){$o(n,e);function n(t){var a=e.call(this)||this;return a.isStopped=!1,t?(a.destination=t,jh(t)&&t.add(a)):a.destination=Ov,a}return n.create=function(t,a,o){return new Ru(t,a,o)},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(Go),Lv=function(){function e(n){this.partialObserver=n}return e.prototype.next=function(n){var t=this.partialObserver;if(t.next)try{t.next(n)}catch(a){Lu(a)}},e.prototype.error=function(n){var t=this.partialObserver;if(t.error)try{t.error(n)}catch(a){Lu(a)}else Lu(n)},e.prototype.complete=function(){var n=this.partialObserver;if(n.complete)try{n.complete()}catch(t){Lu(t)}},e}(),Ru=function(e){$o(n,e);function n(t,a,o){var s=e.call(this)||this,f;return rr(t)||!t?f={next:t??void 0,error:a??void 0,complete:o??void 0}:f=t,s.destination=new Lv(f),s}return n}(Ho);function Lu(e){kv(e)}function Nv(e){throw e}var Ov={closed:!0,next:ec,error:Nv,complete:ec},Mv=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Pv(e){return e}function $v(e){return e.length===0?Pv:e.length===1?e[0]:function(t){return e.reduce(function(a,o){return o(a)},t)}}var Uv=function(){function e(n){n&&(this._subscribe=n)}return e.prototype.lift=function(n){var t=new e;return t.source=this,t.operator=n,t},e.prototype.subscribe=function(n,t,a){var o=this,s=qv(n)?n:new Ru(n,t,a);return Rv(function(){var f=o,h=f.operator,v=f.source;s.add(h?h.call(s,v):v?o._subscribe(s):o._trySubscribe(s))}),s},e.prototype._trySubscribe=function(n){try{return this._subscribe(n)}catch(t){n.error(t)}},e.prototype.forEach=function(n,t){var a=this;return t=tc(t),new t(function(o,s){var f=new Ru({next:function(h){try{n(h)}catch(v){s(v),f.unsubscribe()}},error:s,complete:o});a.subscribe(f)})},e.prototype._subscribe=function(n){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(n)},e.prototype[Mv]=function(){return this},e.prototype.pipe=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return $v(n)(this)},e.prototype.toPromise=function(n){var t=this;return n=tc(n),new n(function(a,o){var s;t.subscribe(function(f){return s=f},function(f){return o(f)},function(){return a(s)})})},e.create=function(n){return new e(n)},e}();function tc(e){var n;return(n=e??Iv.Promise)!==null&&n!==void 0?n:Promise}function Wv(e){return e&&rr(e.next)&&rr(e.error)&&rr(e.complete)}function qv(e){return e&&e instanceof Ho||Wv(e)&&jh(e)}function Gv(e){return rr(e==null?void 0:e.lift)}function nc(e){return function(n){if(Gv(n))return n.lift(function(t){try{return e(t,this)}catch(a){this.error(a)}});throw new TypeError("Unable to lift unknown Observable type")}}function Hv(e,n,t,a,o){return new Zv(e,n,t,a,o)}var Zv=function(e){$o(n,e);function n(t,a,o,s,f,h){var v=e.call(this,t)||this;return v.onFinalize=f,v.shouldUnsubscribe=h,v._next=a?function(d){try{a(d)}catch(c){t.error(c)}}:e.prototype._next,v._error=s?function(d){try{s(d)}catch(c){t.error(c)}finally{this.unsubscribe()}}:e.prototype._error,v._complete=o?function(){try{o()}catch(d){t.error(d)}finally{this.unsubscribe()}}:e.prototype._complete,v}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var a=this.closed;e.prototype.unsubscribe.call(this),!a&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},n}(Ho),Xv=Qh(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Vv(e,n){return new Promise(function(t,a){var o=new Ru({next:function(s){t(s),o.unsubscribe()},error:a,complete:function(){a(new Xv)}});e.subscribe(o)})}function Kv(e,n,t,a,o){return function(s,f){var h=t,v=n,d=0;s.subscribe(Hv(f,function(c){var D=d++;v=h?e(v,c,D):(h=!0,c)},function(){h&&f.next(v),f.complete()}))}}function Yv(e,n){return nc(Kv(e,n,arguments.length>=2,!1,!0))}var Qv=function(e,n){return e.push(n),e};function Jv(){return nc(function(e,n){Yv(Qv,[])(e).subscribe(n)})}class jv{}class zv{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(n=new jv){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(n),n.aborted?this.handleAborted(n):typeof n.addEventListener=="function"&&n.addEventListener("abort",()=>{this.handleAborted(n)})}handleAborted(n){this.signals.delete(n),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}class ew{constructor(){this.callbacks=new Set}addCallback(n=()=>{}){this.callbacks.add(n),this.currentMessage&&n(this.currentMessage)}callback(n){this.currentMessage=n;for(const t of this.callbacks)t(n)}}class Nu{constructor({fill:n,cache:t}){if(typeof n!="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=n}static isAbortException(n){return n.name==="AbortError"||n.code==="ERR_ABORTED"||n.message==="AbortError: aborted"||n.message==="Error: aborted"}evict(n,t){this.cache.get(n)===t&&this.cache.delete(n)}fill(n,t,a,o){const s=new zv,f=new ew;f.addCallback(o);const h={aborter:s,promise:this.fillCallback(t,s.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(n,h)}),h.promise.then(()=>{h.settled=!0},()=>{h.settled=!0,this.evict(n,h)}).catch(v=>{throw console.error(v),v}),this.cache.set(n,h)}static checkSinglePromise(n,t){function a(){if(t!=null&&t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return n.then(o=>(a(),o),o=>{throw a(),o})}has(n){return this.cache.has(n)}get(n,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 s=this.cache.get(n);return s?s.aborted&&!s.settled?(this.evict(n,s),this.get(n,t,a,o)):s.settled?s.promise:(s.aborter.addSignal(a),s.statusReporter.addCallback(o),Nu.checkSinglePromise(s.promise,a)):(this.fill(n,t,a,o),Nu.checkSinglePromise(this.cache.get(n).promise,a))}delete(n){const t=this.cache.get(n);t&&(t.settled||t.aborter.abort(),this.cache.delete(n))}clear(){const n=this.cache.keys();let t=0;for(let a=n.next();!a.done;a=n.next())this.delete(a.value),t+=1;return t}}let rc=class Gs{constructor(n){this.ranges=n}get min(){return this.ranges[0].min}get max(){return this.ranges.at(-1).max}contains(n){for(const t of this.ranges)if(t.min<=n&&t.max>=n)return!0;return!1}isContiguous(){return this.ranges.length>1}getRanges(){return this.ranges.map(n=>new Gs([{min:n.min,max:n.max}]))}toString(){return this.ranges.map(n=>`[${n.min}-${n.max}]`).join(",")}union(n){const t=[...this.getRanges(),...n.getRanges()].sort((s,f)=>s.min<f.min?-1:s.min>f.min?1:s.max<f.max?-1:f.max>s.max?1:0),a=[];let o=t[0];for(const s of t)s.min>o.max+1?(a.push(o),o=s):s.max>o.max&&(o=new Gs([{min:o.min,max:s.max}]));return a.push(o),a.length===1?a[0]:new Gs(a)}};function Ki(e){let n=e.length;for(;--n>=0;)e[n]=0}const tw=3,nw=258,ic=29,rw=256+1+ic,ac=30,iw=512,aw=new Array((rw+2)*2);Ki(aw);const uw=new Array(ac*2);Ki(uw);const sw=new Array(iw);Ki(sw);const ow=new Array(nw-tw+1);Ki(ow);const fw=new Array(ic);Ki(fw);const lw=new Array(ac);Ki(lw);var Zo=(e,n,t,a)=>{let o=e&65535|0,s=e>>>16&65535|0,f=0;for(;t!==0;){f=t>2e3?2e3:t,t-=f;do o=o+n[a++]|0,s=s+o|0;while(--f);o%=65521,s%=65521}return o|s<<16|0};const hw=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var a=0;a<8;a++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},cw=new Uint32Array(hw());var ir=(e,n,t,a)=>{const o=cw,s=a+t;e^=-1;for(let f=a;f<s;f++)e=e>>>8^o[(e^n[f])&255];return e^-1},Xo={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"},uc={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 dw=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var gw=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const a in t)dw(t,a)&&(e[a]=t[a])}}return e},pw=e=>{let n=0;for(let a=0,o=e.length;a<o;a++)n+=e[a].length;const t=new Uint8Array(n);for(let a=0,o=0,s=e.length;a<s;a++){let f=e[a];t.set(f,o),o+=f.length}return t},sc={assign:gw,flattenChunks:pw};let oc=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{oc=!1}const $a=new Uint8Array(256);for(let e=0;e<256;e++)$a[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;$a[254]=$a[254]=1;var _w=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,a,o,s,f=e.length,h=0;for(o=0;o<f;o++)t=e.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=e.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(n=new Uint8Array(h),s=0,o=0;s<h;o++)t=e.charCodeAt(o),(t&64512)===55296&&o+1<f&&(a=e.charCodeAt(o+1),(a&64512)===56320&&(t=65536+(t-55296<<10)+(a-56320),o++)),t<128?n[s++]=t:t<2048?(n[s++]=192|t>>>6,n[s++]=128|t&63):t<65536?(n[s++]=224|t>>>12,n[s++]=128|t>>>6&63,n[s++]=128|t&63):(n[s++]=240|t>>>18,n[s++]=128|t>>>12&63,n[s++]=128|t>>>6&63,n[s++]=128|t&63);return n};const vw=(e,n)=>{if(n<65534&&e.subarray&&oc)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let a=0;a<n;a++)t+=String.fromCharCode(e[a]);return t};var ww=(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let a,o;const s=new Array(t*2);for(o=0,a=0;a<t;){let f=e[a++];if(f<128){s[o++]=f;continue}let h=$a[f];if(h>4){s[o++]=65533,a+=h-1;continue}for(f&=h===2?31:h===3?15:7;h>1&&a<t;)f=f<<6|e[a++]&63,h--;if(h>1){s[o++]=65533;continue}f<65536?s[o++]=f:(f-=65536,s[o++]=55296|f>>10&1023,s[o++]=56320|f&1023)}return vw(s,o)},mw=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+$a[e[t]]>n?t:n},Vo={string2buf:_w,buf2string:ww,utf8border:mw};function bw(){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 Dw=bw;const Ou=16209,xw=16191;var yw=function(n,t){let a,o,s,f,h,v,d,c,D,y,m,I,F,k,L,G,P,T,$,q,N,C,S,O;const W=n.state;a=n.next_in,S=n.input,o=a+(n.avail_in-5),s=n.next_out,O=n.output,f=s-(t-n.avail_out),h=s+(n.avail_out-257),v=W.dmax,d=W.wsize,c=W.whave,D=W.wnext,y=W.window,m=W.hold,I=W.bits,F=W.lencode,k=W.distcode,L=(1<<W.lenbits)-1,G=(1<<W.distbits)-1;e:do{I<15&&(m+=S[a++]<<I,I+=8,m+=S[a++]<<I,I+=8),P=F[m&L];t:for(;;){if(T=P>>>24,m>>>=T,I-=T,T=P>>>16&255,T===0)O[s++]=P&65535;else if(T&16){$=P&65535,T&=15,T&&(I<T&&(m+=S[a++]<<I,I+=8),$+=m&(1<<T)-1,m>>>=T,I-=T),I<15&&(m+=S[a++]<<I,I+=8,m+=S[a++]<<I,I+=8),P=k[m&G];n:for(;;){if(T=P>>>24,m>>>=T,I-=T,T=P>>>16&255,T&16){if(q=P&65535,T&=15,I<T&&(m+=S[a++]<<I,I+=8,I<T&&(m+=S[a++]<<I,I+=8)),q+=m&(1<<T)-1,q>v){n.msg="invalid distance too far back",W.mode=Ou;break e}if(m>>>=T,I-=T,T=s-f,q>T){if(T=q-T,T>c&&W.sane){n.msg="invalid distance too far back",W.mode=Ou;break e}if(N=0,C=y,D===0){if(N+=d-T,T<$){$-=T;do O[s++]=y[N++];while(--T);N=s-q,C=O}}else if(D<T){if(N+=d+D-T,T-=D,T<$){$-=T;do O[s++]=y[N++];while(--T);if(N=0,D<$){T=D,$-=T;do O[s++]=y[N++];while(--T);N=s-q,C=O}}}else if(N+=D-T,T<$){$-=T;do O[s++]=y[N++];while(--T);N=s-q,C=O}for(;$>2;)O[s++]=C[N++],O[s++]=C[N++],O[s++]=C[N++],$-=3;$&&(O[s++]=C[N++],$>1&&(O[s++]=C[N++]))}else{N=s-q;do O[s++]=O[N++],O[s++]=O[N++],O[s++]=O[N++],$-=3;while($>2);$&&(O[s++]=O[N++],$>1&&(O[s++]=O[N++]))}}else if(T&64){n.msg="invalid distance code",W.mode=Ou;break e}else{P=k[(P&65535)+(m&(1<<T)-1)];continue n}break}}else if(T&64)if(T&32){W.mode=xw;break e}else{n.msg="invalid literal/length code",W.mode=Ou;break e}else{P=F[(P&65535)+(m&(1<<T)-1)];continue t}break}}while(a<o&&s<h);$=I>>3,a-=$,I-=$<<3,m&=(1<<I)-1,n.next_in=a,n.next_out=s,n.avail_in=a<o?5+(o-a):5-(a-o),n.avail_out=s<h?257+(h-s):257-(s-h),W.hold=m,W.bits=I};const Yi=15,fc=852,lc=592,hc=0,Ko=1,cc=2,Ew=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]),Aw=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]),Fw=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]),Cw=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 Ua=(e,n,t,a,o,s,f,h)=>{const v=h.bits;let d=0,c=0,D=0,y=0,m=0,I=0,F=0,k=0,L=0,G=0,P,T,$,q,N,C=null,S;const O=new Uint16Array(Yi+1),W=new Uint16Array(Yi+1);let V=null,te,ie,le;for(d=0;d<=Yi;d++)O[d]=0;for(c=0;c<a;c++)O[n[t+c]]++;for(m=v,y=Yi;y>=1&&O[y]===0;y--);if(m>y&&(m=y),y===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,h.bits=1,0;for(D=1;D<y&&O[D]===0;D++);for(m<D&&(m=D),k=1,d=1;d<=Yi;d++)if(k<<=1,k-=O[d],k<0)return-1;if(k>0&&(e===hc||y!==1))return-1;for(W[1]=0,d=1;d<Yi;d++)W[d+1]=W[d]+O[d];for(c=0;c<a;c++)n[t+c]!==0&&(f[W[n[t+c]]++]=c);if(e===hc?(C=V=f,S=20):e===Ko?(C=Ew,V=Aw,S=257):(C=Fw,V=Cw,S=0),G=0,c=0,d=D,N=s,I=m,F=0,$=-1,L=1<<m,q=L-1,e===Ko&&L>fc||e===cc&&L>lc)return 1;for(;;){te=d-F,f[c]+1<S?(ie=0,le=f[c]):f[c]>=S?(ie=V[f[c]-S],le=C[f[c]-S]):(ie=96,le=0),P=1<<d-F,T=1<<I,D=T;do T-=P,o[N+(G>>F)+T]=te<<24|ie<<16|le|0;while(T!==0);for(P=1<<d-1;G&P;)P>>=1;if(P!==0?(G&=P-1,G+=P):G=0,c++,--O[d]===0){if(d===y)break;d=n[t+f[c]]}if(d>m&&(G&q)!==$){for(F===0&&(F=m),N+=D,I=d-F,k=1<<I;I+F<y&&(k-=O[I+F],!(k<=0));)I++,k<<=1;if(L+=1<<I,e===Ko&&L>fc||e===cc&&L>lc)return 1;$=G&q,o[$]=m<<24|I<<16|N-s|0}}return G!==0&&(o[N+G]=d-F<<24|64<<16|0),h.bits=m,0};const Bw=0,dc=1,gc=2,{Z_FINISH:pc,Z_BLOCK:Sw,Z_TREES:Mu,Z_OK:gi,Z_STREAM_END:Iw,Z_NEED_DICT:Tw,Z_STREAM_ERROR:Fn,Z_DATA_ERROR:_c,Z_MEM_ERROR:vc,Z_BUF_ERROR:kw,Z_DEFLATED:wc}=uc,Pu=16180,mc=16181,bc=16182,Dc=16183,xc=16184,yc=16185,Ec=16186,Ac=16187,Fc=16188,Cc=16189,$u=16190,dr=16191,Yo=16192,Bc=16193,Qo=16194,Sc=16195,Ic=16196,Tc=16197,kc=16198,Uu=16199,Wu=16200,Rc=16201,Lc=16202,Nc=16203,Oc=16204,Mc=16205,Jo=16206,Pc=16207,$c=16208,_t=16209,Uc=16210,Wc=16211,Rw=852,Lw=592,Nw=15,qc=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Ow(){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 pi=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.mode<Pu||n.mode>Wc?1:0},Gc=e=>{if(pi(e))return Fn;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=Pu,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(Rw),n.distcode=n.distdyn=new Int32Array(Lw),n.sane=1,n.back=-1,gi},Hc=e=>{if(pi(e))return Fn;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,Gc(e)},Zc=(e,n)=>{let t;if(pi(e))return Fn;const a=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?Fn:(a.window!==null&&a.wbits!==n&&(a.window=null),a.wrap=t,a.wbits=n,Hc(e))},Xc=(e,n)=>{if(!e)return Fn;const t=new Ow;e.state=t,t.strm=e,t.window=null,t.mode=Pu;const a=Zc(e,n);return a!==gi&&(e.state=null),a},Mw=e=>Xc(e,Nw);let Vc=!0,jo,zo;const Pw=e=>{if(Vc){jo=new Int32Array(512),zo=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Ua(dc,e.lens,0,288,jo,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Ua(gc,e.lens,0,32,zo,0,e.work,{bits:5}),Vc=!1}e.lencode=jo,e.lenbits=9,e.distcode=zo,e.distbits=5},Kc=(e,n,t,a)=>{let o;const s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),a>=s.wsize?(s.window.set(n.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>a&&(o=a),s.window.set(n.subarray(t-a,t-a+o),s.wnext),a-=o,a?(s.window.set(n.subarray(t-a,t),0),s.wnext=a,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0},$w=(e,n)=>{let t,a,o,s,f,h,v,d,c,D,y,m,I,F,k=0,L,G,P,T,$,q,N,C;const S=new Uint8Array(4);let O,W;const V=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pi(e)||!e.output||!e.input&&e.avail_in!==0)return Fn;t=e.state,t.mode===dr&&(t.mode=Yo),f=e.next_out,o=e.output,v=e.avail_out,s=e.next_in,a=e.input,h=e.avail_in,d=t.hold,c=t.bits,D=h,y=v,C=gi;e:for(;;)switch(t.mode){case Pu:if(t.wrap===0){t.mode=Yo;break}for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&2&&d===35615){t.wbits===0&&(t.wbits=15),t.check=0,S[0]=d&255,S[1]=d>>>8&255,t.check=ir(t.check,S,2,0),d=0,c=0,t.mode=mc;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){e.msg="incorrect header check",t.mode=_t;break}if((d&15)!==wc){e.msg="unknown compression method",t.mode=_t;break}if(d>>>=4,c-=4,N=(d&15)+8,t.wbits===0&&(t.wbits=N),N>15||N>t.wbits){e.msg="invalid window size",t.mode=_t;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=d&512?Cc:dr,d=0,c=0;break;case mc:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.flags=d,(t.flags&255)!==wc){e.msg="unknown compression method",t.mode=_t;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=_t;break}t.head&&(t.head.text=d>>8&1),t.flags&512&&t.wrap&4&&(S[0]=d&255,S[1]=d>>>8&255,t.check=ir(t.check,S,2,0)),d=0,c=0,t.mode=bc;case bc:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.time=d),t.flags&512&&t.wrap&4&&(S[0]=d&255,S[1]=d>>>8&255,S[2]=d>>>16&255,S[3]=d>>>24&255,t.check=ir(t.check,S,4,0)),d=0,c=0,t.mode=Dc;case Dc:for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.head&&(t.head.xflags=d&255,t.head.os=d>>8),t.flags&512&&t.wrap&4&&(S[0]=d&255,S[1]=d>>>8&255,t.check=ir(t.check,S,2,0)),d=0,c=0,t.mode=xc;case xc:if(t.flags&1024){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.length=d,t.head&&(t.head.extra_len=d),t.flags&512&&t.wrap&4&&(S[0]=d&255,S[1]=d>>>8&255,t.check=ir(t.check,S,2,0)),d=0,c=0}else t.head&&(t.head.extra=null);t.mode=yc;case yc:if(t.flags&1024&&(m=t.length,m>h&&(m=h),m&&(t.head&&(N=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(a.subarray(s,s+m),N)),t.flags&512&&t.wrap&4&&(t.check=ir(t.check,a,m,s)),h-=m,s+=m,t.length-=m),t.length))break e;t.length=0,t.mode=Ec;case Ec:if(t.flags&2048){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.name+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&t.wrap&4&&(t.check=ir(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Ac;case Ac:if(t.flags&4096){if(h===0)break e;m=0;do N=a[s+m++],t.head&&N&&t.length<65536&&(t.head.comment+=String.fromCharCode(N));while(N&&m<h);if(t.flags&512&&t.wrap&4&&(t.check=ir(t.check,a,m,s)),h-=m,s+=m,N)break e}else t.head&&(t.head.comment=null);t.mode=Fc;case Fc:if(t.flags&512){for(;c<16;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&4&&d!==(t.check&65535)){e.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),e.adler=t.check=0,t.mode=dr;break;case Cc:for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}e.adler=t.check=qc(d),d=0,c=0,t.mode=$u;case $u:if(t.havedict===0)return e.next_out=f,e.avail_out=v,e.next_in=s,e.avail_in=h,t.hold=d,t.bits=c,Tw;e.adler=t.check=1,t.mode=dr;case dr:if(n===Sw||n===Mu)break e;case Yo:if(t.last){d>>>=c&7,c-=c&7,t.mode=Jo;break}for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}switch(t.last=d&1,d>>>=1,c-=1,d&3){case 0:t.mode=Bc;break;case 1:if(Pw(t),t.mode=Uu,n===Mu){d>>>=2,c-=2;break e}break;case 2:t.mode=Ic;break;case 3:e.msg="invalid block type",t.mode=_t}d>>>=2,c-=2;break;case Bc:for(d>>>=c&7,c-=c&7;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if((d&65535)!==(d>>>16^65535)){e.msg="invalid stored block lengths",t.mode=_t;break}if(t.length=d&65535,d=0,c=0,t.mode=Qo,n===Mu)break e;case Qo:t.mode=Sc;case Sc:if(m=t.length,m){if(m>h&&(m=h),m>v&&(m=v),m===0)break e;o.set(a.subarray(s,s+m),f),h-=m,s+=m,v-=m,f+=m,t.length-=m;break}t.mode=dr;break;case Ic:for(;c<14;){if(h===0)break e;h--,d+=a[s++]<<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){e.msg="too many length or distance symbols",t.mode=_t;break}t.have=0,t.mode=Tc;case Tc:for(;t.have<t.ncode;){for(;c<3;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}t.lens[V[t.have++]]=d&7,d>>>=3,c-=3}for(;t.have<19;)t.lens[V[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,O={bits:t.lenbits},C=Ua(Bw,t.lens,0,19,t.lencode,0,t.work,O),t.lenbits=O.bits,C){e.msg="invalid code lengths set",t.mode=_t;break}t.have=0,t.mode=kc;case kc:for(;t.have<t.nlen+t.ndist;){for(;k=t.lencode[d&(1<<t.lenbits)-1],L=k>>>24,G=k>>>16&255,P=k&65535,!(L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(P<16)d>>>=L,c-=L,t.lens[t.have++]=P;else{if(P===16){for(W=L+2;c<W;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(d>>>=L,c-=L,t.have===0){e.msg="invalid bit length repeat",t.mode=_t;break}N=t.lens[t.have-1],m=3+(d&3),d>>>=2,c-=2}else if(P===17){for(W=L+3;c<W;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=L,c-=L,N=0,m=3+(d&7),d>>>=3,c-=3}else{for(W=L+7;c<W;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=L,c-=L,N=0,m=11+(d&127),d>>>=7,c-=7}if(t.have+m>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=_t;break}for(;m--;)t.lens[t.have++]=N}}if(t.mode===_t)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=_t;break}if(t.lenbits=9,O={bits:t.lenbits},C=Ua(dc,t.lens,0,t.nlen,t.lencode,0,t.work,O),t.lenbits=O.bits,C){e.msg="invalid literal/lengths set",t.mode=_t;break}if(t.distbits=6,t.distcode=t.distdyn,O={bits:t.distbits},C=Ua(gc,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,O),t.distbits=O.bits,C){e.msg="invalid distances set",t.mode=_t;break}if(t.mode=Uu,n===Mu)break e;case Uu:t.mode=Wu;case Wu:if(h>=6&&v>=258){e.next_out=f,e.avail_out=v,e.next_in=s,e.avail_in=h,t.hold=d,t.bits=c,yw(e,y),f=e.next_out,o=e.output,v=e.avail_out,s=e.next_in,a=e.input,h=e.avail_in,d=t.hold,c=t.bits,t.mode===dr&&(t.back=-1);break}for(t.back=0;k=t.lencode[d&(1<<t.lenbits)-1],L=k>>>24,G=k>>>16&255,P=k&65535,!(L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(G&&!(G&240)){for(T=L,$=G,q=P;k=t.lencode[q+((d&(1<<T+$)-1)>>T)],L=k>>>24,G=k>>>16&255,P=k&65535,!(T+L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=T,c-=T,t.back+=T}if(d>>>=L,c-=L,t.back+=L,t.length=P,G===0){t.mode=Mc;break}if(G&32){t.back=-1,t.mode=dr;break}if(G&64){e.msg="invalid literal/length code",t.mode=_t;break}t.extra=G&15,t.mode=Rc;case Rc:if(t.extra){for(W=t.extra;c<W;){if(h===0)break e;h--,d+=a[s++]<<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=Lc;case Lc:for(;k=t.distcode[d&(1<<t.distbits)-1],L=k>>>24,G=k>>>16&255,P=k&65535,!(L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(!(G&240)){for(T=L,$=G,q=P;k=t.distcode[q+((d&(1<<T+$)-1)>>T)],L=k>>>24,G=k>>>16&255,P=k&65535,!(T+L<=c);){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}d>>>=T,c-=T,t.back+=T}if(d>>>=L,c-=L,t.back+=L,G&64){e.msg="invalid distance code",t.mode=_t;break}t.offset=P,t.extra=G&15,t.mode=Nc;case Nc:if(t.extra){for(W=t.extra;c<W;){if(h===0)break e;h--,d+=a[s++]<<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){e.msg="invalid distance too far back",t.mode=_t;break}t.mode=Oc;case Oc:if(v===0)break e;if(m=y-v,t.offset>m){if(m=t.offset-m,m>t.whave&&t.sane){e.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),F=t.window}else F=o,I=f-t.offset,m=t.length;m>v&&(m=v),v-=m,t.length-=m;do o[f++]=F[I++];while(--m);t.length===0&&(t.mode=Wu);break;case Mc:if(v===0)break e;o[f++]=t.length,v--,t.mode=Wu;break;case Jo:if(t.wrap){for(;c<32;){if(h===0)break e;h--,d|=a[s++]<<c,c+=8}if(y-=v,e.total_out+=y,t.total+=y,t.wrap&4&&y&&(e.adler=t.check=t.flags?ir(t.check,o,y,f-y):Zo(t.check,o,y,f-y)),y=v,t.wrap&4&&(t.flags?d:qc(d))!==t.check){e.msg="incorrect data check",t.mode=_t;break}d=0,c=0}t.mode=Pc;case Pc:if(t.wrap&&t.flags){for(;c<32;){if(h===0)break e;h--,d+=a[s++]<<c,c+=8}if(t.wrap&4&&d!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=_t;break}d=0,c=0}t.mode=$c;case $c:C=Iw;break e;case _t:C=_c;break e;case Uc:return vc;case Wc:default:return Fn}return e.next_out=f,e.avail_out=v,e.next_in=s,e.avail_in=h,t.hold=d,t.bits=c,(t.wsize||y!==e.avail_out&&t.mode<_t&&(t.mode<Jo||n!==pc))&&Kc(e,e.output,e.next_out,y-e.avail_out),D-=e.avail_in,y-=e.avail_out,e.total_in+=D,e.total_out+=y,t.total+=y,t.wrap&4&&y&&(e.adler=t.check=t.flags?ir(t.check,o,y,e.next_out-y):Zo(t.check,o,y,e.next_out-y)),e.data_type=t.bits+(t.last?64:0)+(t.mode===dr?128:0)+(t.mode===Uu||t.mode===Qo?256:0),(D===0&&y===0||n===pc)&&C===gi&&(C=kw),C},Uw=e=>{if(pi(e))return Fn;let n=e.state;return n.window&&(n.window=null),e.state=null,gi},Ww=(e,n)=>{if(pi(e))return Fn;const t=e.state;return t.wrap&2?(t.head=n,n.done=!1,gi):Fn},qw=(e,n)=>{const t=n.length;let a,o,s;return pi(e)||(a=e.state,a.wrap!==0&&a.mode!==$u)?Fn:a.mode===$u&&(o=1,o=Zo(o,n,t,0),o!==a.check)?_c:(s=Kc(e,n,t,t),s?(a.mode=Uc,vc):(a.havedict=1,gi))};var Gw=Hc,Hw=Zc,Zw=Gc,Xw=Mw,Vw=Xc,Kw=$w,Yw=Uw,Qw=Ww,Jw=qw,jw="pako inflate (from Nodeca project)",gr={inflateReset:Gw,inflateReset2:Hw,inflateResetKeep:Zw,inflateInit:Xw,inflateInit2:Vw,inflate:Kw,inflateEnd:Yw,inflateGetHeader:Qw,inflateSetDictionary:Jw,inflateInfo:jw};function zw(){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 em=zw;const Yc=Object.prototype.toString,{Z_NO_FLUSH:tm,Z_FINISH:nm,Z_OK:Wa,Z_STREAM_END:ef,Z_NEED_DICT:tf,Z_STREAM_ERROR:rm,Z_DATA_ERROR:Qc,Z_MEM_ERROR:im}=uc;function qu(e){this.options=sc.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15||(n.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Dw,this.strm.avail_out=0;let t=gr.inflateInit2(this.strm,n.windowBits);if(t!==Wa)throw new Error(Xo[t]);if(this.header=new em,gr.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Vo.string2buf(n.dictionary):Yc.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=gr.inflateSetDictionary(this.strm,n.dictionary),t!==Wa)))throw new Error(Xo[t])}qu.prototype.push=function(e,n){const t=this.strm,a=this.options.chunkSize,o=this.options.dictionary;let s,f,h;if(this.ended)return!1;for(n===~~n?f=n:f=n===!0?nm:tm,Yc.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,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),s=gr.inflate(t,f),s===tf&&o&&(s=gr.inflateSetDictionary(t,o),s===Wa?s=gr.inflate(t,f):s===Qc&&(s=tf));t.avail_in>0&&s===ef&&t.state.wrap>0&&e[t.next_in]!==0;)gr.inflateReset(t),s=gr.inflate(t,f);switch(s){case rm:case Qc:case tf:case im:return this.onEnd(s),this.ended=!0,!1}if(h=t.avail_out,t.next_out&&(t.avail_out===0||s===ef))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(!(s===Wa&&h===0)){if(s===ef)return s=gr.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},qu.prototype.onData=function(e){this.chunks.push(e)},qu.prototype.onEnd=function(e){e===Wa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=sc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function am(e,n){const t=new qu(n);if(t.push(e),t.err)throw t.msg||Xo[t.err];return t.result}function um(e,n){return n=n||{},n.raw=!0,am(e,n)}var sm=um,om={inflateRaw:sm};const{inflateRaw:fm}=om;var lm=fm;function hm(e){return lm(e.subarray(2))}class cm extends Error{constructor(n){super(n),this.code="ERR_ABORTED"}}function dm(e){e.sort((o,s)=>o.offset-s.offset);const n=[];let t,a;for(const o of e)t&&a&&o.offset-a<=2e3?(t.length=t.length+o.length-a+o.offset,t.blocks.push(o)):n.push(t={blocks:[o],length:o.length,offset:o.offset}),a=t.offset+t.length;return n}function Gu(e){if(e&&e.aborted)if(typeof DOMException>"u"){const n=new cm("aborted");throw n.code="ERR_ABORTED",n}else throw new DOMException("aborted","AbortError")}const nf=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function rf(e,n,t,a){return e<a&&n>=t}class Jc{constructor(n,t,a,o,s){if(this.bbi=n,this.refsByName=t,this.cirTreeOffset=a,this.isCompressed=o,this.blockType=s,this.featureCache=new Nu({cache:new Pl({maxSize:1e3}),fill:async({length:f,offset:h},v)=>this.bbi.read(f,h,{signal:v})}),!(a>=0))throw new Error("invalid cirTreeOffset!")}async readWigData(n,t,a,o,s){try{const f=this.refsByName[n];f===void 0&&o.complete();const h={chrId:f,start:t,end:a};this.cirTreePromise||(this.cirTreePromise=this.bbi.read(48,this.cirTreeOffset,s));const v=await this.cirTreePromise,c=new DataView(v.buffer).getUint32(4,!0);let D=[],y=0;const m=(L,G,P)=>{try{const $=L.subarray(G),q=new DataView($.buffer,$.byteOffset,$.length);let N=0;const C=q.getUint8(N);N+=2;const S=q.getUint16(N,!0);if(N+=2,C===1){const O=[];for(let W=0;W<S;W++){const V=q.getUint32(N,!0);N+=4;const te=q.getUint32(N,!0);N+=4;const ie=q.getUint32(N,!0);N+=4;const le=q.getUint32(N,!0);N+=4;const Fe=Number(q.getBigUint64(N,!0));N+=8;const ae=Number(q.getBigUint64(N,!0));N+=8,O.push({startChrom:V,startBase:te,endBase:le,endChrom:ie,blockOffset:Fe,blockSize:ae,offset:N})}D=D.concat(O.filter(W=>I(W)).map(W=>({offset:W.blockOffset,length:W.blockSize})))}else if(C===0){const O=[];for(let V=0;V<S;V++){const te=q.getUint32(N,!0);N+=4;const ie=q.getUint32(N,!0);N+=4;const le=q.getUint32(N,!0);N+=4;const Fe=q.getUint32(N,!0);N+=4;const ae=Number(q.getBigUint64(N,!0));N+=8,O.push({startChrom:te,startBase:ie,endChrom:le,endBase:Fe,blockOffset:ae,offset:N})}const W=O.filter(V=>I(V)).map(V=>V.blockOffset);W.length>0&&k(W,P+1)}}catch(T){o.error(T)}},I=L=>{const{startChrom:G,startBase:P,endChrom:T,endBase:$}=L;return(G<f||G===f&&P<=a)&&(T>f||T===f&&$>=t)},F=async(L,G,P)=>{try{const T=G.max-G.min,$=G.min,q=await this.featureCache.get(`${T}_${$}`,{length:T,offset:$},s==null?void 0:s.signal);for(const N of L)G.contains(N)&&(m(q,N-$,P),y-=1,y===0&&this.readFeatures(o,D,{...s,request:h}).catch(C=>{o.error(C)}))}catch(T){o.error(T)}},k=(L,G)=>{try{y+=L.length;const P=4+c*32;let T=new rc([{min:L[0],max:L[0]+P}]);for(let $=1;$<L.length;$+=1){const q=new rc([{min:L[$],max:L[$]+P}]);T=T.union(q)}T.getRanges().map($=>F(L,$,G))}catch(P){o.error(P)}};k([Number(this.cirTreeOffset)+48],1);return}catch(f){o.error(f)}}parseSummaryBlock(n,t,a){const o=[];let s=t;const f=new DataView(n.buffer,n.byteOffset,n.length);for(;s<n.byteLength;){const h=f.getUint32(s,!0);s+=4;const v=f.getUint32(s,!0);s+=4;const d=f.getUint32(s,!0);s+=4;const c=f.getUint32(s,!0);s+=4;const D=f.getFloat32(s,!0);s+=4;const y=f.getFloat32(s,!0);s+=4;const m=f.getFloat32(s,!0);s+=4,s+=4,(!a||h===a.chrId&&rf(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(n,t,a,o){const s=[];let f=t;const h=n,v=new DataView(h.buffer,h.byteOffset,h.length);for(;f<n.byteLength;){const d=f,c=v.getUint32(f,!0);f+=4;const D=v.getInt32(f,!0);f+=4;const y=v.getInt32(f,!0);f+=4;let m=f;for(;m<n.length&&n[m]!==0;m++);const I=n.subarray(f,m),F=(nf==null?void 0:nf.decode(I))??I.toString();f=m+1,s.push({chromId:c,start:D,end:y,rest:F,uniqueId:`bb-${a+d}`})}return o?s.filter(d=>rf(d.start,d.end,o.start,o.end)):s}parseBigWigBlock(n,t,a){const o=n.subarray(t),s=new DataView(o.buffer,o.byteOffset,o.length);let f=0;f+=4;const h=s.getInt32(f,!0);f+=8;const v=s.getUint32(f,!0);f+=4;const d=s.getUint32(f,!0);f+=4;const c=s.getUint8(f);f+=2;const D=s.getUint16(f,!0);f+=2;const y=new Array(D);switch(c){case 1:{for(let m=0;m<D;m++){const I=s.getInt32(f,!0);f+=4;const F=s.getInt32(f,!0);f+=4;const k=s.getFloat32(f,!0);f+=4,y[m]={start:I,end:F,score:k}}break}case 2:{for(let m=0;m<D;m++){const I=s.getInt32(f,!0);f+=4;const F=s.getFloat32(f,!0);f+=4,y[m]={score:F,start:I,end:I+d}}break}case 3:{for(let m=0;m<D;m++){const I=s.getFloat32(f,!0);f+=4;const F=h+m*v;y[m]={score:I,start:F,end:F+d}}break}}return a?y.filter(m=>rf(m.start,m.end,a.start,a.end)):y}async readFeatures(n,t,a={}){try{const{blockType:o,isCompressed:s}=this,{signal:f,request:h}=a,v=dm(t);Gu(f),await Promise.all(v.map(async d=>{Gu(f);const{length:c,offset:D}=d,y=await this.featureCache.get(`${c}_${D}`,d,f);for(const m of d.blocks){Gu(f);let I=y.subarray(Number(m.offset)-Number(d.offset));switch(s&&(I=hm(I)),Gu(f),o){case"summary":{n.next(this.parseSummaryBlock(I,0,h));break}case"bigwig":{n.next(this.parseBigWigBlock(I,0,h));break}case"bigbed":{n.next(this.parseBigBedBlock(I,0,Number(m.offset)*256,h));break}default:console.warn(`Don't know what to do with ${o}`)}}})),n.complete()}catch(o){n.error(o)}}}const gm=-2003829722,jc=-2021002517;function Qi(e){return new DataView(e.buffer,e.byteOffset,e.length)}class pm{getHeader(n){return this.headerP||(this.headerP=this._getHeader(n).catch(t=>{throw this.headerP=void 0,t})),this.headerP}constructor(n){const{filehandle:t,renameRefSeqs:a=f=>f,path:o,url:s}=n;if(this.renameRefSeqs=a,t)this.bbi=t;else if(s)this.bbi=new Kh(s);else if(o)this.bbi=new Sv(o);else throw new Error("no file given")}async _getHeader(n){const t=await this._getMainHeader(n),a=await this._readChromTree(t,n);return{...t,...a}}async _getMainHeader(n,t=2e3){const a=await this.bbi.read(t,0,n),o=Qi(a),s=o.getInt32(0,!0);if(s!==gm&&s!==jc)throw new Error("not a BigWig/BigBed file");let f=0;const h=o.getInt32(f,!0);f+=4;const v=o.getUint16(f,!0);f+=2;const d=o.getUint16(f,!0);f+=2;const c=Number(o.getBigUint64(f,!0));f+=8;const D=Number(o.getBigUint64(f,!0));f+=8;const y=Number(o.getBigUint64(f,!0));f+=8;const m=o.getUint16(f,!0);f+=2;const I=o.getUint16(f,!0);f+=2;const F=Number(o.getBigUint64(f,!0));f+=8;const k=Number(o.getBigUint64(f,!0));f+=8;const L=o.getUint32(f,!0);f+=4;const G=Number(o.getBigUint64(f,!0));f+=8;const P=[];for(let N=0;N<d;N++){const C=o.getUint32(f,!0);f+=4;const S=o.getUint32(f,!0);f+=4;const O=Number(o.getBigUint64(f,!0));f+=8;const W=Number(o.getBigUint64(f,!0));f+=8,P.push({reductionLevel:C,reserved:S,dataOffset:O,indexOffset:W})}const T=h===jc?"bigbed":"bigwig";if(F>t||k>t-8*5)return this._getMainHeader(n,t*2);let $;if(k){const N=a.subarray(Number(k));let C=0;const S=Qi(N),O=Number(S.getBigUint64(C,!0));C+=8;const W=S.getFloat64(C,!0);C+=8;const V=S.getFloat64(C,!0);C+=8;const te=S.getFloat64(C,!0);C+=8;const ie=S.getFloat64(C,!0);C+=8,$={scoreMin:W,scoreMax:V,scoreSum:te,scoreSumSquares:ie,basesCovered:O}}else throw new Error("no stats");const q=new TextDecoder("utf8");return{zoomLevels:P,magic:h,extHeaderOffset:G,numZoomLevels:d,fieldCount:m,totalSummary:$,definedFieldCount:I,uncompressBufSize:L,asOffset:F,chromTreeOffset:c,totalSummaryOffset:k,unzoomedDataOffset:D,unzoomedIndexOffset:y,fileType:T,version:v,autoSql:F?q.decode(a.subarray(F,a.indexOf(0,F))):""}}async _readChromTree(n,t){const a=[],o={},s=Number(n.chromTreeOffset),f=Qi(await this.bbi.read(32,s,t));let h=0;h+=4,h+=4;const v=f.getUint32(h,!0);h+=4;const d=f.getUint32(h,!0);h+=4,h+=8;const c=new TextDecoder("utf8"),D=async y=>{const m=await this.bbi.read(4,y),I=Qi(m);let F=0;const k=I.getUint8(F);F+=1,F+=1;const L=I.getUint16(F,!0);if(F+=2,k){const G=await this.bbi.read(L*(v+d),y+F),P=Qi(G);F=0;for(let T=0;T<L;T++){const $=c.decode(G.subarray(F,F+v)).replaceAll("\0","");F+=v;const q=P.getUint32(F,!0);F+=4;const N=P.getUint32(F,!0);F+=4,o[this.renameRefSeqs($)]=q,a[q]={name:$,id:q,length:N}}}else{const G=[],P=Qi(await this.bbi.read(L*(v+8),y+F));F=0;for(let T=0;T<L;T++){F+=v;const $=Number(P.getBigUint64(F,!0));F+=8,G.push(D($))}await Promise.all(G)}};return await D(s+32),{refsByName:o,refsByNumber:a}}async getUnzoomedView(n){const{unzoomedIndexOffset:t,refsByName:a,uncompressBufSize:o,fileType:s}=await this.getHeader(n);return new Jc(this.bbi,a,t,o>0,s)}async getFeatureStream(n,t,a,o){await this.getHeader(o);const s=this.renameRefSeqs(n);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 Uv(d=>{f.readWigData(s,t,a,d,o).catch(c=>{d.error(c)})})}async getFeatures(n,t,a,o){const s=await this.getFeatureStream(n,t,a,o);return(await Vv(s.pipe(Jv()))).flat()}}let _m=class extends pm{async getView(n,t){const{zoomLevels:a,refsByName:o,uncompressBufSize:s}=await this.getHeader(t),f=1/n,h=a.length-1;for(let v=h;v>=0;v-=1){const d=a[v];if(d&&d.reductionLevel<=2*f)return new Jc(this.bbi,o,d.indexOffset,s>0,"summary")}return this.getUnzoomedView(t)}};const vm=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","X","Y","M"];class af{constructor(n){ge(this,"url");ge(this,"bw");this.url=n,this.bw=new _m({filehandle:new Kh(n,{fetch:So})})}async detectChromosomeNaming(){try{const n=await this.bw.getHeader(),t=Object.keys(n.refsByName||{})[0];return t?vm.includes(t):!1}catch(n){return console.error("Error detecting chromosome naming:",n),!1}}async getData(n,t){const a=await this.detectChromosomeNaming(),o=n.map(h=>{let v=a?h.chr.replace("chr",""):h.chr;return(v==="M"||v==="chrM")&&(v=a?"M":"chrM"),this.bw.getFeatures(v,h.start,h.end)}),s=await Promise.all(o);return n.forEach((h,v)=>{s[v].forEach(d=>d.chr=h.chr)}),on.flatten(s)}}const wm=1e3;class mm{constructor(n){ge(this,"maxBasesPerPixel");ge(this,"workerSource");this.maxBasesPerPixel=wm,this.workerSource=new af(n)}getData(n,t,a){return t>this.maxBasesPerPixel?Promise.resolve([]):this.workerSource.getData(n,a)}}const bm=2;class Dm{constructor(n){ge(this,"maxBasesPerPixel");ge(this,"workerSource");this.maxBasesPerPixel=bm,this.workerSource=new af(n)}getData(n,t,a){return t>this.maxBasesPerPixel?Promise.resolve([]):this.workerSource.getData(n,a)}}var Hu={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 xm(e){Object.assign(this,e)}function ym(e){try{return decodeURIComponent(e)}catch{return e}}class Em{constructor({header:n="",strict:t=!0}){if(!n||!n.length)throw new Error("empty header received");const a=n.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:Hu.InfoFields,FORMAT:Hu.GenotypeFields,ALT:Hu.AltTypes,FILTER:Hu.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:
38
- ${v}`)}),!o)throw new Error("No format line found in header");const s=o.trim().split(" "),f=s.slice(0,8),h=["#CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO"];if(s.length<8)throw new Error(`VCF header missing columns:
39
- ${o}`);if(f.length!==h.length||!f.every((v,d)=>v===h[d]))throw new Error(`VCF column headers not correct:
40
- ${o}`);this.samples=s.slice(9)}_parseGenotypes(n,t){const a=t.split(" "),o={},s=n==null?void 0:n.split(":");return s&&this.samples.forEach((f,h)=>{o[f]={},s.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",s[d],"Type");y==="Integer"||y==="Float"?c=D.map(m=>m&&+m):c=D}o[f][s[d]]=c},{})}),o}_parseMetadata(n){const t=n.trim().match(/^##(.+?)=(.*)/);if(!t)throw new Error(`Line is not a valid metadata line: ${n}`);const[a,o]=t.slice(1,3);if(o.startsWith("<")){a in this.metadata||(this.metadata[a]={});const[s,f]=this._parseStructuredMetaVal(o);this.metadata[a][s]=f}else this.metadata[a]=o}_parseStructuredMetaVal(n){const t=this._parseKeyValue(n.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(...n){let t=this.metadata;for(let a=0;a<n.length;a+=1)if(t=t[n[a]],!t)return t;return t}_parseKeyValue(n,t=";"){const a={};let o="",s="",f=1;for(let h=0;h<n.length;h+=1)f===1?n[h]==="="?f=2:n[h]!==t?o+=n[h]:s===""&&(a[o]=null,o=""):f===2?n[h]===t?(a[o]=s,o="",s="",f=1):n[h]==='"'?f=3:s+=n[h]:f===3&&(n[h]!=='"'?s+=n[h]:f=2);return f===2||f===3?a[o]=s:f===1&&(a[o]=null),a}parseLine(n){if(n=n.trim(),!n.length)return;const t=this;let a=0;for(let q=0;a<n.length&&(n[a]===" "&&(q+=1),q!==9);a+=1);const o=n.substr(0,a).split(" "),s=n.substr(a+1),[f,h,v,d,c,D,y]=o,m=f,I=+h,F=v==="."?null:v.split(";"),k=d,L=c==="."?null:c.split(","),G=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 T=o[7]===void 0||o[7]==="."?{}:this._parseKeyValue(o[7]);Object.keys(T).forEach(q=>{let N;T[q]?N=T[q].split(",").map(S=>S==="."?null:S).map(S=>S&&ym(S)):N=T[q];const C=this.getMetadata("INFO",q,"Type");C&&(C==="Integer"||C==="Float"?N=N.map(S=>S===null?null:Number(S)):C==="Flag"&&(T[q]?console.warn(`Info field ${q} is a Flag and should not have a value (got value ${T[q]})`):N=!0)),T[q]=N});const $=new xm({CHROM:m,POS:I,ALT:L,INFO:T,REF:k,FILTER:P&&P.length===1&&P[0]==="PASS"?"PASS":P,ID:F,QUAL:G});return Object.defineProperty($,"SAMPLES",{get(){const q=t._parseGenotypes(o[8],s);return Object.defineProperty(this,"SAMPLES",{value:q,configurable:!1}),q},configurable:!0}),$}}class Am{constructor(n,t=null){ge(this,"header");ge(this,"vcf");ge(this,"parser");let a,o;Array.isArray(n)?(a=new Gl(n.filter(s=>!s.name.endsWith(".tbi"))[0]),o=new Gl(n.filter(s=>s.name.endsWith(".tbi"))[0])):(a=new Tr(n),o=new Tr(t||n+".tbi")),this.vcf=new Lh({filehandle:a,tbiFilehandle:o}),this.header=null,this.parser=null}async getData(n,t,a){this.header||(this.header=await this.vcf.getHeader()),this.parser||(this.parser=new Em({header:this.header}));const o=n.map(h=>this._getDataInLocus(h,a)),s=await Promise.all(o);return on.flatten(s)}async _getDataInLocus(n,t){const a=[];let o=t&&t.ensemblStyle?n.chr.replace("chr",""):n.chr;if(o==="M"&&(o="MT"),await this.vcf.getLines(o,n.start+1,n.end,s=>a.push(this.parser.parseLine(s))),t&&t.ensemblStyle)for(let s of a)s.CHROM=n.chr;return a}}const Fm={AUTO:"auto"};function nn(e,n){if(typeof e!="number"||typeof n!="number")throw"Bad range "+e+","+n;this._min=e,this._max=n}nn.prototype.min=function(){return this._min},nn.prototype.max=function(){return this._max},nn.prototype.contains=function(e){return e>=this._min&&e<=this._max},nn.prototype.isContiguous=function(){return!0},nn.prototype.ranges=function(){return[this]},nn.prototype._pushRanges=function(e){e.push(this)},nn.prototype.toString=function(){return"["+this._min+"-"+this._max+"]"};function Cn(e){var n=e.sort(zc),t=[],a=n.shift();n.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}Cn.prototype.min=function(){return this._ranges[0].min()},Cn.prototype.max=function(){return this._ranges[this._ranges.length-1].max()},Cn.prototype.lower_bound=function(e){var n=this.ranges();if(e>this.max())return n.length;if(e<this.min())return 0;for(var t=0,a=n.length-1;t<=a;){var o=Math.floor((t+a)/2);if(e>n[o]._max)t=o+1;else if(e<n[o]._min)a=o-1;else return o}return t},Cn.prototype.contains=function(e){var n=this.lower_bound(e);return!!(n<this._ranges.length&&this._ranges[n].contains(e))},Cn.prototype.insertRange=function(e){var n=this.lower_bound(e._min);if(n===this._ranges.length){this._ranges.push(e);return}var t=this.ranges();if(e._max<t[n]._min){this._ranges.splice(n,0,e);return}t[n]._min<e._min&&(e._min=t[n]._min);for(var a=n+1;a<t.length&&t[a]._min<=e._max;)a++;a--,t[a]._max>e._max&&(e._max=t[a]._max),this._ranges.splice(n,a-n+1,e)},Cn.prototype.isContiguous=function(){return this._ranges.length>1},Cn.prototype.ranges=function(){return this._ranges},Cn.prototype._pushRanges=function(e){for(var n=0;n<this._ranges.length;++n)e.push(this._ranges[n])},Cn.prototype.toString=function(){for(var e="",n=0;n<this._ranges.length;++n)n>0&&(e=e+","),e=e+this._ranges[n].toString();return e};function Cm(e,n){return e instanceof Cn||(e instanceof Array||(e=[e]),e=new Cn(e)),n&&e.insertRange(n),e}function Bm(e,n){for(var t=e.ranges(),a=n.ranges(),o=t.length,s=a.length,f=0,h=0,v=[];f<o&&h<s;){var e=t[f],n=a[h],d=Math.max(e.min(),n.min()),c=Math.min(e.max(),n.max());c>=d&&v.push(new nn(d,c)),e.max()>n.max()?++h:++f}return v.length==0?null:v.length==1?v[0]:new Cn(v)}function Sm(e){for(var n=0,t=e.ranges(),a=0;a<t.length;++a){var o=t[a];n+=o.max()-o.min()+1}return n}function Im(e,n){return e.min()<n.min()?-1:e.min()>n.min()?1:e.max()<n.max()?-1:n.max()>e.max()?1:0}function zc(e,n){return e._min<n._min?-1:e._min>n._min?1:e._max<n._max?-1:n._max>e._max?1:0}typeof module<"u"&&(module.exports={Range:nn,union:Cm,intersection:Bm,coverage:Sm,rangeOver:Im,_rangeOrder:zc});var Tm=15,ed=Tm,td=1440,$r=15,km=32,Rm=0,Lm=4,Nm=8,He=0,pr=1,Om=2,Bn=-2,st=-3,nd=-4,ar=-5,rd=0,id=1,ad=2,ud=3,sd=4,od=5,uf=6,qa=7,fd=8,ld=9,hd=10,cd=11,Zu=12,Sn=13,ln=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Ji=0,sf=1,dd=2,gd=3,pd=4,_d=5,Xu=6,Vu=7,Mm=8,Ku=9,Pm=9,$m=5,Um=[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],Wm=[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],qm=[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],Gm=[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],Hm=[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],Zm=[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 ji(){}ji.prototype.inflateInit=function(e,n){return e||(e=ed),n&&(n=!1),this.istate=new Ur,this.istate.inflateInit(this,n?-e:e)},ji.prototype.inflate=function(e){return this.istate==null?Bn:this.istate.inflate(this,e)},ji.prototype.inflateEnd=function(){if(this.istate==null)return Bn;var e=istate.inflateEnd(this);return this.istate=null,e},ji.prototype.inflateSync=function(){return istate.inflateSync(this)},ji.prototype.inflateSetDictionary=function(e,n){return istate.inflateSetDictionary(this,e,n)};function Ur(){this.was=[0]}Ur.prototype.inflateReset=function(e){return e==null||e.istate==null?Bn:(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=e.istate.nowrap!=0?qa:rd,e.istate.blocks.reset(e,null),He)},Ur.prototype.inflateEnd=function(e){return this.blocks!=null&&this.blocks.free(e),this.blocks=null,He},Ur.prototype.inflateInit=function(e,n){return e.msg=null,this.blocks=null,n<0&&(n=-n),n<8||n>15?(this.inflateEnd(e),Bn):(this.wbits=n,e.istate.blocks=new _i(e,e.istate.nowrap!=0?null:this,1<<n),this.inflateReset(e),He)},Ur.prototype.inflate=function(e,n){var t,a;if(e==null||e.istate==null||e.next_in==null)return Bn;for(n=n==Lm?ar:He,t=ar;;)switch(e.istate.mode){case rd:if(e.avail_in==0)return t;if(t=n,e.avail_in--,e.total_in++,((e.istate.method=e.next_in[e.next_in_index++])&15)!=Nm){e.istate.mode=Sn,e.msg="unknown compression method",e.istate.marker=5;break}if((e.istate.method>>4)+8>e.istate.wbits){e.istate.mode=Sn,e.msg="invalid window size",e.istate.marker=5;break}e.istate.mode=id;case id:if(e.avail_in==0)return t;if(t=n,e.avail_in--,e.total_in++,a=e.next_in[e.next_in_index++]&255,((e.istate.method<<8)+a)%31!=0){e.istate.mode=Sn,e.msg="incorrect header check",e.istate.marker=5;break}if(!(a&km)){e.istate.mode=qa;break}e.istate.mode=ad;case ad:if(e.avail_in==0)return t;t=n,e.avail_in--,e.total_in++,e.istate.need=(e.next_in[e.next_in_index++]&255)<<24&4278190080,e.istate.mode=ud;case ud:if(e.avail_in==0)return t;t=n,e.avail_in--,e.total_in++,e.istate.need+=(e.next_in[e.next_in_index++]&255)<<16&16711680,e.istate.mode=sd;case sd:if(e.avail_in==0)return t;t=n,e.avail_in--,e.total_in++,e.istate.need+=(e.next_in[e.next_in_index++]&255)<<8&65280,e.istate.mode=od;case od:return e.avail_in==0?t:(t=n,e.avail_in--,e.total_in++,e.istate.need+=e.next_in[e.next_in_index++]&255,e.adler=e.istate.need,e.istate.mode=uf,Om);case uf:return e.istate.mode=Sn,e.msg="need dictionary",e.istate.marker=0,Bn;case qa:if(t=e.istate.blocks.proc(e,t),t==st){e.istate.mode=Sn,e.istate.marker=0;break}if(t==He&&(t=n),t!=pr)return t;if(t=n,e.istate.blocks.reset(e,e.istate.was),e.istate.nowrap!=0){e.istate.mode=Zu;break}e.istate.mode=fd;case fd:if(e.avail_in==0)return t;t=n,e.avail_in--,e.total_in++,e.istate.need=(e.next_in[e.next_in_index++]&255)<<24&4278190080,e.istate.mode=ld;case ld:if(e.avail_in==0)return t;t=n,e.avail_in--,e.total_in++,e.istate.need+=(e.next_in[e.next_in_index++]&255)<<16&16711680,e.istate.mode=hd;case hd:if(e.avail_in==0)return t;t=n,e.avail_in--,e.total_in++,e.istate.need+=(e.next_in[e.next_in_index++]&255)<<8&65280,e.istate.mode=cd;case cd:if(e.avail_in==0)return t;if(t=n,e.avail_in--,e.total_in++,e.istate.need+=e.next_in[e.next_in_index++]&255,e.istate.was[0]!=e.istate.need){e.istate.mode=Sn,e.msg="incorrect data check",e.istate.marker=5;break}e.istate.mode=Zu;case Zu:return pr;case Sn:return st;default:return Bn}},Ur.prototype.inflateSetDictionary=function(e,n,t){var a=0,o=t;return e==null||e.istate==null||e.istate.mode!=uf?Bn:e._adler.adler32(1,n,0,t)!=e.adler?st:(e.adler=e._adler.adler32(0,null,0,0),o>=1<<e.istate.wbits&&(o=(1<<e.istate.wbits)-1,a=t-o),e.istate.blocks.set_dictionary(n,a,o),e.istate.mode=qa,He)};var Xm=[0,0,255,255];Ur.prototype.inflateSync=function(e){var n,t,a,o,s;if(e==null||e.istate==null)return Bn;if(e.istate.mode!=Sn&&(e.istate.mode=Sn,e.istate.marker=0),(n=e.avail_in)==0)return ar;for(t=e.next_in_index,a=e.istate.marker;n!=0&&a<4;)e.next_in[t]==Xm[a]?a++:e.next_in[t]!=0?a=0:a=4-a,t++,n--;return e.total_in+=t-e.next_in_index,e.next_in_index=t,e.avail_in=n,e.istate.marker=a,a!=4?st:(o=e.total_in,s=e.total_out,this.inflateReset(e),e.total_in=o,e.total_out=s,e.istate.mode=qa,He)},Ur.prototype.inflateSyncPoint=function(e){return e==null||e.istate==null||e.istate.blocks==null?Bn:e.istate.blocks.sync_point()};var vd=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function _i(e,n,t){this.hufts=new Int32Array(td*3),this.window=new Uint8Array(t),this.end=t,this.checkfn=n,this.mode=Ji,this.reset(e,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 Ga,this.last=0,this.bitk=0,this.bitb=0,this.read=0,this.write=0,this.check=0,this.inftree=new Ha}_i.prototype.reset=function(e,n){n&&(n[0]=this.check),this.mode==Xu&&this.codes.free(e),this.mode=Ji,this.bitk=0,this.bitb=0,this.read=this.write=0,this.checkfn&&(e.adler=this.check=e._adler.adler32(0,null,0,0))},_i.prototype.proc=function(e,n){var t,a,o,s,f,h,v;for(s=e.next_in_index,f=e.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 Ji:for(;o<3;){if(f!=0)n=He;else return this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);f--,a|=(e.next_in[s++]&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=sf;break;case 1:{var d=new Int32Array(1),c=new Int32Array(1),D=[],y=[];Vm(d,c,D,y),this.codes.init(d[0],c[0],D[0],0,y[0],0,e)}a>>>=3,o-=3,this.mode=Xu;break;case 2:a>>>=3,o-=3,this.mode=gd;break;case 3:return a>>>=3,o-=3,this.mode=Sn,e.msg="invalid block type",n=st,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n)}break;case sf:for(;o<32;){if(f!=0)n=He;else return this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);f--,a|=(e.next_in[s++]&255)<<o,o+=8}if((~a>>>16&65535)!=(a&65535))return this.mode=Sn,e.msg="invalid stored block lengths",n=st,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);this.left=a&65535,a=o=0,this.mode=this.left!=0?dd:this.last!=0?Vu:Ji;break;case dd:if(f==0)return this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,write=h,this.inflate_flush(e,n);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,n=this.inflate_flush(e,n),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,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);if(n=He,t=this.left,t>f&&(t=f),t>v&&(t=v),qn(e.next_in,s,this.window,h,t),s+=t,f-=t,h+=t,v-=t,(this.left-=t)!=0)break;this.mode=this.last!=0?Vu:Ji;break;case gd:for(;o<14;){if(f!=0)n=He;else return this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);f--,a|=(e.next_in[s++]&255)<<o,o+=8}if(this.table=t=a&16383,(t&31)>29||(t>>5&31)>29)return this.mode=Ku,e.msg="too many length or distance symbols",n=st,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);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 k=pd;case pd:for(;this.index<4+(this.table>>>10);){for(;o<3;){if(f!=0)n=He;else return this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);f--,a|=(e.next_in[s++]&255)<<o,o+=8}this.blens[vd[this.index++]]=a&7,a>>>=3,o-=3}for(;this.index<19;)this.blens[vd[this.index++]]=0;if(this.bb[0]=7,t=this.inftree.inflate_trees_bits(this.blens,this.bb,this.tb,this.hufts,e),t!=He)return n=t,n==st&&(this.blens=null,this.mode=Ku),this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,write=h,this.inflate_flush(e,n);this.index=0,this.mode=_d;case _d:for(;t=this.table,this.index<258+(t&31)+(t>>5&31);){var m,I,F;for(t=this.bb[0];o<t;){if(f!=0)n=He;else return this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);f--,a|=(e.next_in[s++]&255)<<o,o+=8}if(t=this.hufts[(this.tb[0]+(a&ln[t]))*3+1],F=this.hufts[(this.tb[0]+(a&ln[t]))*3+2],F<16)a>>>=t,o-=t,this.blens[this.index++]=F;else{for(m=F==18?7:F-14,I=F==18?11:3;o<t+m;){if(f!=0)n=He;else return this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);f--,a|=(e.next_in[s++]&255)<<o,o+=8}if(a>>>=t,o-=t,I+=a&ln[m],a>>>=m,o-=m,m=this.index,t=this.table,m+I>258+(t&31)+(t>>5&31)||F==16&&m<1)return this.blens=null,this.mode=Ku,e.msg="invalid bit length repeat",n=st,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);F=F==16?this.blens[m-1]:0;do this.blens[m++]=F;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,e),t!=He)return t==st&&(this.blens=null,this.mode=Sn),n=t,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);this.codes.init(d[0],c[0],this.hufts,D[0],this.hufts,y[0],e)}this.mode=Xu;case Xu:if(this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,(n=this.codes.proc(this,e,n))!=pr)return this.inflate_flush(e,n);if(n=He,this.codes.free(e),s=e.next_in_index,f=e.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=Ji;break}this.mode=Vu;case Vu:if(this.write=h,n=this.inflate_flush(e,n),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,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);k=Zu;case Mm:return n=pr,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);case Ku:return n=st,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n);default:return n=Bn,this.bitb=a,this.bitk=o,e.avail_in=f,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=h,this.inflate_flush(e,n)}},_i.prototype.free=function(e){this.reset(e,null),this.window=null,this.hufts=null},_i.prototype.set_dictionary=function(e,n,t){qn(e,n,window,0,t),this.read=this.write=t},_i.prototype.sync_point=function(){return this.mode==sf},_i.prototype.inflate_flush=function(e,n){var t,a,o;return a=e.next_out_index,o=this.read,t=(o<=this.write?this.write:this.end)-o,t>e.avail_out&&(t=e.avail_out),t!=0&&n==ar&&(n=He),e.avail_out-=t,e.total_out+=t,this.checkfn!=null&&(e.adler=this.check=e._adler.adler32(this.check,this.window,o,t)),qn(this.window,o,e.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>e.avail_out&&(t=e.avail_out),t!=0&&n==ar&&(n=He),e.avail_out-=t,e.total_out+=t,this.checkfn!=null&&(e.adler=this.check=e._adler.adler32(this.check,this.window,o,t)),qn(this.window,o,e.next_out,a,t),a+=t,o+=t),e.next_out_index=a,this.read=o,n};var Yu=0,wd=1,md=2,bd=3,Dd=4,xd=5,yd=6,of=7,Ed=8,Qu=9;function Ga(){}Ga.prototype.init=function(e,n,t,a,o,s,f){this.mode=Yu,this.lbits=e,this.dbits=n,this.ltree=t,this.ltree_index=a,this.dtree=o,this.dtree_index=s,this.tree=null},Ga.prototype.proc=function(e,n,t){var a,o,s,f=0,h=0,v=0,d,c,D,y;for(v=n.next_in_index,d=n.avail_in,f=e.bitb,h=e.bitk,c=e.write,D=c<e.read?e.read-c-1:e.end-c;;)switch(this.mode){case Yu:if(D>=258&&d>=10&&(e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,t=this.inflate_fast(this.lbits,this.dbits,this.ltree,this.ltree_index,this.dtree,this.dtree_index,e,n),v=n.next_in_index,d=n.avail_in,f=e.bitb,h=e.bitk,c=e.write,D=c<e.read?e.read-c-1:e.end-c,t!=He)){this.mode=t==pr?of:Qu;break}this.need=this.lbits,this.tree=this.ltree,this.tree_index=this.ltree_index,this.mode=wd;case wd:for(a=this.need;h<a;){if(d!=0)t=He;else return e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);d--,f|=(n.next_in[v++]&255)<<h,h+=8}if(o=(this.tree_index+(f&ln[a]))*3,f>>>=this.tree[o+1],h-=this.tree[o+1],s=this.tree[o],s==0){this.lit=this.tree[o+2],this.mode=yd;break}if(s&16){this.get=s&15,this.len=this.tree[o+2],this.mode=md;break}if(!(s&64)){this.need=s,this.tree_index=o/3+this.tree[o+2];break}if(s&32){this.mode=of;break}return this.mode=Qu,n.msg="invalid literal/length code",t=st,e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);case md:for(a=this.get;h<a;){if(d!=0)t=He;else return e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);d--,f|=(n.next_in[v++]&255)<<h,h+=8}this.len+=f&ln[a],f>>=a,h-=a,this.need=this.dbits,this.tree=this.dtree,this.tree_index=this.dtree_index,this.mode=bd;case bd:for(a=this.need;h<a;){if(d!=0)t=He;else return e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);d--,f|=(n.next_in[v++]&255)<<h,h+=8}if(o=(this.tree_index+(f&ln[a]))*3,f>>=this.tree[o+1],h-=this.tree[o+1],s=this.tree[o],s&16){this.get=s&15,this.dist=this.tree[o+2],this.mode=Dd;break}if(!(s&64)){this.need=s,this.tree_index=o/3+this.tree[o+2];break}return this.mode=Qu,n.msg="invalid distance code",t=st,e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);case Dd:for(a=this.get;h<a;){if(d!=0)t=He;else return e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);d--,f|=(n.next_in[v++]&255)<<h,h+=8}this.dist+=f&ln[a],f>>=a,h-=a,this.mode=xd;case xd:for(y=c-this.dist;y<0;)y+=e.end;for(;this.len!=0;){if(D==0&&(c==e.end&&e.read!=0&&(c=0,D=c<e.read?e.read-c-1:e.end-c),D==0&&(e.write=c,t=e.inflate_flush(n,t),c=e.write,D=c<e.read?e.read-c-1:e.end-c,c==e.end&&e.read!=0&&(c=0,D=c<e.read?e.read-c-1:e.end-c),D==0)))return e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);e.window[c++]=e.window[y++],D--,y==e.end&&(y=0),this.len--}this.mode=Yu;break;case yd:if(D==0&&(c==e.end&&e.read!=0&&(c=0,D=c<e.read?e.read-c-1:e.end-c),D==0&&(e.write=c,t=e.inflate_flush(n,t),c=e.write,D=c<e.read?e.read-c-1:e.end-c,c==e.end&&e.read!=0&&(c=0,D=c<e.read?e.read-c-1:e.end-c),D==0)))return e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);t=He,e.window[c++]=this.lit,D--,this.mode=Yu;break;case of:if(h>7&&(h-=8,d++,v--),e.write=c,t=e.inflate_flush(n,t),c=e.write,D=c<e.read?e.read-c-1:e.end-c,e.read!=e.write)return e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);this.mode=Ed;case Ed:return t=pr,e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);case Qu:return t=st,e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t);default:return t=Bn,e.bitb=f,e.bitk=h,n.avail_in=d,n.total_in+=v-n.next_in_index,n.next_in_index=v,e.write=c,e.inflate_flush(n,t)}},Ga.prototype.free=function(e){},Ga.prototype.inflate_fast=function(e,n,t,a,o,s,f,h){var v,d,c,D,y,m,I,F,k,L,G,P,T,$,q,N;I=h.next_in_index,F=h.avail_in,y=f.bitb,m=f.bitk,k=f.write,L=k<f.read?f.read-k-1:f.end-k,G=ln[e],P=ln[n];do{for(;m<20;)F--,y|=(h.next_in[I++]&255)<<m,m+=8;if(v=y&G,d=t,c=a,N=(c+v)*3,(D=d[N])==0){y>>=d[N+1],m-=d[N+1],f.window[k++]=d[N+2],L--;continue}do{if(y>>=d[N+1],m-=d[N+1],D&16){for(D&=15,T=d[N+2]+(y&ln[D]),y>>=D,m-=D;m<15;)F--,y|=(h.next_in[I++]&255)<<m,m+=8;v=y&P,d=o,c=s,N=(c+v)*3,D=d[N];do if(y>>=d[N+1],m-=d[N+1],D&16){for(D&=15;m<D;)F--,y|=(h.next_in[I++]&255)<<m,m+=8;if($=d[N+2]+(y&ln[D]),y>>=D,m-=D,L-=T,k>=$)q=k-$,k-q>0&&2>k-q,f.window[k++]=f.window[q++],f.window[k++]=f.window[q++],T-=2;else{q=k-$;do q+=f.end;while(q<0);if(D=f.end-q,T>D){if(T-=D,k-q>0&&D>k-q)do f.window[k++]=f.window[q++];while(--D!=0);else qn(f.window,q,f.window,k,D),k+=D,q+=D,D=0;q=0}}do f.window[k++]=f.window[q++];while(--T!=0);break}else if(!(D&64))v+=d[N+2],v+=y&ln[D],N=(c+v)*3,D=d[N];else return h.msg="invalid distance code",T=h.avail_in-F,T=m>>3<T?m>>3:T,F+=T,I-=T,m-=T<<3,f.bitb=y,f.bitk=m,h.avail_in=F,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=k,st;while(!0);break}if(D&64)return D&32?(T=h.avail_in-F,T=m>>3<T?m>>3:T,F+=T,I-=T,m-=T<<3,f.bitb=y,f.bitk=m,h.avail_in=F,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=k,pr):(h.msg="invalid literal/length code",T=h.avail_in-F,T=m>>3<T?m>>3:T,F+=T,I-=T,m-=T<<3,f.bitb=y,f.bitk=m,h.avail_in=F,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=k,st);if(v+=d[N+2],v+=y&ln[D],N=(c+v)*3,(D=d[N])==0){y>>=d[N+1],m-=d[N+1],f.window[k++]=d[N+2],L--;break}}while(!0)}while(L>=258&&F>=10);return T=h.avail_in-F,T=m>>3<T?m>>3:T,F+=T,I-=T,m-=T<<3,f.bitb=y,f.bitk=m,h.avail_in=F,h.total_in+=I-h.next_in_index,h.next_in_index=I,f.write=k,He};function Ha(){}Ha.prototype.huft_build=function(e,n,t,a,o,s,f,h,v,d,c){var D,y,m,I,F,k,L,G,P,T,$,q,N,C,S;T=0,F=t;do this.c[e[n+T]]++,T++,F--;while(F!=0);if(this.c[0]==t)return f[0]=-1,h[0]=0,He;for(G=h[0],k=1;k<=$r&&this.c[k]==0;k++);for(L=k,G<k&&(G=k),F=$r;F!=0&&this.c[F]==0;F--);for(m=F,G>F&&(G=F),h[0]=G,C=1<<k;k<F;k++,C<<=1)if((C-=this.c[k])<0)return st;if((C-=this.c[F])<0)return st;for(this.c[F]+=C,this.x[1]=k=0,T=1,N=2;--F!=0;)this.x[N]=k+=this.c[T],N++,T++;F=0,T=0;do(k=e[n+T])!=0&&(this.v[this.x[k]++]=F),T++;while(++F<t);for(t=this.x[m],this.x[0]=F=0,T=0,I=-1,q=-G,this.u[0]=0,$=0,S=0;L<=m;L++)for(D=this.c[L];D--!=0;){for(;L>q+G;){if(I++,q+=G,S=m-q,S=S>G?G:S,(y=1<<(k=L-q))>D+1&&(y-=D+1,N=L,k<S))for(;++k<S&&!((y<<=1)<=this.c[++N]);)y-=this.c[N];if(S=1<<k,this.hn[0]+S>td)return st;this.u[I]=$=this.hn[0],this.hn[0]+=S,I!=0?(this.x[I]=F,this.r[0]=k,this.r[1]=G,k=F>>>q-G,this.r[2]=$-this.u[I-1]-k,qn(this.r,0,v,(this.u[I-1]+k)*3,3)):f[0]=$}for(this.r[1]=L-q,T>=t?this.r[0]=192:c[T]<a?(this.r[0]=this.v[T]<256?0:96,this.r[2]=this.v[T++]):(this.r[0]=s[this.v[T]-a]+16+64,this.r[2]=o[this.v[T++]-a]),y=1<<L-q,k=F>>>q;k<S;k+=y)qn(this.r,0,v,($+k)*3,3);for(k=1<<L-1;F&k;k>>>=1)F^=k;for(F^=k,P=(1<<q)-1;(F&P)!=this.x[I];)I--,q-=G,P=(1<<q)-1}return C!=0&&m!=1?ar:He},Ha.prototype.inflate_trees_bits=function(e,n,t,a,o){var s;return this.initWorkArea(19),this.hn[0]=0,s=this.huft_build(e,0,19,19,null,null,t,n,a,this.hn,this.v),s==st?o.msg="oversubscribed dynamic bit lengths tree":(s==ar||n[0]==0)&&(o.msg="incomplete dynamic bit lengths tree",s=st),s},Ha.prototype.inflate_trees_dynamic=function(e,n,t,a,o,s,f,h,v){var d;return this.initWorkArea(288),this.hn[0]=0,d=this.huft_build(t,0,e,257,qm,Gm,s,a,h,this.hn,this.v),d!=He||a[0]==0?(d==st?v.msg="oversubscribed literal/length tree":d!=nd&&(v.msg="incomplete literal/length tree",d=st),d):(this.initWorkArea(288),d=this.huft_build(t,e,n,0,Hm,Zm,f,o,h,this.hn,this.v),d!=He||o[0]==0&&e>257?(d==st?v.msg="oversubscribed distance tree":d==ar?(v.msg="incomplete distance tree",d=st):d!=nd&&(v.msg="empty distance tree with lengths",d=st),d):He)};function Vm(e,n,t,a,o){return e[0]=Pm,n[0]=$m,t[0]=Um,a[0]=Wm,He}Ha.prototype.initWorkArea=function(e){this.hn==null&&(this.hn=new Int32Array(1),this.v=new Int32Array(e),this.c=new Int32Array($r+1),this.r=new Int32Array(3),this.u=new Int32Array($r),this.x=new Int32Array($r+1)),this.v.length<e&&(this.v=new Int32Array(e));for(var n=0;n<e;n++)this.v[n]=0;for(var n=0;n<$r+1;n++)this.c[n]=0;for(var n=0;n<3;n++)this.r[n]=0;qn(this.c,0,this.u,0,$r),qn(this.c,0,this.x,0,$r+1)};var Km=new Uint8Array(1),Ym=typeof Km.subarray=="function";function qn(e,n,t,a,o){if(o!=0){if(e){if(!t)throw"Undef dest"}else throw"Undef src";n==0&&o==e.length?ff(e,t,a):Ym?ff(e.subarray(n,n+o),t,a):e.BYTES_PER_ELEMENT==1&&o>100?ff(new Uint8Array(e.buffer,e.byteOffset+n,o),t,a):Qm(e,n,t,a,o)}}function Qm(e,n,t,a,o){for(var s=0;s<o;++s)t[a+s]=e[n+s]}function ff(e,n,t){n.set(e,t)}function Jm(e,n,t,a){n?t?e=new Uint8Array(e,n,t):e=new Uint8Array(e,n,e.byteLength-n):e=new Uint8Array(e);var o=new ji;o.inflateInit(ed,!0),o.next_in=e,o.next_in_index=0,o.avail_in=e.length;for(var s=[],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(Rm);if(v!=He&&v!=pr&&v!=ar)throw o.msg;if(o.avail_out!=0){var d=new Uint8Array(h.length-o.avail_out);qn(h,0,d,0,h.length-o.avail_out),h=d}if(s.push(h),f+=h.length,v==pr||v==ar)break}if(s.length==1)return s[0].buffer;for(var c=new Uint8Array(f),D=0,y=0;y<s.length;++y){var m=s[y];qn(m,0,c,D,m.length),D+=m.length}return c.buffer}function Ad(){}function Fd(e){e&&(this.id=e)}typeof module<"u"&&(module.exports={DASGroup:Fd,DASFeature:Ad});var jm=2291137574,zm=654086024,eb=2273964779,tb=3958540679,nb=1,rb=2,ib=3,Cd=256,Bd=256*256,Sd=256*256*256,ab=256*256*256*256,ub=new RegExp("^[0-9]+,[0-9]+,[0-9]+");function Rt(e,n){var t=e[n]+e[n+1]*Cd+e[n+2]*Bd+e[n+3]*Sd+e[n+4]*ab;return t}function _r(){}_r.prototype.readChromTree=function(e){var n=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 s=new Uint8Array(o),f=new Int16Array(o),h=new Int32Array(o);h[0],h[1];var v=h[2];h[3],Rt(s,16);var d=32,c=function(D){var y=s[D],m=f[D/2+1];D+=4;for(var I=0;I<m;++I)if(y==0){D+=v;var F=Rt(s,D);D+=8,F-=n.chromTreeOffset,c(F)}else{for(var k="",L=0;L<v;++L){var G=s[D++];G!=0&&(k+=String.fromCharCode(G))}var P=s[D+3]<<24|s[D+2]<<16|s[D+1]<<8|s[D+0];s[D+7]<<24|s[D+6]<<16|s[D+5]<<8|s[D+4],D+=8,n.chromsToIDs[k]=P,n.idsToChroms[P]=k,n.chrAlias.hasOwnProperty(k)&&(n.chromsToIDs[n.chrAlias[k]]=P,n.idsToChroms[P]=n.chrAlias[k]),n.maxID=Math.max(n.maxID,P)}};c(d),e(n)})};function Wr(e,n,t,a){this.bwg=e,this.cirTreeOffset=n,this.cirTreeLength=t,this.isSummary=a}Wr.prototype.readWigData=function(e,n,t,a){var o=this.bwg.chromsToIDs[e];if(o===void 0)return a([]);this.readWigDataById(o,n,t,a)},Wr.prototype.readWigDataById=function(e,n,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(e,n,t,a)});return}var s=[],f=0,h=function(D,y,m,I){return(e<0||D==e)&&y<=t&&m>=n},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,s,a);return}for(var m=4+o.cirBlockSize*32,I,F=0;F<D.length;++F){var k=new nn(D[F],D[F]+m);I=I?union(I,k):k}for(var L=I.ranges(),G=0;G<L.length;++G){var P=L[G];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(F){for(var k=0;k<D.length;++k)y.contains(D[k])&&(c(F,D[k]-y.min(),m),D[k]-o.cirTreeOffset==48&&D[k]-y.min()==0&&(o.cachedCirRoot=F),--f,f==0&&o.fetchFeatures(h,s,a))})},c=function(D,y,m){var I=new Uint8Array(D),F=new Int16Array(D),k=new Int32Array(D),L=I[y],G=F[y/2+1];if(y+=4,L!=0)for(var P=0;P<G;++P){var T=y/4,$=k[T],q=k[T+1],N=k[T+2],C=k[T+3],S=Rt(I,y+16),O=Rt(I,y+24);(e<0||$<e||$==e&&q<=t)&&(e<0||N>e||N==e&&C>=n)&&s.push({offset:S,size:O}),y+=32}else{for(var W=[],P=0;P<G;++P){var T=y/4,$=k[T],q=k[T+1],N=k[T+2],C=k[T+3],S=Rt(I,y+16);(e<0||$<e||$==e&&q<=t)&&(e<0||N>e||N==e&&C>=n)&&W.push(S),y+=24}W.length>0&&v(W,m+1)}};v([o.cirTreeOffset+48],1)},Wr.prototype.fetchFeatures=function(e,n,t){var a=this;if(n.sort(function(h,v){return(h.offset|0)-(v.offset|0)}),n.length==0)t([]);else{var o=[],s=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(n.length==0){t(o);return}else{var h=n[0];if(h.data)a.parseFeatures(h.data,s,e),n.splice(0,1),f();else{for(var v=h.offset,d=h.size,c=1;c<n.length&&n[c].offset==v+d;)d+=n[c].size,++c;a.bwg.data.slice(v,d).fetch(function(D){for(var y=0,m=0;y<d;){var I=n[m],F;if(a.bwg.uncompressBufSize>0)F=Jm(D,y+2,I.size-2);else{var k=new Uint8Array(I.size);arrayCopy(new Uint8Array(D,y,I.size),0,k,0,I.size),F=k.buffer}I.data=F,y+=I.size,++m}f()})}}};f()}},Wr.prototype.parseFeatures=function(e,n,t){var a=new Uint8Array(e);if(this.isSummary)for(var o=new Int16Array(e),s=new Int32Array(e),f=new Float32Array(e),h=e.byteLength/32,v=0;v<h;++v){var d=s[v*8],c=s[v*8+1],D=s[v*8+2],y=s[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 F={type:"bigwig",score:I/y,maxScore:m};this.bwg.type=="bigbed"&&(F.type="density"),n(d,c+1,D,F)}}else if(this.bwg.type=="bigwig"){var o=new Int16Array(e),s=new Int32Array(e),f=new Float32Array(e),d=s[0],k=s[1];s[2];var L=s[3],G=s[4],P=a[20],h=o[11];if(P==ib)for(var v=0;v<h;++v){var T=f[v+6],$=k+v*L+1,q=k+v*L+G;t(d,$,q)&&n(d,$,q,{score:T})}else if(P==rb)for(var v=0;v<h;++v){var c=s[v*2+6]+1,D=c+G-1,T=f[v*2+7];t(d,c,D)&&n(d,c,D,{score:T})}else if(P==nb)for(var v=0;v<h;++v){var c=s[v*3+6]+1,D=s[v*3+7],T=f[v*3+8];c>D&&(c=D),t(d,c,D)&&n(d,c,D,{score:T})}else console.log("Currently not handling bwgType="+P)}else if(this.bwg.type=="bigbed")for(var N=0,C=this.bwg.definedFieldCount,S=this.bwg.schema;N<a.length;){var d=a[N+3]<<24|a[N+2]<<16|a[N+1]<<8|a[N+0],c=a[N+7]<<24|a[N+6]<<16|a[N+5]<<8|a[N+4],D=a[N+11]<<24|a[N+10]<<16|a[N+9]<<8|a[N+8];N+=12;for(var O="";;){var W=a[N++];if(W!=0)O+=String.fromCharCode(W);else break}var V={},te;if(O.length>0?te=O.split(" "):te=[],te.length>0&&C>3&&(V.label=te[0]),te.length>1&&C>4){var T=parseInt(te[1]);isNaN(T)||(V.score=T)}if(te.length>2&&C>5&&(V.orientation=te[2]),te.length>5&&C>8){var ie=te[5];ub.test(ie)&&(V.itemRgb="rgb("+ie+")")}if(te.length>C-3&&S)for(var le=C-3;le<te.length;++le)V[S.fields[le+3].name]=te[le];if(t(d,c+1,D,te))if(C<12)n(d,c+1,D,V);else{var Fe=te[3]|0,ae=te[4]|0,pe=te[6]|0,_e=te[7].split(","),Xe=te[8].split(",");if(V.exonFrames){var he=V.exonFrames.split(",");V.exonFrames=void 0}V.type="transcript";var se=new Fd;for(var fe in V)se[fe]=V[fe];if(se.id=te[0],se.segment=this.bwg.idsToChroms[d],se.min=c+1,se.max=D,se.notes=[],V.groups=[se],te.length>9){var Ee=V.geneName||te[9],ve=Ee;te.length>10&&(ve=te[10]),V.geneName2&&(ve=V.geneName2);var qe=shallowCopy(se);qe.id=Ee,qe.label=ve,qe.type="gene",V.groups.push(qe)}for(var ot=[],me=0;me<pe;++me){var Be=(Xe[me]|0)+c,Ve=Be+(_e[me]|0),ce=new nn(Be,Ve);ot.push(ce)}for(var Me=union(ot),Ke=Me.ranges(),we=0;we<Ke.length;++we){var Ce=Ke[we];n(d,Ce.min()+1,Ce.max(),V)}if(ae>Fe){var Ae=V.orientation=="+"?new nn(Fe,ae+3):new nn(Fe-3,ae),je=intersection(Me,Ae);if(je){V.type="translation";for(var De=je.ranges(),Qe=0,At=0;De[0].min()>Ke[At].max();)At++;for(var we=0;we<De.length;++we){var vt=we;V.orientation=="-"&&(vt=De.length-we-1);var Ce=De[vt];if(V.readframe=Qe,he){var xt=parseInt(he[vt+At]);typeof xt=="number"&&xt>=0&&xt<=2&&(V.readframe=xt,V.readframeExplicit=!0)}var Yt=Ce.max()-Ce.min();Qe=(Qe+Yt)%3,n(d,Ce.min()+1,Ce.max(),V)}}}}}else throw Error("Don't know what to do with "+this.bwg.type)},Wr.prototype.getFirstAdjacent=function(e,n,t,a){var o=this.bwg.chromsToIDs[e];if(o===void 0)return a([]);this.getFirstAdjacentById(o,n,t,a)},Wr.prototype.getFirstAdjacentById=function(e,n,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(e,n,t,a)});return}var s=null,f=-1,h=-1,v=0,d=function(y,m){v+=y.length;for(var I=4+o.cirBlockSize*32,F,k=0;k<y.length;++k){var L=new nn(y[k],y[k]+I);F=F?union(F,L):L}for(var G=F.ranges(),P=0;P<G.length;++P){var T=G[P];c(y,T)}},c=function(y,m,I,F){m.max()-m.min(),o.bwg.data.slice(m.min(),m.max()-m.min()).fetch(function(k){for(var L=0;L<y.length;++L)if(m.contains(y[L])&&(D(k,y[L]-m.min()),--v,v==0)){if(!s)return t>0&&(e!=0||n>0)?o.getFirstAdjacentById(0,0,t,a):t<0&&(e!=o.bwg.maxID||n<1e9)?o.getFirstAdjacentById(o.bwg.maxID,1e9,t,a):a([]);o.fetchFeatures(function(G,P,T,$){return t<0&&(G<e||T<n)||t>0&&(G>e||P>n)},[s],function(G){for(var P=null,T=-1,$=-1,q=0;q<G.length;++q){var N=G[q],C=N._chromId,S=N.min,O=N.max;(P==null||t<0&&(C>T||O>$)||t>0&&(C<T||S<$))&&(P=N,$=t<0?O:S,T=C)}return P!=null?a([P]):a([])})}})},D=function(y,m,I){var F=new Uint8Array(y),k=new Int16Array(y),L=new Int32Array(y),G=F[m],P=k[m/2+1];if(m+=4,G!=0)for(var T=0;T<P;++T){var $=m/4,q=L[$],N=L[$+1],C=L[$+2],S=L[$+3],O=Rt(F,m+16),W=Rt(F,m+24);(t<0&&(q<e||q==e&&N<=n)||t>0&&(C>e||C==e&&S>=n))&&(/_random/.exec(o.bwg.idsToChroms[q])||(s==null||t<0&&(C>f||C==f&&S>h)||t>0&&(q<f||q==f&&N<h))&&(s={offset:O,size:W},h=t<0?S:N,f=t<0?C:q)),m+=32}else{for(var V=-1,te=-1,T=0;T<P;++T){var $=m/4,q=L[$],N=L[$+1],C=L[$+2],S=L[$+3],O=L[$+4]<<32|L[$+5];(t<0&&(q<e||q==e&&N<=n)&&C>=e||t>0&&(C>e||C==e&&S>=n)&&q<=e)&&(V<0||S>te)&&(V=O,te=t<0?S:N),m+=24}V>=0&&d([V])}};d([o.cirTreeOffset+48])},_r.prototype.readWigData=function(e,n,t,a){this.getUnzoomedView().readWigData(e,n,t,a)},_r.prototype.getUnzoomedView=function(){if(!this.unzoomedView){var e=4e3,n=this.zoomLevels[0];n&&(e=this.zoomLevels[0].dataOffset-this.unzoomedIndexOffset),this.unzoomedView=new Wr(this,this.unzoomedIndexOffset,e,!1)}return this.unzoomedView},_r.prototype.getZoomedView=function(e){var n=this.zoomLevels[e];return n.view||(n.view=new Wr(this,n.indexOffset,4e3,!0)),n.view};function sb(e,n,t){var a=new _r;a.data=e,a.name=t,a.data.slice(0,512).salted().fetch(function(o){if(!o)return n(null,"Couldn't fetch file");var s=o,f=new Uint8Array(s),h=new Int16Array(s),v=new Int32Array(s),d=f[0]+Cd*f[1]+Bd*f[2]+Sd*f[3];if(d==jm)a.type="bigwig";else if(d==eb)a.type="bigbed";else return d==zm||d==tb?n(null,"Currently don't support big-endian BBI files"):n(null,"Not a supported format, magic=0x"+d.toString(16));a.version=h[2],a.numZoomLevels=h[3],a.chromTreeOffset=Rt(f,8),a.unzoomedDataOffset=Rt(f,16),a.unzoomedIndexOffset=Rt(f,24),a.fieldCount=h[16],a.definedFieldCount=h[17],a.asOffset=Rt(f,36),a.totalSummaryOffset=Rt(f,44),a.uncompressBufSize=v[13],a.extHeaderOffset=Rt(f,56),a.zoomLevels=[];for(var c=0;c<a.numZoomLevels;++c){var D=v[c*6+16],y=Rt(f,c*24+72),m=Rt(f,c*24+80);a.zoomLevels.push({reduction:D,dataOffset:y,indexOffset:m})}a.readChromTree(function(){a.getAutoSQL(function(I){return a.schema=I,n(a)})})},{timeout:5e3})}_r.prototype._tsFetch=function(e,n,t,a,o){var s=this;if(e>=this.zoomLevels.length-1)if(!this.topLevelReductionCache)this.getZoomedView(this.zoomLevels.length-1).readWigDataById(-1,0,3e8,function(c){return s.topLevelReductionCache=c,s._tsFetch(e,n,t,a,o)});else{for(var f=[],h=this.topLevelReductionCache,v=0;v<h.length;++v)h[v]._chromId==n&&f.push(h[v]);return o(f)}else{var d;return e<0?d=this.getUnzoomedView():d=this.getZoomedView(e),d.readWigDataById(n,t,a,o)}},_r.prototype.thresholdSearch=function(e,n,t,a,o){t=t<0?-1:1;for(var s=this,f=this.chromsToIDs[e],h=[{chrOrd:0,chr:f,zoom:s.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:s.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];s._tsFetch(D.zoom,D.chr,D.min,D.max,function(y){var m=t>0?0:3e8;D.fromRef&&(m=n);for(var I=0;I<y.length;++I){var F=y[I],k;if(F.maxScore!=null?k=F.maxScore:k=F.score,t>0){if(k>a)if(D.zoom<0){if(F.min>m)return o(F)}else F.max>m&&h.push({chr:D.chr,chrOrd:D.chrOrd,zoom:D.zoom-2,min:F.min,max:F.max,fromRef:D.fromRef})}else if(k>a)if(D.zoom<0){if(F.max<m)return o(F)}else F.min<m&&h.push({chr:D.chr,chrOrd:D.chrOrd,zoom:D.zoom-2,min:F.min,max:F.max,fromRef:D.fromRef})}c()})}c()},_r.prototype.getAutoSQL=function(e){if(!this.asOffset)return e(null);this.data.slice(this.asOffset,2048).fetch(function(n){for(var t=new Uint8Array(n),a="",o=0;o<t.length&&t[o]!=0;++o)a+=String.fromCharCode(t[o]);var s=/(\w+)\s+(\w+)\s+("([^"]+)")?\s+\(\s*/,f=/([\w\[\]]+)\s+(\w+)\s*;\s*("([^"]+)")?\s*/g,h=s.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 e(v)}})},_r.prototype.getExtraIndices=function(e){var n=this;if(this.version<4||this.extHeaderOffset==0||this.type!="bigbed")return e(null);this.data.slice(this.extHeaderOffset,64).fetch(function(t){if(!t)return e(null,"Couldn't fetch extension header");var a=new Uint8Array(t),o=new Int16Array(t);o[0];var s=o[1],f=Rt(a,4);if(s==0)return e(null);n.data.slice(f,s*20).fetch(function(h){if(!h)return e(null,"Couldn't fetch index info");for(var v=new Uint8Array(h),d=new Int16Array(h),c=[],D=0;D<s;++D){var y=d[D*10],m=d[D*10+1],I=Rt(v,D*20+4),F=d[D*10+8],k=new Id(n,y,m,I,F);c.push(k)}e(c)})})};function Id(e,n,t,a,o){this.bbi=e,this.type=n,this.fieldCount=t,this.offset=a,this.field=o}Id.prototype.lookup=function(e,n){var t=this;this.bbi.data.slice(this.offset,32).fetch(function(a){var o=new Uint8Array(a),s=new Int32Array(a);s[0];var f=s[1],h=s[2],v=s[3];Rt(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),F=m[0],k=I[1],L=4;if(F==0){for(var G=null,P=0;P<k;++P){for(var T="",$=0;$<h;++$){var q=m[L++];q!=0&&(T+=String.fromCharCode(q))}var N=Rt(m,L);if(L+=8,e.localeCompare(T)<0&&G){c(G);return}G=N}c(G)}else{for(var P=0;P<k;++P){for(var T="",$=0;$<h;++$){var q=m[L++];q!=0&&(T+=String.fromCharCode(q))}if(T==e){var C=Rt(m,L),S=readInt(m,L+8);return t.bbi.getUnzoomedView().fetchFeatures(function(V,te,ie,le){if(le&&le.length>t.field-3)return le[t.field-3]==e},[{offset:C,size:S}],n)}L+=v}return n([])}})}c(t.offset+d)})};var ob="";function fb(e){return lb(Td(kd(e)))}function lf(e){return hb(Td(kd(e)))}function Td(e){return db(gb(cb(e),e.length*8))}function lb(e){for(var n="0123456789abcdef",t="",a,o=0;o<e.length;o++)a=e.charCodeAt(o),t+=n.charAt(a>>>4&15)+n.charAt(a&15);return t}function hb(e){for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",a=e.length,o=0;o<a;o+=3)for(var s=e.charCodeAt(o)<<16|(o+1<a?e.charCodeAt(o+1)<<8:0)|(o+2<a?e.charCodeAt(o+2):0),f=0;f<4;f++)o*8+f*6>e.length*8?t+=ob:t+=n.charAt(s>>>6*(3-f)&63);return t}function kd(e){for(var n="",t=-1,a,o;++t<e.length;)a=e.charCodeAt(t),o=t+1<e.length?e.charCodeAt(t+1):0,55296<=a&&a<=56319&&56320<=o&&o<=57343&&(a=65536+((a&1023)<<10)+(o&1023),t++),a<=127?n+=String.fromCharCode(a):a<=2047?n+=String.fromCharCode(192|a>>>6&31,128|a&63):a<=65535?n+=String.fromCharCode(224|a>>>12&15,128|a>>>6&63,128|a&63):a<=2097151&&(n+=String.fromCharCode(240|a>>>18&7,128|a>>>12&63,128|a>>>6&63,128|a&63));return n}function cb(e){for(var n=Array(e.length>>2),t=0;t<n.length;t++)n[t]=0;for(var t=0;t<e.length*8;t+=8)n[t>>5]|=(e.charCodeAt(t/8)&255)<<24-t%32;return n}function db(e){for(var n="",t=0;t<e.length*32;t+=8)n+=String.fromCharCode(e[t>>5]>>>24-t%32&255);return n}function gb(e,n){e[n>>5]|=128<<24-n%32,e[(n+64>>9<<4)+15]=n;for(var t=Array(80),a=1732584193,o=-271733879,s=-1732584194,f=271733878,h=-1009589776,v=0;v<e.length;v+=16){for(var d=a,c=o,D=s,y=f,m=h,I=0;I<80;I++){I<16?t[I]=e[v+I]:t[I]=hf(t[I-3]^t[I-8]^t[I-14]^t[I-16],1);var F=vr(vr(hf(a,5),pb(I,o,s,f)),vr(vr(h,t[I]),_b(I)));h=f,f=s,s=hf(o,30),o=a,a=F}a=vr(a,d),o=vr(o,c),s=vr(s,D),f=vr(f,y),h=vr(h,m)}return Array(a,o,s,f,h)}function pb(e,n,t,a){return e<20?n&t|~n&a:e<40?n^t^a:e<60?n&t|n&a|t&a:n^t^a}function _b(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}function vr(e,n){var t=(e&65535)+(n&65535),a=(e>>16)+(n>>16)+(t>>16);return a<<16|t&65535}function hf(e,n){return e<<n|e>>>32-n}typeof module<"u"&&(module.exports={b64_sha1:lf,hex_sha1:fb});function vb(e){var n={};for(var t in e)n[t]=e[t];return n}function vi(e,n,t,a){a||(typeof n=="object"?(a=n,n=void 0):a={}),this.url=e,this.start=n||0,t&&(this.end=t),this.opts=a}vi.prototype.slice=function(e,n){if(e<0)throw"Bad slice "+e;var t=this.start,a=this.end;return t&&e?t=t+e:t=e||t,n&&t?a=t+n-1:a=a||n-1,new vi(this.url,t,a,this.opts)};var Rd=0,Ld=navigator.userAgent.indexOf("Safari")>=0&&navigator.userAgent.indexOf("Chrome")<0;vi.prototype.fetchAsText=function(e){try{var n=new XMLHttpRequest,t,a=this.url;if((Ld||this.opts.salt)&&a.indexOf("?")<0&&(a=a+"?salt="+lf(""+Date.now()+","+ ++Rd)),n.open("GET",a,!0),this.end){if(this.end-this.start>1e8)throw"Monster fetch!";n.setRequestHeader("Range","bytes="+this.start+"-"+this.end),n.setRequestHeader("accept-encoding","gzip,deflate"),t=this.end-this.start+1}n.onreadystatechange=function(){if(n.readyState==4)return n.status==200||n.status==206?e(n.responseText):e(null)},this.opts.credentials&&(n.withCredentials=!0),n.send("")}catch{return e(null)}},vi.prototype.salted=function(){var e=vb(this.opts);return e.salt=!0,new vi(this.url,this.start,this.end,e)},vi.prototype.fetch=function(e,n){var t=this;n=n||{};var a=n.attempt||1,o=n.truncatedLength;if(a>3)return e(null);try{var s,f=new XMLHttpRequest,h,v=this.url;if((Ld||this.opts.salt)&&v.indexOf("?")<0&&(v=v+"?salt="+lf(""+Date.now()+","+ ++Rd)),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(s&&clearTimeout(s),f.status==200||f.status==206)if(f.response){var d=f.response.byteLength;return h&&h!=d&&(!o||d!=o)?t.fetch(e,{attempt:a+1,truncatedLength:d}):e(f.response)}else{if(f.mozResponseArrayBuffer)return e(f.mozResponseArrayBuffer);var c=f.responseText;return h&&h!=c.length&&(!o||c.length!=o)?t.fetch(e,{attempt:a+1,truncatedLength:c.length}):e(wb(f.responseText))}else return t.fetch(e,{attempt:a+1})},this.opts.credentials&&f.setRequestHeader("Authorization",this.opts.credentials),f.send("")}catch{return e(null)}};function wb(e){if(!e)return null;for(var n=new Uint8Array(e.length),t=0;t<n.length;++t)n[t]=e.charCodeAt(t);return n.buffer}/**
41
- * Reads and gets data from bigwig or bigbed files hosted remotely. Gets DASFeature records, which vary in schema
42
- * depending on the file.
43
- *
44
- * @license MIT
45
- */class mb{constructor(n){ge(this,"url");ge(this,"bigWigPromise");this.url=n,this.bigWigPromise=this.loadBigWig(n)}async loadBigWig(n){try{return new Promise((t,a)=>{sb(new vi(n),(o,s)=>{s?a(s):t(o)})})}catch(t){return console.error("Failed to dynamically load the BigWig module:",t),Promise.reject(t)}}async getData(n,t,a){const o=await this.bigWigPromise,s=a.zoomLevel===void 0||a.zoomLevel===Fm.AUTO?this._getMatchingZoomLevel(o,t):Number.parseInt(a.zoomLevel);let f=n.map(d=>this._getDataForChromosome(d,o,s));const h=await Promise.all(f),v=on.flatten(h);for(let d of v)d.min-=1;return v}_getMatchingZoomLevel(n,t){if(!t)return-1;if(n.zoomLevels.length===1)return 0;let o=n.zoomLevels.slice().sort((s,f)=>f.reduction-s.reduction).find(s=>s.reduction<t);return n.zoomLevels.findIndex(s=>s===o)}_getDataForChromosome(n,t,a){const o=n.start+1,s=n.end;return new Promise((f,h)=>{try{a===-1?t.readWigData(n.chr,o,s,f):t.getZoomedView(a).readWigData(n.chr,o,s,f)}catch(v){h(v)}})}}let qr={};const cf={WashU:"https://lambda.epigenomegateway.org/v3"},bb={geneannotation:async function(n){let t,a;const o=n.trackModel;o.apiConfig&&o.apiConfig.genome?t=o.apiConfig.genome:t=n.genomeName,o.apiConfig&&o.apiConfig.format in cf?a=cf[`${o.apiConfig.format}`]:a=cf.WashU;let s=`${a}/${t}/genes/${n.name}/queryRegion?chr=${n.chr}&start=${n.start}&end=${n.end}`;return(await fetch(s,{method:"GET"})).json()},snp:async function(n){const t={hg19:"https://grch37.rest.ensembl.org/overlap/region/human",hg38:"https://rest.ensembl.org/overlap/region/human"},a=n.genomeName in t?t[`${n.genomeName}`]:null;if(!a)return[];const o={"Content-Type":"application/json"};if(n.end-n.start<=3e4){const s=`${a}/${n.chr.substr(3)}:${n.start}-${n.end+"?content-type=application%2Fjson&feature=variation"}`;return fetch(s,{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(n){return St(n,"bedOrTabix")},bedcolor:async function(n){return St(n,"bedOrTabix")},omeroidr:async function(n){return St(n,"bedOrTabix")},bedgraph:async function(n){return St(n,"bedOrTabix")},qbed:async function(n){return St(n,"bedOrTabix")},dbedgraph:async function(n){return St(n,"bedOrTabix")},boxplot:async function(n){return St(n,"big")},modbed:async function(n){return St(n,"bedOrTabix")},jaspar:async function(n){return St(n,"jaspar")},bigbed:async function(n){return St(n,"bigbed")},refbed:async function(n){return St(n,"bedOrTabix")},matplot:async function(n){return St(n,"bedOrTabix")},bigwig:async function(n){return St(n,"big")},categorical:async function(n){return St(n,"bedOrTabix")},longrange:async function(n){return St(n,"bedOrTabix")},dynseq:async function(n){return St(n,"big")},repeatmasker:async function(n){return St(n,"repeat")},biginteract:async function(n){return St(n,"big")},methylc:async function(n){return St(n,"bedOrTabix")},genomealign:function(n){return St(n,"bedOrTabix")},vcf:function(n){return St(n,"vcf")}};function St(e,n){let t=null;e.trackModel.indexUrl&&(t=e.trackModel.indexUrl),e.trackModel.id in qr||(n==="bedOrTabix"?qr[`${e.trackModel.id}`]=new Fv(e.trackModel.url,t):n==="vcf"?qr[`${e.trackModel.id}`]=new Am(e.trackModel.url,t):n==="bigbed"?qr[`${e.trackModel.id}`]=new mb(e.trackModel.url):n==="big"?qr[`${e.trackModel.id}`]=new af(e.trackModel.url):n==="repeat"?qr[`${e.trackModel.id}`]=new mm(e.trackModel.url):n==="jaspar"&&(qr[`${e.trackModel.id}`]=new Dm(e.trackModel.url)));let a=qr[`${e.trackModel.id}`];return n in{repeat:"",jaspar:"",bigbed:""}?a.getData(e.nav,e.basesPerPixel,e.trackModel.options):a.getData(e.nav,e.trackModel.options)}var Db={exports:{}};/* @license
46
- Papa Parse
47
- v5.5.3
48
- https://github.com/mholt/PapaParse
49
- License: MIT
50
- */(function(e,n){((t,a)=>{e.exports=a()})(vn,function t(){var a=typeof self<"u"?self:typeof window<"u"?window:a!==void 0?a:{},o,s=!a.document&&!!a.postMessage,f=a.IS_PAPA_WORKER||!1,h={},v=0,d={};function c(C){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(S){var O=$(S);O.chunkSize=parseInt(O.chunkSize),S.step||S.chunk||(O.chunkSize=null),this._handle=new F(O),(this._handle.streamer=this)._config=O}).call(this,C),this.parseChunk=function(S,O){var W=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<W){let te=this._config.newline;te||(V=this._config.quoteChar||'"',te=this._handle.guessLineEndings(S,V)),S=[...S.split(te).slice(W)].join(te)}this.isFirstChunk&&N(this._config.beforeFirstChunk)&&(V=this._config.beforeFirstChunk(S))!==void 0&&(S=V),this.isFirstChunk=!1,this._halted=!1;var W=this._partialLine+S,V=(this._partialLine="",this._handle.parse(W,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(S=V.meta.cursor,W=(this._finished||(this._partialLine=W.substring(S-this._baseIndex),this._baseIndex=S),V&&V.data&&(this._rowCount+=V.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),f)a.postMessage({results:V,workerId:d.WORKER_ID,finished:W});else if(N(this._config.chunk)&&!O){if(this._config.chunk(V,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=V=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(V.data),this._completeResults.errors=this._completeResults.errors.concat(V.errors),this._completeResults.meta=V.meta),this._completed||!W||!N(this._config.complete)||V&&V.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),W||V&&V.meta.paused||this._nextChunk(),V}this._halted=!0},this._sendError=function(S){N(this._config.error)?this._config.error(S):f&&this._config.error&&a.postMessage({workerId:d.WORKER_ID,error:S,finished:!1})}}function D(C){var S;(C=C||{}).chunkSize||(C.chunkSize=d.RemoteChunkSize),c.call(this,C),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(S=new XMLHttpRequest,this._config.withCredentials&&(S.withCredentials=this._config.withCredentials),s||(S.onload=q(this._chunkLoaded,this),S.onerror=q(this._chunkError,this)),S.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var O,W=this._config.downloadRequestHeaders;for(O in W)S.setRequestHeader(O,W[O])}var V;this._config.chunkSize&&(V=this._start+this._config.chunkSize-1,S.setRequestHeader("Range","bytes="+this._start+"-"+V));try{S.send(this._config.downloadRequestBody)}catch(te){this._chunkError(te.message)}s&&S.status===0&&this._chunkError()}},this._chunkLoaded=function(){S.readyState===4&&(S.status<200||400<=S.status?this._chunkError():(this._start+=this._config.chunkSize||S.responseText.length,this._finished=!this._config.chunkSize||this._start>=(O=>(O=O.getResponseHeader("Content-Range"))!==null?parseInt(O.substring(O.lastIndexOf("/")+1)):-1)(S),this.parseChunk(S.responseText)))},this._chunkError=function(O){O=S.statusText||O,this._sendError(new Error(O))}}function y(C){(C=C||{}).chunkSize||(C.chunkSize=d.LocalChunkSize),c.call(this,C);var S,O,W=typeof FileReader<"u";this.stream=function(V){this._input=V,O=V.slice||V.webkitSlice||V.mozSlice,W?((S=new FileReader).onload=q(this._chunkLoaded,this),S.onerror=q(this._chunkError,this)):S=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var V=this._input,te=(this._config.chunkSize&&(te=Math.min(this._start+this._config.chunkSize,this._input.size),V=O.call(V,this._start,te)),S.readAsText(V,this._config.encoding));W||this._chunkLoaded({target:{result:te}})},this._chunkLoaded=function(V){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(V.target.result)},this._chunkError=function(){this._sendError(S.error)}}function m(C){var S;c.call(this,C=C||{}),this.stream=function(O){return S=O,this._nextChunk()},this._nextChunk=function(){var O,W;if(!this._finished)return O=this._config.chunkSize,S=O?(W=S.substring(0,O),S.substring(O)):(W=S,""),this._finished=!S,this.parseChunk(W)}}function I(C){c.call(this,C=C||{});var S=[],O=!0,W=!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(V){this._input=V,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){W&&S.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),S.length?this.parseChunk(S.shift()):O=!0},this._streamData=q(function(V){try{S.push(typeof V=="string"?V:V.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(S.shift()))}catch(te){this._streamError(te)}},this),this._streamError=q(function(V){this._streamCleanUp(),this._sendError(V)},this),this._streamEnd=q(function(){this._streamCleanUp(),W=!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 F(C){var S,O,W,V,te=Math.pow(2,53),ie=-te,le=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Fe=/^((\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,pe=0,_e=0,Xe=!1,he=!1,se=[],fe={data:[],errors:[],meta:{}};function Ee(me){return C.skipEmptyLines==="greedy"?me.join("").trim()==="":me.length===1&&me[0].length===0}function ve(){if(fe&&W&&(ot("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),W=!1),C.skipEmptyLines&&(fe.data=fe.data.filter(function(ce){return!Ee(ce)})),qe()){let ce=function(Me,Ke){N(C.transformHeader)&&(Me=C.transformHeader(Me,Ke)),se.push(Me)};if(fe)if(Array.isArray(fe.data[0])){for(var me=0;qe()&&me<fe.data.length;me++)fe.data[me].forEach(ce);fe.data.splice(0,1)}else fe.data.forEach(ce)}function Be(ce,Me){for(var Ke=C.header?{}:[],we=0;we<ce.length;we++){var Ce=we,Ae=ce[we],Ae=((je,De)=>(Qe=>(C.dynamicTypingFunction&&C.dynamicTyping[Qe]===void 0&&(C.dynamicTyping[Qe]=C.dynamicTypingFunction(Qe)),(C.dynamicTyping[Qe]||C.dynamicTyping)===!0))(je)?De==="true"||De==="TRUE"||De!=="false"&&De!=="FALSE"&&((Qe=>{if(le.test(Qe)&&(Qe=parseFloat(Qe),ie<Qe&&Qe<te))return 1})(De)?parseFloat(De):Fe.test(De)?new Date(De):De===""?null:De):De)(Ce=C.header?we>=se.length?"__parsed_extra":se[we]:Ce,Ae=C.transform?C.transform(Ae,Ce):Ae);Ce==="__parsed_extra"?(Ke[Ce]=Ke[Ce]||[],Ke[Ce].push(Ae)):Ke[Ce]=Ae}return C.header&&(we>se.length?ot("FieldMismatch","TooManyFields","Too many fields: expected "+se.length+" fields but parsed "+we,_e+Me):we<se.length&&ot("FieldMismatch","TooFewFields","Too few fields: expected "+se.length+" fields but parsed "+we,_e+Me)),Ke}var Ve;fe&&(C.header||C.dynamicTyping||C.transform)&&(Ve=1,!fe.data.length||Array.isArray(fe.data[0])?(fe.data=fe.data.map(Be),Ve=fe.data.length):fe.data=Be(fe.data,0),C.header&&fe.meta&&(fe.meta.fields=se),_e+=Ve)}function qe(){return C.header&&se.length===0}function ot(me,Be,Ve,ce){me={type:me,code:Be,message:Ve},ce!==void 0&&(me.row=ce),fe.errors.push(me)}N(C.step)&&(V=C.step,C.step=function(me){fe=me,qe()?ve():(ve(),fe.data.length!==0&&(pe+=me.data.length,C.preview&&pe>C.preview?O.abort():(fe.data=fe.data[0],V(fe,ae))))}),this.parse=function(me,Be,Ve){var ce=C.quoteChar||'"',ce=(C.newline||(C.newline=this.guessLineEndings(me,ce)),W=!1,C.delimiter?N(C.delimiter)&&(C.delimiter=C.delimiter(me),fe.meta.delimiter=C.delimiter):((ce=((Me,Ke,we,Ce,Ae)=>{var je,De,Qe,At;Ae=Ae||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var vt=0;vt<Ae.length;vt++){for(var xt,Yt=Ae[vt],yt=0,nt=0,wt=0,Ft=(Qe=void 0,new L({comments:Ce,delimiter:Yt,newline:Ke,preview:10}).parse(Me)),dt=0;dt<Ft.data.length;dt++)we&&Ee(Ft.data[dt])?wt++:(xt=Ft.data[dt].length,nt+=xt,Qe===void 0?Qe=xt:0<xt&&(yt+=Math.abs(xt-Qe),Qe=xt));0<Ft.data.length&&(nt/=Ft.data.length-wt),(De===void 0||yt<=De)&&(At===void 0||At<nt)&&1.99<nt&&(De=yt,je=Yt,At=nt)}return{successful:!!(C.delimiter=je),bestDelimiter:je}})(me,C.newline,C.skipEmptyLines,C.comments,C.delimitersToGuess)).successful?C.delimiter=ce.bestDelimiter:(W=!0,C.delimiter=d.DefaultDelimiter),fe.meta.delimiter=C.delimiter),$(C));return C.preview&&C.header&&ce.preview++,S=me,O=new L(ce),fe=O.parse(S,Be,Ve),ve(),Xe?{meta:{paused:!0}}:fe||{meta:{paused:!1}}},this.paused=function(){return Xe},this.pause=function(){Xe=!0,O.abort(),S=N(C.chunk)?"":S.substring(O.getCharIndex())},this.resume=function(){ae.streamer._halted?(Xe=!1,ae.streamer.parseChunk(S,!0)):setTimeout(ae.resume,3)},this.aborted=function(){return he},this.abort=function(){he=!0,O.abort(),fe.meta.aborted=!0,N(C.complete)&&C.complete(fe),S=""},this.guessLineEndings=function(Me,ce){Me=Me.substring(0,1048576);var ce=new RegExp(k(ce)+"([^]*?)"+k(ce),"gm"),Ve=(Me=Me.replace(ce,"")).split("\r"),ce=Me.split(`
51
- `),Me=1<ce.length&&ce[0].length<Ve[0].length;if(Ve.length===1||Me)return`
52
- `;for(var Ke=0,we=0;we<Ve.length;we++)Ve[we][0]===`
53
- `&&Ke++;return Ke>=Ve.length/2?`\r
54
- `:"\r"}}function k(C){return C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L(C){var S=(C=C||{}).delimiter,O=C.newline,W=C.comments,V=C.step,te=C.preview,ie=C.fastMode,le=null,Fe=!1,ae=C.quoteChar==null?'"':C.quoteChar,pe=ae;if(C.escapeChar!==void 0&&(pe=C.escapeChar),(typeof S!="string"||-1<d.BAD_DELIMITERS.indexOf(S))&&(S=","),W===S)throw new Error("Comment character same as delimiter");W===!0?W="#":(typeof W!="string"||-1<d.BAD_DELIMITERS.indexOf(W))&&(W=!1),O!==`
55
- `&&O!=="\r"&&O!==`\r
56
- `&&(O=`
57
- `);var _e=0,Xe=!1;this.parse=function(he,se,fe){if(typeof he!="string")throw new Error("Input must be a string");var Ee=he.length,ve=S.length,qe=O.length,ot=W.length,me=N(V),Be=[],Ve=[],ce=[],Me=_e=0;if(!he)return yt();if(ie||ie!==!1&&he.indexOf(ae)===-1){for(var Ke=he.split(O),we=0;we<Ke.length;we++){if(ce=Ke[we],_e+=ce.length,we!==Ke.length-1)_e+=O.length;else if(fe)return yt();if(!W||ce.substring(0,ot)!==W){if(me){if(Be=[],At(ce.split(S)),nt(),Xe)return yt()}else At(ce.split(S));if(te&&te<=we)return Be=Be.slice(0,te),yt(!0)}}return yt()}for(var Ce=he.indexOf(S,_e),Ae=he.indexOf(O,_e),je=new RegExp(k(pe)+k(ae),"g"),De=he.indexOf(ae,_e);;)if(he[_e]===ae)for(De=_e,_e++;;){if((De=he.indexOf(ae,De+1))===-1)return fe||Ve.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Be.length,index:_e}),xt();if(De===Ee-1)return xt(he.substring(_e,De).replace(je,ae));if(ae===pe&&he[De+1]===pe)De++;else if(ae===pe||De===0||he[De-1]!==pe){Ce!==-1&&Ce<De+1&&(Ce=he.indexOf(S,De+1));var Qe=vt((Ae=Ae!==-1&&Ae<De+1?he.indexOf(O,De+1):Ae)===-1?Ce:Math.min(Ce,Ae));if(he.substr(De+1+Qe,ve)===S){ce.push(he.substring(_e,De).replace(je,ae)),he[_e=De+1+Qe+ve]!==ae&&(De=he.indexOf(ae,_e)),Ce=he.indexOf(S,_e),Ae=he.indexOf(O,_e);break}if(Qe=vt(Ae),he.substring(De+1+Qe,De+1+Qe+qe)===O){if(ce.push(he.substring(_e,De).replace(je,ae)),Yt(De+1+Qe+qe),Ce=he.indexOf(S,_e),De=he.indexOf(ae,_e),me&&(nt(),Xe))return yt();if(te&&Be.length>=te)return yt(!0);break}Ve.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Be.length,index:_e}),De++}}else if(W&&ce.length===0&&he.substring(_e,_e+ot)===W){if(Ae===-1)return yt();_e=Ae+qe,Ae=he.indexOf(O,_e),Ce=he.indexOf(S,_e)}else if(Ce!==-1&&(Ce<Ae||Ae===-1))ce.push(he.substring(_e,Ce)),_e=Ce+ve,Ce=he.indexOf(S,_e);else{if(Ae===-1)break;if(ce.push(he.substring(_e,Ae)),Yt(Ae+qe),me&&(nt(),Xe))return yt();if(te&&Be.length>=te)return yt(!0)}return xt();function At(wt){Be.push(wt),Me=_e}function vt(wt){var Ft=0;return Ft=wt!==-1&&(wt=he.substring(De+1,wt))&&wt.trim()===""?wt.length:Ft}function xt(wt){return fe||(wt===void 0&&(wt=he.substring(_e)),ce.push(wt),_e=Ee,At(ce),me&&nt()),yt()}function Yt(wt){_e=wt,At(ce),ce=[],Ae=he.indexOf(O,_e)}function yt(wt){if(C.header&&!se&&Be.length&&!Fe){var Ft=Be[0],dt=Object.create(null),Dr=new Set(Ft);let E=!1;for(let _=0;_<Ft.length;_++){let w=Ft[_];if(dt[w=N(C.transformHeader)?C.transformHeader(w,_):w]){let R,H=dt[w];for(;R=w+"_"+H,H++,Dr.has(R););Dr.add(R),Ft[_]=R,dt[w]++,E=!0,(le=le===null?{}:le)[R]=w}else dt[w]=1,Ft[_]=w;Dr.add(w)}E&&console.warn("Duplicate headers found and renamed."),Fe=!0}return{data:Be,errors:Ve,meta:{delimiter:S,linebreak:O,aborted:Xe,truncated:!!wt,cursor:Me+(se||0),renamedHeaders:le}}}function nt(){V(yt()),Be=[],Ve=[]}},this.abort=function(){Xe=!0},this.getCharIndex=function(){return _e}}function G(C){var S=C.data,O=h[S.workerId],W=!1;if(S.error)O.userError(S.error,S.file);else if(S.results&&S.results.data){var V={abort:function(){W=!0,P(S.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:T,resume:T};if(N(O.userStep)){for(var te=0;te<S.results.data.length&&(O.userStep({data:S.results.data[te],errors:S.results.errors,meta:S.results.meta},V),!W);te++);delete S.results}else N(O.userChunk)&&(O.userChunk(S.results,V,S.file),delete S.results)}S.finished&&!W&&P(S.workerId,S.results)}function P(C,S){var O=h[C];N(O.userComplete)&&O.userComplete(S),O.terminate(),delete h[C]}function T(){throw new Error("Not implemented.")}function $(C){if(typeof C!="object"||C===null)return C;var S,O=Array.isArray(C)?[]:{};for(S in C)O[S]=$(C[S]);return O}function q(C,S){return function(){C.apply(S,arguments)}}function N(C){return typeof C=="function"}return d.parse=function(C,S){var O=(S=S||{}).dynamicTyping||!1;if(N(O)&&(S.dynamicTypingFunction=O,O={}),S.dynamicTyping=O,S.transform=!!N(S.transform)&&S.transform,!S.worker||!d.WORKERS_SUPPORTED)return O=null,d.NODE_STREAM_INPUT,typeof C=="string"?(C=(W=>W.charCodeAt(0)!==65279?W:W.slice(1))(C),O=new(S.download?D:m)(S)):C.readable===!0&&N(C.read)&&N(C.on)?O=new I(S):(a.File&&C instanceof File||C instanceof Object)&&(O=new y(S)),O.stream(C);(O=(()=>{var W;return!!d.WORKERS_SUPPORTED&&(W=(()=>{var V=a.URL||a.webkitURL||null,te=t.toString();return d.BLOB_URL||(d.BLOB_URL=V.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; ","(",te,")();"],{type:"text/javascript"})))})(),(W=new a.Worker(W)).onmessage=G,W.id=v++,h[W.id]=W)})()).userStep=S.step,O.userChunk=S.chunk,O.userComplete=S.complete,O.userError=S.error,S.step=N(S.step),S.chunk=N(S.chunk),S.complete=N(S.complete),S.error=N(S.error),delete S.worker,O.postMessage({input:C,config:S,workerId:O.id})},d.unparse=function(C,S){var O=!1,W=!0,V=",",te=`\r
58
- `,ie='"',le=ie+ie,Fe=!1,ae=null,pe=!1,_e=((()=>{if(typeof S=="object"){if(typeof S.delimiter!="string"||d.BAD_DELIMITERS.filter(function(se){return S.delimiter.indexOf(se)!==-1}).length||(V=S.delimiter),typeof S.quotes!="boolean"&&typeof S.quotes!="function"&&!Array.isArray(S.quotes)||(O=S.quotes),typeof S.skipEmptyLines!="boolean"&&typeof S.skipEmptyLines!="string"||(Fe=S.skipEmptyLines),typeof S.newline=="string"&&(te=S.newline),typeof S.quoteChar=="string"&&(ie=S.quoteChar),typeof S.header=="boolean"&&(W=S.header),Array.isArray(S.columns)){if(S.columns.length===0)throw new Error("Option columns is empty");ae=S.columns}S.escapeChar!==void 0&&(le=S.escapeChar+ie),S.escapeFormulae instanceof RegExp?pe=S.escapeFormulae:typeof S.escapeFormulae=="boolean"&&S.escapeFormulae&&(pe=/^[=+\-@\t\r].*$/)}})(),new RegExp(k(ie),"g"));if(typeof C=="string"&&(C=JSON.parse(C)),Array.isArray(C)){if(!C.length||Array.isArray(C[0]))return Xe(null,C,Fe);if(typeof C[0]=="object")return Xe(ae||Object.keys(C[0]),C,Fe)}else if(typeof C=="object")return typeof C.data=="string"&&(C.data=JSON.parse(C.data)),Array.isArray(C.data)&&(C.fields||(C.fields=C.meta&&C.meta.fields||ae),C.fields||(C.fields=Array.isArray(C.data[0])?C.fields:typeof C.data[0]=="object"?Object.keys(C.data[0]):[]),Array.isArray(C.data[0])||typeof C.data[0]=="object"||(C.data=[C.data])),Xe(C.fields||[],C.data||[],Fe);throw new Error("Unable to serialize unrecognized input");function Xe(se,fe,Ee){var ve="",qe=(typeof se=="string"&&(se=JSON.parse(se)),typeof fe=="string"&&(fe=JSON.parse(fe)),Array.isArray(se)&&0<se.length),ot=!Array.isArray(fe[0]);if(qe&&W){for(var me=0;me<se.length;me++)0<me&&(ve+=V),ve+=he(se[me],me);0<fe.length&&(ve+=te)}for(var Be=0;Be<fe.length;Be++){var Ve=(qe?se:fe[Be]).length,ce=!1,Me=qe?Object.keys(fe[Be]).length===0:fe[Be].length===0;if(Ee&&!qe&&(ce=Ee==="greedy"?fe[Be].join("").trim()==="":fe[Be].length===1&&fe[Be][0].length===0),Ee==="greedy"&&qe){for(var Ke=[],we=0;we<Ve;we++){var Ce=ot?se[we]:we;Ke.push(fe[Be][Ce])}ce=Ke.join("").trim()===""}if(!ce){for(var Ae=0;Ae<Ve;Ae++){0<Ae&&!Me&&(ve+=V);var je=qe&&ot?se[Ae]:Ae;ve+=he(fe[Be][je],Ae)}Be<fe.length-1&&(!Ee||0<Ve&&!Me)&&(ve+=te)}}return ve}function he(se,fe){var Ee,ve;return se==null?"":se.constructor===Date?JSON.stringify(se).slice(1,25):(ve=!1,pe&&typeof se=="string"&&pe.test(se)&&(se="'"+se,ve=!0),Ee=se.toString().replace(_e,le),(ve=ve||O===!0||typeof O=="function"&&O(se,fe)||Array.isArray(O)&&O[fe]||((qe,ot)=>{for(var me=0;me<ot.length;me++)if(-1<qe.indexOf(ot[me]))return!0;return!1})(Ee,d.BAD_DELIMITERS)||-1<Ee.indexOf(V)||Ee.charAt(0)===" "||Ee.charAt(Ee.length-1)===" ")?ie+Ee+ie:Ee)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
59
- `,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!s&&!!a.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=L,d.ParserHandle=F,d.NetworkStreamer=D,d.FileStreamer=y,d.StringStreamer=m,d.ReadableStreamStreamer=I,a.jQuery&&((o=a.jQuery).fn.parse=function(C){var S=C.config||{},O=[];return this.each(function(te){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 ie=0;ie<this.files.length;ie++)O.push({file:this.files[ie],inputElem:this,instanceConfig:o.extend({},S)})}),W(),this;function W(){if(O.length===0)N(C.complete)&&C.complete();else{var te,ie,le,Fe,ae=O[0];if(N(C.before)){var pe=C.before(ae.file,ae.inputElem);if(typeof pe=="object"){if(pe.action==="abort")return te="AbortError",ie=ae.file,le=ae.inputElem,Fe=pe.reason,void(N(C.error)&&C.error({name:te},ie,le,Fe));if(pe.action==="skip")return void V();typeof pe.config=="object"&&(ae.instanceConfig=o.extend(ae.instanceConfig,pe.config))}else if(pe==="skip")return void V()}var _e=ae.instanceConfig.complete;ae.instanceConfig.complete=function(Xe){N(_e)&&_e(Xe,ae.file,ae.inputElem),V()},d.parse(ae.file,ae.instanceConfig)}}function V(){O.splice(0,1),W()}}),f&&(a.onmessage=function(C){C=C.data,d.WORKER_ID===void 0&&C&&(d.WORKER_ID=C.workerId),typeof C.input=="string"?a.postMessage({workerId:d.WORKER_ID,results:d.parse(C.input,C.config),finished:!0}):(a.File&&C.input instanceof File||C.input instanceof Object)&&(C=d.parse(C.input,C.config))&&a.postMessage({workerId:d.WORKER_ID,results:C,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})})(Db);var xb=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,yb=/[\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]/,Eb=/[\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]/,df={Space_Separator:xb,ID_Start:yb,ID_Continue:Eb},It={isSpaceSeparator(e){return typeof e=="string"&&df.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||df.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="‌"||e==="‍"||df.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let gf,Kt,wr,Ju,Gr,Gn,Pt,pf,Za;var Ab=function(n,t){gf=String(n),Kt="start",wr=[],Ju=0,Gr=1,Gn=0,Pt=void 0,pf=void 0,Za=void 0;do Pt=Fb(),Sb[Kt]();while(Pt.type!=="eof");return typeof t=="function"?_f({"":Za},"",t):Za};function _f(e,n,t){const a=e[n];if(a!=null&&typeof a=="object")if(Array.isArray(a))for(let o=0;o<a.length;o++){const s=String(o),f=_f(a,s,t);f===void 0?delete a[s]:Object.defineProperty(a,s,{value:f,writable:!0,enumerable:!0,configurable:!0})}else for(const o in a){const s=_f(a,o,t);s===void 0?delete a[o]:Object.defineProperty(a,o,{value:s,writable:!0,enumerable:!0,configurable:!0})}return t.call(e,n,a)}let Le,Ie,Xa,mr,$e;function Fb(){for(Le="default",Ie="",Xa=!1,mr=1;;){$e=br();const e=Nd[Le]();if(e)return e}}function br(){if(gf[Ju])return String.fromCodePoint(gf.codePointAt(Ju))}function ee(){const e=br();return e===`
60
- `?(Gr++,Gn=0):e?Gn+=e.length:Gn++,e&&(Ju+=e.length),e}const Nd={default(){switch($e){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
61
- `:case"\r":case"\u2028":case"\u2029":ee();return;case"/":ee(),Le="comment";return;case void 0:return ee(),ht("eof")}if(It.isSpaceSeparator($e)){ee();return}return Nd[Kt]()},comment(){switch($e){case"*":ee(),Le="multiLineComment";return;case"/":ee(),Le="singleLineComment";return}throw ct(ee())},multiLineComment(){switch($e){case"*":ee(),Le="multiLineCommentAsterisk";return;case void 0:throw ct(ee())}ee()},multiLineCommentAsterisk(){switch($e){case"*":ee();return;case"/":ee(),Le="default";return;case void 0:throw ct(ee())}ee(),Le="multiLineComment"},singleLineComment(){switch($e){case`
62
- `:case"\r":case"\u2028":case"\u2029":ee(),Le="default";return;case void 0:return ee(),ht("eof")}ee()},value(){switch($e){case"{":case"[":return ht("punctuator",ee());case"n":return ee(),wi("ull"),ht("null",null);case"t":return ee(),wi("rue"),ht("boolean",!0);case"f":return ee(),wi("alse"),ht("boolean",!1);case"-":case"+":ee()==="-"&&(mr=-1),Le="sign";return;case".":Ie=ee(),Le="decimalPointLeading";return;case"0":Ie=ee(),Le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":Ie=ee(),Le="decimalInteger";return;case"I":return ee(),wi("nfinity"),ht("numeric",1/0);case"N":return ee(),wi("aN"),ht("numeric",NaN);case'"':case"'":Xa=ee()==='"',Ie="",Le="string";return}throw ct(ee())},identifierNameStartEscape(){if($e!=="u")throw ct(ee());ee();const e=vf();switch(e){case"$":case"_":break;default:if(!It.isIdStartChar(e))throw Od();break}Ie+=e,Le="identifierName"},identifierName(){switch($e){case"$":case"_":case"‌":case"‍":Ie+=ee();return;case"\\":ee(),Le="identifierNameEscape";return}if(It.isIdContinueChar($e)){Ie+=ee();return}return ht("identifier",Ie)},identifierNameEscape(){if($e!=="u")throw ct(ee());ee();const e=vf();switch(e){case"$":case"_":case"‌":case"‍":break;default:if(!It.isIdContinueChar(e))throw Od();break}Ie+=e,Le="identifierName"},sign(){switch($e){case".":Ie=ee(),Le="decimalPointLeading";return;case"0":Ie=ee(),Le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":Ie=ee(),Le="decimalInteger";return;case"I":return ee(),wi("nfinity"),ht("numeric",mr*(1/0));case"N":return ee(),wi("aN"),ht("numeric",NaN)}throw ct(ee())},zero(){switch($e){case".":Ie+=ee(),Le="decimalPoint";return;case"e":case"E":Ie+=ee(),Le="decimalExponent";return;case"x":case"X":Ie+=ee(),Le="hexadecimal";return}return ht("numeric",mr*0)},decimalInteger(){switch($e){case".":Ie+=ee(),Le="decimalPoint";return;case"e":case"E":Ie+=ee(),Le="decimalExponent";return}if(It.isDigit($e)){Ie+=ee();return}return ht("numeric",mr*Number(Ie))},decimalPointLeading(){if(It.isDigit($e)){Ie+=ee(),Le="decimalFraction";return}throw ct(ee())},decimalPoint(){switch($e){case"e":case"E":Ie+=ee(),Le="decimalExponent";return}if(It.isDigit($e)){Ie+=ee(),Le="decimalFraction";return}return ht("numeric",mr*Number(Ie))},decimalFraction(){switch($e){case"e":case"E":Ie+=ee(),Le="decimalExponent";return}if(It.isDigit($e)){Ie+=ee();return}return ht("numeric",mr*Number(Ie))},decimalExponent(){switch($e){case"+":case"-":Ie+=ee(),Le="decimalExponentSign";return}if(It.isDigit($e)){Ie+=ee(),Le="decimalExponentInteger";return}throw ct(ee())},decimalExponentSign(){if(It.isDigit($e)){Ie+=ee(),Le="decimalExponentInteger";return}throw ct(ee())},decimalExponentInteger(){if(It.isDigit($e)){Ie+=ee();return}return ht("numeric",mr*Number(Ie))},hexadecimal(){if(It.isHexDigit($e)){Ie+=ee(),Le="hexadecimalInteger";return}throw ct(ee())},hexadecimalInteger(){if(It.isHexDigit($e)){Ie+=ee();return}return ht("numeric",mr*Number(Ie))},string(){switch($e){case"\\":ee(),Ie+=Cb();return;case'"':if(Xa)return ee(),ht("string",Ie);Ie+=ee();return;case"'":if(!Xa)return ee(),ht("string",Ie);Ie+=ee();return;case`
63
- `:case"\r":throw ct(ee());case"\u2028":case"\u2029":Ib($e);break;case void 0:throw ct(ee())}Ie+=ee()},start(){switch($e){case"{":case"[":return ht("punctuator",ee())}Le="value"},beforePropertyName(){switch($e){case"$":case"_":Ie=ee(),Le="identifierName";return;case"\\":ee(),Le="identifierNameStartEscape";return;case"}":return ht("punctuator",ee());case'"':case"'":Xa=ee()==='"',Le="string";return}if(It.isIdStartChar($e)){Ie+=ee(),Le="identifierName";return}throw ct(ee())},afterPropertyName(){if($e===":")return ht("punctuator",ee());throw ct(ee())},beforePropertyValue(){Le="value"},afterPropertyValue(){switch($e){case",":case"}":return ht("punctuator",ee())}throw ct(ee())},beforeArrayValue(){if($e==="]")return ht("punctuator",ee());Le="value"},afterArrayValue(){switch($e){case",":case"]":return ht("punctuator",ee())}throw ct(ee())},end(){throw ct(ee())}};function ht(e,n){return{type:e,value:n,line:Gr,column:Gn}}function wi(e){for(const n of e){if(br()!==n)throw ct(ee());ee()}}function Cb(){switch(br()){case"b":return ee(),"\b";case"f":return ee(),"\f";case"n":return ee(),`
64
- `;case"r":return ee(),"\r";case"t":return ee()," ";case"v":return ee(),"\v";case"0":if(ee(),It.isDigit(br()))throw ct(ee());return"\0";case"x":return ee(),Bb();case"u":return ee(),vf();case`
65
- `:case"\u2028":case"\u2029":return ee(),"";case"\r":return ee(),br()===`
66
- `&&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 Bb(){let e="",n=br();if(!It.isHexDigit(n)||(e+=ee(),n=br(),!It.isHexDigit(n)))throw ct(ee());return e+=ee(),String.fromCodePoint(parseInt(e,16))}function vf(){let e="",n=4;for(;n-- >0;){const t=br();if(!It.isHexDigit(t))throw ct(ee());e+=ee()}return String.fromCodePoint(parseInt(e,16))}const Sb={start(){if(Pt.type==="eof")throw mi();wf()},beforePropertyName(){switch(Pt.type){case"identifier":case"string":pf=Pt.value,Kt="afterPropertyName";return;case"punctuator":ju();return;case"eof":throw mi()}},afterPropertyName(){if(Pt.type==="eof")throw mi();Kt="beforePropertyValue"},beforePropertyValue(){if(Pt.type==="eof")throw mi();wf()},beforeArrayValue(){if(Pt.type==="eof")throw mi();if(Pt.type==="punctuator"&&Pt.value==="]"){ju();return}wf()},afterPropertyValue(){if(Pt.type==="eof")throw mi();switch(Pt.value){case",":Kt="beforePropertyName";return;case"}":ju()}},afterArrayValue(){if(Pt.type==="eof")throw mi();switch(Pt.value){case",":Kt="beforeArrayValue";return;case"]":ju()}},end(){}};function wf(){let e;switch(Pt.type){case"punctuator":switch(Pt.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Pt.value;break}if(Za===void 0)Za=e;else{const n=wr[wr.length-1];Array.isArray(n)?n.push(e):Object.defineProperty(n,pf,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")wr.push(e),Array.isArray(e)?Kt="beforeArrayValue":Kt="beforePropertyName";else{const n=wr[wr.length-1];n==null?Kt="end":Array.isArray(n)?Kt="afterArrayValue":Kt="afterPropertyValue"}}function ju(){wr.pop();const e=wr[wr.length-1];e==null?Kt="end":Array.isArray(e)?Kt="afterArrayValue":Kt="afterPropertyValue"}function ct(e){return zu(e===void 0?`JSON5: invalid end of input at ${Gr}:${Gn}`:`JSON5: invalid character '${Md(e)}' at ${Gr}:${Gn}`)}function mi(){return zu(`JSON5: invalid end of input at ${Gr}:${Gn}`)}function Od(){return Gn-=5,zu(`JSON5: invalid identifier character at ${Gr}:${Gn}`)}function Ib(e){console.warn(`JSON5: '${Md(e)}' in strings is not valid ECMAScript; consider escaping`)}function Md(e){const n={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(n[e])return n[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return e}function zu(e){const n=new SyntaxError(e);return n.lineNumber=Gr,n.columnNumber=Gn,n}var Tb=function(n,t,a){const o=[];let s="",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 F of t){let k;typeof F=="string"?k=F:(typeof F=="number"||F instanceof String||F instanceof Number)&&(k=String(F)),k!==void 0&&f.indexOf(k)<0&&f.push(k)}}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("",{"":n});function c(F,k){let L=k[F];switch(L!=null&&(typeof L.toJSON5=="function"?L=L.toJSON5(F):typeof L.toJSON=="function"&&(L=L.toJSON(F))),h&&(L=h.call(k,F,L)),L instanceof Number?L=Number(L):L instanceof String?L=String(L):L instanceof Boolean&&(L=L.valueOf()),L){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof L=="string")return D(L);if(typeof L=="number")return String(L);if(typeof L=="object")return Array.isArray(L)?I(L):y(L)}function D(F){const k={"'":.1,'"':.2},L={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let G="";for(let T=0;T<F.length;T++){const $=F[T];switch($){case"'":case'"':k[$]++,G+=$;continue;case"\0":if(It.isDigit(F[T+1])){G+="\\x00";continue}}if(L[$]){G+=L[$];continue}if($<" "){let q=$.charCodeAt(0).toString(16);G+="\\x"+("00"+q).substring(q.length);continue}G+=$}const P=d||Object.keys(k).reduce((T,$)=>k[T]<k[$]?T:$);return G=G.replace(new RegExp(P,"g"),L[P]),P+G+P}function y(F){if(o.indexOf(F)>=0)throw TypeError("Converting circular structure to JSON5");o.push(F);let k=s;s=s+v;let L=f||Object.keys(F),G=[];for(const T of L){const $=c(T,F);if($!==void 0){let q=m(T)+":";v!==""&&(q+=" "),q+=$,G.push(q)}}let P;if(G.length===0)P="{}";else{let T;if(v==="")T=G.join(","),P="{"+T+"}";else{let $=`,
67
- `+s;T=G.join($),P=`{
68
- `+s+T+`,
69
- `+k+"}"}}return o.pop(),s=k,P}function m(F){if(F.length===0)return D(F);const k=String.fromCodePoint(F.codePointAt(0));if(!It.isIdStartChar(k))return D(F);for(let L=k.length;L<F.length;L++)if(!It.isIdContinueChar(String.fromCodePoint(F.codePointAt(L))))return D(F);return F}function I(F){if(o.indexOf(F)>=0)throw TypeError("Converting circular structure to JSON5");o.push(F);let k=s;s=s+v;let L=[];for(let P=0;P<F.length;P++){const T=c(String(P),F);L.push(T!==void 0?T:"null")}let G;if(L.length===0)G="[]";else if(v==="")G="["+L.join(",")+"]";else{let P=`,
70
- `+s,T=L.join(P);G=`[
71
- `+s+T+`,
72
- `+k+"]"}return o.pop(),s=k,G}},kb={parse:Ab,stringify:Tb};function mf(e){const n=/^chr[\w.]+:\d+-\d+$/,t=/^chr[\w.]+:\d+-chr[\w.]+-\d+$/;return n.test(e)||t.test(e)}function bf(e){const n=/^(chr[\w.]+):(\d+)-(\d+)$/,t=e.match(n);if(!t)throw new Error(`Invalid region format: ${e}. Expected format: chr7:27053397-27373765`);return t[1]}class In{constructor(n,t=0,a){ge(this,"relativeStart");ge(this,"relativeEnd");if(this.feature=n,a===void 0&&(a=n.locus.end-n.locus.start),a<t)throw new RangeError("End cannot be less than start");this.feature=n,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 Ye(this.relativeStart,this.relativeEnd)}getName(){return this.feature.getName()}getLength(){return this.relativeEnd-this.relativeStart}getLocus(){const n=this.feature.locus;return new it(n.chr,n.start+this.relativeStart,n.start+this.relativeEnd)}getOverlap(n){if(this.feature!==n.feature)return null;const t=this.toOpenInterval().getOverlap(n.toOpenInterval());return t?new In(this.feature,t.start,t.end):null}getGenomeOverlap(n){const t=this.feature.getLocus(),o=this.getLocus().getOverlap(n);if(!o)return null;const s=o.start-t.start,f=o.end-t.start;return new In(this.feature,s,f)}toString(){let n;return mf(this.getName())?n=bf(this.getName()):n=this.getName(),`${n}:${this.relativeStart}-${this.relativeEnd}`}toStringWithOther(n){let t,a;return mf(this.getName())?t=bf(this.getName()):t=this.getName(),mf(n.getName())?a=bf(n.getName()):a=n.getName(),`${t}:${this.relativeStart+1}-${a}:${n.relativeEnd}`}}const Pd="";class Hn{constructor(n,t){ge(this,"_name");ge(this,"_features");ge(this,"_sortedFeatureStarts");ge(this,"_minCoordinateForFeature");ge(this,"_featuresForChr");ge(this,"_totalBases");this._name=n,this._features=t,this._minCoordinateForFeature=new Map,this._sortedFeatureStarts=[],this._featuresForChr=on.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(n,t="Gap"){return new Yn(t,new it(Pd,0,Math.round(n)))}static isGapFeature(n){return n.getLocus().chr===Pd}_flipIfReverseStrand(n){if(n.feature.getIsReverseStrand())return new In(n.feature,t(n.relativeEnd),t(n.relativeStart));return n;function t(a){return n.feature.getLength()-a}}getName(){return this._name}getFeatures(){return this._features.slice()}getTotalBases(){return this._totalBases}getIsValidBase(n){return 0<=n&&n<this._totalBases}getFeatureStart(n){const t=this._minCoordinateForFeature.get(n);if(t===void 0)throw new RangeError(`Feature "${n.getName()}" not in this navigation context`);return t}convertBaseToFeatureCoordinate(n){if(!this.getIsValidBase(n))throw new RangeError(`Base number ${n} is invalid. Valid bases in this context: [0, ${this.getTotalBases()})`);const t=on.sortedLastIndex(this._sortedFeatureStarts,n)-1,a=this._features[t],o=n-this._sortedFeatureStarts[t];return new In(a,o,o+1)}convertFeatureSegmentToContextCoordinates(n){n=this._flipIfReverseStrand(n);const t=this.getFeatureStart(n.feature);return new Ye(t+n.relativeStart,t+n.relativeEnd)}convertGenomeIntervalToBases(n){const t=this._featuresForChr[n.chr]||[],a=[];for(const o of t){const s=new In(o).getGenomeOverlap(n);s&&a.push(this.convertFeatureSegmentToContextCoordinates(s))}return a}toGaplessCoordinate(n){const t=this.convertBaseToFeatureCoordinate(n),a=this._features.findIndex(f=>f===t.feature),o=this._features.slice(0,a).filter(Hn.isGapFeature);let s=on.sumBy(o,f=>f.getLength());return Hn.isGapFeature(t.feature)&&(s+=t.relativeStart),n-s}parse(n){var h,v,d;const t=n.split("-");if(t.length===2&&t[0].includes(":")&&t[1].includes(":")&&t[1].startsWith("chr")){const c=t[0],D=t[1],[y,m]=c.split(":"),[I,F]=D.split(":"),k=Math.round(parseFloat(m)),L=Math.round(parseFloat(F)),G=(h=this._featuresForChr[y])==null?void 0:h[0],P=(v=this._featuresForChr[I])==null?void 0:v[0];if(!G||!P)throw new RangeError("One or more chromosomes unavailable in this context");const T=parseInt(y.replace("chr","")),$=parseInt(I.replace("chr","")),q=[],N=`${y}:${k}-${G.getLocus().end}`,C=this.convertGenomeIntervalToBases(it.parse(N))[0];C&&q.push(C);for(let W=T+1;W<$;W++){const V=`chr${W}`,te=(d=this._featuresForChr[V])==null?void 0:d[0];if(te){const ie=`${V}:${te.getLocus().start}-${te.getLocus().end}`,le=this.convertGenomeIntervalToBases(it.parse(ie))[0];le&&q.push(le)}}if(T!==$){const W=`${I}:${P.getLocus().start}-${L}`,V=this.convertGenomeIntervalToBases(it.parse(W))[0];V&&q.push(V)}if(q.length===0)throw new RangeError("No valid intervals found in this context");const S=Math.min(...q.map(W=>W.start)),O=Math.max(...q.map(W=>W.end));return new Ye(S,O)}const o=this._features.find(c=>c.getName()===n);if(o){const c=this.convertFeatureSegmentToContextCoordinates(new In(o)),D=.5*(c.start+c.end);return new Ye(D-3,D+3)}if(n.includes(":")&&n.includes("-")){const[c,D]=n.split(":"),[y,m]=D.split("-"),I=Math.round(parseFloat(y)),F=Math.round(parseFloat(m)),k=`${c}:${I}-${F}`,L=it.parse(k),G=this.convertGenomeIntervalToBases(L)[0];if(G)return G;throw new RangeError("Location unavailable in this context")}const s=it.parse(n),f=this.convertGenomeIntervalToBases(s)[0];if(f)return f;throw new RangeError("Location unavailable in this context")}getFeaturesInInterval(n,t,a=!0){const o=new Ye(n,t),s=[];for(const f of this._features){if(!a&&Hn.isGapFeature(f))continue;const h=this.getFeatureStart(f),v=h+f.getLength(),d=new Ye(h,v).getOverlap(o);if(d){const c=d.start-h,D=d.end-h,y=new In(f,c,D);s.push(this._flipIfReverseStrand(y))}else if(s.length>0)break}return s}getLociInInterval(n,t){const o=this.getFeaturesInInterval(n,t,!1).map(s=>s.getLocus());return it.mergeOverlaps(o)}hasFeatureWithName(n){return this._features.some(t=>t.name===n.name)}}var $d=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function Rb(e,n){return!!(e===n||$d(e)&&$d(n))}function Lb(e,n){if(e.length!==n.length)return!1;for(var t=0;t<e.length;t++)if(!Rb(e[t],n[t]))return!1;return!0}function Nb(e,n){n===void 0&&(n=Lb);var t=null;function a(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(t&&t.lastThis===this&&n(o,t.lastArgs))return t.lastResult;var f=e.apply(this,o);return t={lastResult:f,lastArgs:o,lastThis:this},f}return a.clear=function(){t=null},a}const Va="-";function es(e){return on.sumBy(e,n=>n===Va?0:1)}function Ud(e,n,t=!1){const a=[],o=new RegExp(Va+"+","g");let s;for(;(s=o.exec(e))!==null;)v(!0,s.index,s[0].length,n);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,e.length-f),a;function v(d,c,D,y=0){D>y&&a.push({isGap:d,index:c,length:D})}}function Df(e,n,t=!1){const a=t?-1:1,o=[];let s=n;for(const f of e)o.push(s),f!==Va&&(s+=a);return o}class Ob{constructor(n){ge(this,"sequence");ge(this,"_currentIndex");this.sequence=n,this._currentIndex=-1}reset(){this._currentIndex=0}getCurrentIndex(){return this._currentIndex}getIndexOfNextBase(){do this._currentIndex++;while(this.sequence.charAt(this._currentIndex)===Va);return this._currentIndex}hasNextBase(){return this._currentIndex<this.sequence.length-1}advanceN(n){let t=this._currentIndex;for(let a=0;a<n;a++)t=this.getIndexOfNextBase();return t}}class xf extends In{constructor(t,a,o){super(t,a,o);ge(this,"feature");ge(this,"sequenceInterval");this.feature=t;const s=new Ob(t.targetSeq),f=s.advanceN(this.relativeStart+1),h=s.advanceN(this.getLength());this.sequenceInterval=new Ye(f,h)}static fromFeatureSegment(t){return new xf(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 it(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=es(t.substring(0,this.sequenceInterval.start)),s=es(this.getQuerySequence());if(this.feature.getIsReverseStrandQuery()){const f=a.end-o;return new it(a.chr,f-s,f)}else{const f=a.start+o;return new it(a.chr,f,f+s)}}getQuerySequence(){const[t,a]=this.sequenceInterval;return this.feature.querySeq.substring(t,a)}}function Mb(e,n=!1){const t=e>=1e3?Math.floor(e):Math.round(e);return t>=75e4?`${(t/1e6).toFixed(1)} Mb`:t>=1e4?`${(t/1e3).toFixed(1)} Kb`:t>0?`${t} bp`:n?"<1 bp":"0 bp"}class Wd{constructor(n){ge(this,"_baseNavContext");ge(this,"_gaps");ge(this,"_cumulativeGapBases");this._baseNavContext=n,this._cumulativeGapBases=[]}setGaps(n){this._gaps=n.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 n=this._baseNavContext.getFeatures(),t=new Map;for(let f=0;f<n.length;f++)t.set(n[f],f);const a=[];let o=-1,s=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(...n.slice(o+1,d)),d===o&&s>0&&a.pop(),s=s>c?0:s;const D=new In(v,s,c).getLocus(),y=new In(v,c).getLocus();D.getLength()>0&&a.push(new Yn(v.getName(),D,v.getStrand())),a.push(Hn.makeGap(f.length,`${Mb(f.length)} gap`)),y.getLength()>0&&a.push(new Yn(v.getName(),y,v.getStrand())),o=d,s=c}return a.push(...n.slice(o+1)),new Hn(this._baseNavContext.getName(),a)}convertOldCoordinates(n){const t=on.sortedIndexBy(this._gaps,{contextBase:n},"contextBase"),a=this._cumulativeGapBases[t]||0;return n+a}}class bi{constructor(n,t){ge(this,"_viewRegion");ge(this,"_drawWidth");ge(this,"_pixelsPerBase");ge(this,"_basesPerPixel");this._viewRegion=n,this._drawWidth=t,this._pixelsPerBase=t/n.getWidth(),this._basesPerPixel=n.getWidth()/t}getDrawWidth(){return this._drawWidth}basesToXWidth(n){return n*this._pixelsPerBase}xWidthToBases(n){return n*this._basesPerPixel}baseToX(n){return(n-this._viewRegion.getContextCoordinates().start)*this._pixelsPerBase}xToBase(n){return n*this._basesPerPixel+this._viewRegion.getContextCoordinates().start}baseSpanToXSpan(n){const t=this.baseToX(n.start),a=this.baseToX(n.end);return new Ye(t,a)}baseSpanToXCenter(n){const t=this.baseSpanToXSpan(n),a=Math.round((t.start+t.end)/2);return new Ye(a,a)}xToSegmentCoordinate(n){const t=Math.floor(this.xToBase(n));return this._viewRegion.getNavigationContext().convertBaseToFeatureCoordinate(t)}}class Pb{constructor(n,t,a){ge(this,"interaction");ge(this,"xSpan1");ge(this,"xSpan2");this.interaction=n,t.start<=a.start?(this.xSpan1=t,this.xSpan2=a):(this.xSpan1=a,this.xSpan2=t)}getWidth(){const n=this.xSpan1.start;return Math.max(this.xSpan1.end,this.xSpan2.end)-n}generateKey(){return""+this.xSpan1.start+this.xSpan1.end+this.xSpan2.start+this.xSpan2.end}}class $b{placeFeatures(n,t,a,o=!1){const s=new bi(t,a),f=t.getContextCoordinates(),h=t.getNavigationContext(),v=[];for(const d of n)for(let c of d.computeNavContextCoordinates(h))if(c=c.getOverlap(f),c){const D=o?s.baseSpanToXCenter(c):s.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(n,t,a){const o=t.convertBaseToFeatureCoordinate(a.start),s=o.getLocus().start,f=o.feature.getIsReverseStrand();let h;f?h=s-a.getLength()+1:h=s;const v=h-n.getLocus().start,d=Math.max(0,v);return{visiblePart:new In(n,d,d+a.getLength()),isReverse:f}}placeFeatureSegments(n,t){const a=n.xSpan.getLength()/n.contextLocation.getLength(),o=[];for(let s of t)if(s=s.getOverlap(n.visiblePart),s){const h=(s.relativeStart-n.visiblePart.relativeStart)*a,v=s.getLength()*a;let d;n.isReverse?d=n.xSpan.end-h-v:d=n.xSpan.start+h,o.push({segment:s,xSpan:new Ye(d,d+v)})}return o}placeInteractions(n,t,a){const o=new bi(t,a),s=t.getContextCoordinates(),f=t.getNavigationContext(),h=[];for(const v of n){let d=f.convertGenomeIntervalToBases(v.locus1),c=f.convertGenomeIntervalToBases(v.locus2);d=d.map(D=>D.getOverlap(s)),c=c.map(D=>D.getOverlap(s));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 Pb(v,m,I))}}return h}placeGraphNodes(n,t,a){const o=new bi(t,a),s=t.getContextCoordinates(),f=t.getNavigationContext(),h=[],v=[];for(const d of n)for(let c of d.computeNavContextCoordinates(f))if(c=c.getOverlap(s),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 Ub=10,yf=5,qd=.99,Wb=200,qb=5,Gb=new $b;class Hb{constructor(n){ge(this,"primaryGenome");this.primaryGenome=n,this.multiAlign=Nb(this.multiAlign)}multiAlign(n,t){const{visRegion:a,visWidth:o,viewWindowRegion:s}=n,h=new bi(a,o).xWidthToBases(1)<Ub;let v;if(h){const d=t,{newRecordsArray:c,allGaps:D}=this.refineRecordsArray(d,n);v=c;const y=this.calculatePrimaryVis(D,n);return v.reduce((m,I)=>({...m,[I.query]:I.isBigChain?this.alignRough(I.id,I.query,I.records,n):this.alignFine(I.id,I.query,I.records,n,y,D)}),{})}else return v=t,v.reduce((d,c)=>({...d,[c.query]:this.alignRough(c.id,c.query,c.records,n)}),{})}calculatePrimaryVis(n,t){const{visRegion:a,viewWindow:o,viewWindowRegion:s}=t,f=a.getNavigationContext(),h=new Wd(f);h.setGaps(n);const v=h.build(),d=F(a),c=F(s),D=o.getLength()/c.getWidth(),y=d.getWidth()*D,I=new bi(d,y).baseSpanToXSpan(c.getContextCoordinates());return{visRegion:d,visWidth:y,viewWindowRegion:c,viewWindow:I};function F(k){const[L,G]=k.getContextCoordinates();return new Ii(v,h.convertOldCoordinates(L),h.convertOldCoordinates(G))}}refineRecordsArray(n,t){const a=qd,o=[],s={};for(const d of n){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 s?s[m]=Math.max(s[m],y[m]):s[m]=y[m]}const f=[];for(const d of Object.keys(s))f.push({contextBase:Number(d),length:s[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(s))if(D in d.primaryGapsObj){const y=s[D]-d.primaryGapsObj[D];y>0&&c.push({contextBase:Number(D),length:y})}else c.push({contextBase:Number(D),length:s[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(F=>F.contextSpan.start<m&&F.contextSpan.end>m)[0];if(I){const F=I.visiblePart.getTargetSequence(),k=v(F,m-I.contextSpan.start),L=I.visiblePart.sequenceInterval.start+k,G=I.record.targetSeq,P=I.record.querySeq;I.record.targetSeq=G.slice(0,L)+y+G.slice(L),I.record.querySeq=P.slice(0,L)+y+P.slice(L)}}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!==Va&&c--,c===0)break;return D}}alignFine(n,t,a,o,s,f){const{visRegion:h,visWidth:v}=s,d=new bi(h,v),c=qd,D=o.visRegion.getNavigationContext(),y=this._computeContextLocations(a,o),m=new Wd(D);m.setGaps(f);for(const P of y){const T=P.contextSpan,$=P.visiblePart,q=new Ye(m.convertOldCoordinates(T.start),m.convertOldCoordinates(T.end)),N=d.baseSpanToXSpan(q),C=$.getTargetSequence(),S=$.getQuerySequence();P.contextSpan=q,P.targetXSpan=N,P.queryXSpan=N,P.targetSegments=this._placeSequenceSegments(C,c,N.start,d),P.querySegments=this._placeSequenceSegments(S,c,N.start,d)}const I=[],F=new Ef(yf),k=new Ef(yf);for(let P=1;P<y.length;P++){const T=y[P-1],$=y[P],q=T.targetXSpan.end,N=$.targetXSpan.start,C=T.record.locus.chr,S=T.record.locus.end,O=T.record.queryLocus.chr,W=T.record.queryStrand,V=W==="+"?T.record.queryLocus.end:T.record.queryLocus.start,te=$.record.locus.chr,ie=$.record.locus.start,le=$.record.queryLocus.chr,Fe=$.record.queryStrand,ae=Fe==="+"?$.record.queryLocus.start:$.record.queryLocus.end;let pe;O===le?W==="+"&&Fe==="+"?(pe=ae>=V?"":"overlap ",pe+=Vi(Math.abs(ae-V))):W==="-"&&Fe==="-"?(pe=V>=ae?"":"overlap ",pe+=Vi(Math.abs(V-ae))):pe="reverse direction":pe="not connected";const _e=(q+N)/2,Xe=(T.queryXSpan.end+$.queryXSpan.start)/2,he=C===te?Vi(ie-S):"not connected",fe=.5*(he.length*5),Ee=_e-fe,ve=_e+fe,qe=Ee<=q||ve>=N,ot=qe?F.place(new Ye(Ee,ve)):new Ye(Ee,ve),me=new Ye(q,N),Ve=.5*(pe.length*5),ce=Xe-Ve,Me=Xe+Ve,Ke=ce<=T.queryXSpan.end||Me>=$.queryXSpan.start,we=Ke?k.place(new Ye(ce,Me)):new Ye(ce,Me),Ce=new Ye(T.queryXSpan.end,$.queryXSpan.start);I.push({targetGapText:he,targetXSpan:me,targetTextXSpan:ot,queryGapText:pe,queryXSpan:Ce,queryTextXSpan:we,shiftTarget:qe,shiftQuery:Ke})}const L=this._getQueryPieces(y),G=this._makeQueryGenomeRegion(L,v,d);return{id:n,isFineMode:!0,primaryVisData:s,queryRegion:G,drawData:y,drawGapText:I,primaryGenome:this.primaryGenome,queryGenome:t,basesPerPixel:d.xWidthToBases(1),navContextBuilder:m}}alignRough(n,t,a,o){const{visRegion:s,visWidth:f}=o,h=new bi(s,f),v=h.xWidthToBases(Wb),c=a.reduce((F,k)=>F+(k.getIsReverseStrandQuery()?-1*k.getLength():k.getLength()),0)<0?"-":"+",D=this._computeContextLocations(a,o);let y=it.mergeAdvanced(D,v,F=>F.visiblePart.getQueryLocus());y=y.sort((F,k)=>k.locus.getLength()-F.locus.getLength());const m=new Ef(yf),I=[];for(const F of y){const k=F.locus,L=F.sources,G=h.basesToXWidth(k.getLength()),P=.5*G;if(G<qb)continue;const T=Zb(L.map(ie=>ie.targetXSpan)),$=Math.min(...L.map(ie=>ie.targetXSpan.start)),q=Math.max(...L.map(ie=>ie.targetXSpan.end)),N=new Ye($,q),C=T-P,S=T+P,O=m.place(new Ye(C,S)),W=L.map(ie=>ie.record.queryLocus),V=c==="-",te=this._placeInternalLoci(k,W,O,V,h);for(let ie=0;ie<W.length;ie++)L[ie].queryXSpan=te[ie];I.push({queryFeature:new Yn(void 0,k,c),targetXSpan:N,queryXSpan:O,segments:L})}return{id:n,isFineMode:!1,primaryVisData:o,queryRegion:this._makeQueryGenomeRegion(I,f,h),drawData:I,plotStrand:c,primaryGenome:this.primaryGenome,queryGenome:t,basesPerPixel:h.xWidthToBases(1)}}_computeContextLocations(n,t){const{visRegion:a,visWidth:o}=t;return Gb.placeFeatures(n,a,o).map(s=>({record:s.feature,visiblePart:xf.fromFeatureSegment(s.visiblePart),contextSpan:s.contextLocation,targetXSpan:s.xSpan,queryXSpan:null}))}_getPrimaryGenomeGaps(n,t){const a=[];for(const o of n){const{visiblePart:s,contextSpan:f}=o,h=Ud(s.getTargetSequence(),t,!0),v=Df(s.getTargetSequence(),f.start);for(const d of h)a.push({contextBase:v[d.index],length:d.length})}return a}_placeSequenceSegments(n,t,a,o){const s=Ud(n,t);s.sort((h,v)=>h.index-v.index);let f=a;for(const h of s){const v=h.isGap?h.length:es(n.substr(h.index,h.length)),d=o.basesToXWidth(v);h.xSpan=new Ye(f,f+d),f+=d}return s}_getQueryPieces(n){const t=[];for(const a of n){const{record:o,visiblePart:s}=a,f=o.getIsReverseStrandQuery(),h=s.getQuerySequence();let v;f?v=Df(h,s.getQueryLocusFine().end,!0):v=Df(h,s.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 F=v[y],k=es(h.substr(y,m));let L;f?L=new it(d,F-k,F):L=new it(d,F,F+k),t.push({queryFeature:new Yn(void 0,L,o.queryStrand),queryXSpan:I})}}return t}_makeQueryGenomeRegion(n,t,a){const o=n.slice().sort((d,c)=>d.queryXSpan.start-c.queryXSpan.start),s=[];let f=0,h=new it("",-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 F=Xb(y,h)?`${Vi(I)} gap`:void 0;s.push(Hn.makeGap(I,F))}s.push(D),f=c.end,h=y}const v=Math.round(a.xWidthToBases(t-f));return v>0&&s.push(Hn.makeGap(v)),new Ii(new Hn("",s))}_placeInternalLoci(n,t,a,o,s){const f=[];if(o)for(const h of t){const v=h.start-n.start,d=s.basesToXWidth(v),c=a.end-d,D=s.basesToXWidth(h.getLength()),y=c<a.end?c:a.end,m=c-D>a.start?c-D:a.start;f.push(new Ye(m,y))}else for(const h of t){const v=h.start-n.start,d=s.basesToXWidth(v),c=a.start+d,D=s.basesToXWidth(h.getLength()),y=c>a.start?c:a.start,m=c+D<a.end?c+D:a.end;f.push(new Ye(y,m))}return f}}class Ef{constructor(n=0){ge(this,"leftExtent");ge(this,"rightExtent");ge(this,"margin");ge(this,"_placements");this.leftExtent=1/0,this.rightExtent=-1/0,this.margin=n,this._placements=[]}place(n){let t=n;if(this._placements.some(a=>a.getOverlap(n)!=null)){const a=.5*(n.start+n.end);t=Math.abs(a-this.leftExtent)<Math.abs(a-this.rightExtent)?new Ye(this.leftExtent-n.getLength(),this.leftExtent):new Ye(this.rightExtent,this.rightExtent+n.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 Zb(e){const n=on.sumBy(e,a=>.5*a.getLength()*(a.start+a.end)),t=on.sumBy(e,a=>a.getLength());return n/t}function Xb(e,n){return e.chr!==n.chr?!1:e.end===n.start||n.end===e.start}async function Vb(e){const n=e.regionExpandLoci,t=e.trackToFetch,a=e.genomicLoci,o={},s={},f={},h=e.useFineModeNav,v=e.primaryGenName,d=e.initGenomicLoci;f[`${v}`]={genomicLoci:a,regionExpandLoci:n,initGenomicLoci:d};const c=t,D=[n];c.length>0&&await y(e.visData.visRegion,c);async function y(I,F){let k=[];for(let O of e.visData.visRegion._navContext._features){let W=new it(O.locus.chr,O.locus.start,O.locus.end);k.push(new Yn(O.name,W))}let L=new Hn(e.visData.visRegion._navContext._name,k),G=new Ii(L,I._startBase,I._endBase),P=[];for(let O of e.visData.viewWindowRegion._navContext._features){let W=new it(O.locus.chr,O.locus.start,O.locus.end);P.push(new Yn(O.name,W))}let T=new Hn(e.visData.viewWindowRegion._navContext._name,P),$=new Ii(T,e.visData.viewWindowRegion._startBase,e.visData.viewWindowRegion._endBase),q={visWidth:e.visData.visWidth,visRegion:G,viewWindow:new Ye(e.windowWidth,e.windowWidth*2),viewWindowRegion:$};await Promise.all(F.map(async(O,W)=>{let V;await Promise.all(D.map(async(te,ie)=>{try{const le=await bb.genomealign({nav:te,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:O.url,trackModel:O});let Fe=[];for(const ae of le){let pe=kb.parse("{"+ae[3]+"}");ae[3]=pe,Fe.push(new Dp(ae))}V=Fe,s[`${O.id}`]=""}catch{V={error:`Error fetching genome align track with id ${O.id}`}}})),o[`${O.id}`]={name:O.name,records:V,query:O.querygenome,id:O.id,trackModel:O,metadata:O.metadata,isBigChain:!1}}));let N=[];for(const O in o)"error"in o[O].records||N.push(o[O]);let S=new Hb(e.primaryGenName).multiAlign(q,N);for(let O in S){let W;if(!h){W=[].concat.apply([],S[`${O}`].drawData.map(se=>se.segments));const ie=W.map(se=>se.record.queryStrand),le=W.map(se=>se.targetXSpan),Fe=W.map(se=>se.queryXSpan),ae=W.map(se=>se.visiblePart.getLocus().toString()),pe=W.map(se=>se.visiblePart.getQueryLocus().toString()),_e=W.map(se=>Vi(se.visiblePart.getLength())),Xe=W.map(se=>Vi(se.visiblePart.getQueryLocus().getLength()));let he={};he={strandList:ie,targetXSpanList:le,queryXSpanList:Fe,targetLocusList:ae,queryLocusList:pe,lengthList:_e,queryLengthList:Xe},S[`${O}`]={...S[`${O}`],...he}}for(let ie=0;ie<S[`${O}`].drawData.length;ie++){let le=S[`${O}`].drawData[ie],Fe={};const{targetXSpan:ae}=le;if(h){const pe=le.visiblePart.getTargetSequence(),_e=le.visiblePart.getQuerySequence(),Xe=ae.getLength()/pe.length,he=le.visiblePart.getLocus().toString(),se=le.visiblePart.getQueryLocus().toString(),fe=le.visiblePart.getQueryLocusFine(),Ee=le.targetSegments.filter(ot=>!ot.isGap),ve=le.querySegments.filter(ot=>!ot.isGap),qe=le.record.getIsReverseStrandQuery();Fe={targetSequence:pe,querySequence:_e,nonGapsQuery:ve,baseWidth:Xe,targetLocus:he,queryLocus:se,nonGapsTarget:Ee,isReverseStrandQuery:qe,queryLocusFine:fe}}else Fe={estimatedLabelWidth:le.queryFeature.toString().length};S[`${O}`].drawData[ie]={...le,...Fe}}let V=[],te=S[`${O}`].queryRegion._navContext._featuresForChr;for(let ie in te)if(ie!==""){let le=m(te[`${ie}`][0].name).start,Fe=m(te[`${ie}`][te[`${ie}`].length-1].name).end;V.push({chr:ie,start:le,end:Fe})}f[`${v}`].primaryVisData=S[`${O}`].primaryVisData,f[`${O}`]={queryGenomicCoord:new Array(V),id:S[`${O}`].id,queryRegion:S[`${O}`].queryRegion},o[`${S[`${O}`].id}`].records=S[`${O}`]}}function m(I){const[F,k]=I.split(":"),[L,G]=k.split("-"),P=F.slice(3),T=parseInt(L,10),$=parseInt(G,10);return{chr:P,start:T,end:$}}return{fetchResults:o,navData:{...e,genomicFetchCoord:f,trackToDrawId:s,regionSetStartBp:e.visData.visRegion._endBase-e.visData.visRegion._startBase===e.bpRegionSize?0:null}}}typeof self<"u"&&"postMessage"in self&&"onmessage"in self&&typeof self.importScripts<"u"&&(self.onmessage=async e=>{try{const n=await Vb(e.data);postMessage(n)}catch(n){console.error("Worker error:",n),postMessage({error:n instanceof Error?n.message:"Unknown error"})}})})();