igv 3.0.3 → 3.0.5

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.
@@ -27,7 +27,7 @@ function(e){var t,i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v="sizzle"+1*new Date,y=e.
27
27
  /**
28
28
  * Note: Some portions of this code adapated from the GMOD two-bit.js project, @Copyright (c) 2017 Robert Buels
29
29
  * * https://github.com/GMOD/twobit-js/blob/master/src/twoBitFile.ts*
30
- */const xc=["T","C","A","G"],kc=[];for(let xA=0;xA<256;xA++)kc.push(xc[xA>>6&3]+xc[xA>>4&3]+xc[xA>>2&3]+xc[3&xA]);const Ic=kc.map((e=>e.toLowerCase()));class Sc{littleEndian;metaIndex=new Map;constructor(e){this.url=e.twoBitURL||e.fastaURL,this.config=e,e.twoBitBptURL&&(this.bptURL=e.twoBitBptURL)}async init(){if(this.bptURL)this.index=await _c.loadBpTree(this.bptURL,this.config,0);else{const e=await this._readIndex();this.index={search:async t=>e.has(t)?{offset:e.get(t)}:void 0}}}async readSequence(e,t,i){this.index||await this.init();const n=await this.getSequenceRecord(e);if(!n)return null;if(t<0)throw new TypeError("regionStart cannot be less than 0");(void 0===i||i>n.dnaSize)&&(i=n.dnaSize);const r=this._getOverlappingBlocks(t,i,n.nBlocks),s=this._getOverlappingBlocks(t,i,n.maskBlocks),o=Math.floor(t/4),a=n.packedPos+o,c=Math.floor(i/4)-o+1,l=await Qs.loadArrayBuffer(this.url,{range:{start:a,size:c}}),h=new Uint8Array(l);let d="";for(let e=t;e<i;e+=1){for(;s.length&&s[0].end<=e;)s.shift();const t=s[0]&&s[0].start<=e&&s[0].end>e;if(r[0]&&e>=r[0].start&&e<r[0].end){const t=r.shift();for(;e<t.end&&e<i;)d+="N",e++;e--}else{const i=e%4,n=h[Math.floor(e/4)-o];d+=t?Ic[n][i]:kc[n][i]}}return d}async _readIndex(){const e=new Map;let t=await Qs.loadArrayBuffer(this.url,{range:{start:0,size:64}}),i=new DataView(t),n=0;const r=i.getUint32(n,!0),s=i.getUint32(n,!1);n+=4;const o=440477507;if(r===o)this.littleEndian=!0;else{if(s!==o)throw Error(`Bad magic number ${o}`);this.littleEndian=!1}let a,c;this.version=i.getUint32(n,this.littleEndian),n+=4,this.sequenceCount=i.getUint32(n,this.littleEndian),n+=4,this.reserved=i.getUint32(n,this.littleEndian),n+=4;let l=20;for(let t=0;t<this.sequenceCount;t++){(!c||c.available()<1)&&(a=(this.sequenceCount-t)*l,c=await this._loadBinaryBuffer(n,a));const i=c.getByte();n+=1,c.available()<i+5&&(a=(this.sequenceCount-t)*l+100,c=await this._loadBinaryBuffer(n,a));const r=c.getString(i),s=c.getUInt();n+=i+4,e.set(r,s),l=Math.floor(l*(t/(t+1))+r.length/(t+1))}return e}async getSequenceRecord(e){if(!this.metaIndex.has(e)){if(!this.index)throw Error("TwobitSequence object must be initialized before accessing sequence");let t=await this.index.search(e);if(!t)return;let i=t.offset,n=8,r=await this._loadBinaryBuffer(i,n);const s=r.getUInt(),o=r.getUInt();i+=n,n=8*o+4,r=await this._loadBinaryBuffer(i,n);const a=[];for(let e=0;e<o;e++)a.push(r.getUInt());const c=[];for(let e=0;e<o;e++)c.push(r.getUInt());const l=r.getUInt();i+=n,n=8*l+4,r=await this._loadBinaryBuffer(i,n);const h=[];for(let e=0;e<l;e++)h.push(r.getUInt());const d=[];for(let e=0;e<l;e++)d.push(r.getUInt());const u=[];for(let e=0;e<o;e++)u.push(new Ec(a[e],c[e]));const f=[];for(let e=0;e<l;e++)f.push(new Ec(h[e],d[e]));if(0!=r.getUInt())throw Error("Bad 2-bit file");i+=n;const p={dnaSize:s,nBlocks:u,maskBlocks:f,packedPos:i,bpLength:s};this.metaIndex.set(e,p)}return this.metaIndex.get(e)}_getOverlappingBlocks(e,t,i){const n=[];for(let r of i){if(r.start>t)break;r.end<e||n.push(r)}return n}async _loadBinaryBuffer(e,t){const i=await Qs.loadArrayBuffer(this.url,{range:{start:e,size:t}});return new Ac(new DataView(i),this.littleEndian)}}class Ec{constructor(e,t){this.start=e,this.size=t}get end(){return this.start+this.size}}class Nc{static#i=1e5;#n;#r=[];#s=10;constructor(e,t){this.sequenceReader=e,this.browser=t}get chromosomes(){return this.sequenceReader.chromosomes}async getSequenceRecord(e){return this.sequenceReader.getSequenceRecord(e)}async getSequence(e,t,i){let n=this.#r.find((n=>n.contains(e,t,i)));if(n||(n=await this.#o(e,t,i),this.#a(n),this.#r.push(n)),n){const e=t-n.start,r=i-t;return n.features?n.features.substring(e,e+r):null}}#a(e){this.#r=this.#r.filter((t=>!e.contains(t))),this.#r.length===this.#s&&this.#r.shift(),this.browser&&this.browser.referenceFrameList.length<100&&(this.#r=this.#r.filter((e=>void 0!==this.browser.referenceFrameList.find((t=>t.overlaps(e))))))}getSequenceInterval(e,t,i){return this.#r.find((n=>n.contains(e,t,i)))}async#o(e,t,i){let n=t,r=i;if(i-t<Nc.#i){const e=i-t,s=Math.round(t+e/2);n=Math.max(0,s-Nc.#i/2),r=n+Nc.#i}const s=new uc(e,n,r);if(this.#n&&this.#n[0].contains(e,t,i))return this.#n[1];{const t=new Promise((async(t,i)=>{s.features=await this.sequenceReader.readSequence(e,n,r),t(s)}));return this.#n=[s,t],t}}async init(){return this.sequenceReader.init()}get chromosomeNames(){return this.sequenceReader.chromosomeNames}getFirstChromosomeName(){return"function"==typeof this.sequenceReader.getFirstChromosomeName?this.sequenceReader.getFirstChromosomeName():void 0}#c(e){this.browser.referenceFrameList}}async function Bc(e,t){let i;return"chromsizes"===e.format?i=new yc(e.fastaURL||e.url):"2bit"===e.format||e.twoBitURL?i=new Nc(new Sc(e),t):$a(e.fastaURL)||!e.indexURL?i=new gc(e):"gbk"===e.format||e.gbkURL||(i=new Nc(new Fc(e),t)),await i.init(),i}const Mc={A:"rgb( 0, 200, 0)",C:"rgb( 0,0,200)",T:"rgb(255,0,0)",G:"rgb(209,113, 5)",N:"rgb(80,80,80)"};function Rc(e,t){if(e.length<6)return void console.log("Skipping line: "+e.join(" "));var i={chr1:e[0],start1:Number.parseInt(e[1]),end1:Number.parseInt(e[2]),chr2:e[3],start2:Number.parseInt(e[4]),end2:Number.parseInt(e[5])};if(isNaN(i.start1)||isNaN(i.end1)||isNaN(i.start2)||isNaN(i.end2))return;t&&void 0===t.hiccups&&(t.hiccups=!!t.columnNames&&Tc(t.columnNames));const n=t&&t.hiccups,r=n?6:10;if(n||(e.length>6&&"."!==e[6]&&(i.name=e[6]),e.length>7&&"."!==e[7]&&(i.score=Number(e[7])),e.length>8&&"."!==e[8]&&(i.strand1=e[8]),e.length>9&&"."!==e[9]&&(i.strand2=e[9])),t){const n=t.colorColumn;n&&n<e.length&&(i.color=_s.createColorString(e[n]));const s=t.thicknessColumn;s&&s<e.length&&(i.thickness=e[s]),e.length>r&&t.columnNames&&t.columnNames.length===e.length&&(i.extras=e.slice(r))}return i.chr1===i.chr2&&(i.chr=i.chr1,i.start=Math.min(i.start1,i.start2),i.end=Math.max(i.end1,i.end2)),i}function Dc(e,t){if(!(e.length<8))return{chr:e[0],start:Number.parseInt(e[1]),end:Number.parseInt(e[2]),color:_s.createColorString(e[6]),value:Number(e[7])}}function Tc(e){return e&&(e.includes("fdrDonut")||e.includes("fdr_donut"))}function Lc(e,t){if(!(e.length<6))return{chr:e[0],start:Number.parseInt(e[1]),end:Number.parseInt(e[2]),chr1:e[8],start1:Number.parseInt(e[9]),end1:Number.parseInt(e[10]),chr2:e[13],start2:Number.parseInt(e[14]),end2:Number.parseInt(e[15]),name:e[3],score:Number(e[4]),value:Number(e[5]),color:"."===e[7]?void 0:"0"===e[7]?"rgb(0,0,0)":e[7]};console.log("Skipping line: "+e.join(" "))}class zc{constructor(e){this.message=e}}const Hc=new Map([["%09","\t"],["%0A","\n"],["%0D","\r"],["%25","%"],["%3B",";"],["%3D","="],["%26","&"],["%2C",","]]);function Pc(e){if(!e.includes("%"))return e;let t="";for(let i=0;i<e.length;i++)if(37===e.charCodeAt(i)&&i<e.length-2){const n=e.substring(i,i+3);Hc.has(n)?t+=Hc.get(n):t+=n,i+=2}else t+=e.charAt(i);return t}function Oc(e,t="="){const i="="===t;var n=[];for(let r of e.split(";")){r=r.trim();const e=r.indexOf(t);if(e>0&&e<r.length-1){let t=Pc(r.substring(0,e).trim()),s=Pc(r.substring(e+1).trim());i||(t=Uc(t),s=Uc(s)),n.push([t,s])}}return n}function Uc(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),e}function qc(e,t,i=Number.MAX_SAFE_INTEGER){if(e.length<3)return;t&&t.gffTags;const n=e[0],r=parseInt(e[1]),s=e.length>2?parseInt(e[2]):r+1;if(isNaN(r)||isNaN(s))return new zc("Unparsable bed record.");const o=new nl({chr:n,start:r,end:s,score:1e3});let a=3;try{if(e.length>3&&a++<i){if(e[3].indexOf(";")>0&&e[3].indexOf("=")>0){const i=Oc(e[3],"=");o.attributes={};for(let e of i)o.attributes[e[0]]=e[1],null!=t.nameField&&e[0]===t.nameField&&(o.name=e[1])}o.name||(o.name="."===e[3]?"":e[3])}if(e.length>4&&a++<i&&(o.score="."===e[4]?0:Number(e[4]),isNaN(o.score)))return o;if(e.length>5&&a++<i&&(o.strand=e[5],"."!==o.strand&&"+"!==o.strand&&"-"!==o.strand))return o;if(e.length>6&&a++<i&&(o.cdStart=parseInt(e[6]),isNaN(o.cdStart)))return o;if(e.length>7&&a++<i&&(o.cdEnd=parseInt(e[7]),isNaN(o.cdEnd)))return o;if(e.length>8&&a++<i&&"."!==e[8]&&"0"!==e[8]&&(o.color=_s.createColorString(e[8])),e.length>11&&a++<i){const t=parseInt(e[9]);if(t>1e3)return o;const i=e[10].replace(/,$/,"").split(","),n=e[11].replace(/,$/,"").split(",");if(i.length!==n.length||t!==i.length)return o;const s=[];for(let e=0;e<t;e++){const t=r+parseInt(n[e]),o=t+parseInt(i[e]);s.push({start:t,end:o})}s.length>0&&(Xc(s,o.cdStart,o.cdEnd),o.exons=s)}if(t){let i=t.thicknessColumn,n=t.colorColumn;n&&n<e.length&&(o.color=_s.createColorString(e[n])),i&&i<e.length&&(o.thickness=e[i])}}catch(e){}return o}function Qc(e,t){const i=qc(e,t);return i&&e.length>14&&(i.signal=Number(e[12]),i.pValue=Number(e[13]),i.qValue=Number(e[14])),i}function Vc(e,t){const i=qc(e,t,9);if(i){const t=["Coverage","% Showing Methylation","N-mod","N-canonical","N-other mod","N-delete","N-fail","N-dff","N-nocall"];for(let n=9;n<e.length;n++){i[t[n-9]]=e[n]}}return i}function jc(e,t){if(e.length<=15)return;return{swScore:Number.parseInt(e[1]),milliDiv:Number.parseInt(e[2]),milliDel:Number.parseInt(e[3]),milliIns:Number.parseInt(e[4]),chr:e[5],start:Number.parseInt(e[6]),end:Number.parseInt(e[7]),strand:e[9],repName:e[10],repClass:e[11],repFamily:e[12],repStart:Number.parseInt(e[13]),repEnd:Number.parseInt(e[14]),repLeft:Number.parseInt(e[15])}}function Wc(e,t){var i=void 0===t.shift?0:1;if(e.length<=9+i)return;const n=parseInt(e[5+i]),r=parseInt(e[6+i]);var s={name:e[0+i],chr:e[1+i],strand:e[2+i],start:parseInt(e[3+i]),end:parseInt(e[4+i]),cdStart:n,cdEnd:r,id:e[0+i]};const o=Yc(parseInt(e[7+i]),e[8+i],e[9+i]);return Xc(o,n,r),s.exons=o,s}function Gc(e,t){var i=void 0===t.shift?0:1;if(e.length<=11+i)return;const n=parseInt(e[5+i]),r=parseInt(e[6+i]),s={name:e[11+i],chr:e[1+i],strand:e[2+i],start:parseInt(e[3+i]),end:parseInt(e[4+i]),cdStart:n,cdEnd:r,id:e[0+i]},o=Yc(parseInt(e[7+i]),e[8+i],e[9+i],e[14+i]);return Xc(o,n,r),s.exons=o,s}function $c(e,t){var i=void 0===t.shift?0:1;if(e.length<=10+i)return;const n=parseInt(e[6+i]),r=parseInt(e[7+i]);var s={name:e[0+i],id:e[1+i],chr:e[2+i],strand:e[3+i],start:parseInt(e[4+i]),end:parseInt(e[5+i]),cdStart:n,cdEnd:r};const o=Yc(parseInt(e[8+i]),e[9+i],e[10+i]);return Xc(o,n,r),s.exons=o,s}function Kc(e,t){if(e.length<21)return;const i=e[13],n=parseInt(e[15]),r=parseInt(e[16]),s=e[8].charAt(0),o=parseInt(e[17]),a=[],c=e[20].replace(/,$/,"").split(","),l=e[18].replace(/,$/,"").split(",");for(let e=0;e<o;e++){const t=parseInt(c[e]),i=t+parseInt(l[e]);a.push({start:t,end:i})}return new rl({chr:i,start:n,end:r,strand:s,exons:a,tokens:e})}function Yc(e,t,i,n){const r=t.replace(/,$/,"").split(","),s=i.replace(/,$/,"").split(","),o=n?n.replace(/,$/,"").split(","):void 0,a=[];for(let t=0;t<e;t++){const e={start:parseInt(r[t]),end:parseInt(s[t])};if(o){const i=parseInt(o[t]);-1!=i&&(e.readingFrame=i)}a.push(e)}return a}function Xc(e,t,i){for(let n of e){const e=n.end,r=n.start;e<t||r>i?n.utr=!0:(t>=r&&t<=e&&(n.cdStart=t),i>=r&&i<=e&&(n.cdEnd=i))}}function Zc(e,t){var i,n,r,s,o,a,c;if(!(e.length<9))return i=e[0],n=parseInt(e[1]),r=parseInt(e[2]),o=e[3],a=Number(e[4]),s=e[5].trim(),c=Number(e[6]),0===a&&(a=c),{chr:i,start:n,end:r,name:o,score:a,strand:s,signal:c,pValue:Number(e[7]),qValue:Number(e[8])}}function Jc(e,t){const i=Zc(e);return e.length>9&&(i.peak=Number(e[9])),i}function el(e,t){if(e.length<=3)return;const i={chr:e[0],start:parseInt(e[1]),end:parseInt(e[2]),value:Number(e[3])};if(t){let n=t.colorColumn;n&&n<e.length&&(i.color=_s.createColorString(e[n]))}return i}function tl(e,t){const i=t.wig;if(i&&"fixedStep"===i.format){const t=i.index*i.step+i.start,n=t+i.span,r=Number(e[0]);return++i.index,isNaN(r)?null:{chr:i.chrom,start:t,end:n,value:r}}if(i&&"variableStep"===i.format){if(e.length<2)return null;const t=parseInt(e[0],10)-1,n=t+i.span,r=Number(e[1]);return isNaN(r)?null:{chr:i.chrom,start:t,end:n,value:r}}return el(e)}function il(e,t){if(e.length<6)return;const i=["bin","chr","start","end","name","score","strand","refNCBI","refUCSC","observed","molType","class","valid","avHet","avHetSE","func","locType","weight","exceptions","submitterCount","submitters","alleleFreqCount","alleles","alleleNs","alleleFreqs","bitfields"],n={chr:e[1],start:Number.parseInt(e[2]),end:Number.parseInt(e[3]),name:e[4],score:Number.parseInt(e[5])},r=Math.min(e.length,i.length);for(let t=6;t<r;t++)n[i[t]]=e[t];return n}class nl{constructor(e){Object.assign(this,e)}getAttributeValue(e){return this.hasOwnProperty(e)?this[e]:this.attributes?this.attributes[e]:void 0}}class rl{constructor(e){Object.assign(this,e)}get score(){const e=this.tokens,t=parseInt(e[0]),i=parseInt(e[2]),n=parseInt(e[1]),r=parseInt(e[4]),s=parseInt(e[6]),o=parseInt(e[10]);return Math.floor(1e3*(t+i-n-r-s)/o)}get matches(){return this.tokens[0]}get misMatches(){return this.tokens[1]}get repMatches(){return this.tokens[2]}get nCount(){return this.tokens[3]}get qNumInsert(){return this.tokens[4]}get qBaseInsert(){return this.tokens[5]}get tNumInsert(){return this.tokens[6]}get tBaseInsert(){return this.tokens[7]}popupData(){return[{name:"chr",value:this.chr},{name:"start",value:this.start+1},{name:"end",value:this.end},{name:"strand",value:this.strand},{name:"score",value:this.score},{name:"match",value:this.matches},{name:"mis-match",value:this.misMatches},{name:"rep. match",value:this.repMatches},{name:"N's",value:this.nCount},{name:"Q gap count",value:this.qNumInsert},{name:"Q gap bases",value:this.qBaseInsert},{name:"T gap count",value:this.tNumInsert},{name:"T gap bases",value:this.tBaseInsert}]}}const sl=new Set(["transcript","primary_transcript","processed_transcript","mRNA","mrna","lnc_RNA","miRNA","ncRNA","rRNA","scRNA","snRNA","snoRNA","tRNA"]),ol=new Set(["CDS","cds"]),al=new Set(["start_codon","stop_codon"]),cl=new Set(["5UTR","3UTR","UTR","five_prime_UTR","three_prime_UTR","3'-UTR","5'-UTR"]),ll=new Set(["exon","coding-exon"]),hl=new Set;for(let kA of[ol,al,cl,ll])for(let IA of kA)hl.add(IA);function dl(e){return e.includes("intron")}function ul(e){return ol.has(e)||al.has(e)}function fl(e){return cl.has(e)}function pl(e){return sl.has(e)||e.endsWith("RNA")||e.endsWith("transcript")}function gl(e){return hl.has(e)||e.endsWith("RNA")||dl(e)}const ml=new Set(["id","parent","name"]);class wl{constructor(e){Object.assign(this,e),void 0!==e.phase&&"."!==e.phase&&(this.readingFrame=(3-parseInt(e.phase))%3)}popupData(e){const t=this.geneObject?this.geneObject.popupData():[];if(this.geneObject&&t.push("<hr/>"),this.name&&t.push({name:"Name",value:this.name}),t.push({name:"Type",value:this.type}),t.push({name:"Source",value:this.source}),void 0!==this.score&&t.push({name:"Score",value:this.score}),t.push({name:"Phase",value:this.phase}),this.attributeString){const e=Oc(this.attributeString,this.delim);for(let[i,n]of e)void 0!==n&&n.length>0&&!ml.has(i.toLowerCase())&&t.push({name:i+":",value:n})}return t.push({name:"Location",value:`${this.chr}:${Rt(this.start+1)}-${Rt(this.end)}`}),t}getAttributeValue(e){if(this.hasOwnProperty(e))return this[e];if(this._attributeCache||(this._attributeCache=new Map),this._attributeCache.has(e))return this._attributeCache.get(e);{const t=Oc(this.attributeString,this.delim);let i;for(let[n,r]of t)if(n===e){i=r;break}return this._attributeCache.set(e,i),i}}}class bl extends wl{constructor(e){super(e),this.exons=[],this.parts=[]}addExon(e){this.exons.push(e),this.start=Math.min(this.start,e.start),this.end=Math.max(this.end,e.end)}addPart(e){this.parts.push(e)}assembleParts(){if(0===this.parts.length)return;this.parts.sort((function(e,t){return e.start-t.start}));let e=this.parts[0].start,t=this.parts[0].end;for(let i=1;i<this.parts.length;i++){const n=this.parts[i];if(!dl(n.type))if(n.start<=t)t=Math.max(t,n.end);else{this.findExonContaining({start:e,end:t})||this.exons.push({start:e,end:t,psuedo:!0}),e=n.start,t=n.end}}this.findExonContaining({start:e,end:t})||(this.exons.push({start:e,end:t,psuedo:!0}),this.start=Math.min(this.start,e),this.end=Math.max(this.end,t));for(let e of this.parts){const t=e.type;ul(t)?this.addCDS(e):fl(t)&&this.addUTR(e)}}findExonContaining({start:e,end:t}){for(let i of this.exons)if(i.end>=t&&i.start<=e)return i}addCDS(e){let t;const i=this.exons;for(let n of i)if(n.start<=e.start&&n.end>=e.end){t=n;break}t?(t.cdStart=t.cdStart?Math.min(e.start,t.cdStart):e.start,t.cdEnd=t.cdEnd?Math.max(e.end,t.cdEnd):e.end,t.readingFrame=e.readingFrame):console.error("No exon found spanning "+e.start+"-"+e.end),this.cdStart=this.cdStart?Math.min(e.start,this.cdStart):e.start,this.cdEnd=this.cdEnd?Math.max(e.end,this.cdEnd):e.end}addUTR(e){let t;const i=this.exons;for(let n=0;n<i.length;n++)if(i[n].start<=e.start&&i[n].end>=e.end){t=i[n];break}t?e.start===t.start&&e.end===t.end?t.utr=!0:(e.end<t.end&&(t.cdStart=e.end),e.start>t.start&&(t.cdEnd=e.start)):console.error("No exon found spanning "+cds.start+"-"+cds.end)}finish(){this.assembleParts();var e=this.cdStart,t=this.cdEnd;this.exons.sort((function(e,t){return e.start-t.start})),e&&this.exons.forEach((function(i){(i.end<e||i.start>t)&&(i.utr=!0)}))}popupData(e){const t=super.popupData(e);for(let i of this.exons)if(!i.pseudo&&e>=i.start&&e<i.end&&"function"==typeof i.popupData){t.push("<hr/>");const n=i.popupData(e);for(let e of n)t.push(e)}for(let i of this.parts)if(e>=i.start&&e<i.end&&"function"==typeof i.popupData){t.push("<hr/>");const n=i.popupData(e);for(let e of n)t.push(e)}return t}}function Fl(e,t){const i=t.format;if(e.length<9)return;const n="gff3"===i?"=":" ";return new wl({source:Pc(e[1]),type:e[2],chr:e[0],start:parseInt(e[3])-1,end:parseInt(e[4]),score:"."===e[5]?void 0:Number(e[5]),strand:e[6],phase:"."===e[7]?".":parseInt(e[7]),attributeString:e[8],delim:n})}function vl(e,t){const i=Fl(e,t);if(!i)return;const n=Oc(i.attributeString,i.delim);for(let[e,t]of n){const n=e.toLowerCase();"color"===n||"colour"===n?i.color=_s.createColorString(t):"ID"===e?i.id=t:"Parent"===e&&(i.parent=t)}return i}function yl(e,t){const i=Fl(e,t);if(!i)return;const n=Oc(i.attributeString,i.delim);let r,s;switch(i.type){case"gene":r="gene_id";break;case"transcript":r="transcript_id",s="gene_id";break;default:s="transcript_id"}for(let[e,t]of n){const n=e.toLowerCase();"color"===n||"colour"===n?i.color=_s.createColorString(t):e===r?i.id=t:e===s&&(i.parent=t)}return i}function Al(e,t){if(!(e.length<7)){var i=e[0],n=e[1],r=parseInt(e[2]),s=parseInt(e[3]),o=parseInt(e[4]),a=parseInt(e[5]),c=e[6],l={chr:i,name:n,junction_left:r,junction_right:s,num_junction_reads:o,num_spanning_frags:a,spanning_frag_coords:[],start:-1,end:-1},h=r,d=s;if(a>0)for(var u=c.split(","),f=0;f<u.length;f++){var p=u[f].split("-"),g=p[0],m=p[1];g<h&&(h=g),m>d&&(d=m),l.spanning_frag_coords.push({left:g,right:m})}return l.start=h,l.end=d,l}}function Cl(e,t){if(e.length<7)return null;const i={chr:e[0],start:parseInt(e[1])-1,end:parseInt(e[2]),"Strongest SNP-risk allele":e[3],"Disease/Phenotype":e[4],"P-value":e[5],"Odds ratio or beta":e[6]};return e.length>6&&(i.PUBMEDID=`<a target = "blank" href = "https://www.ncbi.nlm.nih.gov/pubmed/${e[7]}">${e[7]}</a>`),i}function _l(e,t){const i=t.customFormat;if(e.length<i.fields.length)return;const n=i.coords||0,r=e[i.chr],s=parseInt(e[i.start])-n,o={chr:r,start:s,end:void 0!==i.end?parseInt(e[i.end]):s+1};return i.fields&&i.fields.forEach((function(t,n){n!==i.chr&&n!==i.start&&n!==i.end&&(o[t]=e[n])})),o}function xl(e,t){const i=t.columnNames;if(!i)throw Error("Sample names are not defined. Missing column headers?");const n=i.length-3,r=e[0],s=parseInt(e[1]),o=parseInt(e[2]),a=e.slice(3).map(Number);return a.length==n?{chr:r,start:s,end:o,values:a}:void console.warn(`${r}:${s}-${o} row contains ${a.length} sample columns instead of the expected ${n} columns. Skipping...`)}const kl=["Name","transcript_id","gene_name","gene","gene_id","alias","locus","name"];class Il{constructor(e){this.format=e.format,this.nameField=e.nameField,this.filterTypes=void 0===e.filterTypes?new Set(["chromosome"]):new Set(e.filterTypes)}combineFeatures(e,t){let i;const n=this.filterTypes;if(e=e.filter((e=>void 0===n||!n.has(e.type))),"gff3"===this.format){const t=this.combineFeaturesById(e);i=this.combineFeaturesByType(t)}else i=this.combineFeaturesByType(e);return i.sort((function(e,t){return e.start-t.start})),this.numberExons(i,t),this.nameFeatures(i),i}combineFeaturesById(e){const t=new Map,i=[];for(let n of e)if(gl(n.type)||pl(n.type)||!n.id)i.push(n);else{let e=t.get(n.chr);e||(e=new Map,t.set(n.chr,e));let i=e.get(n.id);i?i.push(n):e.set(n.id,[n])}for(let e of t.values())for(let t of e.values())if(t.length>1){const e=t[0];e.exons=[];for(let i of t)e.start=Math.min(e.start,i.start),e.end=Math.max(e.end,i.end),e.exons.push({start:i.start,end:i.end});i.push(e)}else i.push(t[0]);return i}combineFeaturesByType(e){const t=e.filter((e=>"gene"===e.type||e.type.endsWith("_gene"))),i=Object.create(null);for(let e of t)i[e.id]=e;const n=Object.create(null),r=[],s=new Set,o=this.filterTypes;e=e.filter((e=>void 0===o||!o.has(e.type)));for(let t of e)if(pl(t.type)){const e=t.id;if(void 0!==e){const o=new bl(t);n[e]=o,r.push(o),s.add(t);const a=i[t.parent];a&&(o.geneObject=a,s.add(a))}}for(let t of e)if(gl(t.type)){const e=l(t);if(e)for(let i of e){let o=n[i];if(!o&&"gtf"===this.format){const e=Object.assign({},t);e.type="transcript",o=new bl(e),n[i]=o,r.push(o)}if(void 0!==o){if(a=t.type,ll.has(a))if(e.length>1){const e=new wl(t);o.addExon(e)}else o.addExon(t);else o.addPart(t);s.add(t)}}}var a;r.forEach((function(e){"function"==typeof e.finish&&e.finish()}));const c=e.filter((e=>!s.has(e)));for(let e of c)r.push(e);return r;function l(e){return e.parent&&""!==e.parent.trim()?e.parent.trim().split(","):null}}numberExons(e,t){for(let i of e)if(i.exons&&(!t||i.end<=t.end&&i.start>t.start))for(let e=0;e<i.exons.length;e++){i.exons[e].number="-"===i.strand?i.exons.length-e:e+1}}nameFeatures(e){for(let t of e)if("function"==typeof t.getAttributeValue)if(this.nameField)t.name=t.getAttributeValue(this.nameField);else for(let e of kl){const i=t.getAttributeValue(e);if(i){t.name=i;break}}}}const Sl={gwascatalog:{fields:["bin","chr","start","end","name","pubMedID","author","pubDate","journal","title","trait","initSample","replSample","region","genes","riskAllele","riskAlFreq","pValue","pValueDesc","orOrBeta","ci95","platform","cnv"]},wgrna:{fields:["bin","chr","start","end","name","score","strand","thickStart","thickEnd","type"]},cpgislandext:{fields:["bin","chr","start","end","name","length","cpgNum","gcNum","perCpg","perGc","obsExp"]},clinVarMain:{fields:["chr1","start","end","name","score","strand","thickStart","thickEnd","reserved","blockCount","blockSizes","chromStarts","origName","clinSign","reviewStatus","type","geneId","snpId","nsvId","rcvAcc","testedInGtr","phenotypeList","phenotype","origin","assembly","cytogenetic","hgvsCod","hgvsProt","numSubmit","lastEval","guidelines","otherIds"]}};class El{constructor(e){this.config=e,this.header={},e.nameField&&(this.header.nameField=e.nameField),this.skipRows=0,e.decode?(this.decode=e.decode,this.delimiter=e.delimiter||"\t"):e.format&&(this.header.format=e.format.toLowerCase(),this.setDecoder(this.header.format)),this.delimiter||(this.delimiter="\t")}async parseHeader(e){let t,i,n=this.header;for(;void 0!==(i=await e.nextLine());)if(i.startsWith("track")||i.startsWith("#track")){let e=Nl(i);Object.assign(n,e)}else if(i.startsWith("browser"));else if(i.startsWith("#columns")){let e=Bl(i);Object.assign(n,e)}else if(i.startsWith("##gff-version 3"))n.format="gff3";else if(i.startsWith("#gffTags"))n.gffTags=!0;else{if(i.startsWith("fixedStep")||i.startsWith("variableStep"))break;if(i.startsWith("#")){const e=i.split(this.delimiter||"\t");e.length>1&&(t=e)}else{this.setDecoder(n.format);const e=i.split(this.delimiter||"\t");try{const i=Object.assign({columnNames:t},n);if(this.decode(e,i))break;e.length>1&&(t=e)}catch(i){e.length>1&&(t=e)}}}if(t){n.columnNames=t;for(let e=0;e<t.length;e++)"color"===t[e]||"colour"===t[e]?n.colorColumn=e:"thickness"===t[e]&&(n.thicknessColumn=e)}return this.header=n,n}async parseFeatures(e){const t=[],i=this.decode,n=this.header.format,r=this.delimiter||"\t";let s,o=0,a=0;for(;void 0!==(s=await e.nextLine());){if(o++,o<=this.skipRows)continue;if(!s||s.startsWith("track")||s.startsWith("#")||s.startsWith("browser"))continue;if("wig"===n&&s.startsWith("fixedStep")){this.header.wig=Ml(s);continue}if("wig"===n&&s.startsWith("variableStep")){this.header.wig=Rl(s);continue}const e=s.split(r);if(e.length<1)continue;const c=i(e,this.header);c instanceof zc?(a++,a>0&&console.error(`Error parsing line '${s}': ${c.message}`)):c&&t.push(c)}return i===Rc&&function(e){if(0==e.length)return;const t=e[0];if(void 0===t.score&&void 0!==t.name){for(let t of e)if(!ja(t.name)&&"."!==t.name)return;for(let t of e)t.score=Number(t.name),delete t.name}const i=e.filter((e=>e.chr1!==e.chr2));for(let t of i){const i=Object.assign({},t);i.dup=!0,e.push(i),t.chr=t.chr1,t.start=t.start1,t.end=t.end1,i.chr=i.chr2,i.start=i.start2,i.end=i.end2}}(t),"gtf"!==this.config.format&&"gff3"!==this.config.format&&"gff"!==this.config.format||!1===this.config.assembleGFF?t:new Il(this.config).combineFeatures(t)}setDecoder(e){switch(e){case"broadpeak":case"regionpeak":case"peaks":this.decode=Zc,this.delimiter=this.config.delimiter||/\s+/;break;case"narrowpeak":this.decode=Jc,this.delimiter=this.config.delimiter||/\s+/;break;case"bedgraph":this.decode=el,this.delimiter=/\s+/;break;case"wig":this.decode=tl,this.delimiter=this.config.delimiter||/\s+/;break;case"gff3":case"gff":this.decode=vl,this.delimiter="\t";break;case"gtf":this.decode=yl,this.delimiter="\t";break;case"fusionjuncspan":this.decode=Al,this.delimiter=this.config.delimiter||/\s+/;break;case"gtexgwas":this.skipRows=1,this.decode=Cl,this.delimiter="\t";break;case"refflat":this.decode=$c,this.delimiter=this.config.delimiter||/\s+/;break;case"genepred":this.decode=Wc,this.delimiter=this.config.delimiter||/\s+/;break;case"genepredext":this.decode=Gc,this.delimiter=this.config.delimiter||/\s+/;break;case"ensgene":this.decode=Wc,this.header.shift=1,this.delimiter=this.config.delimiter||/\s+/;break;case"refgene":this.decode=Gc,this.delimiter=this.config.delimiter||/\s+/,this.header.shift=1;break;case"bed":this.decode=qc,this.delimiter=this.config.delimiter||/\s+/;break;case"gappedpeak":this.decode=Qc,this.delimiter=this.config.delimiter||/\s+/;break;case"bedmethyl":this.decode=Vc,this.delimiter=this.config.delimiter||/\s+/;break;case"bedpe":case"hiccups":this.decode=Rc,this.delimiter=this.config.delimiter||"\t";break;case"bedpe-domain":this.decode=Dc,this.headerLine=!0,this.delimiter=this.config.delimiter||"\t";break;case"bedpe-loop":this.decode=Rc,this.delimiter=this.config.delimiter||"\t",this.header={colorColumn:7};break;case"interact":this.decode=Lc,this.delimiter=this.config.delimiter||/\s+/;break;case"snp":this.decode=il,this.delimiter="\t";break;case"rmsk":this.decode=jc,this.delimiter="\t";break;case"gcnv":this.decode=xl,this.delimiter="\t";break;default:const t=function(e){return Sl&&Sl[e]?function(e){const t=e.fields,i=["chr","start","end"];for(let n=0;n<t.length;n++)for(let r of i)r===t[n]&&(e[r]=n);return e}(Sl[e]):void 0}(e);void 0!==t?(this.decode=_l,this.header.customFormat=t,this.delimiter=t.delimiter||"\t"):(this.decode=qc,this.delimiter=this.config.delimiter||/\s+/)}}}function Nl(e){const t={},i=e.split(/(?:")([^"]+)(?:")|([^\s"]+)(?=\s+|$)/g);let n;const r=[];for(let e of i)e&&0!==e.trim().length&&(e.endsWith("=")?n=e:n?(r.push(n+e),n=void 0):r.push(e));for(let e of r){if(!e)return;var s=e.split("=",2);if(2===s.length){const e=s[0].trim(),i=s[1].trim();if(t.hasOwnProperty(e)){let n=t[e];Array.isArray(n)?n.push(i):t[e]=[n,i]}else t[e]=i}}return"interact"==t.type?t.format="interact":"gcnv"===t.type&&(t.format="gcnv"),t}function Bl(e){let t={},i=e.split(/\s+/);if(2===i.length){i[1].split(";").forEach((function(e){let i=e.split("=");"color"===i[0]?t.colorColumn=Number.parseInt(i[1])-1:"thickness"===i[0]&&(t.thicknessColumn=Number.parseInt(i[1])-1)}))}return t}function Ml(e){const t=e.split(/\s+/);return{format:"fixedStep",chrom:t[1].split("=")[1],start:parseInt(t[2].split("=")[1],10)-1,step:parseInt(t[3].split("=")[1],10),span:t.length>4?parseInt(t[4].split("=")[1],10):1,index:0}}function Rl(e){const t=e.split(/\s+/);return{format:"variableStep",chrom:t[1].split("=")[1],span:t.length>2?parseInt(t[2].split("=")[1],10):1}}function Dl(t,i){const n=e({class:"igv-menu-popup-check-container"}),r=e();n.appendChild(r);const s=l("check",!0===i?"#444":"transparent");r.appendChild(s);const o=e();return o.innerText=t,n.appendChild(o),n}function Tl(e,t){t=t||Number.MAX_SAFE_INTEGER;const i=[];e.sort((function(e,t){return e.start-t.start})),i.push(-1e3);for(let n of e){let e=0;const r=Math.min(i.length,t);for(e=0;e<r;e++)if(n.start>=i[e]){n.row=e,i[e]=n.end;break}n.row=e,i[e]=n.end}}async function Ll(e,t,i){const n=e=>{const i=Object.assign({},e);return i.chr="all",i.start=t.getGenomeCoordinate(e.chr,e.start),i.end=t.getGenomeCoordinate(e.chr,e.end),i._f=e,i.exons&&delete i.exons,i},r=new Set(t.wgChromosomeNames),s=[];let o=0;for(let a of t.wgChromosomeNames){if(Array.isArray(e)){const i={};for(let n of e){const e=t.getChromosomeName(n.chr);i.hasOwnProperty(e)||(i[e]=[]),i[e].push(n)}e=i}const c=e[a];if(c){const e=i||1e4;for(let i of c){let a=t.getChromosomeName(i.chr);if(r.has(a))if(s.length<e)s.push(n(i));else{const t=e/(o+1);if(Math.random()<t){s[Math.floor(Math.random()*(e-1))]=n(i)}}o++}}}return s.sort((function(e,t){return e.start-t.start})),s}function zl(e,t){if(t=t||1e3,null==e||0===e.length)return;const i={},n=[];for(let t of e){const e=t.chr;let r=i[e];r||(r=[],i[e]=r,n.push(e)),r.push(t)}for(let e of n)Tl(i[e],t)}class Hl{static defaults={height:50,autoHeight:!1,visibilityWindow:void 0,color:void 0,altColor:void 0,supportHiDPI:!0,selected:!1};constructor(e,t){this.browser=t,this.init(e)}init(e){this.config=e,e.displayMode&&(e.displayMode=e.displayMode.toUpperCase());const t=Object.assign({},Hl.defaults);if(this.constructor.defaults)for(let e of Object.keys(this.constructor.defaults))t[e]=this.constructor.defaults[e];for(let n of Object.keys(t))this[n]=e.hasOwnProperty(n)?e[n]:t[n],"color"!==n&&"altColor"!==n||!this[n]||(this[n]=Mt(i=this[n])&&i.indexOf(",")>0&&!i.startsWith("rgb(")&&!i.startsWith("rgba(")?`rgb(${i})`:i);var i;e.name||e.label?this.name=e.name||e.label:Ht(e.url)?this.name=e.url.name:Mt(e.url)&&!e.url.startsWith("data:")&&(this.name=zt(e.url)),this.url=e.url,this.config.type&&(this.type=this.config.type),this.id=void 0===this.config.id?this.name:this.config.id,this.order=e.order,this.autoscaleGroup=e.autoscaleGroup,this.removable=void 0===e.removable||e.removable,this.minHeight=e.minHeight||Math.min(25,this.height),this.maxHeight=e.maxHeight||Math.max(1e3,this.height),e.onclick&&(this.onclick=e.onclick,e.onclick=void 0),e.description&&("function"==typeof e.description?this.description=e.description:this.description=()=>e.description),e.hoverTextFields?this.hoverText=Pl.bind(this):"function"==typeof this.config.hoverText&&(this.hoverText=this.config.hoverText)}get name(){return this._name}set name(e){this._name=e,this.trackView&&this.trackView.setTrackLabelName(e)}clearCachedFeatures(){this.trackView&&this.trackView.clearCachedFeatures()}updateViews(){this.trackView&&this.trackView.updateViews()}repaintViews(){this.trackView&&this.trackView.repaintViews()}getState(){const e={},t=Object.keys(this.config).filter((e=>{return!(void 0===(t=this.config[e])||"function"==typeof t||t instanceof Promise);var t}));for(const i of t)i.startsWith("_")||(e[i]=this.config[i]);for(let t of Object.keys(e)){if(t.startsWith("_"))continue;const i=this[t];void 0===i||!Ua(i)&&"boolean"!=typeof i&&"metadata"!==t||(e[t]=i)}const i=Object.assign({},Hl.defaults);if(this.constructor.defaults)for(let e of Object.keys(this.constructor.defaults))i[e]=this.constructor.defaults[e];for(let t of Object.keys(i))void 0!==this[t]&&i[t]!==this[t]&&(e[t]=this[t]);return!this.autoscale&&this.dataRange&&(e.min=this.dataRange.min,e.max=this.dataRange.max),this.autoscaleGroup&&(e.autoscaleGroup=this.autoscaleGroup),e}get supportsWholeGenome(){return!0===this.config.supportsWholeGenome}hasSamples(){return!1}getGenomeId(){return this.browser.genome?this.browser.genome.id:void 0}setTrackProperties(e){if(this.disposed)return;const t={};let i;for(let n of Object.keys(e))switch(n.toLowerCase()){case"usescore":t.useScore=1===e[n]||"1"===e[n]||"on"===e[n]||!0===e[n];break;case"visibility":switch(e[n]){case"2":case"3":case"pack":case"full":t.displayMode="EXPANDED";break;case"4":case"squish":t.displayMode="SQUISHED";break;case"1":case"dense":t.displayMode="COLLAPSED"}break;case"color":case"altcolor":t[n]=e[n].startsWith("rgb(")?e[n]:"rgb("+e[n]+")";break;case"featurevisiblitywindow":case"visibilitywindow":t.visibilityWindow=Number.parseInt(e[n]);break;case"maxheightpixels":i=e[n].split(":"),3===i.length&&(t.minHeight=Number.parseInt(i[2]),t.height=Number.parseInt(i[1]),t.maxHeight=Number.parseInt(i[0]));break;case"viewlimits":if(!this.config.autoscale){i=e[n].split(":");let r,s=0;1==i.length?r=Number(i[0]):2==i.length&&(s=Number(i[0]),r=Number(i[1])),Number.isNaN(r)||Number.isNaN(s)?console.warn(`Unexpected viewLimits value in track line: ${e.viewLimits}`):(t.autoscale=!1,t.dataRange={min:s,max:r},this.viewLimitMin=s,this.viewLimitMax=r)}case"name":t[n]=e[n];break;case"url":t.infoURL=e[n];break;case"type":const r=e[n];Ol.has(r)?t[n]=Ol.get(r):t[n]=r;break;case"graphtype":t.graphType=e[n];break;default:t[n]=e[n]}for(let e of Object.keys(t))if(!this.config.hasOwnProperty(e)||"name"===e&&this.config._derivedName){let i=t[e];if("true"===i&&(i=!0),"false"===i&&(i=!1),this[e]=i,"height"===e&&this.trackView)try{const e=Number.parseInt(i);this.trackView.setTrackHeight(e)}catch(e){console.error(e)}}}clickedFeatures(e){const t=e.viewport.cachedFeatures;if(!t||!Array.isArray(t)||0===t.length)return[];const i=e.genomicLocation,n=e.referenceFrame.bpPerPixel>.2?3*e.referenceFrame.bpPerPixel:.2;return to(t,i-n,i+n)}extractPopupData(e,t){const i=new Set(["row","color","chr","start","end","cdStart","cdEnd","strand","alpha"]),n=[];let r,s;for(let t in e)if(e.hasOwnProperty(t)&&!i.has(t)&&Ua(e[t])){let i=e[t];n.push({name:Lt(t),value:i}),"alleles"===t?r=e[t]:"alleleFreqs"===t&&(s=e[t])}if(r&&s){r.endsWith(",")&&(r=r.substr(0,r.length-1)),s.endsWith(",")&&(s=s.substr(0,s.length-1));let i=r.split(","),o=s.split(",");if(o.length>1){let r=[];for(let e=0;e<o.length;e++)r.push({a:i[e],af:Number(o[e])});r.sort((function(e,t){return e.af-t.af}));let s=r[r.length-1].a;if(1===s.length)for(let i=r.length-2;i>=0;i--){let o=r[i].a;if(1===o.length){t||(t=this.getGenomeId());const i=Hl.getCravatLink(e.chr,e.start+1,s,o,t);console.log(i),i&&(n.push("<hr/>"),n.push({html:i}),n.push("<hr/>"))}}}}if(e.attributes)for(let t of Object.keys(e.attributes))n.push({name:t,value:e.attributes[t]});let o=`${e.chr}:${Rt(e.start+1)}-${Rt(e.end)}`;return e.strand&&(o+=` (${e.strand})`),n.push({name:"Location",value:o}),n}description(){const e=(e,t)=>`<div class="igv-track-label-popup-shim"><b>${e}: </b>${t}</div>`;let t='<div class="igv-track-label-popup">';if(this.url?Ht(this.url)?t+=e("Filename",this.url.name):t+=e("URL",this.url):t=this.name,this.config){if(this.config.metadata)for(let i of Object.keys(this.config.metadata)){t+=e(i,this.config.metadata[i])}for(let i of Object.keys(this.config)){if(i.startsWith("_"))continue;let n=i.substr(0,1);if(n!==n.toLowerCase()){const n=this.config[i];n&&Ua(n)&&(t+=e(i,n))}}}return t+="</div>",t}getColorForFeature(e){return"function"==typeof this.color?this.color(feature):this.color}numericDataMenuItems(){const e=[];e.push("<hr/>");let t=Bt("<div>");if(t.text("Set data range"),e.push({object:t,dialog:function(){this.trackView.track.selected?this.browser.dataRangeDialog.configure(this.trackView.browser.getSelectedTrackViews()):this.browser.dataRangeDialog.configure(this.trackView),this.browser.dataRangeDialog.present(Bt(this.browser.columnContainer))}}),void 0!==this.logScale){function i(){this.logScale=!this.logScale,this.trackView.repaintViews()}t=Bt(Dl("Log scale",this.logScale)),e.push({object:t,click:i})}return t=Bt(Dl("Autoscale",this.autoscale)),e.push({object:t,click:function(){this.autoscaleGroup=void 0,this.autoscale=!this.autoscale,this.browser.updateViews()}}),e}setDataRange({min:e,max:t}){this.dataRange={min:e,max:t},this.autoscale=!1,this.autoscaleGroup=void 0,this.trackView.repaintViews()}async nextFeatureAfter(e,t,i){let n=this.trackView.viewports[0].cachedFeatures;if(n&&Array.isArray(n)&&n.length>0){if(this.browser.genome.getChromosomeName(n[0].chr)===e){const e=function(e,t,i=!0){const n=e=>(e.start+e.end)/2,r=i?(e,t)=>e.start-t.start+e.end-t.end:(e,t)=>t.start-e.start+t.end-e.end,s=Array.from(e);s.sort(r);let o=0,a=s.length;for(;o<a;){let e=Math.floor((o+a)/2);i?n(s[e])<=t?o=e+1:a=e:n(s[e])>=t?o=e+1:a=e}return s[o]}(n,t,i);if(e)return e}}if("function"==typeof this.featureSource.nextFeature)return this.featureSource.nextFeature(e,t,i,this.visibilityWindow)}dispose(){this.disposed=!0;for(let e of Object.keys(this))this[e]=void 0}static getCravatLink(e,t,i,n,r){if("hg38"===r||"GRCh38"===r){return`<a target="_blank" href="https://run.opencravat.org/result/nocache/variant.html?chrom=${e.startsWith("chr")?e:"chr"+e}&pos=${t}&ref_base=${i}&alt_base=${n}"><b>Cravat ${i}->${n}</b></a>`}}static localFileInspection(e){const t=Object.assign({},e),i={url:"file",indexURL:"indexFile"};for(const e of["url","indexURL"])t[e]&&t[e]instanceof File&&(t[i[e]]=t[e].name,delete t[e]);return t}}function Pl(e){if(!this.hoverTextFields)return;const t=this.clickedFeatures(e);if(t&&t.length>0){let e="";for(let i=0;i<t.length;i++){if(10===i){e+="; ...";break}if(!t[i])continue;const n=t[i]._f||t[i];e.length>0&&(e+="\n"),e="";for(let t of this.hoverTextFields)e.length>0&&(e+="\n"),n.hasOwnProperty(t)?e+=n[t]:"function"==typeof n.getAttribute&&(e+=n.getAttribute(t))}return e}}const Ol=new Map([["wiggle_0","wig"],["bed","bed"],["bigBed","bigBed"],["bigWig","bigWig"]]);class Ul{constructor(e){switch(this.type=e||"seg",this.type){case"mut":this.sampleColumn=3,this.chrColumn=0,this.startColumn=1,this.endColumn=2,this.dataColumn=4;break;case"maf":this.sampleColumn=15,this.chrColumn=4,this.startColumn=5,this.endColumn=6,this.dataColumn=8;break;default:this.sampleColumn=0,this.chrColumn=1,this.startColumn=2,this.endColumn=3}}async parseHeader(e){let t;for(;void 0!==(t=await e.nextLine());)if(!t.startsWith("#")){const e=t.split("\t");this.header={headings:e};break}return this.header}async parseFeatures(e){const t=[];let i;this.header||(this.header=await this.parseHeader(e)),"seg"===this.type&&(this.dataColumn=this.header.headings.length-1),this.header.headings.length>5&&(i=this.extractExtraColumns(this.header.headings));const n=this.header.headings[this.dataColumn];let r;for(;void 0!==(r=await e.nextLine());){const e=r.split("\t"),s="seg"===this.type?Number(e[this.dataColumn]):e[this.dataColumn];if(e.length>this.dataColumn){const r=new ql({sample:e[this.sampleColumn],chr:e[this.chrColumn],start:parseInt(e[this.startColumn])-1,end:parseInt(e[this.endColumn]),value:s,valueColumnName:n});if(i){const t=this.extractExtraColumns(e);r.setAttributes({names:i,values:t})}t.push(r)}}return t}extractExtraColumns(e){const t=[];for(let i=0;i<e.length;i++)i!==this.chrColumn&&i!==this.startColumn&&i!==this.endColumn&&i!==this.sampleColumn&&t.push(e[i]);return t}}class ql{constructor({sample:e,chr:t,start:i,end:n,value:r,valueColumnName:s}){this.sample=e,this.chr=t,this.start=i,this.end=n,this.value=r,this.valueColumnName=s}setAttributes({names:e,values:t}){this.attributeNames=e,this.attributeValues=t}getAttribute(e){if(this.attributeNames){const t=this.attributeNames.indexOf(e);if(t>=0)return this.attributeValues[t]}}popupData(e,t){const i=new Set(["chr","start","end","sample","value","row","color","sampleKey","uniqueSampleKey","sampleId","chromosome","uniquePatientKey"]),n=this.chr+":"+Rt(this.start+1)+"-"+Rt(this.end),r=[{name:"Sample",value:this.sample},{name:"Location",value:n},{name:this.valueColumnName?Lt(this.valueColumnName):"Value",value:this.value}];if("mut"===e&&"hg38"===t){const e=this.extractCravatLink(t);e&&(r.push("<hr/>"),r.push({html:e}),r.push("<hr/>"))}if(this.attributeNames&&this.attributeNames.length>0)for(let e=0;e<this.attributeNames.length;e++)!i.has(this.attributeNames[e])&this.valueColumnName!==this.attributeNames[e]&&r.push({name:Lt(this.attributeNames[e]),value:this.attributeValues[e]});return r}extractCravatLink(e){let t,i;if(this.attributeNames&&this.attributeNames.length>0)for(let n=0;n<this.attributeNames.length;n++)if(t||"Reference_Allele"!==this.attributeNames[n]||(t=this.attributeValues[n]),!i&&this.attributeNames[n].startsWith("Tumor_Seq_Allele")&&this.attributeValues[n]!==t&&(i=this.attributeValues[n]),t&&i)return Hl.getCravatLink(this.chr,this.start+1,t,i,e)}}const Ql=new Map([["REF","referenceBases"],["ALT","alternateBases"],["QUAL","quality"],["FILTER","filter"]]);class Vl{constructor(e){this.chr=e[0],this.pos=parseInt(e[1]),this.names=e[2],this.referenceBases=e[3],this.alternateBases=e[4],this.quality=e[5],this.filter=e[6],this.info={};const t=e[7];if(t&&"."!==t)for(let e of t.split(";")){var i=e.split("=");this.info[i[0]]=i[1]}this.init()}getAttributeValue(e){return Ql.has(e)&&(e=Ql.get(e)),this.hasOwnProperty(e)?this[e]:this.info[e]}init(){const e=this.referenceBases,t=this.alternateBases;if(this.info&&(this.info.VT?this.type=this.info.VT:this.info.SVTYPE?this.type="SV":this.info.PERIOD&&(this.type="STR")),void 0===this.type&&(this.type=function(e,t){const i=e.length;if(void 0===t)return"UNKNOWN";if(0===t.trim().length||"<NON_REF>"===t||"<*>"===t||"."===t)return"NONVARIANT";{const e=t.split(",").map((function(e){return 1===i&&1===e.length?"SNP":"<NON_REF>"===e?"NONVARIANT":e.length>i&&$l(e)?"INSERTION":e.length<i&&$l(e)?"DELETION":"OTHER"}));let n=e[0];for(let t of e)if(t!==n)return"MIXED";return n}}(e,t)),this.info.END)this.start=this.pos-1,this.info.CHR2&&this.info.CHR2!==this.chr?this.end=this.start+1:this.end=Number.parseInt(this.info.END);else if("NONVARIANT"===this.type)this.start=this.pos-1,this.end=this.start+e.length;else{const i=t.split(",").filter((e=>e.length>0));this.alleles=[],this.start=void 0,this.end=void 0;for(let t of i)if(this.alleles.push(t),"SV"!==this.type&&$l(t)){let i=t.length,n=e.length;const r=Math.min(i,n);let s=0;for(;s<r&&e.charCodeAt(s)===t.charCodeAt(s);)s++,i--,n--;for(;i>0&&n>0;){const r=s+i-1,o=s+n-1;if(t.charCodeAt(r)!==e.charCodeAt(o))break;i--,n--}for(;i>0&&n>0;){const r=s,o=s;if(t.charCodeAt(r)!==e.charCodeAt(o))break;s++,i--,n--}const o=this.pos+s-1,a=o+n;this.start=void 0===this.start?o:Math.min(this.start,o),this.end=void 0===this.end?a:Math.max(this.end,a)}void 0===this.start&&(this.start=this.pos-1,this.end=this.pos),this.start===this.end&&(this.start-=.5,this.end+=.5)}}popupData(e,t){const i=`${Rt(this.pos)}`,n=this.start===this.end?`${Rt(this.start)} | ${Rt(this.start+1)}`:`${Rt(this.start+1)}-${Rt(this.end)}`,r=[{name:"Chr",value:this.chr},{name:"Pos",value:i},{name:"Loc",value:n},{name:"ID",value:this.names?this.names:""},{name:"Ref",value:this.referenceBases},{name:"Alt",value:this.alternateBases.replace("<","&lt;")},{name:"Qual",value:this.quality},{name:"Filter",value:this.filter}];if(this.type&&r.push({name:"Type",value:this.type}),"SNP"===this.type){let e=this.referenceBases;if(1===e.length){let i=this.alternateBases.split(",");for(let n of i)if(1===n.length){let i=Hl.getCravatLink(this.chr,this.pos,e,n,t);i&&(r.push("<hr/>"),r.push({html:i}))}}}const s=Object.keys(this.info);if(this.info&&s.length>0){r.push({html:'<hr style="border-top: dotted 1px;border-color: #c9c3ba" />'});for(let e of s)r.push({name:e,value:Kl(decodeURIComponent(this.info[e]))})}return r}getInfo(e){return this.info?this.info[e]:void 0}isRefBlock(){return"NONVARIANT"===this.type}isFiltered(){return!("."===this.filter||"PASS"===this.filter)}alleleFreq(){return this.info?this.info.AF:void 0}}class jl{constructor(e){this.mate=e,this.chr=e.info.CHR2,this.pos=Number.parseInt(e.info.END),this.start=this.pos-1,this.end=this.pos}get info(){return this.mate.info}get names(){return this.mate.names}get referenceBases(){return this.mate.referenceBases}get alternateBases(){return this.mate.alternateBases}get quality(){return this.mate.quality}get filter(){return this.mate.filter}get calls(){return this.mate.calls}getAttributeValue(e){return this.mate.getAttributeValue(e)}getInfo(e){this.mate.getInfo(e)}isFiltered(){return this.mate.isFiltered()}alleleFreq(){return this.mate.alleleFreq()}popupData(e,t){const i=[];return i.push("SV Breakpoint"),i.push({name:"Chr",value:this.chr}),i.push({name:"Pos",value:`${Rt(this.pos)}`}),i.push({html:'<hr style="border-top: dotted 1px;border-color: #c9c3ba" />'}),i.push("SV"),i.push(...this.mate.popupData(e,t)),i}}class Wl{constructor({formatFields:e,sample:t,token:i}){this.info={},this.sample=t;const n=i.split(":");for(let t=0;t<n.length;t++){const i=n[t];if(t==e.genotypeIndex){this.genotype=[];for(let e of i.split(/[\|\/]/))this.genotype.push("."===e?e:parseInt(e))}else this.info[e.fields[t]]=i}}get zygosity(){if(!this._zygosity)if(this.genotype){let e=!0,t=!0,i=!1;for(let n of this.genotype){if("."===n){i=!0;break}0!==n&&(t=!1),0===n&&(e=!1)}this._zygosity=i?"nocall":t?"homref":e?"homvar":"hetvar"}else this._zygosity="unknown";return this._zygosity}zygosityScore(){switch(this.zygosity){case"homvar":return 4;case"hetvar":return 3;case"homref":return 2;case"nocall":return 1;default:return 0}}#l(){switch(this.zygosity){case"homref":return"Homozygous reference";case"homvar":return"Homozygous variant";case"hetvar":return"Heterozygous";default:return""}}popupData(e,t){const i=[];void 0!==this.sample&&i.push({name:"Sample",value:this.sample}),this.genotypeString&&i.push({name:"Genotype",value:this.genotypeString});const n=this.#l();n&&i.push({name:"Zygosity",value:n});var r=Object.keys(this.info);r.length&&i.push("<hr/>");for(let e of r)i.push({name:e,value:decodeURIComponent(this.info[e])});return i}}const Gl=new Set(["A","C","T","G"].map((e=>e.charCodeAt(0))));function $l(e){for(let t=0;t<e.length;t++)if(!Gl.has(e.charCodeAt(t)))return!1;return!0}function Kl(e,t){return void 0===t&&(t=","),Array.isArray(e)?e.join(t):e}class Yl{construtor(){}async parseHeader(e,t){const i={};i.chrAliasTable=new Map;let n=await e.nextLine();if(!n.startsWith("##fileformat"))throw new Error("Invalid VCF file: missing fileformat line");for(i.version=n.substr(13);void 0!==(n=await e.nextLine())&&n.startsWith("#");){let e;const s={};if(n.startsWith("##")){if(n.startsWith("##INFO")||n.startsWith("##FILTER")||n.startsWith("##FORMAT")){const t=n.indexOf("<"),o=n.lastIndexOf(">");if(!(t>2&&o>0)){console.log("Malformed VCF header line: "+n);continue}const a=n.substring(2,t-1);i[a]||(i[a]={});const c=Tt(n.substring(t+1,o-1),",");for(let t of c){var r=t.split("=");r.length>1&&("ID"===r[0]?e=r[1]:s[r[0]]=r[1])}e&&(i[a][e]=s)}else if(n.startsWith("##contig")&&t){const e=n.indexOf("<ID=");let r=n.indexOf(",",e);-1==r&&(r=n.indexOf(">",e));const s=n.substring(e+4,r),o=t.getChromosomeName(s);i.chrAliasTable.set(o,s)}}else if(n.startsWith("#CHROM")){const e=n.split("\t");if(e.length>8){i.sampleNameMap=new Map;for(let t=9;t<e.length;t++)i.sampleNameMap.set(e[t],t-9)}}}return this.header=i,i}async parseFeatures(e){const t=[],i=this.header.sampleNameMap?Array.from(this.header.sampleNameMap.keys()):void 0,n=8+(i?i.length+1:0);let r;for(;void 0!==(r=await e.nextLine());)if(r&&!r.startsWith("#")){const e=r.split("\t");if(e.length===n){const n=new Vl(e);if(n.header=this.header,t.push(n),e.length>9){const r=Xl(e[8].split(":"));n.calls=[];for(let t=9;t<e.length;t++){const s=i[t-9],o=e[t],a=new Wl({formatFields:r,sample:s,token:o});n.calls.push(a)}n.info&&n.info.CHR2&&n.info.END&&t.push(new jl(n))}}}return t}}function Xl(e){const t={genotypeIndex:-1,fields:e};for(let i=0;i<e.length;i++)"GT"===e[i]&&(t.genotypeIndex=i);return t}const Zl=Math.log10(Number.MIN_VALUE);class Jl{constructor(e){if(this.config=e,e.columns){if(void 0===e.columns.chromosome||void 0===e.columns.position||void 0===e.columns.value)throw Error("columns property must define chrCol, posCol, and valueCol");this.posCol=e.columns.position-1,this.chrCol=e.columns.chromosome-1,this.valueCol=e.columns.value-1}else this.posCol=2,this.chrCol=1,this.valueCol=3}async parseHeader(e){const t=await e.nextLine();return this.parseHeaderLine(t)}parseHeaderLine(e){if(this.columns=e.split(/\t/),!this.config.columns)for(let e=0;e<this.columns.length;e++){switch(this.columns[e].toLowerCase()){case"chr":case"chromosome":case"chr_id":this.chrCol=e;break;case"bp":case"pos":case"position":case"chr_pos":this.posCol=e;break;case"p":case"pval":case"pvalue":case"p-value":case"p.value":this.valueCol=e}}return this.columns}async parseFeatures(e){const t=[],i=e.nextLine();let n;this.columns||this.parseHeaderLine(i);const r=e=>{const t=e.indexOf("E");if(t>0){if(Number.parseInt(e.substring(t+1))<Zl)return Number.MIN_VALUE}return Number(e)};for(;void 0!==(n=e.nextLine());){const e=n.split(/\t/);if(e.length===this.columns.length){const i=e[this.posCol];if(i.indexOf(";")>0||0==i.length||i.indexOf("x")>0)continue;const s=e[this.chrCol],o=r(e[this.valueCol]),a=parseInt(i)-1,c=a+1;t.push(new eh({chr:s,start:a,end:c,value:o,line:n,columns:this.columns}))}}return t}static isGWAS(e){const t=e.split("\t");if(t.length<5)return!1;const i=[["chr","chromosome","chr_id","chrom"],["bp","pos","position","chr_pos","chromEnd"],["p","pval","p-value","p.value"]];for(let e of i)if(!t.some((t=>e.includes(t.toLowerCase()))))return!1;return!0}}class eh{constructor({chr:e,start:t,end:i,value:n,line:r,columns:s}){this.chr=e,this.start=t,this.end=i,this.value=n,this.line=r,this.columns=s}popupData(){const e=this.line.split(/\t/);return this.columns.map((function(t,i){return{name:t,value:e[i]}}))}getAttribute(e){const t=this.line.split(/\t/);for(let i=0;i<this.columns.length;i++)if(this.columns[i]===e)return t[i]}}var th=new RegExp("([^:]*)\\(([^)]*)\\)"),ih=new RegExp("([^:]*):([^(]*)\\(([^)]*)\\)");class nh{constructor(e){const t=e?e.decode:void 0;this.nameField=e?e.nameField:void 0,this.skipRows=0,this.decode=t||lh,this.delimiter="\t"}async parseHeader(e){let t,i;for(;(t=await e.nextLine())&&(t.startsWith("track")||t.startsWith("#")||t.startsWith("browser"));)if(t.startsWith("track")||t.startsWith("#track")){let e=oh(t);i?Object.assign(i,e):i=e}else if(t.startsWith("#columns")){let e=ah(t);i?Object.assign(i,e):i=e}else t.startsWith("##gff-version 3")&&(this.format="gff3",i||(i={}),i.format="gff3");return this.header=i,i}async parseFeatures(e){const t=[],i=this.decode,n=this.delimiter||"\t";let r,s=0;for(;void 0!==(r=e.nextLine());){if(s++,s<=this.skipRows||r.startsWith("track")||r.startsWith("#")||r.startsWith("browser"))continue;let e=o();if(e.length<1)continue;if(!this.aed){this.aed=sh(e);continue}const n=i.call(this,e,undefined);n&&t.push(n)}return t;function o(){for(var e,t,i=[],s="",o=!1;r||""===r;){for(e=0;e<r.length;e++)(t=r.charAt(e))===n?o?s+=t:(i.push(s),s=""):'"'===t?e+1<r.length&&'"'===r.charAt(e+1)?(o&&(s+='"'),e++):o=!o:s+=t;if(!o)break;s+="\n",r=nextLine()}return i.push(s),i}}}function rh(e){var t=ih.exec(e);if(t)return{namespace:t[1],name:t[2],type:t[3]};if(t=th.exec(e))return{namespace:"?",name:t[1],type:t[2]};throw new Error("Error parsing the header row of AED file - column not in ns:name(ns:type) format")}function sh(e){var t,i,n;for(t={columns:[],metadata:{}},i=0;i<e.length;i++)n=rh(e[i]),t.columns.push(n);return t}function oh(e){const t={},i=e.split(/(?:")([^"]+)(?:")|([^\s"]+)(?=\s+|$)/g);let n;const r=[];for(let e of i)e&&0!==e.trim().length&&(e.endsWith("=")>0?n=e:n?(r.push(n+e),n=void 0):r.push(e));for(let e of r){if(!e)return;var s=e.split("=",2);if(2===s.length){const e=s[0].trim(),i=s[1].trim();t[e]=i}}return t}function ah(e){let t={},i=e.split(/\s+/);if(2===i.length){i[1].split(";").forEach((function(e){let i=e.split("=");"color"===i[0]?t.colorColumn=Number.parseInt(i[1])-1:"thickness"===i[0]&&(t.thicknessColumn=Number.parseInt(i[1])-1)}))}return t}function ch(e,t){var i,n,r=e.columns;this.aed=e,this.allColumns=t,this.chr=null,this.start=null,this.end=null,this.score=1e3,this.strand=".",this.cdStart=null,this.cdEnd=null,this.name=null,this.color=null;for(let e=0;e<t.length;e++)if(i=t[e]){"aed:Integer"===(n=r[e]).type&&(i=parseInt(i));var s=[];if(n.namespace.length>0)for(let e=0;e<n.namespace.length;e++)s.push(n.namespace.charCodeAt(e));"bio"===n.namespace.trim()?"sequence"===n.name?this.chr=i:"start"===n.name?this.start=i:"end"===n.name?this.end=i:"cdsMin"===n.name?this.cdStart=i:"cdsMax"===n.name?this.cdEnd=i:"strand"===n.name&&(this.strand=i):"aed"===n.namespace?"name"===n.name&&(this.name=i):"style"===n.namespace&&"color"===n.name&&(this.color=_s.createColorString(i))}}function lh(e,t){var i,n,r,s,o,a,c=0,l=this.aed.columns;if(e.length===l.length){for(a=0;a<e.length;a++)s=l[a],""!==(r=e[a])&&c++,"name"===s.name&&"aed"===s.namespace?i=r:"value"===s.name&&"aed"===s.namespace&&(n=r);if(2===c&&i&&n)return o=rh(i),this.aed.metadata[o.namespace]||(this.aed.metadata[o.namespace]={}),void(this.aed.metadata[o.namespace][o.name]||(this.aed.metadata[o.namespace][o.name]={type:o.type,value:n}));var h=new ch(this.aed,e);if(h.chr&&(h.start||0===h.start)&&h.end)return h;console.log("Cannot parse feature: "+e.join(","))}else console.log("Corrupted AED file row: "+e.join(","))}function hh(e,t){if(0===e.length)return e;if(e.sort((function(e,t){const i=e.minv.block-t.minv.block;return 0!==i?i:e.minv.offset-t.minv.offset})),e.length<=1)return e;t&&(e=e.filter((e=>e.maxv.isGreaterThan(t))));const i=[];let n;for(let t of e)n&&dh(n,t)?t.maxv.isGreaterThan(n.maxv)&&(n.maxv=t.maxv):(i.push(t),n=t);return i}function dh(e,t){const i=t.minv.block-e.maxv.block;return t.maxv.block-e.minv.block<5e6&&i<65e3}ch.prototype.popupData=function(){for(var e=[],t=this.aed,i=0;i<this.allColumns.length;i++){var n=this.allColumns[i],r=t.columns[i].name;"sequence"!==r&&"color"!==r&&n&&e.push({name:r,value:n})}return e};class uh{constructor(){this.tabix=!0}parse(e){const t=new Ac(new DataView(e)),i=t.getInt();if(21582659!==i)throw 38359875===i?Error("CSI version 2 is not supported. Please enter an issue at https://github.com/igvteam/igv.js"):Error("Not a CSI index");this.indices=[],this.blockMin=Number.MAX_SAFE_INTEGER,this.lastBlockPosition=[],this.sequenceIndexMap={},this.minShift=t.getInt(),this.depth=t.getInt();const n=[];let r=0;if(t.getInt()>=28){t.getInt(),t.getInt(),t.getInt(),t.getInt(),t.getInt(),t.getInt();const e=t.getInt(),i=t.position+e;let r=0;for(;t.position<i;){let e=t.getString();this.sequenceIndexMap[e]=r,n[r]=e,r++}}const s=this.bin_limit()+1,o=t.getInt();for(let e=0;e<o;e++){const i=[],n=[],o=t.getInt();for(let e=0;e<o;e++){const e=t.getInt();if(n[e]=t.getVPointer(),e>s)t.getInt(),t.getVPointer(),t.getVPointer(),t.getLong(),t.getLong();else{i[e]=[];const n=t.getInt();for(let s=0;s<n;s++){const n=t.getVPointer(),s=t.getVPointer();n&&s&&(n.block<this.blockMin&&(this.blockMin=n.block),s.block>r&&(r=s.block),i[e].push([n,s]))}}}o>0&&(this.indices[e]={binIndex:i,loffset:n})}this.lastBlockPosition=r}get sequenceNames(){return Object.keys(this.sequenceIndexMap)}chunksForRange(e,t,i){const n=this.indices[e];if(n){const e=this.reg2bins(t,i);if(0==e.length)return[];const r=[];for(let t of e)for(let e=t[0];e<=t[1];e++)if(n.binIndex[e]){const t=n.binIndex[e];for(let i of t){const t=i[0],n=i[1];r.push({minv:t,maxv:n,bin:e})}}let s=e[this.depth][0];do{if(n.binIndex[s])break;s>1+(this.getParentBin(s)<<3)?s--:s=this.getParentBin(s)}while(0!=s);return hh(r,n.loffset[s])}return[]}getParentBin(e){return 0==e?0:e-1>>3}reg2bins(e,t){(e-=1)<1&&(e=1),t>2**34&&(t=2**34),t-=1;let i=0,n=0,r=this.minShift+3*this.depth;const s=[];for(;i<=this.depth;r-=3,n+=1<<3*i,i+=1){const i=n+(e>>r),o=n+(t>>r);s.push([i,o])}return s}bin_limit(){return((1<<3*(this.depth+1))-1)/7}}class fh{constructor(){}async parse(e,t){const i=[];let n=Number.MAX_SAFE_INTEGER,r=0;const s=new Ac(new DataView(e)),o=s.getInt(),a={};if(!(21578050===o||t&&21578324===o))throw new Error(indexURL+" is not a "+(t?"tabix":"bai")+" file");{const e=s.getInt();if(t){s.getInt(),s.getInt(),s.getInt(),s.getInt(),s.getInt(),s.getInt(),s.getInt();for(let t=0;t<e;t++){a[s.getString()]=t}}for(let t=0;t<e;t++){const e={},o=[],a=s.getInt();for(let t=0;t<a;t++){const t=s.getInt();if(37450===t)s.getInt(),s.getVPointer(),s.getVPointer(),s.getLong(),s.getLong();else{e[t]=[];const i=s.getInt();for(let o=0;o<i;o++){const i=s.getVPointer(),o=s.getVPointer();i&&o&&(i.block<n&&(n=i.block),o.block>r&&(r=o.block),e[t].push([i,o]))}}}const c=s.getInt();for(let e=0;e<c;e++){const e=s.getVPointer();o.push(e)}a>0&&(i[t]={binIndex:e,linearIndex:o})}this.firstBlockPosition=n,this.lastBlockPosition=r,this.indices=i,this.sequenceIndexMap=a,this.tabix=t}}get sequenceNames(){return Object.keys(this.sequenceIndexMap)}chunksForRange(e,t,i){const n=this.indices[e];if(n){const e=function(e,t){const i=[];t>=1<<29&&(t=1<<29);return--t,i.push([0,0]),i.push([1+(e>>26),1+(t>>26)]),i.push([9+(e>>23),9+(t>>23)]),i.push([73+(e>>20),73+(t>>20)]),i.push([585+(e>>17),585+(t>>17)]),i.push([4681+(e>>14),4681+(t>>14)]),i}(t,i),r=[];for(let t of e)for(let e=t[0];e<=t[1];e++)if(n.binIndex[e]){const t=n.binIndex[e];for(let e of t){const t=e[0],i=e[1];r.push({minv:t,maxv:i})}}const s=n.linearIndex.length;let o;const a=Math.min(t>>14,s-1),c=Math.min(i>>14,s-1);for(let e=a;e<=c;e++){const t=n.linearIndex[e];if(t){o=t;break}}return hh(r,o)}return[]}}class ph{constructor(){this.tribble=!0}async parse(e){let t=0;this.chrIndex={},this.lastBlockPosition=[];const i=new Ac(new DataView(e));!function(e){e.getInt(),e.getInt();const t=e.getInt();if(e.getString(),e.getLong(),e.getLong(),e.getString(),e.getInt(),t>=3){let t=e.getInt();for(;t-- >0;)e.getString(),e.getString()}}(i);let n=i.getInt();for(;n-- >0;){let e=i.getString();const n=i.getInt(),r=i.getInt(),s=i.getInt();i.getInt(),i.getInt();let o=i.getLong();const a=[];for(let e=0;e<r;e++){const e=i.getLong();a.push({min:o,max:e}),o=e,e>t&&(t=e)}this.chrIndex[e]={chr:e,blocks:a,longestFeature:s,binWidth:n}}this.lastBlockPosition=t}get sequenceNames(){return Object.keys(this.chrIndex)}chunksForRange(e,t,i){const n=this.chrIndex[e];if(n){const e=n.blocks,r=n.longestFeature,s=n.binWidth,o=Math.max(t-r,0),a=Math.floor(o/s);if(a>=e.length)return[];{const t=Math.min(Math.floor((i-1)/s),e.length-1),n=e[a].min,r=e[t].max;if(0===r-n)return[];return[{minv:{block:n,offset:0},maxv:{block:r,offset:0}}]}}}}async function gh(e,t){let i=await Qs.loadArrayBuffer(e,qa(t)),n=new DataView(i);if(31===n.getUint8(0)&&139===n.getUint8(1)){i=gs(i).buffer,n=new DataView(i)}switch(n.getInt32(0,!0)){case 21578050:return async function(e){const t=new fh;return await t.parse(e,!1),t}(i);case 21578324:return async function(e){const t=new fh;return await t.parse(e,!0),t}(i);case 21582659:return async function(e){const t=new uh;return t.parse(e),t}(i);case 1480870228:return async function(e){const t=new ph;return t.parse(e),t}(i);case 38359875:throw Error("CSI version 2 is not supported.");default:throw Error(`Unrecognized index type: ${e}`)}}function mh(e){return"string"==typeof e||e instanceof String?new wh(e):new bh(e)}class wh{constructor(e){this.data=e,this.ptr=0}nextLine(){var e=this.ptr,t=this.data.indexOf("\n",e),i=this.data;if(t>0)return this.ptr=t+1,t>e&&"\r"===i.charAt(t-1)?i.substring(e,t-1):i.substring(e,t);var n=i.length;return this.ptr=n,e>=n?void 0:i.substring(e)}}class bh{constructor(e){this.data=e,this.length=this.data.length,this.ptr=0}nextLine(){if(this.ptr>=this.data.length)return;let e=this.ptr;const t=this.data;let i="",n=!1;for(;e<t.length;){var r=t[e],s=0,o=0;if(r<=127?(s=0,o=255&r):r<=223?(s=1,o=31&r):r<=239?(s=2,o=15&r):r<=244&&(s=3,o=7&r),t.length-e-s>0)for(var a=0;a<s;)o=o<<6|63&(r=t[e+a+1]),a+=1;else o=65533,s=t.length-e;e+=s+1;const c=String.fromCodePoint(o);if("\r"===c)n=!0;else{if("\n"===c)break;n&&(i+="\r",n=!1),i+=c}}return this.ptr=e,i}}class Fh{constructor(e){this.config=e,this.filePtr=0,this.bufferPtr=0,this.buffer}async nextLine(){let e;try{for(;;){const t=this.buffer?this.buffer.length:0;for(;this.bufferPtr<t;){const t=String.fromCharCode(this.buffer[this.bufferPtr++]);if("\r"!==t){if("\n"===t)return e;e=e?e+t:t}}if(this.eof)return e;await this.readNextBlock()}}catch(t){return console.warn(t),this.eof=!0,e}}async readNextBlock(){const e=qa(this.config,{range:{start:this.filePtr,size:26}}),t=ms(await Qs.loadArrayBuffer(this.config.url,e));if(0===t)this.eof=!0,this.buffer=void 0;else{const e=qa(this.config,{range:{start:this.filePtr,size:t}}),i=await Qs.loadArrayBuffer(this.config.url,e);i.byteLength<t&&(this.eof=!0),this.buffer=gs(i),0==this.buffer.byteLength&&(this.eof=!0),this.bufferPtr=0,this.filePtr+=i.byteLength}}}const vh=e=>{const t=ArrayBuffer.isView(e)?e:new Uint8Array(e);return 1+(t[17]<<8|t[16])};class yh{constructor(e){this.config=e,this.cacheBlocks=0!=e.cacheBlocks,this.cache=void 0}async getData(e,t){const i=e.block,n=t.block,r=0===t.offset,s=await this.getInflatedBlocks(i,n,r);if(1===s.length)return s[0];let o=0;for(const e of s)o+=e.byteLength;const a=new Uint8Array(o);let c=0;for(const e of s)a.set(e,c),c+=e.byteLength;return a}async getInflatedBlocks(e,t,i){if(this.cacheBlocks){const n=this.cache;if(n&&n.startBlock<=e&&(n.endBlock>=t||i&&n.nextEndBlock===t)){const i=e-n.startBlock,r=t-n.startBlock;return Ch(n.buffer,i,r)}{let r;if(!n||n.startBlock>t||n.endBlock<e)r=await this.loadBLockData(e,t,{skipEnd:i});else{const s=[];if(e<n.startBlock){const t=await this.loadBLockData(e,n.startBlock,{skipEnd:!0});s.push(t)}let o;if(e<=n.startBlock&&t>=n.endBlock)o=n.buffer;else{const i=Math.max(0,e-n.startBlock);let r;if(t>=n.endBlock)r=n.buffer.byteLength;else{const e=Ah(n.buffer);for(let i=0;i<e.length-1;i++)if(n.startBlock+e[i]===t){r=e[i+1];break}}o=n.buffer.slice(i,r)}if(s.push(o),t>n.endBlock){const e=await this.loadBLockData(n.endBlock,t,{skipStart:!0,skipEnd:i});s.push(e)}r=function(e){if(1===e.length)return e[0];let t=0;for(const i of e)t+=i.byteLength;const i=new Uint8Array(t);let n=0;for(const t of e)i.set(new Uint8Array(t),n),n+=t.byteLength;return i.buffer}(s)}let s=t;if(i){const e=Ah(r);t=e[e.length-1]}return this.cache={startBlock:e,endBlock:t,nextEndBlock:s,buffer:r},Ch(r)}}return Ch(await this.loadBLockData(e,t,{skipEnd:i}))}async loadBLockData(e,t,i){const n=this.config,r=i&&i.skipStart;let s=0;if(!(i&&i.skipEnd)){const e=qa(n,{range:{start:t,size:26}}),i=await Qs.loadArrayBuffer(n.url,e);s=vh(i)}if(r){const t=qa(n,{range:{start:e,size:26}}),i=await Qs.loadArrayBuffer(n.url,t);e+=vh(i)}const o=qa(n,{range:{start:e,size:t+s-e}});return Qs.loadArrayBuffer(n.url,o)}}function Ah(e){const t=e.byteLength;let i=0;const n=[0];for(;i<t;){const r=new Uint8Array(e,i);i+=1+(r[17]<<8|r[16]),i<t&&n.push(i)}return n}function Ch(e,t,i){const n=[];let r=t=t||0;const s=e.byteLength-18;for(;r<s;)try{const t=new Uint8Array(e,r,18),s=t[11]<<8|t[10],o=t[17]<<8|t[16],a=12+s+r,c=e.byteLength-a,l=o-s-18;if(c<l||l<=0)break;const h=new Uint8Array(e,a,l),d=hs(h);if(n.push(d),i===r)break;r+=o+1}catch(e){console.error(e);break}return n}const _h=Math.log10(Number.MIN_VALUE);class xh{chrCol=-1;snpCol=-1;posCol=-1;pValueCol=-1;phenotypeColumn=-1;delimiter="\t";constructor(e){this.config=e}async parseHeader(e){const t=this.config;t.delimiter&&(this.delimiter=t.delimiter);const i=await e.nextLine(),n=this.parseHeaderLine(i);return t.chrColumn&&(this.chrColumn=t.chrColumn-1),t.snpColumn&&(this.snpColumn=t.snpColumn-1),t.posColumn&&(this.posColumn=t.posColumn-1),t.pValueColumn&&(this.pValueColumn=t.pValueColumn-1),t.phenotypeColumn&&(this.phenotypeColumn=t.phenotypeColumn-1),n}parseHeaderLine(e){this.columns=e.split(this.delimiter);for(let e=0;e<this.columns.length;e++){switch(this.columns[e].toLowerCase()){case"chr":case"chromosome":case"chr_id":case"chrom":this.chrColumn=e;break;case"bp":case"pos":case"position":case"chr_pos":case"chromEnd":this.posColumn=e;break;case"p":case"pval":case"pvalue":case"p-value":case"p.value":this.pValueColumn=e;break;case"rsid":case"variant":case"snp":this.snpColumn=e;break;case"phenotype":case"gene":case"gene_id":case"molecular_trait_id":this.phenotypeColumn=e}}return this.columns}async parseFeatures(e){const t=[],i=e.nextLine();let n;this.columns||this.parseHeaderLine(i);const r=e=>{const t=e.indexOf("E");if(t>0){if(Number.parseInt(e.substring(t+1))<_h)return Number.MIN_VALUE}return Number(e)};for(;void 0!==(n=e.nextLine());){const e=n.split(this.delimiter);if(e.length===this.columns.length){const i=e[this.posColumn];if(i.indexOf(";")>0||0==i.length||i.indexOf("x")>0)continue;const n=e[this.chrColumn],s=r(e[this.pValueColumn]),o=parseInt(i)-1,a=o+1,c=e[this.snpColumn],l=e[this.phenotypeColumn],h=new kh({chr:n,start:o,end:a,pValue:s,snp:c,phenotype:l},this.columns,e);t.push(h)}}return t}static isQTL(e){const t=e.split("\t");if(t.length<5)return!1;const i=[["chr","chromosome","chr_id","chrom"],["bp","pos","position","chr_pos","chromEnd"],["p","pval","p-value","p.value"],["rsid","variant","snp"],["phenotype","gene","gene_id","molecular_trait_id"]];for(let e of i)if(!t.some((t=>e.includes(t.toLowerCase()))))return!1;return!0}}class kh{constructor({chr:e,start:t,end:i,pValue:n,snp:r,phenotype:s},o,a){this.chr=e,this.start=t,this.end=i,this.pValue=n,this.snp=r,this.phenotype=s,this.headers=o,this.tokens=a}popupData(){const e=[];for(let t=0;t<this.headers.length;t++)e.push({name:this.headers[t],value:this.tokens[t]});return e}}class Ih{sequenceNames;constructor(e,t){if(this.config=e||{},this.genome=t,this.indexURL=e.indexURL,this.indexed=e.indexed||void 0!==this.indexURL,this.queryable=this.indexed,Ht(this.config.url))this.filename=this.config.url.name;else if($a(this.config.url))this.indexed=!1,this.dataURI=e.url;else{const t=Ot(this.config.url);this.filename=e.filename||t.file}this.parser=this.getParser(this.config),"vcf"!==this.config.format||this.config.indexURL||console.warn("Warning: index file not specified. The entire vcf file will be loaded.")}async defaultVisibilityWindow(){if(this.config.indexURL){const e=await this.getIndex();if(e&&e.lastBlockPosition){let t=0;const i=1e4;for(let i of e.sequenceNames){const e=this.genome.getChromosome(i);e&&(t+=e.bpLength)}return Math.round(t/e.lastBlockPosition*i)}}}async readFeatures(e,t,i){this.dataURI||this.header||await this.readHeader();return await this.getIndex()?(this.indexed=!0,this.loadFeaturesWithIndex(e,t,i)):this.dataURI?(this.indexed=!1,this.loadFeaturesFromDataURI()):"service"===this.config.sourceType?this.loadFeaturesFromService(e,t,i):(this.indexed=!1,this.loadFeaturesNoIndex())}async readHeader(){if(this.dataURI)return await this.loadFeaturesFromDataURI(this.dataURI),this.header;if(this.config.indexURL){const e=await this.getIndex();if(!e)throw new Error("Unable to load index: "+this.config.indexURL);let t;if(this.sequenceNames=new Set(e.sequenceNames),e.tabix)this._blockLoader=new yh(this.config),t=new Fh(this.config);else{const i=Object.values(e.chrIndex).flatMap((e=>e.blocks)).map((e=>e.max)).reduce(((e,t)=>Math.min(e,t)),Number.MAX_SAFE_INTEGER),n=qa(this.config,{bgz:e.tabix,range:{start:0,size:i}});t=mh(await Qs.loadString(this.config.url,n))}return this.header=await this.parser.parseHeader(t),this.header}if("service"!==this.config.sourceType){let e;if(this.config._filecontents)e=this.config._filecontents,delete this.config._filecontents;else{const t=qa(this.config);e=await Qs.loadByteArray(this.config.url,t)}e.length<5e8&&(e=(new TextDecoder).decode(e));let t=mh(e);this.header=await this.parser.parseHeader(t),t=mh(e),this.features=await this.parser.parseFeatures(t),this.sequenceNames=new Set;for(let e of this.features)this.sequenceNames.add(e.chr);return this.header}if(this.config.seqnamesURL){const e=qa(this.config,{}),t=await Qs.loadString(this.config.seqnamesURL,e);t&&(this.sequenceNames=new Set(t.split(",").map((e=>e.trim())).filter((e=>e))))}if(this.config.headerURL){const e=qa(this.config,{}),t=mh(await Qs.loadString(this.config.headerURL,e));return this.header=await this.parser.parseHeader(t),this.header}}getParser(e){switch(e.format){case"vcf":return new Yl(e);case"seg":return new Ul("seg");case"mut":return new Ul("mut");case"maf":return new Ul("maf");case"gwas":return new Jl(e);case"qtl":return new xh(e);case"aed":return new nh(e);default:return new El(e)}}async loadFeaturesNoIndex(){if(this.features){const e=this.features;return delete this.features,e}{const e=qa(this.config),t=await Qs.loadByteArray(this.config.url,e);if(!this.header){const e=mh(t);this.header=await this.parser.parseHeader(e)}const i=mh(t),n=[];return await this._parse(n,i),n}}async loadFeaturesWithIndex(e,t,i){const n=this.config;this.parser;const r=this.index.tabix,s=r?this.index.sequenceIndexMap[e]:e;if(void 0===s)return[];const o=this.index.chunksForRange(s,t,i);if(o&&0!==o.length){const s=[];for(let a of o){let o;if(r)o=await this._blockLoader.getData(a.minv,a.maxv);else{const e=qa(n,{range:{start:a.minv.block,size:a.maxv.block-a.minv.block+1}});o=await Qs.loadString(n.url,e)}const c=mh(a.minv.offset?o.slice(a.minv.offset):o);await this._parse(s,c,e,i,t)}return s.sort((function(e,t){return e.start-t.start})),s}return[]}async loadFeaturesFromService(e,t,i){let n;n="function"==typeof this.config.url?this.config.url({chr:e,start:t,end:i}):this.config.url.replace("$CHR",e).replace("$START",t).replace("$END",i);const r=qa(this.config),s=mh(await Qs.loadString(n,r)),o=[];return await this._parse(o,s),o}async _parse(e,t,i,n,r){let s=await this.parser.parseFeatures(t);if(void 0===i)for(let t of s)e.push(t);else{let t=!1;for(let o=0;o<s.length;o++){const a=s[o];if(a.chr!==i){if(0===e.length)continue;break}if(a.start>n){e.push(a);break}a.end>=r&&a.start<=n&&(t||(t=!0,o>0&&e.push(s[o-1])),e.push(a))}}}async getIndex(){return this.index?this.index:this.config.indexURL?(this.index=await this.loadIndex(),this.index):void 0}async loadIndex(){return gh(this.config.indexURL,this.config)}async loadFeaturesFromDataURI(){if(this.features){const e=this.features;return delete this.features,e}{const e=vs(this.dataURI);let t=mh(e);this.header=await this.parser.parseHeader(t),this.header instanceof String&&this.header.startsWith("##gff-version 3")&&(this.format="gff3"),t=mh(e);const i=[];return await this._parse(i,t),i}}}const Sh=Mt;class Eh{constructor(e){this.config=e}async readFeatures(e,t,i){let n;n="function"==typeof this.config.url?this.config.url({chr:e,start:t,end:i}):this.config.url.replace("$CHR",e).replace("$START",t).replace("$END",i);let r,s=Object.assign({},this.config);void 0!==this.config.body&&("function"==typeof this.config.body?s.body=this.config.body({chr:e,start:t,end:i}):s.body=this.config.body.replace("$CHR",e).replace("$START",t).replace("$END",i));const o=await Qs.load(n,s);if(o&&(r="function"==typeof this.config.parser?this.config.parser(o):Sh(o)?JSON.parse(o):o),this.config.mappings){let e=Object.keys(this.config.mappings);for(let t of r)for(let i of e)t[i]=t[this.config.mappings[i]]}return r}}const Nh=function(e,t){this.config=e,this.genome=t,this.expandQueryInterval=!1};Nh.prototype.readFeatures=function(e,t,i){const n=Math.max(0,Math.floor(t));let r=Math.ceil(i);if(this.genome){const t=this.genome.getChromosome(e);t&&r>t.bpLength&&(r=t.bpLength)}const s=this.config.url+"?db="+this.config.db+"&table="+this.config.tableName+"&chr="+e+"&start="+n+"&end="+r;return Qs.loadJson(s,this.config).then((function(e){return e?(e.forEach((function(e){e.hasOwnProperty("exonStarts")&&e.hasOwnProperty("exonEnds")&&e.hasOwnProperty("exonCount")&&e.hasOwnProperty("cdsStart")&&e.hasOwnProperty("cdsEnd")&&function(e){var t,i,n,r,s,o;t=e.exonCount,i=e.exonStarts.split(","),n=e.exonEnds.split(","),r=[];for(var a=0;a<t;a++){var c={start:s=parseInt(i[a]),end:o=parseInt(n[a])};(e.cdsStart>o||e.cdsEnd<e.cdsStart)&&(c.utr=!0),e.cdsStart>=s&&e.cdsStart<=o&&(c.cdStart=e.cdsStart),e.cdsEnd>=s&&e.cdsEnd<=o&&(c.cdEnd=e.cdsEnd),r.push(c)}e.exons=r}(e)})),e):null}))};class Bh{featureCaches=[];gtexChrs=new Set(["chr1","chr10","chr11","chr12","chr13","chr14","chr15","chr16","chr17","chr18","chr19","chr2","chr20","chr21","chr22","chr3","chr4","chr5","chr6","chr7","chr8","chr9","chrM","chrX","chrY"]);constructor(e){this.config=e,this.url=e.url,this.tissueId=e.tissueSiteDetailId,this.datasetId=e.datasetId||"gtex_v8"}async readFeatures(e,t,i){const n=e.startsWith("chr")?e:"MT"===e?"chrM":"chr"+e;if(!this.gtexChrs.has(n))return[];const r=Math.floor(t),s=Math.ceil(i),o=this.datasetId,a=this.url+"?chromosome="+n+"&start="+r+"&end="+s+"&tissueSiteDetailId="+this.tissueId+"&datasetId="+o,c=await Qs.loadJson(a,{withCredentials:this.config.withCredentials});return c&&c.singleTissueEqtl?c.singleTissueEqtl.map((e=>new Mh(e))):[]}}class Mh{constructor(e){this.chr=e.chromosome,this.start=e.pos-1,this.end=this.start+1,this.snp=e.snpId,this.phenotype=e.geneSymbol,this.pValue=e.pValue,this.json=e}popupData(){return Object.keys(this.json).map((e=>({name:e,value:this.json[e]})))}}class Rh{constructor(e,t){if(this.config=e,this.genome=t,!e.format)throw Error('Format is required, and must be either "bam" or "cram"');if(this.format=e.format.toUpperCase(),"BAM"!==this.format&&"VCF"!==this.format)throw Error(`htsget format ${e.format} is not supported`)}async readHeaderData(){const e=`${Dh(this.config)}?class=header&format=${this.format}`,t=await Qs.loadJson(e,qa(this.config));return await this.loadUrls(t.htsget.urls)}async readData(e,t,i){const n=`${Dh(this.config)}?format=${this.format}&referenceName=${e}&start=${Math.floor(t)}&end=${Math.ceil(i)}`,r=await Qs.loadJson(n,qa(this.config));return this.loadUrls(r.htsget.urls)}async loadUrls(e){const t=[];for(let i of e)if(i.url.startsWith("data:"))t.push(Promise.resolve(Th(i.url)));else{const e=qa(this.config||{});i.headers&&(e.headers=Object.assign(e.headers||{},i.headers)),t.push(Qs.loadArrayBuffer(i.url,e))}return function(e){let t=0;for(let i of e)t+=i.byteLength;let i=0;const n=new Uint8Array(t);for(let t of e){const e=new Uint8Array(t);n.set(e,i),i+=e.length}return n}(await Promise.all(t))}static async inferFormat(e){try{const t=Dh(e),i=`${t}${t.includes("?")?"&":"?"}class=header`,n=await Qs.loadJson(i,qa(e));if(n.htsget){const t=n.htsget.format;if("BAM"!==t&&"VCF"!==t)throw Error(`htsget format ${t} is not supported`);e.format=t.toLowerCase(),e.sourceType="htsget",e.name||(e.name=await Wa(e.url))}}catch(e){}}}function Dh(e){if(e.url&&e.endpoint&&e.id)return e.url+e.endpoint+e.id;if(e.endpoint&&e.id)return e.endpoint+e.id;if(e.url)return e.url.startsWith("htsget://")?e.url.replace("htsget://","https://"):e.url;throw Error("Must specify either 'url', or 'endpoint' and 'id")}function Th(e){const t=e.split(","),i=t[0].split(":")[1];let n=t[1];n=i.indexOf("base64")>=0?atob(n):decodeURI(n);const r=new Uint8Array(n.length);for(var s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}class Lh extends Rh{constructor(e,t){super(e,t),this.parser=new Yl}async readHeader(){if(!this.header){let e=await this.readHeaderData();fs(e)&&(e=ps(e));const t=mh(e);this.header=await this.parser.parseHeader(t,this.genome),this.chrAliasTable=this.header.chrAliasTable}return this.header}async readFeatures(e,t,i){if(this.config.format&&"VCF"!==this.config.format.toUpperCase())throw Error(`htsget format ${this.config.format} is not supported`);this.chrAliasTable||await this.readHeader();let n=this.chrAliasTable.has(e)?this.chrAliasTable.get(e):e,r=await this.readData(n,t,i);fs(r)&&(r=ps(r));const s=mh(r);return this.parser.parseFeatures(s)}}class zh{chrAliasTable=new Map;constructor(e,t){this.sequenceNames=new Set(e),this.genome=t}async getAliasName(e){if(!this.genome)return e;if(!this.chrAliasTable.has(e)){const t=await this.genome.getAliasRecord(e);if(t){let i;const n=Object.keys(t).filter((e=>"start"!==e&&"end"!==e)).map((e=>t[e])).filter((e=>this.sequenceNames.has(e)));n.length>0&&(i=n[0]),this.chrAliasTable.set(e,i)}else this.chrAliasTable.set(e,void 0)}return this.chrAliasTable.get(e)}}class Hh{constructor(e){this.genome=e}async nextFeature(e,t,i,n){let r=this.genome.chromosomeNames||[e],s=r.indexOf(e);if(s<0)return;const o=Math.min(1e4,n||1e4);let a=i?t:Math.max(t-o,0);for(;s<r.length&&s>=0;){e=r[s];const c=this.genome.getChromosome(e).bpLength;for(;a<c&&a>=0;){let r=i?a+o:Math.min(t,a+o);const s=await this.getFeatures({chr:e,start:a,end:r,visibilityWindow:n});if(s){const e=(e,t)=>e.start-t.start+e.end-t.end,n=Array.from(s);n.sort(e);let r=i?0:n.length-1;for(;r>=0&&r<n.length;){const e=n[r],s=(e.start+e.end)/2;if(i){if(s>t)return e;r++}else{if(s<t)return e;r--}}}a=i?r:a-o}if(i)s++,a=0,t=0;else{if(s--,s<0)break;a=(t=this.genome.getChromosome(r[s]).bpLength)-o}}}async previousFeature(e,t,i,n){let r=this.genome.chromosomeNames||[e],s=r.indexOf(e);if(s<0)return;const o=Math.min(1e4,n||1e4);let a=i?t:Math.max(t-o,0);for(;s<r.length&&s>=0;){e=r[s];const c=this.genome.getChromosome(e).bpLength;for(;a<c&&a>=0;){let r=Math.min(t,a+o);const s=await this.getFeatures({chr:e,start:a,end:r,visibilityWindow:n});if(s){const e=(e,t)=>e.start-t.start+e.end-t.end,n=Array.from(s);n.sort(e);let r=i?0:n.length-1;for(;r>=0&&r<n.length;){const e=n[r],s=(e.start+e.end)/2;if(i){if(s>t)return e;r++}else{if(s<t)return e;r--}}}a=i?r:a-o}if(i)s++,a=0,t=0;else{if(s--,s<0)break;a=(t=this.genome.getChromosome(r[s]).bpLength)-o}}}}class Ph{constructor(e,t){this.config=e,this.genome=t,this.path=e.url,this.groupCache={},this.datasetCache={}}async readHeader(){if(void 0!==this.magic)return this;let e=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:0,size:64e3}})),t=new Ac(new DataView(e));if(this.magic=t.getInt(),this.version=t.getInt(),this.indexPos=t.getLong(),this.indexSize=t.getInt(),t.getInt(),this.version>=2){let e=t.getInt();for(this.windowFunctions=[];e-- >0;)this.windowFunctions.push(t.getString())}this.trackType=t.getString(),this.trackLine=t.getString();let i=t.getInt();for(this.trackNames=[];i-- >0;)this.trackNames.push(t.getString());this.genomeID=t.getString(),this.flags=t.getInt(),this.compressed=!!(1&this.flags),e=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:this.indexPos,size:this.indexSize}})),t=new Ac(new DataView(e)),this.datasetIndex={};let n=t.getInt();for(;n-- >0;){const e=t.getString(),i=t.getLong(),n=t.getInt();this.datasetIndex[e]={position:i,size:n}}for(this.groupIndex={},n=t.getInt();n-- >0;){const e=t.getString(),i=t.getLong(),n=t.getInt();this.groupIndex[e]={position:i,size:n}}return this}async readDataset(e,t,i){const n=e+"_"+t+"_"+i;if(this.datasetCache[n])return this.datasetCache[n];{await this.readHeader();const r=this.version<2?"":"/"+t,s="all"===e.toLowerCase()||void 0===i?"0":i.toString();let o;o="raw"===t?"/"+e+"/raw":"/"+e+"/z"+s+r;const a=this.datasetIndex[o];if(void 0===a)return;const c=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:a.position,size:a.size}}));if(!c)return;const l=new Ac(new DataView(c));let h=l.getInt();const d={};for(;h-- >0;)d[l.getString()]=l.getString();const u=l.getString(),f=l.getFloat();let p=l.getInt();const g=[];for(;p-- >0;)g.push({position:l.getLong(),size:l.getInt()});const m={name:o,attributes:d,dataType:u,tileWidth:f,tiles:g};return this.datasetCache[n]=m,m}}async readRootGroup(){const e=this.genome,t=this.groupCache["/"];if(t)return t;{const t=await this.readGroup("/"),i=t.chromosomes,n=t.maxZoom;n&&(this.maxZoom=Number(n));const r=t.totalCount;r&&(t.totalCount=Number(r));const s={};return i&&i.split(",").forEach((function(t){const i=e.getChromosomeName(t);s[i]=t})),this.chrAliasTable=s,this.groupCache["/"]=t,t}}async readGroup(e){const t=this.groupCache[e];if(t)return t;{await this.readHeader();const t=this.groupIndex[e];if(void 0===t)return;const i=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:t.position,size:t.size}}));if(!i)return;const n=new Ac(new DataView(i)),r={name:e};let s=n.getInt();for(;s-- >0;){const e=n.getString(),t=n.getString();r[e]=t}return this.groupCache[e]=r,r}}async readTiles(e,t){if(e.sort((function(e,t){return e.position-t.position})),0===(e=e.filter((function(e){return e.size>0}))).length)return[];const i=[];for(let n of e){const e=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:n.position,size:n.size}}));let r;try{r=this.compressed?ls(e).buffer:e}catch(e){console.error(e);continue}const s=new Ac(new DataView(r)),o=s.getString();let a;switch(o){case"fixedStep":a=Oh(s,t);break;case"variableStep":a=Uh(s,t);break;case"bed":case"bedWithName":a=qh(s,t,o);break;default:throw"Unknown tile type: "+o}i.push(a)}return i}async readTile(e,t){let i=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:e.position,size:e.size}}));if(this.compressed){i=ls(i).buffer}const n=new Ac(new DataView(i)),r=n.getString();switch(r){case"fixedStep":return Oh(n,t);case"variableStep":return Uh(n,t);case"bed":case"bedWithName":return qh(n,t,r);default:throw"Unknown tile type: "+r}}}function Oh(e,t){const i=e.getInt(),n=e.getInt(),r=e.getFloat(),s=[];let o=t;for(;o-- >0;){let t=i;const n=[];for(;t-- >0;)n.push(e.getFloat());s.push(n)}return{type:"fixedStep",start:n,span:r,data:s,nTracks:t,nPositions:i}}function Uh(e,t){const i=e.getInt(),n=e.getFloat(),r=e.getInt(),s=[];let o=r;for(;o-- >0;)s.push(e.getInt());e.getInt();const a=[];let c=t;for(;c-- >0;){o=r;const t=[];for(;o-- >0;)t.push(e.getFloat());a.push(t)}return{type:"variableStep",tileStart:i,span:n,start:s,data:a,nTracks:t,nPositions:r}}function qh(e,t,i){const n=e.getInt();let r=n;const s=[];for(;r-- >0;)s.push(e.getInt());r=n;const o=[];for(;r-- >0;)o.push(e.getInt());e.getInt();const a=[];let c=t;for(;c-- >0;){let t=n;const i=[];for(;t-- >0;)i.push(e.getFloat());a.push(i)}if("bedWithName"===i){r=n;const t=[];for(;r-- >0;)t.push(e.getString())}return{type:i,start:s,end:o,data:a,nTracks:t,nPositions:n}}class Qh extends Hh{#h={};searchable=!1;constructor(e,t){super(t),this.genome=t,this.reader=new Ph(e,t),this.queryable=!0}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,windowFunction:r="mean"}){return"all"===e.toLowerCase()?this.getWGValues(r,n):this._getFeatures(e,t,i,n,r)}async _getFeatures(e,t,i,n,r){const s=new dc(e,t,i),o=this.genome;if(!this.rootGroup&&(this.rootGroup=await this.reader.readRootGroup(),!this.normalizationFactor)){const e=this.rootGroup.totalCount;e&&(this.normalizationFactor=1e6/e)}s.bpPerPixel=n;const a=function(e,t,i){var n=i.getChromosome(e).bpLength;return Math.ceil(Math.log(Math.max(0,n/(700*t)))/Gh)}(e,n,o);let c=this.reader.chrAliasTable[e],l=this.reader.maxZoom;void 0===c&&(c=e),void 0===l&&(l=-1);const h=a>l?"raw":r,d=await this.reader.readDataset(c,h,a);if(null==d)return[];const u=d.tileWidth,f=Math.floor(t/u),p=Math.floor(i/u),g=await this.reader.readTiles(d.tiles.slice(f,p+1),1),m=[];for(let r of g)switch(r.type){case"bed":Vh(r,e,t,i,n,m);break;case"variableStep":jh(r,e,t,i,n,m);break;case"fixedStep":Wh(r,e,t,i,n,m);break;default:throw"Unknown tile type: "+r.type}return m.sort((function(e,t){return e.start-t.start})),m}get supportsWholeGenome(){return!0}get windowFunctions(){return this.reader.windowFunctions}async getWGValues(e,t){const i=this.#h[e];if(i&&i.bpPerPixel>.8*t&&i.bpPerPixel<1.2*t)return i.values;{const i=[],n=this.genome;if(this.genome.wgChromosomeNames)for(let r of n.wgChromosomeNames){const s=n.getChromosome(r).bpLength;t=s/1e3;const o=await this._getFeatures(r,0,s,t,e);if(o)for(let e of o){const t=Object.assign({},e);t.chr="all",t.start=n.getGenomeCoordinate(e.chr,e.start),t.end=n.getGenomeCoordinate(e.chr,e.end),t._f=e,i.push(t)}}return this.#h[e]={values:i,bpPerPixel:t},i}}}function Vh(e,t,i,n,r,s){const o=e.nPositions,a=e.start,c=e.end,l=e.data[0];for(let e=0;e<o;e++){const r=a[e],o=c[e];if(!(o<i)){if(r>n)break;s.push({chr:t,start:r,end:o,value:l[e]})}}}function jh(e,t,i,n,r,s){const o=e.nPositions,a=e.start,c=e.span,l=e.data[0];for(let e=0;e<o;e++){const r=a[e],o=r+c;if(!(o<i)){if(r>n)break;s.push({chr:t,start:r,end:o,value:l[e]})}}}function Wh(e,t,i,n,r,s){const o=e.nPositions;let a=e.start;const c=e.span,l=e.data[0];for(let e=0;e<o;e++){const r=a+c;if(a>n)break;r>=i&&(Number.isNaN(l[e])||s.push({chr:t,start:a,end:r,value:l[e]})),a=r}}var Gh=Math.log(2);class $h{constructor(e,t,i,n){this.header=e,this.nameToId=t,this.idToName=i,this.sumLengths=n}static parseTree(e,t,i=!1){{const n=e.getInt(),r=e.getInt(),s=e.getInt(),o=e.getInt(),a=e.getLong(),c=e.getLong(),l={magic:n,blockSize:r,keySize:s,valSize:o,itemCount:a,reserved:c},h=new Map,d=[];let u=0;const f=n=>{n>=0&&(e.position=n);const r=e.getByte();e.getByte();const a=e.getUShort();if(1===r)for(let t=0;t<a;t++){let t,n=e.getFixedLengthString(s);if(8!==o)throw Error(`Unexpected "valSize" value in chromosome tree. Expected 8, actual value is ${o}`);{t=e.getInt();const r=e.getInt();u+=r,i&&(n=i.getChromosomeName(n)),h.set(n,t),d[t]=n}}else for(let i=0;i<a;i++){e.getFixedLengthString(s);const i=e.getLong()-t,n=e.position;f(i),e.position=n}};return f(e),new $h(l,h,d,u)}}}class Kh{static magic=610839776;littleEndian=!0;nodeCache=new Map;constructor(e,t,i){this.path=e,this.config=t,this.startOffset=i}async init(){const e=await this.#t(this.startOffset,48);let t=e.getInt();if(t!==Kh.magic&&(e.setPosition(0),this.littleEndian=!this.littleEndian,e.littleEndian=this.littleEndian,t=e.getInt(),t!==Kh.magic))throw Error(`Bad magic number ${t}`);const i=e.getUInt(),n=e.getLong(),r=e.getUInt(),s=e.getUInt(),o=e.getUInt(),a=e.getUInt(),c=e.getLong(),l=e.getUInt(),h=e.getUInt(),d=this.startOffset+48;return this.header={magic:t,blockSize:i,itemCount:n,startChromIx:r,startBase:s,endChromIx:o,endBase:a,endFileOffset:c,itemsPerSlot:l,reserved:h,rootNodeOffset:d},this}async#t(e,t){const i=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:e,size:t}}));return new Ac(new DataView(i),this.littleEndian)}async findLeafItemsOverlapping(e,t,i,n){const r=[],s=async o=>{const a=await this.readNode(o);for(let o of a.items)Yh(o,e,t,i,n)&&(1===a.type?r.push(o):await s(o.childOffset))};return await s(this.header.rootNodeOffset),r}async readNode(e){const t=e;if(this.nodeCache.has(t))return this.nodeCache.get(t);let i=await this.#t(e,4);const n=i.getByte(),r=1===n;i.getByte();const s=i.getUShort();let o=s*(r?32:24);i=await this.#t(e+4,o);const a=[];for(let e=0;e<s;e++){let e={isLeaf:r,startChrom:i.getInt(),startBase:i.getInt(),endChrom:i.getInt(),endBase:i.getInt(),childOffset:i.getLong()};r&&(e.dataSize=i.getLong(),e.dataOffset=e.childOffset),a.push(e)}const c={type:n,items:a};return this.nodeCache.set(t,c),c}}function Yh(e,t,i,n,r){return e?(n>e.startChrom||n===e.startChrom&&r>=e.startBase)&&(t<e.endChrom||t===e.endChrom&&i<=e.endBase):(console.log("null item for "+t+" "+i+" "+r),!1)}class Xh{ixFile;ixxFile;bufferCache=new Map;constructor(e,t){this.ixFile=t,this.ixxFile=e}async search(e,t){const i=e.split(" ")[0].toLowerCase(),n=await this._getBuffer(i,t);if(!n)return;const r=n.slice(0,n.lastIndexOf("\n")).split("\n").filter((e=>!!e)),s=[];for(let e of r){const t=e.split(" ")[0];if(t.startsWith(i)&&s.push(e),t.slice(0,i.length)>i)break}if(0!==s.length){const e=new Map;for(let t of s){const[i,...n]=t.split(" ");e.set(i,n.map((e=>e.split(",")[0])))}return e}}async getIndex(e){return this.index||(this.index=await this._readIndex()),this.index}async _readIndex(e){return(await Qs.loadString(this.ixxFile)).split("\n").filter((e=>!!e)).map((e=>{const t=e.length-10,i=e.slice(0,t),n=e.slice(t);return[i,Number.parseInt(n,16)]}))}async _getBuffer(e,t){let i=0,n=65536;const r=await this.getIndex(t);for(let t=0;t<r.length;t++){const[s,o]=r[t],a=Math.min(s.length,e.length);s.slice(0,a)<e&&(i=o,n=o+65536)}const s=n-i;if(!(s<0)){if(this.bufferCache.has(i))return this.bufferCache.get(i);{const e=await Qs.loadString(this.ixFile,{range:{start:i,size:s}});return this.bufferCache.set(i,e),e}}}}class Zh{chrAliasTable=new Map;rpTreeCache=new Map;constructor(e,t){this.path=e.url,this.format=e.format||"bigwig",this.genome=t,this.config=e,this.bufferSize=512e3,this.loader=$a(this.path)?new sd(this.path):Qs,e.searchTrix&&(this._trix=new Xh(`${e.searchTrix}x`,e.searchTrix))}async readWGFeatures(e,t){await this.loadHeader();const i=this.chromTree.idToName.length-1,n=this.chromTree.idToName[0],r=this.chromTree.idToName[i];return this.readFeatures(n,0,r,Number.MAX_VALUE,e,t)}async readFeatures(e,t,i,n,r,s="mean"){t||(t=0),n||(n=Number.MAX_SAFE_INTEGER),await this.loadHeader();let o,a,c=await this.#d(e),l=await this.#d(i);if(void 0===c||void 0===l)return[];if("bigwig"===this.type){const e=await this.getZoomHeaders();let t=r?function(e,t){let i;for(let n=0;n<t.length;n++){const r=t[n];if(r.reductionLevel<e){i=r;break}}return i}(r,e):void 0;t?(o=t.indexOffset,a=rd):(o=this.header.fullIndexOffset,a=id)}else o=this.header.fullIndexOffset,a=nd.call(this);const h=await this.loadRPTree(o),d=await h.findLeafItemsOverlapping(c,t,l,n);if(d&&0!==d.length){let e=Number.MAX_VALUE,i=0;for(let t of d)e=Math.min(e,t.dataOffset),i=Math.max(i,t.dataOffset+t.dataSize);const r=i-e,o=await this.loader.loadArrayBuffer(this.config.url,qa(this.config,{range:{start:e,size:r}})),h=[];for(let i of d){const r=new Uint8Array(o,i.dataOffset-e,i.dataSize);let d;d=this.header.uncompressBuffSize>0?ls(r):r,a.call(this,new DataView(d.buffer),c,t,l,n,h,this.chromTree.idToName,s,this.littleEndian)}return h.sort((function(e,t){return e.start-t.start})),h}return[]}async#d(e){if(this.chrAliasTable.has(e)&&void 0===(e=this.chrAliasTable.get(e)))return;let t=this.chromTree.nameToId.get(e);if(void 0===t&&this.genome){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>this.chromTree.nameToId.has(e)));e.length>0&&(n=e[0],t=this.chromTree.nameToId.get(e[0]))}this.chrAliasTable.set(e,n)}return t}get searchable(){return"bigbed"===this.type}async search(e){if(this.header||await this.loadHeader(),!this.header||!this.header.extraIndexCount)return;const t=await this._searchForRegions(e);if(t){const i=await this._loadFeaturesForRange(t.offset,t.length);if(i){const t=i.filter((t=>{for(let i of Object.keys(t)){const n=t[i];if(Mt(n)&&n.toLowerCase()===e.toLowerCase())return!0}return!1}));return t.length>0?t.reduce(((e,t)=>e.end-e.start>t.end-t.start?e:t),i[0]):void 0}}}async _searchForRegions(e){const t=await this.#u();if(t){if(this._trix){const t=e.toLowerCase(),i=await this._trix.search(t);i&&i.has(t)&&(e=i.get(t)[0])}for(let i of t){const t=await i.search(e);if(t)return t}}}async#u(){if(void 0===this._searchTrees&&this.header.extraIndexOffsets&&this.header.extraIndexOffsets.length>0){this._searchTrees=[];for(let e of this.header.extraIndexOffsets){const t=await _c.loadBpTree(this.path,this.config,e);this._searchTrees.push(t)}}return this._searchTrees}async getZoomHeaders(){return this.zoomLevelHeaders||await this.loadHeader(),this.zoomLevelHeaders}async loadHeader(){if(this.header)return this.header;{let e,t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:{start:0,size:64}}));this.littleEndian=!0;let i=new Ac(new DataView(t),this.littleEndian),n=i.getUInt();if(2291137574===n)this.type="bigwig";else if(2273964779===n)this.type="bigbed";else{this.littleEndian=!1,i.littleEndian=!1,i.position=0;let e=i.getUInt();654085990===e?this.type="bigwig":3958540679===e&&(this.type="bigbed")}e={bwVersion:i.getUShort(),nZoomLevels:i.getUShort(),chromTreeOffset:i.getLong(),fullDataOffset:i.getLong(),fullIndexOffset:i.getLong(),fieldCount:i.getUShort(),definedFieldCount:i.getUShort(),autoSqlOffset:i.getLong(),totalSummaryOffset:i.getLong(),uncompressBuffSize:i.getInt(),extensionOffset:i.getLong()};const r=64;let s={start:r,size:e.fullDataOffset-r+4};t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:s}));const o=e.nZoomLevels;i=new Ac(new DataView(t),this.littleEndian),this.zoomLevelHeaders=[],this.firstZoomDataOffset=Number.MAX_SAFE_INTEGER;for(let e=1;e<=o;e++){const t=o-e,n=new Jh(t,i);this.firstZoomDataOffset=Math.min(n.dataOffset,this.firstZoomDataOffset),this.zoomLevelHeaders[t]=n}if(e.autoSqlOffset>0){i.position=e.autoSqlOffset-r;const t=i.getString();t&&(this.autoSql=function(e){let t;const i=[];let n=!1;const r=e.trim().split(/\s*[\r\n]+\s*/g);for(let e of r)if(e.startsWith("table"))t=e.split(/\s+/)[1].trim();else if(e.startsWith("("))n=!0;else if(e.startsWith(")"));else if(n&&e.length>0){const t=e.indexOf(";"),n=e.substr(0,t).split(/\s+/),r=e.substr(t+1).replace(/"/g,"").trim();i.push({type:n[0],name:n[1],description:r})}return{table:t,fields:i}}(t))}if(e.totalSummaryOffset>0&&(i.position=e.totalSummaryOffset-r,this.totalSummary=new ed(i)),!(e.chromTreeOffset>0))throw"BigWig chromosome tree offset <= 0";return i.position=e.chromTreeOffset-r,this.chromTree=await $h.parseTree(i,r,this.genome),this.chrNames=new Set(this.chromTree.idToName),i.position=e.fullDataOffset-r,e.dataCount=i.getInt(),this.featureDensity=e.dataCount/this.chromTree.sumLengths,this.header=e,e.extensionOffset>0&&await this.loadExtendedHeader(e.extensionOffset),this.header}}async loadExtendedHeader(e){let t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:{start:e,size:64}})),i=new Ac(new DataView(t),this.littleEndian);i.getUShort();const n=i.getUShort(),r=i.getLong();if(0===n)return;let s=56*n;t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:{start:r,size:s}})),i=new Ac(new DataView(t),this.littleEndian);const o=[],a=[],c=[];for(let e=0;e<n;e++){o.push(i.getUShort());const e=i.getUShort();c.push(i.getLong()),a.push(i.getInt());for(let t=0;t<e;t++)i.getUShort(),a.push(i.getUShort())}this.header.extraIndexCount=n,this.header.extraIndexOffsets=c}async loadRPTree(e){let t=this.rpTreeCache.get(e);return t||(t=new Kh(this.path,this.config,e),await t.init(),this.rpTreeCache.set(e,t),t)}async getType(){return await this.loadHeader(),this.type}async getTrackType(){return await this.loadHeader(),"bigwig"===this.type?"wig":this.autoSql&&"chromatinInteract"===this.autoSql.table?"interact":"annotation"}async _loadFeaturesForRange(e,t){const i=await this.loader.loadArrayBuffer(this.config.url,qa(this.config,{range:{start:e,size:t}})),n=new Uint8Array(i),r=this.header.uncompressBuffSize>0?ls(n):n,s=[];return nd.call(this).call(this,new DataView(r.buffer),0,0,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,s,this.chromTree.idToName),s}}class Jh{constructor(e,t){this.index=e,this.reductionLevel=t.getInt(),this.reserved=t.getInt(),this.dataOffset=t.getLong(),this.indexOffset=t.getLong()}}class ed{constructor(e){e?(this.basesCovered=e.getLong(),this.minVal=e.getDouble(),this.maxVal=e.getDouble(),this.sumData=e.getDouble(),this.sumSquares=e.getDouble(),td.call(this)):(this.basesCovered=0,this.minVal=0,this.maxVal=0,this.sumData=0,this.sumSquares=0,this.mean=0,this.stddev=0)}}function td(){let e=this.basesCovered;if(e>0){this.mean=this.sumData/e,this.stddev=Math.sqrt(this.sumSquares/(e-1));let t=this.minVal<0?this.mean-2*this.stddev:0,i=this.maxVal>0?this.mean+2*this.stddev:0;this.defaultRange={min:t,max:i}}}function id(e,t,i,n,r,s,o,a,c){const l=new Ac(e,c),h=l.getInt(),d=l.getInt();let u=d,f=l.getInt();const p=l.getInt(),g=l.getInt(),m=l.getByte();l.getByte();let w=l.getUShort();if(h>=t&&h<=n){let e=0;for(;w-- >0;){let a;switch(m){case 1:u=l.getInt(),f=l.getInt(),a=l.getFloat();break;case 2:u=l.getInt(),a=l.getFloat(),f=u+g;break;case 3:a=l.getFloat(),u=d+e*p,f=u+g,e++}if(!(h<t||h===t&&f<i)){if(h>n||h===n&&u>=r)break;if(Number.isFinite(a)){const e=o[h];s.push({chr:e,start:u,end:f,value:a})}}}}}function nd(){const e=function(e,t,i,n){if("biginteract"===n||i&&("chromatinInteract"===i.table||"interact"===i.table))return function(e,t){return e.chr1=t[5],e.start1=Number.parseInt(t[6]),e.end1=Number.parseInt(t[7]),e.chr2=t[10],e.start2=Number.parseInt(t[11]),e.end2=Number.parseInt(t[12]),e.name=t[0],e.score=Number(t[1]),e.value=Number(t[2]),e.color="."===t[4]?void 0:"0"===t[4]?"rgb(0,0,0)":t[4],e};{const n=e-3;return function(r,s){if(n>0&&(r.name=s[0]),n>1&&(r.score=Number(s[1])),n>2&&(r.strand=s[2]),n>3&&(r.cdStart=parseInt(s[3])),n>4&&(r.cdEnd=parseInt(s[4])),n>5&&"."!==s[5]&&"0"!==s[5]&&"-1"!==s[5]){const e=_s.createColorString(s[5]);r.color=e.startsWith("rgb")?e:void 0}if(n>8){const e=parseInt(s[6]),t=s[7].split(","),i=s[8].split(","),n=[];for(let s=0;s<e;s++){const e=r.start+parseInt(i[s]),o=e+parseInt(t[s]);n.push({start:e,end:o})}!function(e,t,i){for(let n of e){const e=n.end,r=n.start;e<t||r>i?n.utr=!0:(t>=r&&t<=e&&(n.cdStart=t),i>=r&&i<=e&&(n.cdEnd=i))}}(n,r.cdStart,r.cdEnd),r.exons=n}if(i)for(let n=e;n<t;n++)if(n<i.fields.length){const e=i.fields[n].name,t=s[n-3];r[e]=t}}}}(this.header.definedFieldCount,this.header.fieldCount,this.autoSql,this.format);return function(t,i,n,r,s,o,a,c,l){const h=new Ac(t,l);for(;h.remLength()>=13;){const t=h.getInt(),c=a[t],l=h.getInt(),d=h.getInt(),u=h.getString();if(!(t<i||t===i&&d<n)){if(t>r||t===r&&l>=s)break;if(d>0){const t={chr:c,start:l,end:d};o.push(t);const i=u.split("\t");e(t,i)}}}}}function rd(e,t,i,n,r,s,o,a,c){const l=new Ac(e,c);for(;l.remLength()>=32;){const e=l.getInt(),c=l.getInt(),h=l.getInt(),d=l.getInt(),u=l.getFloat(),f=l.getFloat(),p=l.getFloat();let g;switch(l.getFloat(),a){case"min":g=u;break;case"max":g=f;break;default:g=0===d?0:p/d}if(!(e<t||e===t&&h<i)){if(e>n||e===n&&c>=r)break;if(Number.isFinite(g)){const t=o[e];s.push({chr:t,start:c,end:h,value:g})}}}}class sd{constructor(e){this.data=vs(e).buffer}loadArrayBuffer(e,t){const i=t.range;return i?this.data.slice(i.start,i.start+i.size):this.data}async dataViewForRange(e,t){const i=Math.min(this.data.byteLength-e.start,e.size);return t?new Uint8Array(this.data,e.start,i):new DataView(this.data,e.start,i)}}class od extends Hh{queryable=!0;#h={};windowFunctions=["mean","min","max"];constructor(e,t){super(t),this.reader=new Zh(e,t),this.genome=t,this.format=e.format||"bigwig"}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,windowFunction:r}){await this.reader.loadHeader();const s="bigwig"===this.reader.type;let o;return o="all"===e.toLowerCase()?s?await this.getWGValues(r,n):[]:await this.reader.readFeatures(e,t,e,i,n,r),s||Tl(o),o}async getHeader(){return this.reader.loadHeader()}async defaultVisibilityWindow(){return"bigwig"===this.reader.type?-1:this.reader.featureDensity?Math.floor(1e4/this.reader.featureDensity):-1}async getWGValues(e,t){const i=this.genome,n=this.#h[e];if(n&&n.bpPerPixel>.8*t&&n.bpPerPixel<1.2*t)return n.values;{const n=await this.reader.readWGFeatures(t,e);let r=[];for(let e of n){const t=e.chr,n=i.getCumulativeOffset(t);if(void 0===n)continue;const s=Object.assign({},e);s.chr="all",s.start=n+e.start,s.end=n+e.end,s._f=e,r.push(s)}return r.sort(((e,t)=>e.start-t.start)),this.#h[e]={values:r,bpPerPixel:t},r}}supportsWholeGenome(){return"bigwig"===this.reader.type}async trackType(){return this.reader.getTrackType()}get searchable(){return this.reader.searchable}async search(e){return this.reader.search(e)}}const ad=.01;function cd(e,t,i,n){if(void 0===this.dataRange||void 0===this.dataRange.max||void 0===this.dataRange.min)return;xo.fillRect(e,0,0,t,i,{fillStyle:"white"}),n&&xo.fillRect(e,t-4-2,0,4,i,{fillStyle:n});const r=void 0!==this.flipAxis&&this.flipAxis,s=.95*t-8-5,o=.95*t-5,a={font:"normal 10px Arial",textAlign:"right",fillStyle:"black",strokeStyle:"black"};xo.strokeLine(e,s,ad*i,o,ad*i,a),xo.fillText(e,l(r?this.dataRange.min:this.dataRange.max),s+4,ad*i+12,a);const c=.99*i;function l(e){return 0===e?"0":Math.abs(e)>=10?e.toFixed():Math.abs(e)>=1?e.toFixed(1):Math.abs(e)>=.1?e.toFixed(2):e.toExponential(1)}xo.strokeLine(e,s,c,o,c,a),xo.fillText(e,l(r?this.dataRange.max:this.dataRange.min),s+4,c-4,a),xo.strokeLine(e,o,ad*i,o,c,a)}class ld extends Hl{static defaults={height:50,flipAxis:!1,logScale:!1,windowFunction:"mean",graphType:"bar",normalize:void 0,scaleFactor:void 0,overflowColor:"rgb(255, 32, 255)",baselineColor:"lightGray",summarize:!0};constructor(e,t){super(e,t)}init(e){super.init(e),this.type="wig",this.featureType="numeric",this.resolutionAware=!0,this.paintAxis=cd;const t=e.format?e.format.toLowerCase():e.format;e.featureSource?(this.featureSource=e.featureSource,delete e.featureSource):this.featureSource="bigwig"===t?new od(e,this.browser.genome):"tdf"===t?new Qh(e,this.browser.genome):Ad(e,this.browser.genome),void 0===e.max||!0===e.autoscale?this.autoscale=!0:this.dataRange={min:e.min||0,max:e.max}}async postInit(){const e=await this.getHeader();this.disposed||e&&this.setTrackProperties(e)}async getFeatures(e,t,i,n){const r=this.windowFunction,s=await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:this.visibilityWindow,windowFunction:r});if(this.normalize&&this.featureSource.normalizationFactor){const e=this.featureSource.normalizationFactor;for(let t of s)t.value*=e}if(this.scaleFactor){const e=this.scaleFactor;for(let t of s)t.value*=e}return!this.summarize||"mean"!==r&&"min"!==r&&"max"!==r?s:hd(s,t,n,r)}menuItemList(){const e=[];if(void 0!==this.flipAxis){function t(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}e.push("<hr>"),e.push({label:"Flip y-axis",click:t})}return this.featureSource.windowFunctions&&e.push(...this.wigSummarizationItems()),e.push(...this.numericDataMenuItems()),e}wigSummarizationItems(){const e=this.featureSource.windowFunctions,t=[];t.push("<hr/>"),t.push("<div>Windowing function</div>");for(const i of e){const n=Bt(Dl(i,this.windowFunction===i));function r(){this.windowFunction=i,this.trackView.updateViews()}t.push({object:n,click:r})}return t}async getHeader(){return"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader()),this.header}getScaleFactor(e,t,i,n){const r=!0===n?e<0?-Math.log10(Math.abs(e)+1):Math.log10(Math.abs(e)+1):e;return i/((!0===n?Math.log10(Math.abs(t)+1):t)-r)}computeYPixelValue(e,t){return(this.flipAxis?e-this.dataRange.min:this.dataRange.max-e)*t}computeYPixelValueInLogScale(e,t){let i=this.dataRange.max,n=this.dataRange.min;return n=n<0?-Math.log10(Math.abs(n)+1):Math.log10(Math.abs(n)+1),i=i<0?-Math.log10(Math.abs(i)+1):Math.log10(Math.abs(i)+1),e=e<0?-Math.log10(Math.abs(e)+1):Math.log10(e+1),(this.flipAxis?e-n:i-e)*t}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=e.pixelHeight-1,a=r+s*n+1,c=this.getScaleFactor(this.dataRange.min,this.dataRange.max,o,this.logScale),l=e=>this.logScale?this.computeYPixelValueInLogScale(e,c):this.computeYPixelValue(e,c);if(t&&t.length>0&&(void 0===this.dataRange.min&&(this.dataRange.min=0),this.dataRange.max>this.dataRange.min)){let s,c=-1;const h=l(0);for(let d of t){if(d.end<r)continue;if(d.start>a)break;const t=(d.start-r)/n;if(isNaN(t))continue;let u=l(d.value);const f=(d.end-r)/n-t,p=e.alpha?_s.addAlpha(this.getColorForFeature(d),e.alpha):this.getColorForFeature(d);if("line"===this.graphType)void 0!==s&&xo.strokeLine(i,c,s,t,u,{fillStyle:p,strokeStyle:p}),xo.strokeLine(i,t,u,t+f,u,{fillStyle:p,strokeStyle:p});else if("points"===this.graphType){const e=this.config.pointSize||3,n=t+f/2;xo.fillCircle(i,n,u,e/2,{fillStyle:p,strokeStyle:p}),d.value>this.dataRange.max?xo.fillCircle(i,n,e/2,e/2,3,{fillStyle:this.overflowColor}):d.value<this.dataRange.min&&xo.fillCircle(i,n,o-e/2,e/2,3,{fillStyle:this.overflowColor})}else{const e=Math.min(o,u-h);xo.fillRect(i,t,h,f,e,{fillStyle:p}),d.value>this.dataRange.max?xo.fillRect(i,t,0,f,3,{fillStyle:this.overflowColor}):d.value<this.dataRange.min&&xo.fillRect(i,t,o-2,f,3,{fillStyle:this.overflowColor})}c=t+f,s=u}if(this.dataRange.min<0){let t=this.dataRange.max,n=this.dataRange.min;n=!0===this.logScale?n<0?-Math.log10(Math.abs(n)+1):Math.log10(Math.abs(n)+1):n,t=!0===this.logScale?t<0?-Math.log10(Math.abs(t)+1):Math.log10(Math.abs(t)+1):t;const r=t/(t-n),s=this.flipAxis?(1-r)*o:r*o;xo.strokeLine(i,0,s,e.pixelWidth,s,{strokeStyle:this.baselineColor})}}if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=l(t.y),n={strokeStyle:t.color,strokeWidth:2};t.dotted?xo.dashedLine(e.context,0,i,e.pixelWidth,i,5,n):xo.strokeLine(e.context,0,i,e.pixelWidth,i,n)}}popupData(e,t){if(void 0===t&&(t=this.clickedFeatures(e)),t&&t.length>0){const i=e.genomicLocation,n=[];t.sort((function(e,t){return Math.abs((e.start+e.end)/2-i)-Math.abs((t.start+t.end)/2-i)}));const r=t.length>10?t.slice(0,10):t;r.sort((function(e,t){return e.start-t.start}));for(let e of r)if(e){n.length>0&&n.push("<hr/>");let t=e.end-e.start==1?Rt(Math.floor(e.start)+1):Rt(Math.floor(e.start)+1)+"-"+Rt(Math.floor(e.end));n.push({name:"Position:",value:t}),n.push({name:"Value:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",value:Rt(e.value.toFixed(4))})}return r.length<t.length&&n.push("<hr/>..."),n}return[]}get supportsWholeGenome(){return!this.config.indexURL&&!1!==this.config.supportsWholeGenome}getColorForFeature(e){let t=e.value<0&&this.altColor?this.altColor:this.color||"rgb(150, 150, 150)";return"function"==typeof t?t(e.value):t}dispose(){this.trackView=void 0}}function hd(e,t,i,n="mean"){if(i<=1||!e||0===e.length)return e;const r=e[0].chr,s=i,o=[],a=e=>{const i=t+e.bin*s,a=i+s;let c;switch(n){case"mean":c=e.sumData/e.count;break;case"max":c=e.max;break;case"min":c=e.min;break;default:throw Error(`Unknown window function: ${n}`)}const l=`${n} of ${e.count} values`;o.push({chr:r,start:i,end:a,value:c,description:l})};let c;for(let i of e){let e=Math.floor((i.start-t)/s);const n=Math.floor((i.end-t)/s);if(c&&e===c.bin&&(c.add(i),e++),!c||n>c.bin){if(c&&a(c),n>e){const e=t+n*s;o.push({chr:r,start:i.start,end:e,value:i.value})}c=new dd(n,i)}}c&&a(c);const l=[];let h=o[0];for(let e of o)h.value===e.value&&e.start<=h.end?h.end=e.end:(l.push(h),h=e);return l.push(h),l}class dd{constructor(e,t){this.bin=e,this.sumData=t.value,this.count=1,this.min=t.value,this.max=t.value}add(e){this.sumData+=e.value,this.max=Math.max(e.value,this.max),this.min=Math.min(e.value,this.min),this.count++}get mean(){return this.sumData/this.count}}class ud extends Hh{constructor(e,t){super(t),this.config=e||{},this.genome=t,this.sourceType=void 0===e.sourceType?"file":e.sourceType,this.maxWGCount=e.maxWGCount||1e4,this.windowFunctions=["mean","min","max","none"];const i=new Set(["bigwig","bw","bigbed","bb","biginteract","biggenepred","bignarrowpeak","tdf"]);if(this.queryable=e.indexURL||!0===e.queryable,e.reader)this.reader=e.reader,this.queryable=!1!==e.queryable;else{if("ga4gh"===e.sourceType)throw Error("Unsupported source type 'ga4gh'");"eqtl"!==e.type&&"qtl"!==e.type||"gtex-ws"!==e.sourceType?"htsget"===e.sourceType?(this.reader=new Lh(e,t),this.queryable=!0):"ucscservice"===e.sourceType?(this.reader=new Nh(e.source),this.queryable=!0):"custom"===e.sourceType?(this.reader=new Eh(e.source),this.queryable=!1!==e.source.queryable):"service"===e.sourceType?(this.reader=new Ih(e,t),this.queryable=!0):(this.reader=new Ih(e,t),void 0!==e.queryable?this.queryable=e.queryable:(i.has(e.format)||this.reader.indexed)&&(this.queryable=!0)):(this.reader=new Bh(e),this.queryable=!0)}this.searchable=!1!==e.searchable}async defaultVisibilityWindow(){if(this.reader&&"function"==typeof this.reader.defaultVisibilityWindow)return this.reader.defaultVisibilityWindow()}async trackType(){const e=await this.getHeader();return e?e.type:void 0}async getHeader(){if(!this.header)if(this.reader&&"function"==typeof this.reader.readHeader){const e=await this.reader.readHeader();e?(this.header=e,e.format&&(this.config.format=e.format)):this.header={}}else this.header={};return this.header}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r,windowFunction:s}){const o="all"===e.toLowerCase();if(t=t||0,i=i||Number.MAX_SAFE_INTEGER,(o&&!this.wgFeatures&&this.supportsWholeGenome()||this.config.disableCache||!this.featureCache||!this.featureCache.containsRange(new dc(e,t,i)))&&await this.loadFeatures(e,t,i,r),o){if(!this.wgFeatures)if(this.supportsWholeGenome())if("wig"===this.config.type){const e=await Ll(this.featureCache.getAllFeatures(),this.genome,1e6);this.wgFeatures=hd(e,0,n,s)}else this.wgFeatures=await Ll(this.featureCache.getAllFeatures(),this.genome,this.maxWGCount);else this.wgFeatures=[];return this.wgFeatures}return this.featureCache.queryFeatures(e,t,i)}async findFeatures(e){return this.featureCache?this.featureCache.findFeatures(e):[]}supportsWholeGenome(){return!this.queryable}getAllFeatures(){return this.queryable||!this.featureCache?[]:this.featureCache.getAllFeatures()}async loadFeatures(e,t,i,n){await this.getHeader();const r=this.reader;let s=t,o=i,a=e;if(!this.chrAliasManager&&this.reader&&this.reader.sequenceNames&&(this.chrAliasManager=new zh(this.reader.sequenceNames,this.genome)),this.chrAliasManager&&(a=await this.chrAliasManager.getAliasName(e)),(!n||n<=0)&&!1!==this.config.expandQuery){const e=this.genome?this.genome.getChromosome(a):void 0;s=0,o=Math.max(e?e.bpLength:Number.MAX_SAFE_INTEGER,i)}else if(n>i-t&&!1!==this.config.expandQuery){let e=Math.min(4.1*(i-t),n);this.config.minQuerySize&&e<this.config.minQuerySize&&(e=this.config.minQuerySize),s=Math.max(0,(t+i-e)/2),o=s+e}let c=await r.readFeatures(a,s,o);void 0===this.queryable&&(this.queryable=r.indexed);const l=this.queryable?new dc(e,s,o):void 0;if(c){if("wig"!==this.config.format&&"junctions"!==this.config.type){zl(c,this.config.maxRows||Number.MAX_SAFE_INTEGER)}this.featureCache=new Zs(c,this.genome,l),this.searchable&&this.addFeaturesToDB(c,this.config)}else this.featureCache=new Zs([],l)}addFeaturesToDB(e,t){this.featureMap||(this.featureMap=new Map);const i=t.searchableFields||["name","transcript_id","gene_id","gene_name","id"];for(let t of e)for(let e of i){let i;if("function"==typeof t.getAttributeValue&&(i=t.getAttributeValue(e)),i){if(i=i.replaceAll(" ","+").toUpperCase(),this.featureMap.has(i)){const e=this.featureMap.get(i);if(t.end-t.start<e.end-e.start)continue}this.featureMap.set(i,t)}}}search(e){if(this.featureMap)return this.featureMap.get(e.toUpperCase())}}class fd extends Hh{constructor(e,t){super(t),this.config=e,this.genome=t,this.queryable=!1,this.searchable=!1!==e.searchable,this.updateFeatures(e.features)}updateFeatures(e){zl(e=function(e,t){if(t)for(let i of e)i.chr=t.getChromosomeName(i.chr);return e}(e,this.genome)),this.config.mappings&&function(e,t){let i=Object.keys(t);e.forEach((function(e){i.forEach((function(i){e[i]=e[t[i]]}))}))}(e,this.config.mappings),this.featureCache=new Zs(e,this.genome),(this.searchable||this.config.searchableFields)&&this.addFeaturesToDB(e,this.config)}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){const s=this.genome,o=s?s.getChromosomeName(e):e;return"all"===o.toLowerCase()?Ll(this.featureCache.getAllFeatures(),this.genome,this.maxWGCount):this.featureCache.queryFeatures(o,t,i)}getAllFeatures(){return this.featureCache.getAllFeatures()}supportsWholeGenome(){return!0}addFeaturesToDB(e,t){this.featureMap||(this.featureMap=new Map);const i=t.searchableFields||["name"];for(let t of e)for(let e of i){let i;if("function"==typeof t.getAttributeValue&&(i=t.getAttributeValue(e)),i||(i=t[e]),i){i=i.replaceAll(" ","+");const e=this.featureMap.get(i.toUpperCase());if(e&&e.end-e.start>t.end-t.start)continue;this.featureMap.set(i.toUpperCase(),t)}}}search(e){if(this.featureMap)return this.featureMap.get(e.toUpperCase())}}class pd{constructor({chr:e,locus:t,accession:i,aliases:n,features:r,sequence:s}){this.chr=e,this.locus=t,this.accession=i,this.aliases=n,this.features=r,this.sequence=s,this.bpLength=s.length}toJSON(){return{gbkURL:this.url}}getSequenceRecord(e){return{chr:this.chr,bpLength:this.bpLength}}get chromosomeNames(){return[this.chr]}getFirstChromosomeName(){return this.chr}get id(){return this.accession}get name(){return this.locus}get initialLocus(){return this.chr}get description(){return this.locus}get infoURL(){return this.url}showWholeGenomeView(){return!1}getHomeChromosomeName(){return this.chr}getChromosomeName(e){return e}getChromosomeDisplayName(e){return this.chr}getChromosome(e){if(e===this.chr)return{name:this.chr,bpLength:this.bpLength}}async loadChromosome(e){return this.getChromosome(e)}async getAliasRecord(e){}getCytobands(e){return[]}getChromosomes(){return[this.getChromosome(this.chr)]}get wgChromosomeNames(){}getGenomeCoordinate(e,t){if(e===this.chr)return t}getChromosomeCoordinate(e){return{chr:this.chr,position:e}}getCumulativeOffset(e){return 0}getGenomeLength(){return this.bpLength}async getSequence(e,t,i){return e===this.chr?this.sequence.substring(t,i):void 0}getSequenceInterval(e,t,i){return e===this.chr?new uc(this.chr,0,this.sequence.length,this.sequence):void 0}}const gd=/\s+/,md=new Map;async function wd(e){let t=md.get(e);if(!t){t=function(e){if(!e)return null;const t=mh(e);let i=t.nextLine();const n=i.split(/\s+/);if("LOCUS"!==n[0].toUpperCase())throw Error("Expected `LOCUS` line. Found: "+i);const r=n[1].trim();let s,o;do{if(i=t.nextLine(),i.startsWith("ACCESSION")){const e=i.split(gd);if(e.length<2)throw Error("Genbank file missing ACCESSION number.");s=e[1].trim()}else if(i.startsWith("ALIASES")){const e=i.split(gd);e.length>1&&(o=e[1].split(","))}}while(i&&!i.startsWith("FEATURES"));const a=s||r,c=function(e,t){const i=[];let n,r,s,o=0;for(;;)if(r=t.nextLine(),""!==r){if(!r||r.startsWith("ORIGIN"))break;if(r.length<6)o<10&&console("Unexpected line in genbank file (skipping): "+r),o++;else if(" "!==r.charAt(5)){let t=r.substring(5,21).trim();s={chr:e,type:t,attributes:{},getAttributeValue:function(e){return this.attributes[e]}},n=r.substring(21),"source"!==t.toLowerCase()&&i.push(s)}else{let t=r.substring(21).trim();if(t.length>0)if(47===t.charCodeAt(0)){if(47===n.charCodeAt(0)){let e=n.split("=",2);if(e.length>1){let t=e[0].length>1?e[0].substring(1):"",i=Fd(e[1]);s.attributes[t]=i}}else{const t=n.includes("complement")?"-":"+";s.strand=t;let i=n.replace("join","").replace("order","").replace("complement","").replace("(","").replace(")","");if(i.includes("..")){i=i.replace("<","").replace(">","");const n=bd(i,e,t),r=n[0];s.start=r.start;const o=n[n.length-1];s.end=o.end,n.length>1&&(s.exons=n)}else s.start=parseInt(i)-1,s.end=s.start+1}n=t}else n+=t}}return i}(a,t),l=function(e){let t,i="";for(;(t=e.nextLine())&&!t.startsWith("//");){t=t.trim();const e=t.split(/\s+/);for(let t=1;t<e.length;t++)i+=e[t]}return i}(t);return new pd({chr:a,locus:r,accession:s,aliases:o,features:c,sequence:l})}(await Qs.loadString(e,{})),t.url=e,md.set(e,t)}return t}function bd(e,t,i){const n=e.split(","),r=[];e.includes("complement");for(const e of n){const n=e.split("..");let s=0;try{s=parseInt(n[0])-1}catch(e){console.error(e)}let o=s+1;n.length>1&&(o=parseInt(n[1])),r.push({chr:t,start:s,end:o,strand:i})}return r.sort((function(e,t){return e.start-t.start})),r}function Fd(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.substring(1,e.length-2)),e}class vd extends Hh{constructor(e,t){super(t),this.config=e,this.searchable=!0}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){if(!this.featureSource){const e=await wd(this.config.url);this.featureSource=new fd({genome:this.config.genome,features:e.features,searchableFields:["gene","db_xref","locus_tag","transcript_id"]})}return this.featureSource.getFeatures({chr:e,start:t,end:i})}supportsWholeGenome(){return!1}search(e){return this.featureSource.search(e)}}const yd=new Set(["bigwig","bw","bigbed","bb","biginteract","biggenepred","bignarrowpeak"]);function Ad(e,t){const i=e.format?e.format.toLowerCase():void 0;return e.features?new fd(e,t):yd.has(i)?new od(e,t):"tdf"===i?new Qh(e,t):"gbk"===i?new vd(e,t):new ud(e,t)}function Cd(e){return(3-e.readingFrame)%3}function _d(e){return e.cdStart||e.start}function xd(e){return e.cdEnd||e.end}const kd=.25;function Id(e,t,i){let n=(e.start-t)/i,r=(e.end-t)/i,s=r-n;return s<3&&(s=3,n-=1.5),{px:n,px1:r,pw:s}}function Sd(e,t,i,n,r,s){try{r.save(),r.fillStyle=this.color,r.strokeStyle=this.color;const n=this.getColorForFeature(e);let o,a;r.fillStyle=n,r.strokeStyle=n,"SQUISHED"===this.displayMode&&void 0!==e.row?(o=this.featureHeight/2,a=this.margin+this.squishedRowHeight*e.row):"EXPANDED"===this.displayMode&&void 0!==e.row?(o=this.featureHeight,a=this.margin+this.expandedRowHeight*e.row):(o=this.featureHeight,a=this.margin);const c=s.pixelWidth,l=a+o/2,h=o/2,d=l-h/2,u=e.exons?e.exons.length:0,f=Id(e,t,i),p=this.arrowSpacing,g="+"===e.strand?1:"-"===e.strand?-1:0;if(0===u){const e=Math.max(0,f.px),t=Math.min(c,f.px1),i=t-e;if(r.fillRect(e,a,i,o),0!==g){r.fillStyle="white",r.strokeStyle="white";for(let i=e+p/2;i<t;i+=p)xo.strokeLine(r,i-2*g,l-2,i,l),xo.strokeLine(r,i-2*g,l+2,i,l);r.fillStyle=n,r.strokeStyle=n}}else{xo.strokeLine(r,f.px+1,l,f.px1-1,l);const u=Math.max(0,f.px)+p/2,m=Math.min(c,f.px1);for(let e=u;e<m;e+=p)xo.strokeLine(r,e-2*g,l-2,e,l),xo.strokeLine(r,e-2*g,l+2,e,l);for(let u=0;u<e.exons.length;u++){const f=e.exons[u];let m,w=Math.round((f.start-t)/i),b=Math.round((f.end-t)/i),F=Math.max(1,b-w);if(!(w+F<0)){if(w>c)break;if(f.utr)r.fillRect(w,d,F,h);else{if(f.cdStart&&(m=Math.round((f.cdStart-t)/i),r.fillRect(w,d,m-w,h),F-=m-w,w=m),f.cdEnd&&(m=Math.round((f.cdEnd-t)/i),r.fillRect(m,d,b-m,h),F-=b-m,b=m),F=Math.max(F,1),r.fillRect(w,a,F,o),void 0!==f.readingFrame&&s.bpPerPixel<kd&&s.sequenceInterval){const i=u>0&&void 0!==e.exons[u-1].readingFrame?e.exons[u-1]:void 0,n=u<e.exons.length-1&&void 0!==e.exons[u+1].readingFrame?e.exons[u+1]:void 0;Ed.call(this,r,e.strand,i,f,n,t,s.bpPerPixel,a,o,s.sequenceInterval)}if(F>p+5&&0!==g&&s.bpPerPixel>kd){r.fillStyle="white",r.strokeStyle="white";for(let e=w+p/2;e<b;e+=p)xo.strokeLine(r,e-2*g,l-2,e,l),xo.strokeLine(r,e-2*g,l+2,e,l);r.fillStyle=n,r.strokeStyle=n}}}}}s.drawLabel&&"SQUISHED"!==this.displayMode&&Nd.call(this,r,e,f.px,f.px1,a,s.referenceFrame,s)}finally{r.restore()}}function Ed(e,t,i,n,r,s,o,a,c,l){const h=["rgb(124,124,204)","rgb(12, 12, 120)"];e.save();const d=(t,i,n,r,d,u)=>{const f=Math.round((i-s)/o),p=Math.round((n-s)/o)-f;let g;if(void 0===r){if(l.hasSequence(i,n)){const e=l.getSequence(i,n);if(e&&3===e.length){const i="+"===t?e:cc(e.split("").reverse().join(""));g=Gd[i]}}}else g=r;e.fillStyle="M"===r||"M"===g&&0===u?"#83f902":"STOP"===g?"#ff2101":h[d],e.fillRect(f,a,p,c),g&&(e.save(),((t,i,n,r,s)=>{"STOP"===s&&(s="*");const o=e.measureText(s).width;xo.fillText(e,s,n+(i-o)/2,r-4,{fillStyle:"#ffffff"})})(0,p,f,a+c,g),e.restore());const m=n-i;return m>0&&m<3?{start:i,end:n}:void 0},u=Cd(n);let f,p,g,m,w,b=_d(n),F=xd(n),v=1;if("+"===t){for(u>0&&(b+=u),v=1,w=0,f=b;f<F;w++,f+=3)m=v%2,p=Math.min(F,f+3),g=d(t,f,p,void 0,v%2,w),++v;if(u>0||g){const e=u>0?Bd.call(this,t,u,b-u,b,g,i,n,r,l):Bd.call(this,t,void 0,void 0,void 0,g,i,n,r,l);if(e){const{left:i,rite:n}=e;i&&d(t,b-u,b,i.aminoAcidLetter,0,void 0),n&&d(t,g.start,g.end,n.aminoAcidLetter,m,void 0)}}}else{for(u>0&&(F-=u),v=1,w=0,w=0,p=F;p>b;w++,p-=3)m=v%2,f=Math.max(b,p-3),g=d(t,f,p,void 0,v%2,w),++v;if(u>0||g){const e=u>0?Bd.call(this,t,u,F,F+u,g,i,n,r,l):Bd.call(this,t,void 0,void 0,void 0,g,i,n,r,l);if(e){const{left:i,rite:n}=e;n&&d(t,F,F+u,n.aminoAcidLetter,0,void 0),i&&d(t,g.start,g.end,i.aminoAcidLetter,m,void 0)}}}e.restore()}function Nd(e,t,i,n,r,s,o){try{e.save();let s=t.name;if(void 0===s&&t.gene&&(s=t.gene.name),void 0===s&&(s=t.id||t.ID),!s||"."===s)return;let a,c=(i+n)/2;"COLLAPSED"===this.displayMode&&"SLANT"===this.labelDisplayMode&&(a={rotate:{angle:45}});const l=function(e,t){return t?e+20:e+25}(r,a);let h=this.getColorForFeature(t),d=this.browser.qtlSelections.hasPhenotype(t.name);const u={textAlign:"SLANT"===this.labelDisplayMode?void 0:"center",fillStyle:h,strokeStyle:h},f=e.measureText(s),p=c-f.width/2,g=c+f.width/2,m=o.rowLastLabelX[t.row]||-Number.MAX_SAFE_INTEGER;(o.labelAllFeatures||p>m||d)&&(o.rowLastLabelX[t.row]=g,"y"===o.axis?(e.save(),xo.labelTransformWithContext(e,c),xo.fillText(e,s,c,l,u,a),e.restore()):(e.clearRect(c-f.width/2-1,l-f.actualBoundingBoxAscent-1,f.width+2,f.actualBoundingBoxAscent+f.actualBoundingBoxDescent+2),xo.fillText(e,s,c,l,u,a)))}finally{e.restore()}}function Bd(e,t,i,n,r,s,o,a,c){let l,h,d="",u="",f="";const p={left:void 0,rite:void 0};if("+"===e){if(t){if(u=c.getSequence(i,n),!u)return;if([l,h]=[xd(s)-(3-t),xd(s)],d=c.getSequence(l,h),!d)return;f=d+u,p.left={triplet:f,aminoAcidLetter:Gd[f]}}if(r){if(d=c.getSequence(r.start,r.end),!d)return;const e=Cd(a),t=_d(a);if(u=c.getSequence(t,t+e),!u)return;f=d+u,p.rite={triplet:f,aminoAcidLetter:Gd[f]}}}else{if(t){if(d=c.getSequence(i,n),void 0===d)return;if([l,h]=[_d(a),_d(a)+(3-t)],u=c.getSequence(l,h),void 0===u)return;f=d+u,f=cc(f.split("").reverse().join("")),p.rite={triplet:f,aminoAcidLetter:Gd[f]}}if(r){if(u=c.getSequence(r.start,r.end),void 0===u)return;const e=Cd(s),t=xd(s);if(d=c.getSequence(t-e,t),void 0===d)return;f=d+u,f=cc(f.split("").reverse().join("")),p.left={triplet:f,aminoAcidLetter:Gd[f]}}}return p}const Md=new Set(["nonsense","missense","stop-loss","frameshift","cds-indel"]),Rd=new Set(["coding-synon"]),Dd=new Set(["splice-3","splice-5"]),Td=new Set(["untranslated-5","untranslated-3"]);function Ld(e,t,i,n,r){var s,o,a,c,l,h,d=Id(e,t,i),u=this.margin,f=this.snpColors.length;switch(s="squished"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight,this.colorBy){case"function":c=e.func,h=c.split(","),l=h.map((function(e){return Md.has(e)||Dd.has(e)?f-1:Rd.has(e)?f-2:Td.has(e)?f-3:0})),o=l.reduce((function(e,t){return Math.max(e,t)}));break;case"class":o="deletion"===(a=e.class)?f-1:"mnp"===a?f-2:"microsatellite"===a||"named"===a?f-3:0}r.fillStyle=this.snpColors[o],r.fillRect(d.px,u,d.pw,s)}function zd(e,t,i,n,r){const s="EXPANDED"===this.displayMode?this.expandedRowHeight:this.squishedRowHeight;let o=this.margin;"COLLAPSED"!==this.displayMode&&void 0!==e.row&&(o+=e.row*s);const a=o+.5*s,c=a-.5*s,l=a+.5*s,h=Math.round((e.junction_left-t)/i),d=Math.round((e.junction_right-t)/i);r.beginPath(),r.moveTo(h,a),r.bezierCurveTo(h,c,d,c,d,a),r.lineWidth=1+Math.log(e.num_junction_reads)/Math.log(2),r.strokeStyle="blue",r.stroke();const u=e.spanning_frag_coords;for(let e=0;e<u.length;e++){const n=u[e],s=Math.round((n.left-t)/i),o=Math.round((n.right-t)/i);r.beginPath(),r.moveTo(s,a),r.bezierCurveTo(s,l,o,l,o,a),r.lineWidth=1,r.strokeStyle="purple",r.stroke()}}class Hd extends Hl{static defaults={type:"annotation",maxRows:1e3,displayMode:"EXPANDED",margin:10,featureHeight:14,autoHeight:!1,useScore:!1};constructor(e,t){super(e,t)}init(e){super.init(e),this.labelDisplayMode=e.labelDisplayMode,e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):"blat"!==e.type&&(this.featureSource=e.featureSource?e.featureSource:Ad(e,this.browser.genome)),"FusionJuncSpan"===e.type?(this.render=e.render||zd,this.squishedRowHeight=e.squishedRowHeight||50,this.expandedRowHeight=e.expandedRowHeight||50,this.height=e.height||this.margin+2*this.expandedRowHeight):"snp"===e.type?(this.render=e.render||Ld,this.snpColors=["rgb(0,0,0)","rgb(0,0,255)","rgb(0,255,0)","rgb(255,0,0)"],this.colorBy="function",this.expandedRowHeight=e.expandedRowHeight||10,this.squishedRowHeight=e.squishedRowHeight||5,this.height=e.height||30):(this.render=e.render||Sd,this.arrowSpacing=30,function(e){e.browser.on&&(e.browser.on("trackdragend",t),e.browser.on("trackremoved",i));function t(){e.trackView&&"SQUISHED"!==e.displayMode&&e.trackView.updateViews()}function i(n){e.browser.un&&e===n&&(e.browser.un("trackdragend",t),e.browser.un("trackremoved",i))}}(this),this.squishedRowHeight=e.squishedRowHeight||15,this.expandedRowHeight=e.expandedRowHeight||30,this.height=e.height||this.margin+2*this.expandedRowHeight,e.colorBy&&(e.colorBy.field&&(e.colorTable=e.colorBy.pallete||e.colorBy.palette,e.colorBy=e.colorBy.field),this.colorBy=e.colorBy,e.colorTable?this.colorTable=new ao(e.colorTable):this.colorTable=new oo("Set1")))}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow()),this}get searchable(){return this.featureSource.searchable}async search(e){return this.featureSource&&this.featureSource.searchable?this.featureSource.search(e):void 0}get supportsWholeGenome(){return void 0!==this.config.supportsWholeGenome?this.config.supportsWholeGenome:this.featureSource&&"function"==typeof this.featureSource.supportsWholeGenome?this.featureSource.supportsWholeGenome():!(void 0!==this.visibilityWindow||!1!==this.config.indexed&&this.config.indexURL)||void 0}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}computePixelHeight(e){if("COLLAPSED"===this.displayMode)return this.margin+this.expandedRowHeight;{let t=0;if(e&&"function"==typeof e.forEach)for(let i of e)i.row&&i.row>t&&(t=i.row);return this.margin+(t+1)*("SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight)}}draw(e){const{features:t,context:i,bpPerPixel:n,bpStart:r,bpEnd:s,pixelWidth:o,pixelHeight:a,referenceFrame:c}=e;if(n<kd&&(e.sequenceInterval=this.browser.genome.getSequenceInterval(c.chr,r,s)),this.isMergedTrack||xo.fillRect(i,0,e.pixelTop,o,a,{fillStyle:"rgb(255, 255, 255)"}),t){const c=[];e.rowLastX=[],e.rowLastLabelX=[];for(let i of t)if(i.start>r&&i.end<s){const t="COLLAPSED"===this.displayMode?0:i.row||0;c[t]?c[t]++:c[t]=1,e.rowLastX[t]=-Number.MAX_SAFE_INTEGER,e.rowLastLabelX[t]=-Number.MAX_SAFE_INTEGER}const l=o/Math.max(1,Math.max(...c.filter((e=>!isNaN(e)))));let h=[];const d=[];for(let o of t){if(o.end<r)continue;if(o.start>s)break;"COLLAPSED"===this.displayMode&&this.browser.qtlSelections.hasPhenotype(o.name)&&d.push(o);const t="COLLAPSED"===this.displayMode?0:o.row;e.drawLabel=e.labelAllFeatures||l>10;const c=Math.ceil((o.end-r)/n),u=h[t];if(!u||c>u){this.render.call(this,o,r,n,a,i,e);const s=Math.floor((o.start-r)/n);u&&s-u<=0&&(i.globalAlpha=.5,xo.strokeLine(i,s,0,s,a,{strokeStyle:"rgb(255, 255, 255)"}),i.globalAlpha=1),h[t]=c}}for(let t of d)e.drawLabel=!0,this.render.call(this,t,r,n,a,i,e)}else console.log("No feature list")}clickedFeatures(e){const t=e.y-this.margin,i=super.clickedFeatures(e);let n;switch(this.displayMode){case"SQUISHED":n=Math.floor(t/this.squishedRowHeight);break;case"EXPANDED":n=Math.floor(t/this.expandedRowHeight);break;default:n=void 0}return i.filter((function(e){return void 0===n||void 0===e.row||n===e.row}))}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=[];for(let e of t){const t=e._f||e,r="function"==typeof t.popupData?t.popupData(i):this.extractPopupData(t);if(r){n.length>0&&n.push("<hr/><hr/>");const s=this.infoURL||this.config.infoURL;for(let t of r)if(n.push(t),s&&t.name&&"name"===t.name.toLowerCase()&&t.value&&Mt(t.value)&&!t.value.startsWith("<")){const i=s.replace("$$",e.name);t.value=`<a target=_blank href=${i}>${t.value}</a>`}const o="gff"===this.config.format||"gff3"===this.config.format||"gtf"===this.config.format;if(t.exons&&t.exons.length>1)for(let e=0;e<t.exons.length;e++){const r=t.exons[e];if(i>=r.start&&i<=r.end){const i=o?r.number:"-"===t.strand?t.exons.length-e:e+1;i&&(n.push("<hr/>"),n.push({name:"Exon Number",value:i}));break}}}}return n}menuItemList(){const e=[];if(this.render===Ld){e.push("<hr/>");for(const i of["function","class"]){const n=Bt(Dl(`Color by ${i}`,i===this.colorBy));function r(){this.colorBy=i,this.trackView.repaintViews()}e.push({object:n,click:r})}}e.push("<hr/>");const t={COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"};for(const s of["COLLAPSED","SQUISHED","EXPANDED"]){const o=Bt(Dl(t[s],s===this.displayMode));function a(){this.displayMode=s,this.config.displayMode=s,this.trackView.checkContentHeight(),this.trackView.repaintViews()}e.push({object:o,click:a})}return e}contextMenuItemList(e){const t=this.clickedFeatures(e);if(void 0===t||0===t.length)return;t.length>1&&t.sort(((e,t)=>t.end-t.start-(e.end-e.start)));const i=t[0];if(i.end-i.start<=1e6){const e=[{label:"View feature sequence",click:async()=>{let e=await this.browser.genome.getSequence(i.chr,i.start,i.end);e?"-"===i.strand&&(e=lc(e)):e="Unknown sequence",this.browser.alert.present(e)}}];return Za()&&void 0!==navigator.clipboard&&e.push({label:"Copy feature sequence",click:async()=>{let e=await this.browser.genome.getSequence(i.chr,i.start,i.end);e?"-"===i.strand&&(e=lc(e)):e="Unknown sequence";try{await navigator.clipboard.writeText(e)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),e.push("<hr/>"),e}}description(){if(Ld===this.render){let e="<html>"+this.name+"<hr/>";return e+="<em>Color By Function:</em><br>",e+='<span style="color:red">Red</span>: Coding-Non-Synonymous, Splice Site<br>',e+='<span style="color:green">Green</span>: Coding-Synonymous<br>',e+='<span style="color:blue">Blue</span>: Untranslated<br>',e+='<span style="color:black">Black</span>: Intron, Locus, Unknown<br><br>',e+="<em>Color By Class:</em><br>",e+='<span style="color:red">Red</span>: Deletion<br>',e+='<span style="color:green">Green</span>: MNP<br>',e+='<span style="color:blue">Blue</span>: Microsatellite, Named<br>',e+='<span style="color:black">Black</span>: Indel, Insertion, SNP',e+="</html>",e}return super.description()}getColorForFeature(e){const t=e._f||e;let i;if(e.name&&this.browser.qtlSelections.hasPhenotype(e.name))i=this.browser.qtlSelections.colorForGene(e.name);else if(this.altColor&&"-"===t.strand)i="function"==typeof this.altColor?this.altColor(t):this.altColor;else if(this.color)i="function"==typeof this.color?this.color(t):this.color;else if(this.colorBy){const e=t.getAttributeValue?t.getAttributeValue(this.colorBy):t[this.colorBy];i=this.colorTable.getColor(e)}else t.color&&(i=t.color);if(i||(i="rgb(0, 0, 150)"),t.alpha&&1!==t.alpha)i=_s.addAlpha(i,t.alpha);else if(this.useScore&&t.score&&!Number.isNaN(t.score)){const e=function(e,t,i){const n=(t-e)/9,r=Math.floor((i-e)/n);return Math.min(1,.2+.8*r/9)}(this.config.min?this.config.min:this.viewLimitMin?this.viewLimitMin:0,this.config.max?this.config.max:this.viewLimitMax?this.viewLimitMax:1e3,t.score);t.alpha=e,i=_s.addAlpha(i,e)}return i}dispose(){this.trackView=void 0}}class Pd{constructor(t){if(this.config=t,this.browser=t.browser,this.columnFormat=t.columnFormat,this.tableRowSelectionList=[],this.tableDOM=e({class:"igv-roi-table"}),t.width){let[e]=t.width.split("px");e=parseInt(e,10),this.tableDOM.style.width=`${Math.min(e,1600)}px`}t.parent.appendChild(this.tableDOM),this.headerDOM=t,this.tableColumnTitles=this.tableDOM,this.tableRowContainer=this.tableDOM,this.footerDOM=t.gotoButtonHandler}set headerDOM({browser:t,parent:i,headerTitle:n,dismissHandler:r}){const s=e();this.tableDOM.appendChild(s);const o=e();s.appendChild(o),o.innerHTML=n;const a=e();s.appendChild(a),a.appendChild(l("times")),this.boundDismissHandler=function(e){e.stopPropagation(),r()}.bind(this),a.addEventListener("click",this.boundDismissHandler);const{y:c}=t.root.getBoundingClientRect(),{y:h}=i.getBoundingClientRect(),d=-(h-c);p(this.tableDOM,s,{minX:0,minY:d}),this.tableDOM.style.display="none",this._headerDOM=s}set tableColumnTitles(t){const i=e({class:"igv-roi-table-column-titles"});t.appendChild(i);for(const{label:t,width:n}of this.columnFormat){const r=e();i.appendChild(r),r.style.width=n,r.innerText=t}this._tableColumnTitlesDOM=i}get tableColumnTitles(){return this._tableColumnTitlesDOM}set tableRowContainer(t){const i=e({class:"igv-roi-table-row-container"});t.appendChild(i),this._tableRowContainerDOM=i}get tableRowContainer(){return this._tableRowContainerDOM}set footerDOM(t){const i=e();this.tableDOM.appendChild(i);const n=e({class:"igv-roi-table-button"});i.appendChild(n),n.id="igv-roi-table-view-button",n.textContent="Go To",n.style.pointerEvents="none",this._footerDOM=i,this.gotoButton=n,this.boundGotoButtonHandler=t.bind(this),this.gotoButton.addEventListener("click",this.boundGotoButtonHandler)}tableRowDOMHelper(e){e.addEventListener("mousedown",(t=>{t.stopPropagation(),e.classList.toggle("igv-roi-table-row-selected"),e.classList.contains("igv-roi-table-row-selected")?e.classList.remove("igv-roi-table-row-hover"):e.classList.add("igv-roi-table-row-hover"),this.setTableRowSelectionState(e.classList.contains("igv-roi-table-row-selected"))})),e.addEventListener("mouseover",(t=>{e.classList.contains("igv-roi-table-row-selected")?e.classList.remove("igv-roi-table-row-hover"):e.classList.add("igv-roi-table-row-hover")})),e.addEventListener("mouseout",(t=>{e.classList.remove("igv-roi-table-row-hover")}))}clearTable(){const e=this.tableRowContainer.querySelectorAll(".igv-roi-table-row");for(let t of e)t.remove()}setTableRowSelectionState(e){e?this.tableRowSelectionList.push(1):this.tableRowSelectionList.pop(),this.gotoButton.style.pointerEvents=this.tableRowSelectionList.length>0?"auto":"none"}present(){this.tableDOM.style.left="0px";const{y:e}=this.browser.root.getBoundingClientRect(),{y:t}=this.config.parent.getBoundingClientRect();this.tableDOM.style.top=e-t+"px",this.tableDOM.style.display="flex"}dismiss(){this.tableDOM.style.display="none"}isVisible(){return"none"!==this.tableDOM.style.display}dispose(){this.tableDOM.innerHTML="",this.tableDOM.remove();for(const e of Object.keys(this))this[e]=void 0;document.removeEventListener("click",this.boundDismissHandler)}}class Od extends Pd{constructor(e){super(Object.assign({width:"1024px"},e)),this.descriptionDOM=e}set descriptionDOM(t){if(t.description){let i;i=e({class:"igv-roi-table-description"}),this.tableDOM.insertBefore(i,this.tableColumnTitles),i.style.height="auto",i.innerHTML="BLAT result for query sequence:",i=e({class:"igv-roi-table-description"}),this.tableDOM.insertBefore(i,this.tableColumnTitles),i.style.height="auto",i.style.maxHeight="128px",i.innerHTML=t.description,i=e({class:"igv-roi-table-goto-explainer"}),this.tableDOM.insertBefore(i,this.tableColumnTitles),i.innerHTML="Select one or more rows and click Go To to view the regions"}}tableRowDOM(t){const i=e({class:"igv-roi-table-row"}),n=t.map((e=>isFinite(e)?Rt(e):e));for(let t=0;t<n.length;t++){const r=e();i.appendChild(r);const s=this.columnFormat[t];r.style.width=s.width||"fit-content",r.innerText=n[t]}return this.tableRowDOMHelper(i),i}renderTable(e){if(Array.from(this.tableRowContainer.querySelectorAll(".igv-roi-table-row")).forEach((e=>e.remove())),e.length>0)for(let t of e){const e=this.tableRowDOM(t);this.tableRowContainer.appendChild(e)}}static getColumnFormatConfiguration(){return[{label:"chr",width:"7%"},{label:"start",width:"12%"},{label:"end",width:"12%"},{label:"strand",width:"5%"},{label:"score",width:"5%"},{label:"match",width:"5%"},{label:"mis-match",width:"7%"},{label:"rep. match",width:"7%"},{label:"N's",width:"3%"},{label:"Q gap count",width:"9%"},{label:"Q gap bases",width:"9%"},{label:"T gap count",width:"9%"},{label:"T gap bases",width:"9%"}]}static gotoButtonHandler(e){e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected"),i=[];for(const e of t){const t=[];e.querySelectorAll("div").forEach((e=>t.push(e.innerText)));const[n,r,s]=t;i.push(`${n}:${r}-${s}`)}for(const e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");this.setTableRowSelectionState(!1),this.browser.search(i.join(" "))}}const Ud="https://igv.org/services/blatUCSC.php";async function qd({url:e,userSeq:t,db:i}){if(e=e||Ud,!i)throw Error("Blat database is not defined");const n=await async function(e="",t,i){const n=new URLSearchParams;n.append("userSeq",t),n.append("db",i);const r=await fetch(e,{method:"post",body:n});return r.json()}(e,t,i);n.fields;return n.blat.map(Kc)}const Qd=25e3;class Vd extends Hd{constructor(e,t){super(e,t),this.name||(this.name="Blat Results"),this.sequence=e.sequence,this.table=void 0,e.features&&(this._features=e.features,this.featureSource=new fd({features:e.features},this.browser.genome),delete e.features)}async postInit(){if(!this.featureSource){const e=this.browser.genome.id,t=this.browser.config.blatServerURL,i=await qd({url:t,userSeq:this.sequence,db:e});this._features=i,this.featureSource=new fd({features:i},this.browser.genome)}}openTableView(){if(void 0===this.table){const e=this._features.map((e=>[e.chr,e.start+1,e.end,e.strand,e.score,e.matches,e.misMatches,e.repMatches,e.nCount,e.qNumInsert,e.qBaseInsert,e.tNumInsert,e.tBaseInsert])),t={browser:this.browser,parent:this.browser.columnContainer,headerTitle:this.config.title,description:this.sequence,dismissHandler:()=>{this.table.dismiss(),this.table.dispose(),this.table=void 0},columnFormat:Od.getColumnFormatConfiguration(),gotoButtonHandler:Od.gotoButtonHandler};this.table=new Od(t),this.table.renderTable(e)}this.table.present()}menuItemList(){const e=super.menuItemList();return e.push("<hr/>"),e.push({label:"Open table view",click:function(){this.openTableView()}}),e}dispose(){super.dispose(),this.table&&this.table.popover.parentElement.removeChild(this.table.popover)}}async function jd({sequence:e,browser:t,name:i,title:n}){if(e.length>Qd)t.alert.present(`Sequence size exceeds maximum allowed length (${e.length} > 25000)`);else try{const r=t.genome.id,s=t.config.blatServerURL||"https://igv.org/services/blatUCSC.php",o={type:"blat",name:i||"blat results",title:n||"blat results",sequence:e,altColor:"rgb(176, 176, 236)",color:"rgb(236, 176, 176)",searchable:!1,features:await qd({url:s,userSeq:e,db:r})};(await t.loadTrack(o)).openTableView()}catch(e){t.alert.present(`Error performing blat search: ${e}`)}}const Wd=Number.MIN_SAFE_INTEGER,Gd={TTT:"F",TTC:"F",TTA:"L",TTG:"L",CTT:"L",CTC:"L",CTA:"L",CTG:"L",ATT:"I",ATC:"I",ATA:"I",ATG:"M",GTT:"V",GTC:"V",GTA:"V",GTG:"V",TCT:"S",TCC:"S",TCA:"S",TCG:"S",CCT:"P",CCC:"P",CCA:"P",CCG:"P",ACT:"T",ACC:"T",ACA:"T",ACG:"T",GCT:"A",GCC:"A",GCA:"A",GCG:"A",TAT:"Y",TAC:"Y",TAA:"STOP",TAG:"STOP",CAT:"H",CAC:"H",CAA:"Q",CAG:"Q",AAT:"N",AAC:"N",AAA:"K",AAG:"K",GAT:"D",GAC:"D",GAA:"E",GAG:"E",TGT:"C",TGC:"C",TGA:"STOP",TGG:"W",CGT:"R",CGC:"R",CGA:"R",CGG:"R",AGT:"S",AGC:"S",AGA:"R",AGG:"R",GGT:"G",GGC:"G",GGA:"G",GGG:"G"},$d={},Kd=["A","G","C","T","Y","R","W","S","K","M","D","V","H","B","N","X"],Yd=["T","C","G","A","R","Y","W","S","M","K","H","B","D","V","N","X"];for(let SA=0;SA<Kd.length;SA++)$d[Kd[SA]]=Yd[SA],$d[Kd[SA].toLowerCase()]=Yd[SA].toLowerCase();const Xd=115;class Zd{constructor(e,t){this.config=e,this.browser=t,this.type="sequence",this.removable=!0===e.removable,this.name=e.name,this.id=e.id,this.sequenceType=e.sequenceType||"dna",this.disableButtons=!1,this.order=e.order||Wd,this.ignoreTrackMenu=!1,this.reversed=!0===e.reversed,this.frameTranslate=!0===e.frameTranslate,this.height=this.frameTranslate?Xd:25,e.url&&(e.fastaURL=e.url),e.fastaURL||(this.id=e.id||"sequence")}menuItemList(){return[{name:this.reversed?"Forward":"Reverse",click:()=>{this.reversed=!this.reversed,this.trackView.repaintViews()}},{name:this.frameTranslate?"Close Translation":"Three-frame Translate",click:()=>{if(this.frameTranslate=!this.frameTranslate,this.frameTranslate){for(let e of this.trackView.viewports)e.setContentHeight(Xd);this.trackView.setTrackHeight(Xd)}else{for(let e of this.trackView.viewports)e.setContentHeight(25);this.trackView.setTrackHeight(25)}this.trackView.repaintViews()}}]}contextMenuItemList(e){const t=e.viewport;if(t.referenceFrame.bpPerPixel<=1){const e=t.getWidth()*t.referenceFrame.bpPerPixel,i=t.referenceFrame.chr,n=Math.floor(t.referenceFrame.start),r=Math.ceil(n+e),s=[{label:this.reversed?"View visible sequence (reversed)...":"View visible sequence...",click:async()=>{let e=await this.browser.genome.getSequence(i,n,r);e?this.reversed&&(e=lc(e)):e="Unknown sequence",this.browser.alert.present(e)}}];return Za()&&s.push({label:"Copy visible sequence",click:async()=>{let e=await this.browser.genome.getSequence(i,n,r);e?this.reversed&&(e=lc(e)):e="Unknown sequence";try{await navigator.clipboard.writeText(e)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),s.push({label:"BLAT read sequence",click:async()=>{let e=await this.browser.genome.getSequence(i,n,r);if(e){this.reversed&&(e=lc(e));const t=`blat: ${i}:${n+1}-${r}`,s=`blat: ${i}:${n+1}-${r}`;jd({sequence:e,browser:this.browser,name:t,title:s})}}}),s.push("<hr/>"),s}}translateSequence(e){const t=[[],[],[]];for(let i of[0,1,2]){let n=i;for(;e.length-n>=3;){let r=e.slice(n,n+3);this.reversed&&(r=r.split("").reverse().join(""));const s=Gd[r.toUpperCase()]||"";t[i].push({codons:r,aminoA:s}),n+=3}}return t}async getSequenceSource(){return this.config.fastaURL?(this.fasta||(this.fasta=new Jd(this.config,this.browser.genome),await this.fasta.init()),this.fasta):this.browser.genome}async getFeatures(e,t,i,n){if(t=Math.floor(t),i=Math.floor(i),n&&n>10)return null;{const n=await this.getSequenceSource();return{bpStart:t,sequence:await n.getSequence(e,t,i)}}}draw(e){const t=e.context;if(e.features){let i=e.features.sequence;if(!i)return;this.reversed&&(i=i.split("").map((function(e){return $d[e]})).join(""));const n=e.features.bpStart,r=1+e.bpStart+e.pixelWidth*e.bpPerPixel;for(let s=Math.floor(e.bpStart);s<=r;s++){const r=Math.floor(s-n);if(r>=0&&r<i.length){const n=(s-e.bpStart)/e.bpPerPixel,o=1/e.bpPerPixel,a=i[r],c=this.fillColor(a.toUpperCase());if(e.bpPerPixel>.1)xo.fillRect(t,n,5,o,10,{fillStyle:c});else{const i=n+.5*(o-t.measureText(a).width);"y"===e.axis?(t.save(),xo.labelTransformWithContext(t,i),xo.strokeText(t,a,i,15,{strokeStyle:c}),t.restore()):xo.strokeText(t,a,i,15,{strokeStyle:c})}}}if(this.frameTranslate){let r=25;const s=this.translateSequence(i);for(let i=0;i<s.length;i++){const o=s[i];for(let s=0;s<o.length;s++){let a=0==s%2?"rgb(160,160,160)":"rgb(224,224,224)";const c=o[s],l=n+i+3*s-e.bpStart,h=Math.floor(l/e.bpPerPixel),d=Math.floor((l+3)/e.bpPerPixel),u=Math.round((h+d)/2);if(d<0)continue;if(h>e.pixelWidth)break;let f=c.aminoA;c.aminoA.indexOf("STOP")>-1?(a="rgb(255, 0, 0)",f="STOP"):"M"===c.aminoA&&(a="rgb(0, 153, 0)",f="START"),xo.fillRect(t,h,r,d-h,25,{fillStyle:a}),e.bpPerPixel<=.1&&xo.strokeText(t,f,u-t.measureText(f).width/2,r+15)}r+=30}}}}get supportsWholeGenome(){return!1}computePixelHeight(e){return this.height=this.frameTranslate?Xd:25,this.height}fillColor(e){return this.color?this.color:"dna"===this.sequenceType?this.browser.nucleotideColors[e]||"gray":"rgb(0, 0, 150)"}getState(){const e={type:"sequence"};return this.order!==Wd&&(e.order=this.order),this.reversed&&(e.revealed=!0),e}}class Jd{constructor(e,t){this.config=e,this.genome=t}async init(){this.fasta=await Bc(this.config),this.chrNameMap=new Map;for(let e of this.fasta.chromosomeNames)this.chrNameMap.set(this.genome.getChromosomeName(e),e)}async getSequence(e,t,i){const n=this.chrNameMap.has(e)?this.chrNameMap.get(e):e;return this.fasta.getSequence(n,t,i)}}class eu{constructor(e,t,i,n){this.guid=s(),this.trackView=e,this.referenceFrame=i,this.browser=e.browser,this.$viewport=Bt('<div class="igv-viewport">'),t.appendChild(this.$viewport.get(0)),e.track.height&&(this.$viewport.get(0).style.height=`${e.track.height}px`),e.track instanceof Zd&&(this.alert=new La(this.$viewport.get(0))),this.contentTop=0,this.contentHeight=this.$viewport.height(),this.$viewport.width(n),this.initializationHelper()}initializationHelper(){}showMessage(e){this.messageDiv||(this.messageDiv=document.createElement("div"),this.messageDiv.className="igv-viewport-message",this.$viewport.append(Bt(this.messageDiv))),this.messageDiv.textContent=e,this.messageDiv.style.display="inline-block"}hideMessage(e){this.messageDiv&&(this.messageDiv.style.display="none")}setTrackLabel(e){}startSpinner(){}stopSpinner(){}checkZoomIn(){return!0}shift(){}setTop(e){this.contentTop=e,this.$viewport.height()}async loadFeatures(){}clearCache(){}repaint(){}draw(e,t,i){console.log("Viewport - draw(drawConfiguration, features, roiFeatures)")}checkContentHeight(e){let t=this.trackView.track;if(e=e||this.cachedFeatures,"FILL"===t.displayMode)this.setContentHeight(this.$viewport.height());else if("function"==typeof t.computePixelHeight&&e&&e.length>0){let i=t.computePixelHeight(e);i!==this.contentHeight&&this.setContentHeight(i)}}getContentHeight(){return this.contentHeight}setContentHeight(e){this.contentHeight=e}isLoading(){return!1}saveSVG(){}isVisible(){return this.$viewport.width()}setWidth(e){this.$viewport.width(e)}getWidth(){return this.$viewport.width()}getContentTop(){return this.contentTop}containsPosition(e,t){console.log("Viewport - containsPosition(chr, position)")}addMouseHandlers(){}removeMouseHandlers(){}dispose(){this.$viewport.get(0).remove();for(let e of Object.keys(this))this[e]=void 0}}
30
+ */const xc=["T","C","A","G"],kc=[];for(let xA=0;xA<256;xA++)kc.push(xc[xA>>6&3]+xc[xA>>4&3]+xc[xA>>2&3]+xc[3&xA]);const Ic=kc.map((e=>e.toLowerCase()));class Sc{littleEndian;metaIndex=new Map;constructor(e){this.url=e.twoBitURL||e.fastaURL,this.config=e,e.twoBitBptURL&&(this.bptURL=e.twoBitBptURL)}async init(){if(this.bptURL)this.index=await _c.loadBpTree(this.bptURL,this.config,0);else{const e=await this._readIndex();this.index={search:async t=>e.has(t)?{offset:e.get(t)}:void 0}}}async readSequence(e,t,i){this.index||await this.init();const n=await this.getSequenceRecord(e);if(!n)return null;if(t<0)throw new TypeError("regionStart cannot be less than 0");(void 0===i||i>n.dnaSize)&&(i=n.dnaSize);const r=this._getOverlappingBlocks(t,i,n.nBlocks),s=this._getOverlappingBlocks(t,i,n.maskBlocks),o=Math.floor(t/4),a=n.packedPos+o,c=Math.floor(i/4)-o+1,l=await Qs.loadArrayBuffer(this.url,{range:{start:a,size:c}}),h=new Uint8Array(l);let d="";for(let e=t;e<i;e+=1){for(;s.length&&s[0].end<=e;)s.shift();const t=s[0]&&s[0].start<=e&&s[0].end>e;if(r[0]&&e>=r[0].start&&e<r[0].end){const t=r.shift();for(;e<t.end&&e<i;)d+="N",e++;e--}else{const i=e%4,n=h[Math.floor(e/4)-o];d+=t?Ic[n][i]:kc[n][i]}}return d}async _readIndex(){const e=new Map;let t=await Qs.loadArrayBuffer(this.url,{range:{start:0,size:64}}),i=new DataView(t),n=0;const r=i.getUint32(n,!0),s=i.getUint32(n,!1);n+=4;const o=440477507;if(r===o)this.littleEndian=!0;else{if(s!==o)throw Error(`Bad magic number ${o}`);this.littleEndian=!1}let a,c;this.version=i.getUint32(n,this.littleEndian),n+=4,this.sequenceCount=i.getUint32(n,this.littleEndian),n+=4,this.reserved=i.getUint32(n,this.littleEndian),n+=4;let l=20;for(let t=0;t<this.sequenceCount;t++){(!c||c.available()<1)&&(a=(this.sequenceCount-t)*l,c=await this._loadBinaryBuffer(n,a));const i=c.getByte();n+=1,c.available()<i+5&&(a=(this.sequenceCount-t)*l+100,c=await this._loadBinaryBuffer(n,a));const r=c.getString(i),s=c.getUInt();n+=i+4,e.set(r,s),l=Math.floor(l*(t/(t+1))+r.length/(t+1))}return e}async getSequenceRecord(e){if(!this.metaIndex.has(e)){if(!this.index)throw Error("TwobitSequence object must be initialized before accessing sequence");let t=await this.index.search(e);if(!t)return;let i=t.offset,n=8,r=await this._loadBinaryBuffer(i,n);const s=r.getUInt(),o=r.getUInt();i+=n,n=8*o+4,r=await this._loadBinaryBuffer(i,n);const a=[];for(let e=0;e<o;e++)a.push(r.getUInt());const c=[];for(let e=0;e<o;e++)c.push(r.getUInt());const l=r.getUInt();i+=n,n=8*l+4,r=await this._loadBinaryBuffer(i,n);const h=[];for(let e=0;e<l;e++)h.push(r.getUInt());const d=[];for(let e=0;e<l;e++)d.push(r.getUInt());const u=[];for(let e=0;e<o;e++)u.push(new Ec(a[e],c[e]));const f=[];for(let e=0;e<l;e++)f.push(new Ec(h[e],d[e]));if(0!=r.getUInt())throw Error("Bad 2-bit file");i+=n;const p={dnaSize:s,nBlocks:u,maskBlocks:f,packedPos:i,bpLength:s};this.metaIndex.set(e,p)}return this.metaIndex.get(e)}_getOverlappingBlocks(e,t,i){const n=[];for(let r of i){if(r.start>t)break;r.end<e||n.push(r)}return n}async _loadBinaryBuffer(e,t){const i=await Qs.loadArrayBuffer(this.url,{range:{start:e,size:t}});return new Ac(new DataView(i),this.littleEndian)}}class Ec{constructor(e,t){this.start=e,this.size=t}get end(){return this.start+this.size}}class Nc{static#i=1e5;#n;#r=[];#s=10;constructor(e,t){this.sequenceReader=e,this.browser=t}get chromosomes(){return this.sequenceReader.chromosomes}async getSequenceRecord(e){return this.sequenceReader.getSequenceRecord(e)}async getSequence(e,t,i){let n=this.#r.find((n=>n.contains(e,t,i)));if(n||(n=await this.#o(e,t,i),this.#a(n),this.#r.push(n)),n){const e=t-n.start,r=i-t;return n.features?n.features.substring(e,e+r):null}}#a(e){this.#r=this.#r.filter((t=>!e.contains(t))),this.#r.length===this.#s&&this.#r.shift(),this.browser&&this.browser.referenceFrameList.length<100&&(this.#r=this.#r.filter((e=>void 0!==this.browser.referenceFrameList.find((t=>t.overlaps(e))))))}getSequenceInterval(e,t,i){return this.#r.find((n=>n.contains(e,t,i)))}async#o(e,t,i){let n=t,r=i;if(i-t<Nc.#i){const e=i-t,s=Math.round(t+e/2);n=Math.max(0,s-Nc.#i/2),r=n+Nc.#i}const s=new uc(e,n,r);if(this.#n&&this.#n[0].contains(e,t,i))return this.#n[1];{const t=new Promise((async(t,i)=>{s.features=await this.sequenceReader.readSequence(e,n,r),t(s)}));return this.#n=[s,t],t}}async init(){return this.sequenceReader.init()}get chromosomeNames(){return this.sequenceReader.chromosomeNames}getFirstChromosomeName(){return"function"==typeof this.sequenceReader.getFirstChromosomeName?this.sequenceReader.getFirstChromosomeName():void 0}#c(e){this.browser.referenceFrameList}}async function Bc(e,t){let i;return"chromsizes"===e.format?i=new yc(e.fastaURL||e.url):"2bit"===e.format||e.twoBitURL?i=new Nc(new Sc(e),t):$a(e.fastaURL)||!e.indexURL?i=new gc(e):"gbk"===e.format||e.gbkURL||(i=new Nc(new Fc(e),t)),await i.init(),i}const Mc={A:"rgb( 0, 200, 0)",C:"rgb( 0,0,200)",T:"rgb(255,0,0)",G:"rgb(209,113, 5)",N:"rgb(80,80,80)"};function Rc(e,t){if(e.length<6)return void console.log("Skipping line: "+e.join(" "));var i={chr1:e[0],start1:Number.parseInt(e[1]),end1:Number.parseInt(e[2]),chr2:e[3],start2:Number.parseInt(e[4]),end2:Number.parseInt(e[5])};if(isNaN(i.start1)||isNaN(i.end1)||isNaN(i.start2)||isNaN(i.end2))return;t&&void 0===t.hiccups&&(t.hiccups=!!t.columnNames&&Tc(t.columnNames));const n=t&&t.hiccups,r=n?6:10;if(n||(e.length>6&&"."!==e[6]&&(i.name=e[6]),e.length>7&&"."!==e[7]&&(i.score=Number(e[7])),e.length>8&&"."!==e[8]&&(i.strand1=e[8]),e.length>9&&"."!==e[9]&&(i.strand2=e[9])),t){const n=t.colorColumn;n&&n<e.length&&(i.color=_s.createColorString(e[n]));const s=t.thicknessColumn;s&&s<e.length&&(i.thickness=e[s]),e.length>r&&t.columnNames&&t.columnNames.length===e.length&&(i.extras=e.slice(r))}return i.chr1===i.chr2&&(i.chr=i.chr1,i.start=Math.min(i.start1,i.start2),i.end=Math.max(i.end1,i.end2)),i}function Dc(e,t){if(!(e.length<8))return{chr:e[0],start:Number.parseInt(e[1]),end:Number.parseInt(e[2]),color:_s.createColorString(e[6]),value:Number(e[7])}}function Tc(e){return e&&(e.includes("fdrDonut")||e.includes("fdr_donut"))}function Lc(e,t){if(!(e.length<6))return{chr:e[0],start:Number.parseInt(e[1]),end:Number.parseInt(e[2]),chr1:e[8],start1:Number.parseInt(e[9]),end1:Number.parseInt(e[10]),chr2:e[13],start2:Number.parseInt(e[14]),end2:Number.parseInt(e[15]),name:e[3],score:Number(e[4]),value:Number(e[5]),color:"."===e[7]?void 0:"0"===e[7]?"rgb(0,0,0)":e[7]};console.log("Skipping line: "+e.join(" "))}class zc{constructor(e){this.message=e}}const Hc=new Map([["%09","\t"],["%0A","\n"],["%0D","\r"],["%25","%"],["%3B",";"],["%3D","="],["%26","&"],["%2C",","]]);function Pc(e){if(!e.includes("%"))return e;let t="";for(let i=0;i<e.length;i++)if(37===e.charCodeAt(i)&&i<e.length-2){const n=e.substring(i,i+3);Hc.has(n)?t+=Hc.get(n):t+=n,i+=2}else t+=e.charAt(i);return t}function Oc(e,t="="){const i="="===t;var n=[];for(let r of e.split(";")){r=r.trim();const e=r.indexOf(t);if(e>0&&e<r.length-1){let t=Pc(r.substring(0,e).trim()),s=Pc(r.substring(e+1).trim());i||(t=Uc(t),s=Uc(s)),n.push([t,s])}}return n}function Uc(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),e}function qc(e,t,i=Number.MAX_SAFE_INTEGER){if(e.length<3)return;t&&t.gffTags;const n=e[0],r=parseInt(e[1]),s=e.length>2?parseInt(e[2]):r+1;if(isNaN(r)||isNaN(s))return new zc("Unparsable bed record.");const o=new nl({chr:n,start:r,end:s,score:1e3});let a=3;try{if(e.length>3&&a++<i){if(e[3].indexOf(";")>0&&e[3].indexOf("=")>0){const i=Oc(e[3],"=");o.attributes={};for(let e of i)o.attributes[e[0]]=e[1],null!=t.nameField&&e[0]===t.nameField&&(o.name=e[1])}o.name||(o.name="."===e[3]?"":e[3])}if(e.length>4&&a++<i&&(o.score="."===e[4]?0:Number(e[4]),isNaN(o.score)))return o;if(e.length>5&&a++<i&&(o.strand=e[5],"."!==o.strand&&"+"!==o.strand&&"-"!==o.strand))return o;if(e.length>6&&a++<i&&(o.cdStart=parseInt(e[6]),isNaN(o.cdStart)))return o;if(e.length>7&&a++<i&&(o.cdEnd=parseInt(e[7]),isNaN(o.cdEnd)))return o;if(e.length>8&&a++<i&&"."!==e[8]&&"0"!==e[8]&&(o.color=_s.createColorString(e[8])),e.length>11&&a++<i){const t=parseInt(e[9]);if(t>1e3)return o;const i=e[10].replace(/,$/,"").split(","),n=e[11].replace(/,$/,"").split(",");if(i.length!==n.length||t!==i.length)return o;const s=[];for(let e=0;e<t;e++){const t=r+parseInt(n[e]),o=t+parseInt(i[e]);s.push({start:t,end:o})}s.length>0&&(Xc(s,o.cdStart,o.cdEnd),o.exons=s)}if(t){let i=t.thicknessColumn,n=t.colorColumn;n&&n<e.length&&(o.color=_s.createColorString(e[n])),i&&i<e.length&&(o.thickness=e[i])}}catch(e){}return o}function Qc(e,t){const i=qc(e,t);return i&&e.length>14&&(i.signal=Number(e[12]),i.pValue=Number(e[13]),i.qValue=Number(e[14])),i}function Vc(e,t){const i=qc(e,t,9);if(i){const t=["Coverage","% Showing Methylation","N-mod","N-canonical","N-other mod","N-delete","N-fail","N-dff","N-nocall"];for(let n=9;n<e.length;n++){i[t[n-9]]=e[n]}}return i}function jc(e,t){if(e.length<=15)return;return{swScore:Number.parseInt(e[1]),milliDiv:Number.parseInt(e[2]),milliDel:Number.parseInt(e[3]),milliIns:Number.parseInt(e[4]),chr:e[5],start:Number.parseInt(e[6]),end:Number.parseInt(e[7]),strand:e[9],repName:e[10],repClass:e[11],repFamily:e[12],repStart:Number.parseInt(e[13]),repEnd:Number.parseInt(e[14]),repLeft:Number.parseInt(e[15])}}function Wc(e,t){var i=void 0===t.shift?0:1;if(e.length<=9+i)return;const n=parseInt(e[5+i]),r=parseInt(e[6+i]);var s={name:e[0+i],chr:e[1+i],strand:e[2+i],start:parseInt(e[3+i]),end:parseInt(e[4+i]),cdStart:n,cdEnd:r,id:e[0+i]};const o=Yc(parseInt(e[7+i]),e[8+i],e[9+i]);return Xc(o,n,r),s.exons=o,s}function Gc(e,t){var i=void 0===t.shift?0:1;if(e.length<=11+i)return;const n=parseInt(e[5+i]),r=parseInt(e[6+i]),s={name:e[11+i],chr:e[1+i],strand:e[2+i],start:parseInt(e[3+i]),end:parseInt(e[4+i]),cdStart:n,cdEnd:r,id:e[0+i]},o=Yc(parseInt(e[7+i]),e[8+i],e[9+i],e[14+i]);return Xc(o,n,r),s.exons=o,s}function $c(e,t){var i=void 0===t.shift?0:1;if(e.length<=10+i)return;const n=parseInt(e[6+i]),r=parseInt(e[7+i]);var s={name:e[0+i],id:e[1+i],chr:e[2+i],strand:e[3+i],start:parseInt(e[4+i]),end:parseInt(e[5+i]),cdStart:n,cdEnd:r};const o=Yc(parseInt(e[8+i]),e[9+i],e[10+i]);return Xc(o,n,r),s.exons=o,s}function Kc(e,t){if(e.length<21)return;const i=e[13],n=parseInt(e[15]),r=parseInt(e[16]),s=e[8].charAt(0),o=parseInt(e[17]),a=[],c=e[20].replace(/,$/,"").split(","),l=e[18].replace(/,$/,"").split(",");for(let e=0;e<o;e++){const t=parseInt(c[e]),i=t+parseInt(l[e]);a.push({start:t,end:i})}return new rl({chr:i,start:n,end:r,strand:s,exons:a,tokens:e})}function Yc(e,t,i,n){const r=t.replace(/,$/,"").split(","),s=i.replace(/,$/,"").split(","),o=n?n.replace(/,$/,"").split(","):void 0,a=[];for(let t=0;t<e;t++){const e={start:parseInt(r[t]),end:parseInt(s[t])};if(o){const i=parseInt(o[t]);-1!=i&&(e.readingFrame=i)}a.push(e)}return a}function Xc(e,t,i){for(let n of e){const e=n.end,r=n.start;e<t||r>i?n.utr=!0:(t>=r&&t<=e&&(n.cdStart=t),i>=r&&i<=e&&(n.cdEnd=i))}}function Zc(e,t){var i,n,r,s,o,a,c;if(!(e.length<9))return i=e[0],n=parseInt(e[1]),r=parseInt(e[2]),o=e[3],a=Number(e[4]),s=e[5].trim(),c=Number(e[6]),0===a&&(a=c),{chr:i,start:n,end:r,name:o,score:a,strand:s,signal:c,pValue:Number(e[7]),qValue:Number(e[8])}}function Jc(e,t){const i=Zc(e);return e.length>9&&(i.peak=Number(e[9])),i}function el(e,t){if(e.length<=3)return;const i={chr:e[0],start:parseInt(e[1]),end:parseInt(e[2]),value:Number(e[3])};if(t){let n=t.colorColumn;n&&n<e.length&&(i.color=_s.createColorString(e[n]))}return i}function tl(e,t){const i=t.wig;if(i&&"fixedStep"===i.format){const t=i.index*i.step+i.start,n=t+i.span,r=Number(e[0]);return++i.index,isNaN(r)?null:{chr:i.chrom,start:t,end:n,value:r}}if(i&&"variableStep"===i.format){if(e.length<2)return null;const t=parseInt(e[0],10)-1,n=t+i.span,r=Number(e[1]);return isNaN(r)?null:{chr:i.chrom,start:t,end:n,value:r}}return el(e)}function il(e,t){if(e.length<6)return;const i=["bin","chr","start","end","name","score","strand","refNCBI","refUCSC","observed","molType","class","valid","avHet","avHetSE","func","locType","weight","exceptions","submitterCount","submitters","alleleFreqCount","alleles","alleleNs","alleleFreqs","bitfields"],n={chr:e[1],start:Number.parseInt(e[2]),end:Number.parseInt(e[3]),name:e[4],score:Number.parseInt(e[5])},r=Math.min(e.length,i.length);for(let t=6;t<r;t++)n[i[t]]=e[t];return n}class nl{constructor(e){Object.assign(this,e)}getAttributeValue(e){return this.hasOwnProperty(e)?this[e]:this.attributes?this.attributes[e]:void 0}}class rl{constructor(e){Object.assign(this,e)}get score(){const e=this.tokens,t=parseInt(e[0]),i=parseInt(e[2]),n=parseInt(e[1]),r=parseInt(e[4]),s=parseInt(e[6]),o=parseInt(e[10]);return Math.floor(1e3*(t+i-n-r-s)/o)}get matches(){return this.tokens[0]}get misMatches(){return this.tokens[1]}get repMatches(){return this.tokens[2]}get nCount(){return this.tokens[3]}get qNumInsert(){return this.tokens[4]}get qBaseInsert(){return this.tokens[5]}get tNumInsert(){return this.tokens[6]}get tBaseInsert(){return this.tokens[7]}popupData(){return[{name:"chr",value:this.chr},{name:"start",value:this.start+1},{name:"end",value:this.end},{name:"strand",value:this.strand},{name:"score",value:this.score},{name:"match",value:this.matches},{name:"mis-match",value:this.misMatches},{name:"rep. match",value:this.repMatches},{name:"N's",value:this.nCount},{name:"Q gap count",value:this.qNumInsert},{name:"Q gap bases",value:this.qBaseInsert},{name:"T gap count",value:this.tNumInsert},{name:"T gap bases",value:this.tBaseInsert}]}}const sl=new Set(["transcript","primary_transcript","processed_transcript","mRNA","mrna","lnc_RNA","miRNA","ncRNA","rRNA","scRNA","snRNA","snoRNA","tRNA"]),ol=new Set(["CDS","cds"]),al=new Set(["start_codon","stop_codon"]),cl=new Set(["5UTR","3UTR","UTR","five_prime_UTR","three_prime_UTR","3'-UTR","5'-UTR"]),ll=new Set(["exon","coding-exon"]),hl=new Set;for(let kA of[ol,al,cl,ll])for(let IA of kA)hl.add(IA);function dl(e){return e.includes("intron")}function ul(e){return ol.has(e)||al.has(e)}function fl(e){return cl.has(e)}function pl(e){return sl.has(e)||e.endsWith("RNA")||e.endsWith("transcript")}function gl(e){return hl.has(e)||e.endsWith("RNA")||dl(e)}const ml=new Set(["id","parent","name"]);class wl{constructor(e){Object.assign(this,e),void 0!==e.phase&&"."!==e.phase&&(this.readingFrame=(3-parseInt(e.phase))%3)}popupData(e){const t=this.geneObject?this.geneObject.popupData():[];if(this.geneObject&&t.push("<hr/>"),this.name&&t.push({name:"Name",value:this.name}),t.push({name:"Type",value:this.type}),t.push({name:"Source",value:this.source}),void 0!==this.score&&t.push({name:"Score",value:this.score}),t.push({name:"Phase",value:this.phase}),this.attributeString){const e=Oc(this.attributeString,this.delim);for(let[i,n]of e)void 0!==n&&n.length>0&&!ml.has(i.toLowerCase())&&t.push({name:i+":",value:n})}return t.push({name:"Location",value:`${this.chr}:${Rt(this.start+1)}-${Rt(this.end)}`}),t}getAttributeValue(e){if(this.hasOwnProperty(e))return this[e];if(this._attributeCache||(this._attributeCache=new Map),this._attributeCache.has(e))return this._attributeCache.get(e);{const t=Oc(this.attributeString,this.delim);let i;for(let[n,r]of t)if(n===e){i=r;break}return this._attributeCache.set(e,i),i}}}class bl extends wl{constructor(e){super(e),this.exons=[],this.parts=[]}addExon(e){this.exons.push(e),this.start=Math.min(this.start,e.start),this.end=Math.max(this.end,e.end)}addPart(e){this.parts.push(e)}assembleParts(){if(0===this.parts.length)return;this.parts.sort((function(e,t){return e.start-t.start}));let e=this.parts[0].start,t=this.parts[0].end;for(let i=1;i<this.parts.length;i++){const n=this.parts[i];if(!dl(n.type))if(n.start<=t)t=Math.max(t,n.end);else{this.findExonContaining({start:e,end:t})||this.exons.push({start:e,end:t,psuedo:!0}),e=n.start,t=n.end}}this.findExonContaining({start:e,end:t})||(this.exons.push({start:e,end:t,psuedo:!0}),this.start=Math.min(this.start,e),this.end=Math.max(this.end,t));for(let e of this.parts){const t=e.type;ul(t)?this.addCDS(e):fl(t)&&this.addUTR(e)}}findExonContaining({start:e,end:t}){for(let i of this.exons)if(i.end>=t&&i.start<=e)return i}addCDS(e){let t;const i=this.exons;for(let n of i)if(n.start<=e.start&&n.end>=e.end){t=n;break}t?(t.cdStart=t.cdStart?Math.min(e.start,t.cdStart):e.start,t.cdEnd=t.cdEnd?Math.max(e.end,t.cdEnd):e.end,t.readingFrame=e.readingFrame):console.error("No exon found spanning "+e.start+"-"+e.end),this.cdStart=this.cdStart?Math.min(e.start,this.cdStart):e.start,this.cdEnd=this.cdEnd?Math.max(e.end,this.cdEnd):e.end}addUTR(e){let t;const i=this.exons;for(let n=0;n<i.length;n++)if(i[n].start<=e.start&&i[n].end>=e.end){t=i[n];break}t?e.start===t.start&&e.end===t.end?t.utr=!0:(e.end<t.end&&(t.cdStart=e.end),e.start>t.start&&(t.cdEnd=e.start)):console.error("No exon found spanning "+cds.start+"-"+cds.end)}finish(){this.assembleParts();var e=this.cdStart,t=this.cdEnd;this.exons.sort((function(e,t){return e.start-t.start})),e&&this.exons.forEach((function(i){(i.end<e||i.start>t)&&(i.utr=!0)}))}popupData(e){const t=super.popupData(e);for(let i of this.exons)if(!i.pseudo&&e>=i.start&&e<i.end&&"function"==typeof i.popupData){t.push("<hr/>");const n=i.popupData(e);for(let e of n)t.push(e)}for(let i of this.parts)if(e>=i.start&&e<i.end&&"function"==typeof i.popupData){t.push("<hr/>");const n=i.popupData(e);for(let e of n)t.push(e)}return t}}function Fl(e,t){const i=t.format;if(e.length<9)return;const n="gff3"===i?"=":" ";return new wl({source:Pc(e[1]),type:e[2],chr:e[0],start:parseInt(e[3])-1,end:parseInt(e[4]),score:"."===e[5]?void 0:Number(e[5]),strand:e[6],phase:"."===e[7]?".":parseInt(e[7]),attributeString:e[8],delim:n})}function vl(e,t){const i=Fl(e,t);if(!i)return;const n=Oc(i.attributeString,i.delim);for(let[e,t]of n){const n=e.toLowerCase();"color"===n||"colour"===n?i.color=_s.createColorString(t):"ID"===e?i.id=t:"Parent"===e&&(i.parent=t)}return i}function yl(e,t){const i=Fl(e,t);if(!i)return;const n=Oc(i.attributeString,i.delim);let r,s;switch(i.type){case"gene":r="gene_id";break;case"transcript":r="transcript_id",s="gene_id";break;default:s="transcript_id"}for(let[e,t]of n){const n=e.toLowerCase();"color"===n||"colour"===n?i.color=_s.createColorString(t):e===r?i.id=t:e===s&&(i.parent=t)}return i}function Al(e,t){if(!(e.length<7)){var i=e[0],n=e[1],r=parseInt(e[2]),s=parseInt(e[3]),o=parseInt(e[4]),a=parseInt(e[5]),c=e[6],l={chr:i,name:n,junction_left:r,junction_right:s,num_junction_reads:o,num_spanning_frags:a,spanning_frag_coords:[],start:-1,end:-1},h=r,d=s;if(a>0)for(var u=c.split(","),f=0;f<u.length;f++){var p=u[f].split("-"),g=p[0],m=p[1];g<h&&(h=g),m>d&&(d=m),l.spanning_frag_coords.push({left:g,right:m})}return l.start=h,l.end=d,l}}function Cl(e,t){if(e.length<7)return null;const i={chr:e[0],start:parseInt(e[1])-1,end:parseInt(e[2]),"Strongest SNP-risk allele":e[3],"Disease/Phenotype":e[4],"P-value":e[5],"Odds ratio or beta":e[6]};return e.length>6&&(i.PUBMEDID=`<a target = "blank" href = "https://www.ncbi.nlm.nih.gov/pubmed/${e[7]}">${e[7]}</a>`),i}function _l(e,t){const i=t.customFormat;if(e.length<i.fields.length)return;const n=i.coords||0,r=e[i.chr],s=parseInt(e[i.start])-n,o={chr:r,start:s,end:void 0!==i.end?parseInt(e[i.end]):s+1};return i.fields&&i.fields.forEach((function(t,n){n!==i.chr&&n!==i.start&&n!==i.end&&(o[t]=e[n])})),o}function xl(e,t){const i=t.columnNames;if(!i)throw Error("Sample names are not defined. Missing column headers?");const n=i.length-3,r=e[0],s=parseInt(e[1]),o=parseInt(e[2]),a=e.slice(3).map(Number);return a.length==n?{chr:r,start:s,end:o,values:a}:void console.warn(`${r}:${s}-${o} row contains ${a.length} sample columns instead of the expected ${n} columns. Skipping...`)}const kl=["Name","transcript_id","gene_name","gene","gene_id","alias","locus","name"];class Il{constructor(e){this.format=e.format,this.nameField=e.nameField,this.filterTypes=void 0===e.filterTypes?new Set(["chromosome"]):new Set(e.filterTypes)}combineFeatures(e,t){let i;const n=this.filterTypes;if(e=e.filter((e=>void 0===n||!n.has(e.type))),"gff3"===this.format){const t=this.combineFeaturesById(e);i=this.combineFeaturesByType(t)}else i=this.combineFeaturesByType(e);return this.numberExons(i,t),this.nameFeatures(i),i}combineFeaturesById(e){const t=new Map,i=[];for(let n of e)if(gl(n.type)||pl(n.type)||!n.id)i.push(n);else{let e=t.get(n.chr);e||(e=new Map,t.set(n.chr,e));let i=e.get(n.id);i?i.push(n):e.set(n.id,[n])}for(let e of t.values())for(let t of e.values())if(t.length>1){const e=t[0];e.exons=[];for(let i of t)e.start=Math.min(e.start,i.start),e.end=Math.max(e.end,i.end),e.exons.push({start:i.start,end:i.end});i.push(e)}else i.push(t[0]);return i}combineFeaturesByType(e){const t=e.filter((e=>"gene"===e.type||e.type.endsWith("_gene"))),i=Object.create(null);for(let e of t)i[e.id]=e;const n=Object.create(null),r=[],s=new Set,o=this.filterTypes;e=e.filter((e=>void 0===o||!o.has(e.type)));for(let t of e)if(pl(t.type)){const e=t.id;if(void 0!==e){const o=new bl(t);n[e]=o,r.push(o),s.add(t);const a=i[t.parent];a&&(o.geneObject=a,s.add(a))}}for(let t of e)if(gl(t.type)){const e=l(t);if(e)for(let i of e){let o=n[i];if(!o&&"gtf"===this.format){const e=Object.assign({},t);e.type="transcript",o=new bl(e),n[i]=o,r.push(o)}if(void 0!==o){if(a=t.type,ll.has(a))if(e.length>1){const e=new wl(t);o.addExon(e)}else o.addExon(t);else o.addPart(t);s.add(t)}}}var a;r.forEach((function(e){"function"==typeof e.finish&&e.finish()}));const c=e.filter((e=>!s.has(e)));for(let e of c)r.push(e);return r;function l(e){return e.parent&&""!==e.parent.trim()?e.parent.trim().split(","):null}}numberExons(e,t){for(let i of e)if(i.exons&&(!t||i.end<=t.end&&i.start>t.start))for(let e=0;e<i.exons.length;e++){i.exons[e].number="-"===i.strand?i.exons.length-e:e+1}}nameFeatures(e){for(let t of e)if("function"==typeof t.getAttributeValue)if(this.nameField)t.name=t.getAttributeValue(this.nameField);else for(let e of kl){const i=t.getAttributeValue(e);if(i){t.name=i;break}}}}const Sl={gwascatalog:{fields:["bin","chr","start","end","name","pubMedID","author","pubDate","journal","title","trait","initSample","replSample","region","genes","riskAllele","riskAlFreq","pValue","pValueDesc","orOrBeta","ci95","platform","cnv"]},wgrna:{fields:["bin","chr","start","end","name","score","strand","thickStart","thickEnd","type"]},cpgislandext:{fields:["bin","chr","start","end","name","length","cpgNum","gcNum","perCpg","perGc","obsExp"]},clinVarMain:{fields:["chr1","start","end","name","score","strand","thickStart","thickEnd","reserved","blockCount","blockSizes","chromStarts","origName","clinSign","reviewStatus","type","geneId","snpId","nsvId","rcvAcc","testedInGtr","phenotypeList","phenotype","origin","assembly","cytogenetic","hgvsCod","hgvsProt","numSubmit","lastEval","guidelines","otherIds"]}};class El{constructor(e){this.config=e,this.header={},e.nameField&&(this.header.nameField=e.nameField),this.skipRows=0,e.decode?(this.decode=e.decode,this.delimiter=e.delimiter||"\t"):e.format&&(this.header.format=e.format.toLowerCase(),this.setDecoder(this.header.format)),this.delimiter||(this.delimiter="\t")}async parseHeader(e){let t,i,n=this.header;for(;void 0!==(i=await e.nextLine());)if(i.startsWith("track")||i.startsWith("#track")){let e=Nl(i);Object.assign(n,e)}else if(i.startsWith("browser"));else if(i.startsWith("#columns")){let e=Bl(i);Object.assign(n,e)}else if(i.startsWith("##gff-version 3"))n.format="gff3";else if(i.startsWith("#gffTags"))n.gffTags=!0;else{if(i.startsWith("fixedStep")||i.startsWith("variableStep"))break;if(i.startsWith("#")){const e=i.split(this.delimiter||"\t");e.length>1&&(t=e)}else{this.setDecoder(n.format);const e=i.split(this.delimiter||"\t");try{const i=Object.assign({columnNames:t},n);if(this.decode(e,i))break;e.length>1&&(t=e)}catch(i){e.length>1&&(t=e)}}}if(t){n.columnNames=t;for(let e=0;e<t.length;e++)"color"===t[e]||"colour"===t[e]?n.colorColumn=e:"thickness"===t[e]&&(n.thicknessColumn=e)}return this.header=n,n}async parseFeatures(e){const t=[],i=this.decode,n=this.header.format,r=this.delimiter||"\t";let s,o=0,a=0;for(;void 0!==(s=await e.nextLine());){if(o++,o<=this.skipRows)continue;if(!s||s.startsWith("track")||s.startsWith("#")||s.startsWith("browser"))continue;if("wig"===n&&s.startsWith("fixedStep")){this.header.wig=Ml(s);continue}if("wig"===n&&s.startsWith("variableStep")){this.header.wig=Rl(s);continue}const e=s.split(r);if(e.length<1)continue;const c=i(e,this.header);c instanceof zc?(a++,a>0&&console.error(`Error parsing line '${s}': ${c.message}`)):c&&t.push(c)}return i===Rc&&function(e){if(0==e.length)return;const t=e[0];if(void 0===t.score&&void 0!==t.name){for(let t of e)if(!ja(t.name)&&"."!==t.name)return;for(let t of e)t.score=Number(t.name),delete t.name}const i=e.filter((e=>e.chr1!==e.chr2));for(let t of i){const i=Object.assign({},t);i.dup=!0,e.push(i),t.chr=t.chr1,t.start=t.start1,t.end=t.end1,i.chr=i.chr2,i.start=i.start2,i.end=i.end2}}(t),"gtf"!==this.config.format&&"gff3"!==this.config.format&&"gff"!==this.config.format||!1===this.config.assembleGFF?t:new Il(this.config).combineFeatures(t)}setDecoder(e){switch(e){case"broadpeak":case"regionpeak":case"peaks":this.decode=Zc,this.delimiter=this.config.delimiter||/\s+/;break;case"narrowpeak":this.decode=Jc,this.delimiter=this.config.delimiter||/\s+/;break;case"bedgraph":this.decode=el,this.delimiter=/\s+/;break;case"wig":this.decode=tl,this.delimiter=this.config.delimiter||/\s+/;break;case"gff3":case"gff":this.decode=vl,this.delimiter="\t";break;case"gtf":this.decode=yl,this.delimiter="\t";break;case"fusionjuncspan":this.decode=Al,this.delimiter=this.config.delimiter||/\s+/;break;case"gtexgwas":this.skipRows=1,this.decode=Cl,this.delimiter="\t";break;case"refflat":this.decode=$c,this.delimiter=this.config.delimiter||/\s+/;break;case"genepred":this.decode=Wc,this.delimiter=this.config.delimiter||/\s+/;break;case"genepredext":this.decode=Gc,this.delimiter=this.config.delimiter||/\s+/;break;case"ensgene":this.decode=Wc,this.header.shift=1,this.delimiter=this.config.delimiter||/\s+/;break;case"refgene":this.decode=Gc,this.delimiter=this.config.delimiter||/\s+/,this.header.shift=1;break;case"bed":this.decode=qc,this.delimiter=this.config.delimiter||/\s+/;break;case"gappedpeak":this.decode=Qc,this.delimiter=this.config.delimiter||/\s+/;break;case"bedmethyl":this.decode=Vc,this.delimiter=this.config.delimiter||/\s+/;break;case"bedpe":case"hiccups":this.decode=Rc,this.delimiter=this.config.delimiter||"\t";break;case"bedpe-domain":this.decode=Dc,this.headerLine=!0,this.delimiter=this.config.delimiter||"\t";break;case"bedpe-loop":this.decode=Rc,this.delimiter=this.config.delimiter||"\t",this.header={colorColumn:7};break;case"interact":this.decode=Lc,this.delimiter=this.config.delimiter||/\s+/;break;case"snp":this.decode=il,this.delimiter="\t";break;case"rmsk":this.decode=jc,this.delimiter="\t";break;case"gcnv":this.decode=xl,this.delimiter="\t";break;default:const t=function(e){return Sl&&Sl[e]?function(e){const t=e.fields,i=["chr","start","end"];for(let n=0;n<t.length;n++)for(let r of i)r===t[n]&&(e[r]=n);return e}(Sl[e]):void 0}(e);void 0!==t?(this.decode=_l,this.header.customFormat=t,this.delimiter=t.delimiter||"\t"):(this.decode=qc,this.delimiter=this.config.delimiter||/\s+/)}}}function Nl(e){const t={},i=e.split(/(?:")([^"]+)(?:")|([^\s"]+)(?=\s+|$)/g);let n;const r=[];for(let e of i)e&&0!==e.trim().length&&(e.endsWith("=")?n=e:n?(r.push(n+e),n=void 0):r.push(e));for(let e of r){if(!e)return;var s=e.split("=",2);if(2===s.length){const e=s[0].trim(),i=s[1].trim();if(t.hasOwnProperty(e)){let n=t[e];Array.isArray(n)?n.push(i):t[e]=[n,i]}else t[e]=i}}return"interact"==t.type?t.format="interact":"gcnv"===t.type&&(t.format="gcnv"),t}function Bl(e){let t={},i=e.split(/\s+/);if(2===i.length){i[1].split(";").forEach((function(e){let i=e.split("=");"color"===i[0]?t.colorColumn=Number.parseInt(i[1])-1:"thickness"===i[0]&&(t.thicknessColumn=Number.parseInt(i[1])-1)}))}return t}function Ml(e){const t=e.split(/\s+/);return{format:"fixedStep",chrom:t[1].split("=")[1],start:parseInt(t[2].split("=")[1],10)-1,step:parseInt(t[3].split("=")[1],10),span:t.length>4?parseInt(t[4].split("=")[1],10):1,index:0}}function Rl(e){const t=e.split(/\s+/);return{format:"variableStep",chrom:t[1].split("=")[1],span:t.length>2?parseInt(t[2].split("=")[1],10):1}}function Dl(t,i){const n=e({class:"igv-menu-popup-check-container"}),r=e();n.appendChild(r);const s=l("check",!0===i?"#444":"transparent");r.appendChild(s);const o=e();return o.innerText=t,n.appendChild(o),n}function Tl(e,t){t=t||Number.MAX_SAFE_INTEGER;const i=[];e.sort((function(e,t){return e.start-t.start})),i.push(-1e3);for(let n of e){let e=0;const r=Math.min(i.length,t);for(e=0;e<r;e++)if(n.start>=i[e]){n.row=e,i[e]=n.end;break}n.row=e,i[e]=n.end}}async function Ll(e,t,i){const n=e=>{const i=Object.assign({},e);return i.chr="all",i.start=t.getGenomeCoordinate(e.chr,e.start),i.end=t.getGenomeCoordinate(e.chr,e.end),i._f=e,i.exons&&delete i.exons,i},r=new Set(t.wgChromosomeNames),s=[];let o=0;for(let a of t.wgChromosomeNames){if(Array.isArray(e)){const i={};for(let n of e){const e=t.getChromosomeName(n.chr);i.hasOwnProperty(e)||(i[e]=[]),i[e].push(n)}e=i}const c=e[a];if(c){const e=i||1e4;for(let i of c){let a=t.getChromosomeName(i.chr);if(r.has(a))if(s.length<e)s.push(n(i));else{const t=e/(o+1);if(Math.random()<t){s[Math.floor(Math.random()*(e-1))]=n(i)}}o++}}}return s.sort((function(e,t){return e.start-t.start})),s}function zl(e,t){if(t=t||1e3,null==e||0===e.length)return;const i={},n=[];for(let t of e){const e=t.chr;let r=i[e];r||(r=[],i[e]=r,n.push(e)),r.push(t)}for(let e of n)Tl(i[e],t)}class Hl{static defaults={height:50,autoHeight:!1,visibilityWindow:void 0,color:void 0,altColor:void 0,supportHiDPI:!0,selected:!1};constructor(e,t){this.browser=t,this.init(e)}init(e){this.config=e,e.displayMode&&(e.displayMode=e.displayMode.toUpperCase());const t=Object.assign({},Hl.defaults);if(this.constructor.defaults)for(let e of Object.keys(this.constructor.defaults))t[e]=this.constructor.defaults[e];for(let n of Object.keys(t))this[n]=e.hasOwnProperty(n)?e[n]:t[n],"color"!==n&&"altColor"!==n||!this[n]||(this[n]=Mt(i=this[n])&&i.indexOf(",")>0&&!i.startsWith("rgb(")&&!i.startsWith("rgba(")?`rgb(${i})`:i);var i;e.name||e.label?this.name=e.name||e.label:Ht(e.url)?this.name=e.url.name:Mt(e.url)&&!e.url.startsWith("data:")&&(this.name=zt(e.url)),this.url=e.url,this.config.type&&(this.type=this.config.type),this.id=void 0===this.config.id?this.name:this.config.id,this.order=e.order,this.autoscaleGroup=e.autoscaleGroup,this.removable=void 0===e.removable||e.removable,this.minHeight=e.minHeight||Math.min(25,this.height),this.maxHeight=e.maxHeight||Math.max(1e3,this.height),e.onclick&&(this.onclick=e.onclick,e.onclick=void 0),e.description&&("function"==typeof e.description?this.description=e.description:this.description=()=>e.description),e.hoverTextFields?this.hoverText=Pl.bind(this):"function"==typeof this.config.hoverText&&(this.hoverText=this.config.hoverText)}get name(){return this._name}set name(e){this._name=e,this.trackView&&this.trackView.setTrackLabelName(e)}clearCachedFeatures(){this.trackView&&this.trackView.clearCachedFeatures()}updateViews(){this.trackView&&this.trackView.updateViews()}repaintViews(){this.trackView&&this.trackView.repaintViews()}getState(){const e={},t=Object.keys(this.config).filter((e=>{return!(void 0===(t=this.config[e])||"function"==typeof t||t instanceof Promise);var t}));for(const i of t)i.startsWith("_")||(e[i]=this.config[i]);for(let t of Object.keys(e)){if(t.startsWith("_"))continue;const i=this[t];void 0===i||!Ua(i)&&"boolean"!=typeof i&&"metadata"!==t||(e[t]=i)}const i=Object.assign({},Hl.defaults);if(this.constructor.defaults)for(let e of Object.keys(this.constructor.defaults))i[e]=this.constructor.defaults[e];for(let t of Object.keys(i))void 0!==this[t]&&i[t]!==this[t]&&(e[t]=this[t]);return!this.autoscale&&this.dataRange&&(e.min=this.dataRange.min,e.max=this.dataRange.max),this.autoscaleGroup&&(e.autoscaleGroup=this.autoscaleGroup),e}get supportsWholeGenome(){return!0===this.config.supportsWholeGenome}hasSamples(){return!1}getGenomeId(){return this.browser.genome?this.browser.genome.id:void 0}setTrackProperties(e){if(this.disposed)return;const t={};let i;for(let n of Object.keys(e))switch(n.toLowerCase()){case"usescore":t.useScore=1===e[n]||"1"===e[n]||"on"===e[n]||!0===e[n];break;case"visibility":switch(e[n]){case"2":case"3":case"pack":case"full":t.displayMode="EXPANDED";break;case"4":case"squish":t.displayMode="SQUISHED";break;case"1":case"dense":t.displayMode="COLLAPSED"}break;case"color":case"altcolor":t[n]=e[n].startsWith("rgb(")?e[n]:"rgb("+e[n]+")";break;case"featurevisiblitywindow":case"visibilitywindow":t.visibilityWindow=Number.parseInt(e[n]);break;case"maxheightpixels":i=e[n].split(":"),3===i.length&&(t.minHeight=Number.parseInt(i[2]),t.height=Number.parseInt(i[1]),t.maxHeight=Number.parseInt(i[0]));break;case"viewlimits":if(!this.config.autoscale){i=e[n].split(":");let r,s=0;1==i.length?r=Number(i[0]):2==i.length&&(s=Number(i[0]),r=Number(i[1])),Number.isNaN(r)||Number.isNaN(s)?console.warn(`Unexpected viewLimits value in track line: ${e.viewLimits}`):(t.autoscale=!1,t.dataRange={min:s,max:r},this.viewLimitMin=s,this.viewLimitMax=r)}case"name":t[n]=e[n];break;case"url":t.infoURL=e[n];break;case"type":const r=e[n];Ol.has(r)?t[n]=Ol.get(r):t[n]=r;break;case"graphtype":t.graphType=e[n];break;default:t[n]=e[n]}for(let e of Object.keys(t))if(!this.config.hasOwnProperty(e)||"name"===e&&this.config._derivedName){let i=t[e];if("true"===i&&(i=!0),"false"===i&&(i=!1),this[e]=i,"height"===e&&this.trackView)try{const e=Number.parseInt(i);this.trackView.setTrackHeight(e)}catch(e){console.error(e)}}}clickedFeatures(e){const t=e.viewport.cachedFeatures;if(!t||!Array.isArray(t)||0===t.length)return[];const i=e.genomicLocation,n=e.referenceFrame.bpPerPixel>.2?3*e.referenceFrame.bpPerPixel:.2;return to(t,i-n,i+n)}extractPopupData(e,t){const i=new Set(["row","color","chr","start","end","cdStart","cdEnd","strand","alpha"]),n=[];let r,s;for(let t in e)if(e.hasOwnProperty(t)&&!i.has(t)&&Ua(e[t])){let i=e[t];n.push({name:Lt(t),value:i}),"alleles"===t?r=e[t]:"alleleFreqs"===t&&(s=e[t])}if(r&&s){r.endsWith(",")&&(r=r.substr(0,r.length-1)),s.endsWith(",")&&(s=s.substr(0,s.length-1));let i=r.split(","),o=s.split(",");if(o.length>1){let r=[];for(let e=0;e<o.length;e++)r.push({a:i[e],af:Number(o[e])});r.sort((function(e,t){return e.af-t.af}));let s=r[r.length-1].a;if(1===s.length)for(let i=r.length-2;i>=0;i--){let o=r[i].a;if(1===o.length){t||(t=this.getGenomeId());const i=Hl.getCravatLink(e.chr,e.start+1,s,o,t);console.log(i),i&&(n.push("<hr/>"),n.push({html:i}),n.push("<hr/>"))}}}}if(e.attributes)for(let t of Object.keys(e.attributes))n.push({name:t,value:e.attributes[t]});let o=`${e.chr}:${Rt(e.start+1)}-${Rt(e.end)}`;return e.strand&&(o+=` (${e.strand})`),n.push({name:"Location",value:o}),n}description(){const e=(e,t)=>`<div class="igv-track-label-popup-shim"><b>${e}: </b>${t}</div>`;let t='<div class="igv-track-label-popup">';if(this.url?Ht(this.url)?t+=e("Filename",this.url.name):t+=e("URL",this.url):t=this.name,this.config){if(this.config.metadata)for(let i of Object.keys(this.config.metadata)){t+=e(i,this.config.metadata[i])}for(let i of Object.keys(this.config)){if(i.startsWith("_"))continue;let n=i.substr(0,1);if(n!==n.toLowerCase()){const n=this.config[i];n&&Ua(n)&&(t+=e(i,n))}}}return t+="</div>",t}getColorForFeature(e){return"function"==typeof this.color?this.color(feature):this.color}numericDataMenuItems(){const e=[];e.push("<hr/>");let t=Bt("<div>");if(t.text("Set data range"),e.push({object:t,dialog:function(){this.trackView.track.selected?this.browser.dataRangeDialog.configure(this.trackView.browser.getSelectedTrackViews()):this.browser.dataRangeDialog.configure(this.trackView),this.browser.dataRangeDialog.present(Bt(this.browser.columnContainer))}}),void 0!==this.logScale){function i(){this.logScale=!this.logScale,this.trackView.repaintViews()}t=Bt(Dl("Log scale",this.logScale)),e.push({object:t,click:i})}return t=Bt(Dl("Autoscale",this.autoscale)),e.push({object:t,click:function(){this.autoscaleGroup=void 0,this.autoscale=!this.autoscale,this.browser.updateViews()}}),e}setDataRange({min:e,max:t}){this.dataRange={min:e,max:t},this.autoscale=!1,this.autoscaleGroup=void 0,this.trackView.repaintViews()}async nextFeatureAfter(e,t,i){let n=this.trackView.viewports[0].cachedFeatures;if(n&&Array.isArray(n)&&n.length>0){if(this.browser.genome.getChromosomeName(n[0].chr)===e){const e=function(e,t,i=!0){const n=e=>(e.start+e.end)/2,r=i?(e,t)=>e.start-t.start+e.end-t.end:(e,t)=>t.start-e.start+t.end-e.end,s=Array.from(e);s.sort(r);let o=0,a=s.length;for(;o<a;){let e=Math.floor((o+a)/2);i?n(s[e])<=t?o=e+1:a=e:n(s[e])>=t?o=e+1:a=e}return s[o]}(n,t,i);if(e)return e}}if("function"==typeof this.featureSource.nextFeature)return this.featureSource.nextFeature(e,t,i,this.visibilityWindow)}dispose(){this.disposed=!0;for(let e of Object.keys(this))this[e]=void 0}static getCravatLink(e,t,i,n,r){if("hg38"===r||"GRCh38"===r){return`<a target="_blank" href="https://run.opencravat.org/result/nocache/variant.html?chrom=${e.startsWith("chr")?e:"chr"+e}&pos=${t}&ref_base=${i}&alt_base=${n}"><b>Cravat ${i}->${n}</b></a>`}}static localFileInspection(e){const t=Object.assign({},e),i={url:"file",indexURL:"indexFile"};for(const e of["url","indexURL"])t[e]&&t[e]instanceof File&&(t[i[e]]=t[e].name,delete t[e]);return t}}function Pl(e){if(!this.hoverTextFields)return;const t=this.clickedFeatures(e);if(t&&t.length>0){let e="";for(let i=0;i<t.length;i++){if(10===i){e+="; ...";break}if(!t[i])continue;const n=t[i]._f||t[i];e.length>0&&(e+="\n"),e="";for(let t of this.hoverTextFields)e.length>0&&(e+="\n"),n.hasOwnProperty(t)?e+=n[t]:"function"==typeof n.getAttribute&&(e+=n.getAttribute(t))}return e}}const Ol=new Map([["wiggle_0","wig"],["bed","bed"],["bigBed","bigBed"],["bigWig","bigWig"]]);class Ul{constructor(e){switch(this.type=e||"seg",this.type){case"mut":this.sampleColumn=3,this.chrColumn=0,this.startColumn=1,this.endColumn=2,this.dataColumn=4;break;case"maf":this.sampleColumn=15,this.chrColumn=4,this.startColumn=5,this.endColumn=6,this.dataColumn=8;break;default:this.sampleColumn=0,this.chrColumn=1,this.startColumn=2,this.endColumn=3}}async parseHeader(e){let t;for(;void 0!==(t=await e.nextLine());)if(!t.startsWith("#")){const e=t.split("\t");this.header={headings:e};break}return this.header}async parseFeatures(e){const t=[];let i;this.header||(this.header=await this.parseHeader(e)),"seg"===this.type&&(this.dataColumn=this.header.headings.length-1),this.header.headings.length>5&&(i=this.extractExtraColumns(this.header.headings));const n=this.header.headings[this.dataColumn];let r;for(;void 0!==(r=await e.nextLine());){const e=r.split("\t"),s="seg"===this.type?Number(e[this.dataColumn]):e[this.dataColumn];if(e.length>this.dataColumn){const r=new ql({sample:e[this.sampleColumn],chr:e[this.chrColumn],start:parseInt(e[this.startColumn])-1,end:parseInt(e[this.endColumn]),value:s,valueColumnName:n});if(i){const t=this.extractExtraColumns(e);r.setAttributes({names:i,values:t})}t.push(r)}}return t}extractExtraColumns(e){const t=[];for(let i=0;i<e.length;i++)i!==this.chrColumn&&i!==this.startColumn&&i!==this.endColumn&&i!==this.sampleColumn&&t.push(e[i]);return t}}class ql{constructor({sample:e,chr:t,start:i,end:n,value:r,valueColumnName:s}){this.sample=e,this.chr=t,this.start=i,this.end=n,this.value=r,this.valueColumnName=s}setAttributes({names:e,values:t}){this.attributeNames=e,this.attributeValues=t}getAttribute(e){if(this.attributeNames){const t=this.attributeNames.indexOf(e);if(t>=0)return this.attributeValues[t]}}popupData(e,t){const i=new Set(["chr","start","end","sample","value","row","color","sampleKey","uniqueSampleKey","sampleId","chromosome","uniquePatientKey"]),n=this.chr+":"+Rt(this.start+1)+"-"+Rt(this.end),r=[{name:"Sample",value:this.sample},{name:"Location",value:n},{name:this.valueColumnName?Lt(this.valueColumnName):"Value",value:this.value}];if("mut"===e&&"hg38"===t){const e=this.extractCravatLink(t);e&&(r.push("<hr/>"),r.push({html:e}),r.push("<hr/>"))}if(this.attributeNames&&this.attributeNames.length>0)for(let e=0;e<this.attributeNames.length;e++)!i.has(this.attributeNames[e])&this.valueColumnName!==this.attributeNames[e]&&r.push({name:Lt(this.attributeNames[e]),value:this.attributeValues[e]});return r}extractCravatLink(e){let t,i;if(this.attributeNames&&this.attributeNames.length>0)for(let n=0;n<this.attributeNames.length;n++)if(t||"Reference_Allele"!==this.attributeNames[n]||(t=this.attributeValues[n]),!i&&this.attributeNames[n].startsWith("Tumor_Seq_Allele")&&this.attributeValues[n]!==t&&(i=this.attributeValues[n]),t&&i)return Hl.getCravatLink(this.chr,this.start+1,t,i,e)}}const Ql=new Map([["REF","referenceBases"],["ALT","alternateBases"],["QUAL","quality"],["FILTER","filter"]]);class Vl{constructor(e){this.chr=e[0],this.pos=parseInt(e[1]),this.names=e[2],this.referenceBases=e[3],this.alternateBases=e[4],this.quality=e[5],this.filter=e[6],this.info={};const t=e[7];if(t&&"."!==t)for(let e of t.split(";")){var i=e.split("=");this.info[i[0]]=i[1]}this.init()}getAttributeValue(e){return Ql.has(e)&&(e=Ql.get(e)),this.hasOwnProperty(e)?this[e]:this.info[e]}init(){const e=this.referenceBases,t=this.alternateBases;if(this.info&&(this.info.VT?this.type=this.info.VT:this.info.SVTYPE?this.type="SV":this.info.PERIOD&&(this.type="STR")),void 0===this.type&&(this.type=function(e,t){const i=e.length;if(void 0===t)return"UNKNOWN";if(0===t.trim().length||"<NON_REF>"===t||"<*>"===t||"."===t)return"NONVARIANT";{const e=t.split(",").map((function(e){return 1===i&&1===e.length?"SNP":"<NON_REF>"===e?"NONVARIANT":e.length>i&&$l(e)?"INSERTION":e.length<i&&$l(e)?"DELETION":"OTHER"}));let n=e[0];for(let t of e)if(t!==n)return"MIXED";return n}}(e,t)),this.info.END)this.start=this.pos-1,this.info.CHR2&&this.info.CHR2!==this.chr?this.end=this.start+1:this.end=Number.parseInt(this.info.END);else if("NONVARIANT"===this.type)this.start=this.pos-1,this.end=this.start+e.length;else{const i=t.split(",").filter((e=>e.length>0));this.alleles=[],this.start=void 0,this.end=void 0;for(let t of i)if(this.alleles.push(t),"SV"!==this.type&&$l(t)){let i=t.length,n=e.length;const r=Math.min(i,n);let s=0;for(;s<r&&e.charCodeAt(s)===t.charCodeAt(s);)s++,i--,n--;for(;i>0&&n>0;){const r=s+i-1,o=s+n-1;if(t.charCodeAt(r)!==e.charCodeAt(o))break;i--,n--}for(;i>0&&n>0;){const r=s,o=s;if(t.charCodeAt(r)!==e.charCodeAt(o))break;s++,i--,n--}const o=this.pos+s-1,a=o+n;this.start=void 0===this.start?o:Math.min(this.start,o),this.end=void 0===this.end?a:Math.max(this.end,a)}void 0===this.start&&(this.start=this.pos-1,this.end=this.pos),this.start===this.end&&(this.start-=.5,this.end+=.5)}}popupData(e,t){const i=`${Rt(this.pos)}`,n=this.start===this.end?`${Rt(this.start)} | ${Rt(this.start+1)}`:`${Rt(this.start+1)}-${Rt(this.end)}`,r=[{name:"Chr",value:this.chr},{name:"Pos",value:i},{name:"Loc",value:n},{name:"ID",value:this.names?this.names:""},{name:"Ref",value:this.referenceBases},{name:"Alt",value:this.alternateBases.replace("<","&lt;")},{name:"Qual",value:this.quality},{name:"Filter",value:this.filter}];if(this.type&&r.push({name:"Type",value:this.type}),"SNP"===this.type){let e=this.referenceBases;if(1===e.length){let i=this.alternateBases.split(",");for(let n of i)if(1===n.length){let i=Hl.getCravatLink(this.chr,this.pos,e,n,t);i&&(r.push("<hr/>"),r.push({html:i}))}}}const s=Object.keys(this.info);if(this.info&&s.length>0){r.push({html:'<hr style="border-top: dotted 1px;border-color: #c9c3ba" />'});for(let e of s)r.push({name:e,value:Kl(decodeURIComponent(this.info[e]))})}return r}getInfo(e){return this.info?this.info[e]:void 0}isRefBlock(){return"NONVARIANT"===this.type}isFiltered(){return!("."===this.filter||"PASS"===this.filter)}alleleFreq(){return this.info?this.info.AF:void 0}}class jl{constructor(e){this.mate=e,this.chr=e.info.CHR2,this.pos=Number.parseInt(e.info.END),this.start=this.pos-1,this.end=this.pos}get info(){return this.mate.info}get names(){return this.mate.names}get referenceBases(){return this.mate.referenceBases}get alternateBases(){return this.mate.alternateBases}get quality(){return this.mate.quality}get filter(){return this.mate.filter}get calls(){return this.mate.calls}getAttributeValue(e){return this.mate.getAttributeValue(e)}getInfo(e){this.mate.getInfo(e)}isFiltered(){return this.mate.isFiltered()}alleleFreq(){return this.mate.alleleFreq()}popupData(e,t){const i=[];return i.push("SV Breakpoint"),i.push({name:"Chr",value:this.chr}),i.push({name:"Pos",value:`${Rt(this.pos)}`}),i.push({html:'<hr style="border-top: dotted 1px;border-color: #c9c3ba" />'}),i.push("SV"),i.push(...this.mate.popupData(e,t)),i}}class Wl{constructor({formatFields:e,sample:t,token:i}){this.info={},this.sample=t;const n=i.split(":");for(let t=0;t<n.length;t++){const i=n[t];if(t==e.genotypeIndex){this.genotype=[];for(let e of i.split(/[\|\/]/))this.genotype.push("."===e?e:parseInt(e))}else this.info[e.fields[t]]=i}}get zygosity(){if(!this._zygosity)if(this.genotype){let e=!0,t=!0,i=!1;for(let n of this.genotype){if("."===n){i=!0;break}0!==n&&(t=!1),0===n&&(e=!1)}this._zygosity=i?"nocall":t?"homref":e?"homvar":"hetvar"}else this._zygosity="unknown";return this._zygosity}zygosityScore(){switch(this.zygosity){case"homvar":return 4;case"hetvar":return 3;case"homref":return 2;case"nocall":return 1;default:return 0}}#l(){switch(this.zygosity){case"homref":return"Homozygous reference";case"homvar":return"Homozygous variant";case"hetvar":return"Heterozygous";default:return""}}popupData(e,t){const i=[];void 0!==this.sample&&i.push({name:"Sample",value:this.sample}),this.genotypeString&&i.push({name:"Genotype",value:this.genotypeString});const n=this.#l();n&&i.push({name:"Zygosity",value:n});var r=Object.keys(this.info);r.length&&i.push("<hr/>");for(let e of r)i.push({name:e,value:decodeURIComponent(this.info[e])});return i}}const Gl=new Set(["A","C","T","G"].map((e=>e.charCodeAt(0))));function $l(e){for(let t=0;t<e.length;t++)if(!Gl.has(e.charCodeAt(t)))return!1;return!0}function Kl(e,t){return void 0===t&&(t=","),Array.isArray(e)?e.join(t):e}class Yl{construtor(){}async parseHeader(e,t){const i={};i.chrAliasTable=new Map;let n=await e.nextLine();if(!n.startsWith("##fileformat"))throw new Error("Invalid VCF file: missing fileformat line");for(i.version=n.substr(13);void 0!==(n=await e.nextLine())&&n.startsWith("#");){let e;const s={};if(n.startsWith("##")){if(n.startsWith("##INFO")||n.startsWith("##FILTER")||n.startsWith("##FORMAT")){const t=n.indexOf("<"),o=n.lastIndexOf(">");if(!(t>2&&o>0)){console.log("Malformed VCF header line: "+n);continue}const a=n.substring(2,t-1);i[a]||(i[a]={});const c=Tt(n.substring(t+1,o-1),",");for(let t of c){var r=t.split("=");r.length>1&&("ID"===r[0]?e=r[1]:s[r[0]]=r[1])}e&&(i[a][e]=s)}else if(n.startsWith("##contig")&&t){const e=n.indexOf("<ID=");let r=n.indexOf(",",e);-1==r&&(r=n.indexOf(">",e));const s=n.substring(e+4,r),o=t.getChromosomeName(s);i.chrAliasTable.set(o,s)}}else if(n.startsWith("#CHROM")){const e=n.split("\t");if(e.length>8){i.sampleNameMap=new Map;for(let t=9;t<e.length;t++)i.sampleNameMap.set(e[t],t-9)}}}return this.header=i,i}async parseFeatures(e){const t=[],i=this.header.sampleNameMap?Array.from(this.header.sampleNameMap.keys()):void 0,n=8+(i?i.length+1:0);let r;for(;void 0!==(r=await e.nextLine());)if(r&&!r.startsWith("#")){const e=r.split("\t");if(e.length===n){const n=new Vl(e);if(n.header=this.header,t.push(n),e.length>9){const r=Xl(e[8].split(":"));n.calls=[];for(let t=9;t<e.length;t++){const s=i[t-9],o=e[t],a=new Wl({formatFields:r,sample:s,token:o});n.calls.push(a)}n.info&&n.info.CHR2&&n.info.END&&t.push(new jl(n))}}}return t}}function Xl(e){const t={genotypeIndex:-1,fields:e};for(let i=0;i<e.length;i++)"GT"===e[i]&&(t.genotypeIndex=i);return t}const Zl=Math.log10(Number.MIN_VALUE);class Jl{constructor(e){if(this.config=e,e.columns){if(void 0===e.columns.chromosome||void 0===e.columns.position||void 0===e.columns.value)throw Error("columns property must define chrCol, posCol, and valueCol");this.posCol=e.columns.position-1,this.chrCol=e.columns.chromosome-1,this.valueCol=e.columns.value-1}else this.posCol=2,this.chrCol=1,this.valueCol=3}async parseHeader(e){const t=await e.nextLine();return this.parseHeaderLine(t)}parseHeaderLine(e){if(this.columns=e.split(/\t/),!this.config.columns)for(let e=0;e<this.columns.length;e++){switch(this.columns[e].toLowerCase()){case"chr":case"chromosome":case"chr_id":this.chrCol=e;break;case"bp":case"pos":case"position":case"chr_pos":this.posCol=e;break;case"p":case"pval":case"pvalue":case"p-value":case"p.value":this.valueCol=e}}return this.columns}async parseFeatures(e){const t=[],i=e.nextLine();let n;this.columns||this.parseHeaderLine(i);const r=e=>{const t=e.indexOf("E");if(t>0){if(Number.parseInt(e.substring(t+1))<Zl)return Number.MIN_VALUE}return Number(e)};for(;void 0!==(n=e.nextLine());){const e=n.split(/\t/);if(e.length===this.columns.length){const i=e[this.posCol];if(i.indexOf(";")>0||0==i.length||i.indexOf("x")>0)continue;const s=e[this.chrCol],o=r(e[this.valueCol]),a=parseInt(i)-1,c=a+1;t.push(new eh({chr:s,start:a,end:c,value:o,line:n,columns:this.columns}))}}return t}static isGWAS(e){const t=e.split("\t");if(t.length<5)return!1;const i=[["chr","chromosome","chr_id","chrom"],["bp","pos","position","chr_pos","chromEnd"],["p","pval","p-value","p.value"]];for(let e of i)if(!t.some((t=>e.includes(t.toLowerCase()))))return!1;return!0}}class eh{constructor({chr:e,start:t,end:i,value:n,line:r,columns:s}){this.chr=e,this.start=t,this.end=i,this.value=n,this.line=r,this.columns=s}popupData(){const e=this.line.split(/\t/);return this.columns.map((function(t,i){return{name:t,value:e[i]}}))}getAttribute(e){const t=this.line.split(/\t/);for(let i=0;i<this.columns.length;i++)if(this.columns[i]===e)return t[i]}}var th=new RegExp("([^:]*)\\(([^)]*)\\)"),ih=new RegExp("([^:]*):([^(]*)\\(([^)]*)\\)");class nh{constructor(e){const t=e?e.decode:void 0;this.nameField=e?e.nameField:void 0,this.skipRows=0,this.decode=t||lh,this.delimiter="\t"}async parseHeader(e){let t,i;for(;(t=await e.nextLine())&&(t.startsWith("track")||t.startsWith("#")||t.startsWith("browser"));)if(t.startsWith("track")||t.startsWith("#track")){let e=oh(t);i?Object.assign(i,e):i=e}else if(t.startsWith("#columns")){let e=ah(t);i?Object.assign(i,e):i=e}else t.startsWith("##gff-version 3")&&(this.format="gff3",i||(i={}),i.format="gff3");return this.header=i,i}async parseFeatures(e){const t=[],i=this.decode,n=this.delimiter||"\t";let r,s=0;for(;void 0!==(r=e.nextLine());){if(s++,s<=this.skipRows||r.startsWith("track")||r.startsWith("#")||r.startsWith("browser"))continue;let e=o();if(e.length<1)continue;if(!this.aed){this.aed=sh(e);continue}const n=i.call(this,e,undefined);n&&t.push(n)}return t;function o(){for(var e,t,i=[],s="",o=!1;r||""===r;){for(e=0;e<r.length;e++)(t=r.charAt(e))===n?o?s+=t:(i.push(s),s=""):'"'===t?e+1<r.length&&'"'===r.charAt(e+1)?(o&&(s+='"'),e++):o=!o:s+=t;if(!o)break;s+="\n",r=nextLine()}return i.push(s),i}}}function rh(e){var t=ih.exec(e);if(t)return{namespace:t[1],name:t[2],type:t[3]};if(t=th.exec(e))return{namespace:"?",name:t[1],type:t[2]};throw new Error("Error parsing the header row of AED file - column not in ns:name(ns:type) format")}function sh(e){var t,i,n;for(t={columns:[],metadata:{}},i=0;i<e.length;i++)n=rh(e[i]),t.columns.push(n);return t}function oh(e){const t={},i=e.split(/(?:")([^"]+)(?:")|([^\s"]+)(?=\s+|$)/g);let n;const r=[];for(let e of i)e&&0!==e.trim().length&&(e.endsWith("=")>0?n=e:n?(r.push(n+e),n=void 0):r.push(e));for(let e of r){if(!e)return;var s=e.split("=",2);if(2===s.length){const e=s[0].trim(),i=s[1].trim();t[e]=i}}return t}function ah(e){let t={},i=e.split(/\s+/);if(2===i.length){i[1].split(";").forEach((function(e){let i=e.split("=");"color"===i[0]?t.colorColumn=Number.parseInt(i[1])-1:"thickness"===i[0]&&(t.thicknessColumn=Number.parseInt(i[1])-1)}))}return t}function ch(e,t){var i,n,r=e.columns;this.aed=e,this.allColumns=t,this.chr=null,this.start=null,this.end=null,this.score=1e3,this.strand=".",this.cdStart=null,this.cdEnd=null,this.name=null,this.color=null;for(let e=0;e<t.length;e++)if(i=t[e]){"aed:Integer"===(n=r[e]).type&&(i=parseInt(i));var s=[];if(n.namespace.length>0)for(let e=0;e<n.namespace.length;e++)s.push(n.namespace.charCodeAt(e));"bio"===n.namespace.trim()?"sequence"===n.name?this.chr=i:"start"===n.name?this.start=i:"end"===n.name?this.end=i:"cdsMin"===n.name?this.cdStart=i:"cdsMax"===n.name?this.cdEnd=i:"strand"===n.name&&(this.strand=i):"aed"===n.namespace?"name"===n.name&&(this.name=i):"style"===n.namespace&&"color"===n.name&&(this.color=_s.createColorString(i))}}function lh(e,t){var i,n,r,s,o,a,c=0,l=this.aed.columns;if(e.length===l.length){for(a=0;a<e.length;a++)s=l[a],""!==(r=e[a])&&c++,"name"===s.name&&"aed"===s.namespace?i=r:"value"===s.name&&"aed"===s.namespace&&(n=r);if(2===c&&i&&n)return o=rh(i),this.aed.metadata[o.namespace]||(this.aed.metadata[o.namespace]={}),void(this.aed.metadata[o.namespace][o.name]||(this.aed.metadata[o.namespace][o.name]={type:o.type,value:n}));var h=new ch(this.aed,e);if(h.chr&&(h.start||0===h.start)&&h.end)return h;console.log("Cannot parse feature: "+e.join(","))}else console.log("Corrupted AED file row: "+e.join(","))}function hh(e,t){if(0===e.length)return e;if(e.sort((function(e,t){const i=e.minv.block-t.minv.block;return 0!==i?i:e.minv.offset-t.minv.offset})),e.length<=1)return e;t&&(e=e.filter((e=>e.maxv.isGreaterThan(t))));const i=[];let n;for(let t of e)n&&dh(n,t)?t.maxv.isGreaterThan(n.maxv)&&(n.maxv=t.maxv):(i.push(t),n=t);return i}function dh(e,t){const i=t.minv.block-e.maxv.block;return t.maxv.block-e.minv.block<5e6&&i<65e3}ch.prototype.popupData=function(){for(var e=[],t=this.aed,i=0;i<this.allColumns.length;i++){var n=this.allColumns[i],r=t.columns[i].name;"sequence"!==r&&"color"!==r&&n&&e.push({name:r,value:n})}return e};class uh{constructor(){this.tabix=!0}parse(e){const t=new Ac(new DataView(e)),i=t.getInt();if(21582659!==i)throw 38359875===i?Error("CSI version 2 is not supported. Please enter an issue at https://github.com/igvteam/igv.js"):Error("Not a CSI index");this.indices=[],this.blockMin=Number.MAX_SAFE_INTEGER,this.lastBlockPosition=[],this.sequenceIndexMap={},this.minShift=t.getInt(),this.depth=t.getInt();const n=[];let r=0;if(t.getInt()>=28){t.getInt(),t.getInt(),t.getInt(),t.getInt(),t.getInt(),t.getInt();const e=t.getInt(),i=t.position+e;let r=0;for(;t.position<i;){let e=t.getString();this.sequenceIndexMap[e]=r,n[r]=e,r++}}const s=this.bin_limit()+1,o=t.getInt();for(let e=0;e<o;e++){const i=[],n=[],o=t.getInt();for(let e=0;e<o;e++){const e=t.getInt();if(n[e]=t.getVPointer(),e>s)t.getInt(),t.getVPointer(),t.getVPointer(),t.getLong(),t.getLong();else{i[e]=[];const n=t.getInt();for(let s=0;s<n;s++){const n=t.getVPointer(),s=t.getVPointer();n&&s&&(n.block<this.blockMin&&(this.blockMin=n.block),s.block>r&&(r=s.block),i[e].push([n,s]))}}}o>0&&(this.indices[e]={binIndex:i,loffset:n})}this.lastBlockPosition=r}get sequenceNames(){return Object.keys(this.sequenceIndexMap)}chunksForRange(e,t,i){const n=this.indices[e];if(n){const e=this.reg2bins(t,i);if(0==e.length)return[];const r=[];for(let t of e)for(let e=t[0];e<=t[1];e++)if(n.binIndex[e]){const t=n.binIndex[e];for(let i of t){const t=i[0],n=i[1];r.push({minv:t,maxv:n,bin:e})}}let s=e[this.depth][0];do{if(n.binIndex[s])break;s>1+(this.getParentBin(s)<<3)?s--:s=this.getParentBin(s)}while(0!=s);return hh(r,n.loffset[s])}return[]}getParentBin(e){return 0==e?0:e-1>>3}reg2bins(e,t){(e-=1)<1&&(e=1),t>2**34&&(t=2**34),t-=1;let i=0,n=0,r=this.minShift+3*this.depth;const s=[];for(;i<=this.depth;r-=3,n+=1<<3*i,i+=1){const i=n+(e>>r),o=n+(t>>r);s.push([i,o])}return s}bin_limit(){return((1<<3*(this.depth+1))-1)/7}}class fh{constructor(){}async parse(e,t){const i=[];let n=Number.MAX_SAFE_INTEGER,r=0;const s=new Ac(new DataView(e)),o=s.getInt(),a={};if(!(21578050===o||t&&21578324===o))throw new Error(indexURL+" is not a "+(t?"tabix":"bai")+" file");{const e=s.getInt();if(t){s.getInt(),s.getInt(),s.getInt(),s.getInt(),s.getInt(),s.getInt(),s.getInt();for(let t=0;t<e;t++){a[s.getString()]=t}}for(let t=0;t<e;t++){const e={},o=[],a=s.getInt();for(let t=0;t<a;t++){const t=s.getInt();if(37450===t)s.getInt(),s.getVPointer(),s.getVPointer(),s.getLong(),s.getLong();else{e[t]=[];const i=s.getInt();for(let o=0;o<i;o++){const i=s.getVPointer(),o=s.getVPointer();i&&o&&(i.block<n&&(n=i.block),o.block>r&&(r=o.block),e[t].push([i,o]))}}}const c=s.getInt();for(let e=0;e<c;e++){const e=s.getVPointer();o.push(e)}a>0&&(i[t]={binIndex:e,linearIndex:o})}this.firstBlockPosition=n,this.lastBlockPosition=r,this.indices=i,this.sequenceIndexMap=a,this.tabix=t}}get sequenceNames(){return Object.keys(this.sequenceIndexMap)}chunksForRange(e,t,i){const n=this.indices[e];if(n){const e=function(e,t){const i=[];t>=1<<29&&(t=1<<29);return--t,i.push([0,0]),i.push([1+(e>>26),1+(t>>26)]),i.push([9+(e>>23),9+(t>>23)]),i.push([73+(e>>20),73+(t>>20)]),i.push([585+(e>>17),585+(t>>17)]),i.push([4681+(e>>14),4681+(t>>14)]),i}(t,i),r=[];for(let t of e)for(let e=t[0];e<=t[1];e++)if(n.binIndex[e]){const t=n.binIndex[e];for(let e of t){const t=e[0],i=e[1];r.push({minv:t,maxv:i})}}const s=n.linearIndex.length;let o;const a=Math.min(t>>14,s-1),c=Math.min(i>>14,s-1);for(let e=a;e<=c;e++){const t=n.linearIndex[e];if(t){o=t;break}}return hh(r,o)}return[]}}class ph{constructor(){this.tribble=!0}async parse(e){let t=0;this.chrIndex={},this.lastBlockPosition=[];const i=new Ac(new DataView(e));!function(e){e.getInt(),e.getInt();const t=e.getInt();if(e.getString(),e.getLong(),e.getLong(),e.getString(),e.getInt(),t>=3){let t=e.getInt();for(;t-- >0;)e.getString(),e.getString()}}(i);let n=i.getInt();for(;n-- >0;){let e=i.getString();const n=i.getInt(),r=i.getInt(),s=i.getInt();i.getInt(),i.getInt();let o=i.getLong();const a=[];for(let e=0;e<r;e++){const e=i.getLong();a.push({min:o,max:e}),o=e,e>t&&(t=e)}this.chrIndex[e]={chr:e,blocks:a,longestFeature:s,binWidth:n}}this.lastBlockPosition=t}get sequenceNames(){return Object.keys(this.chrIndex)}chunksForRange(e,t,i){const n=this.chrIndex[e];if(n){const e=n.blocks,r=n.longestFeature,s=n.binWidth,o=Math.max(t-r,0),a=Math.floor(o/s);if(a>=e.length)return[];{const t=Math.min(Math.floor((i-1)/s),e.length-1),n=e[a].min,r=e[t].max;if(0===r-n)return[];return[{minv:{block:n,offset:0},maxv:{block:r,offset:0}}]}}}}async function gh(e,t){let i=await Qs.loadArrayBuffer(e,qa(t)),n=new DataView(i);if(31===n.getUint8(0)&&139===n.getUint8(1)){i=gs(i).buffer,n=new DataView(i)}switch(n.getInt32(0,!0)){case 21578050:return async function(e){const t=new fh;return await t.parse(e,!1),t}(i);case 21578324:return async function(e){const t=new fh;return await t.parse(e,!0),t}(i);case 21582659:return async function(e){const t=new uh;return t.parse(e),t}(i);case 1480870228:return async function(e){const t=new ph;return t.parse(e),t}(i);case 38359875:throw Error("CSI version 2 is not supported.");default:throw Error(`Unrecognized index type: ${e}`)}}function mh(e){return"string"==typeof e||e instanceof String?new wh(e):new bh(e)}class wh{constructor(e){this.data=e,this.ptr=0}nextLine(){var e=this.ptr,t=this.data.indexOf("\n",e),i=this.data;if(t>0)return this.ptr=t+1,t>e&&"\r"===i.charAt(t-1)?i.substring(e,t-1):i.substring(e,t);var n=i.length;return this.ptr=n,e>=n?void 0:i.substring(e)}}class bh{constructor(e){this.data=e,this.length=this.data.length,this.ptr=0}nextLine(){if(this.ptr>=this.data.length)return;let e=this.ptr;const t=this.data;let i="",n=!1;for(;e<t.length;){var r=t[e],s=0,o=0;if(r<=127?(s=0,o=255&r):r<=223?(s=1,o=31&r):r<=239?(s=2,o=15&r):r<=244&&(s=3,o=7&r),t.length-e-s>0)for(var a=0;a<s;)o=o<<6|63&(r=t[e+a+1]),a+=1;else o=65533,s=t.length-e;e+=s+1;const c=String.fromCodePoint(o);if("\r"===c)n=!0;else{if("\n"===c)break;n&&(i+="\r",n=!1),i+=c}}return this.ptr=e,i}}class Fh{constructor(e){this.config=e,this.filePtr=0,this.bufferPtr=0,this.buffer}async nextLine(){let e;try{for(;;){const t=this.buffer?this.buffer.length:0;for(;this.bufferPtr<t;){const t=String.fromCharCode(this.buffer[this.bufferPtr++]);if("\r"!==t){if("\n"===t)return e;e=e?e+t:t}}if(this.eof)return e;await this.readNextBlock()}}catch(t){return console.warn(t),this.eof=!0,e}}async readNextBlock(){const e=qa(this.config,{range:{start:this.filePtr,size:26}}),t=ms(await Qs.loadArrayBuffer(this.config.url,e));if(0===t)this.eof=!0,this.buffer=void 0;else{const e=qa(this.config,{range:{start:this.filePtr,size:t}}),i=await Qs.loadArrayBuffer(this.config.url,e);i.byteLength<t&&(this.eof=!0),this.buffer=gs(i),0==this.buffer.byteLength&&(this.eof=!0),this.bufferPtr=0,this.filePtr+=i.byteLength}}}const vh=e=>{const t=ArrayBuffer.isView(e)?e:new Uint8Array(e);return 1+(t[17]<<8|t[16])};class yh{constructor(e){this.config=e,this.cacheBlocks=0!=e.cacheBlocks,this.cache=void 0}async getData(e,t){const i=e.block,n=t.block,r=0===t.offset,s=await this.getInflatedBlocks(i,n,r);if(1===s.length)return s[0];let o=0;for(const e of s)o+=e.byteLength;const a=new Uint8Array(o);let c=0;for(const e of s)a.set(e,c),c+=e.byteLength;return a}async getInflatedBlocks(e,t,i){if(this.cacheBlocks){const n=this.cache;if(n&&n.startBlock<=e&&(n.endBlock>=t||i&&n.nextEndBlock===t)){const i=e-n.startBlock,r=t-n.startBlock;return Ch(n.buffer,i,r)}{let r;if(!n||n.startBlock>t||n.endBlock<e)r=await this.loadBLockData(e,t,{skipEnd:i});else{const s=[];if(e<n.startBlock){const t=await this.loadBLockData(e,n.startBlock,{skipEnd:!0});s.push(t)}let o;if(e<=n.startBlock&&t>=n.endBlock)o=n.buffer;else{const i=Math.max(0,e-n.startBlock);let r;if(t>=n.endBlock)r=n.buffer.byteLength;else{const e=Ah(n.buffer);for(let i=0;i<e.length-1;i++)if(n.startBlock+e[i]===t){r=e[i+1];break}}o=n.buffer.slice(i,r)}if(s.push(o),t>n.endBlock){const e=await this.loadBLockData(n.endBlock,t,{skipStart:!0,skipEnd:i});s.push(e)}r=function(e){if(1===e.length)return e[0];let t=0;for(const i of e)t+=i.byteLength;const i=new Uint8Array(t);let n=0;for(const t of e)i.set(new Uint8Array(t),n),n+=t.byteLength;return i.buffer}(s)}let s=t;if(i){const e=Ah(r);t=e[e.length-1]}return this.cache={startBlock:e,endBlock:t,nextEndBlock:s,buffer:r},Ch(r)}}return Ch(await this.loadBLockData(e,t,{skipEnd:i}))}async loadBLockData(e,t,i){const n=this.config,r=i&&i.skipStart;let s=0;if(!(i&&i.skipEnd)){const e=qa(n,{range:{start:t,size:26}}),i=await Qs.loadArrayBuffer(n.url,e);s=vh(i)}if(r){const t=qa(n,{range:{start:e,size:26}}),i=await Qs.loadArrayBuffer(n.url,t);e+=vh(i)}const o=qa(n,{range:{start:e,size:t+s-e}});return Qs.loadArrayBuffer(n.url,o)}}function Ah(e){const t=e.byteLength;let i=0;const n=[0];for(;i<t;){const r=new Uint8Array(e,i);i+=1+(r[17]<<8|r[16]),i<t&&n.push(i)}return n}function Ch(e,t,i){const n=[];let r=t=t||0;const s=e.byteLength-18;for(;r<s;)try{const t=new Uint8Array(e,r,18),s=t[11]<<8|t[10],o=t[17]<<8|t[16],a=12+s+r,c=e.byteLength-a,l=o-s-18;if(c<l||l<=0)break;const h=new Uint8Array(e,a,l),d=hs(h);if(n.push(d),i===r)break;r+=o+1}catch(e){console.error(e);break}return n}const _h=Math.log10(Number.MIN_VALUE);class xh{chrCol=-1;snpCol=-1;posCol=-1;pValueCol=-1;phenotypeColumn=-1;delimiter="\t";constructor(e){this.config=e}async parseHeader(e){const t=this.config;t.delimiter&&(this.delimiter=t.delimiter);const i=await e.nextLine(),n=this.parseHeaderLine(i);return t.chrColumn&&(this.chrColumn=t.chrColumn-1),t.snpColumn&&(this.snpColumn=t.snpColumn-1),t.posColumn&&(this.posColumn=t.posColumn-1),t.pValueColumn&&(this.pValueColumn=t.pValueColumn-1),t.phenotypeColumn&&(this.phenotypeColumn=t.phenotypeColumn-1),n}parseHeaderLine(e){this.columns=e.split(this.delimiter);for(let e=0;e<this.columns.length;e++){switch(this.columns[e].toLowerCase()){case"chr":case"chromosome":case"chr_id":case"chrom":this.chrColumn=e;break;case"bp":case"pos":case"position":case"chr_pos":case"chromEnd":this.posColumn=e;break;case"p":case"pval":case"pvalue":case"p-value":case"p.value":this.pValueColumn=e;break;case"rsid":case"variant":case"snp":this.snpColumn=e;break;case"phenotype":case"gene":case"gene_id":case"molecular_trait_id":this.phenotypeColumn=e}}return this.columns}async parseFeatures(e){const t=[],i=e.nextLine();let n;this.columns||this.parseHeaderLine(i);const r=e=>{const t=e.indexOf("E");if(t>0){if(Number.parseInt(e.substring(t+1))<_h)return Number.MIN_VALUE}return Number(e)};for(;void 0!==(n=e.nextLine());){const e=n.split(this.delimiter);if(e.length===this.columns.length){const i=e[this.posColumn];if(i.indexOf(";")>0||0==i.length||i.indexOf("x")>0)continue;const n=e[this.chrColumn],s=r(e[this.pValueColumn]),o=parseInt(i)-1,a=o+1,c=e[this.snpColumn],l=e[this.phenotypeColumn],h=new kh({chr:n,start:o,end:a,pValue:s,snp:c,phenotype:l},this.columns,e);t.push(h)}}return t}static isQTL(e){const t=e.split("\t");if(t.length<5)return!1;const i=[["chr","chromosome","chr_id","chrom"],["bp","pos","position","chr_pos","chromEnd"],["p","pval","p-value","p.value"],["rsid","variant","snp"],["phenotype","gene","gene_id","molecular_trait_id"]];for(let e of i)if(!t.some((t=>e.includes(t.toLowerCase()))))return!1;return!0}}class kh{constructor({chr:e,start:t,end:i,pValue:n,snp:r,phenotype:s},o,a){this.chr=e,this.start=t,this.end=i,this.pValue=n,this.snp=r,this.phenotype=s,this.headers=o,this.tokens=a}popupData(){const e=[];for(let t=0;t<this.headers.length;t++)e.push({name:this.headers[t],value:this.tokens[t]});return e}}class Ih{sequenceNames;constructor(e,t){if(this.config=e||{},this.genome=t,this.indexURL=e.indexURL,this.indexed=e.indexed||void 0!==this.indexURL,this.queryable=this.indexed,Ht(this.config.url))this.filename=this.config.url.name;else if($a(this.config.url))this.indexed=!1,this.dataURI=e.url;else{const t=Ot(this.config.url);this.filename=e.filename||t.file}this.parser=this.getParser(this.config),"vcf"!==this.config.format||this.config.indexURL||console.warn("Warning: index file not specified. The entire vcf file will be loaded.")}async defaultVisibilityWindow(){if(this.config.indexURL){const e=await this.getIndex();if(e&&e.lastBlockPosition){let t=0;const i=1e4;for(let i of e.sequenceNames){const e=this.genome.getChromosome(i);e&&(t+=e.bpLength)}return Math.round(t/e.lastBlockPosition*i)}}}async readFeatures(e,t,i){let n;this.dataURI||this.header||await this.readHeader();return await this.getIndex()?(this.indexed=!0,n=await this.loadFeaturesWithIndex(e,t,i)):this.dataURI?(this.indexed=!1,n=await this.loadFeaturesFromDataURI()):"service"===this.config.sourceType?n=await this.loadFeaturesFromService(e,t,i):(this.indexed=!1,n=await this.loadFeaturesNoIndex()),n.sort((function(e,t){return e.chr===t.chr?e.start-t.start:e.chr.localeCompare(t.chr)})),n}async readHeader(){if(this.dataURI)return await this.loadFeaturesFromDataURI(this.dataURI),this.header;if(this.config.indexURL){const e=await this.getIndex();if(!e)throw new Error("Unable to load index: "+this.config.indexURL);let t;if(this.sequenceNames=new Set(e.sequenceNames),e.tabix)this._blockLoader=new yh(this.config),t=new Fh(this.config);else{const i=Object.values(e.chrIndex).flatMap((e=>e.blocks)).map((e=>e.max)).reduce(((e,t)=>Math.min(e,t)),Number.MAX_SAFE_INTEGER),n=qa(this.config,{bgz:e.tabix,range:{start:0,size:i}});t=mh(await Qs.loadString(this.config.url,n))}return this.header=await this.parser.parseHeader(t),this.header}if("service"!==this.config.sourceType){let e;if(this.config._filecontents)e=this.config._filecontents,delete this.config._filecontents;else{const t=qa(this.config);e=await Qs.loadByteArray(this.config.url,t)}e.length<5e8&&(e=(new TextDecoder).decode(e));let t=mh(e);this.header=await this.parser.parseHeader(t),t=mh(e),this.features=await this.parser.parseFeatures(t),this.sequenceNames=new Set;for(let e of this.features)this.sequenceNames.add(e.chr);return this.header}if(this.config.seqnamesURL){const e=qa(this.config,{}),t=await Qs.loadString(this.config.seqnamesURL,e);t&&(this.sequenceNames=new Set(t.split(",").map((e=>e.trim())).filter((e=>e))))}if(this.config.headerURL){const e=qa(this.config,{}),t=mh(await Qs.loadString(this.config.headerURL,e));return this.header=await this.parser.parseHeader(t),this.header}}getParser(e){switch(e.format){case"vcf":return new Yl(e);case"seg":return new Ul("seg");case"mut":return new Ul("mut");case"maf":return new Ul("maf");case"gwas":return new Jl(e);case"qtl":return new xh(e);case"aed":return new nh(e);default:return new El(e)}}async loadFeaturesNoIndex(){if(this.features){const e=this.features;return delete this.features,e}{const e=qa(this.config),t=await Qs.loadByteArray(this.config.url,e);if(!this.header){const e=mh(t);this.header=await this.parser.parseHeader(e)}const i=mh(t),n=[];return await this._parse(n,i),n}}async loadFeaturesWithIndex(e,t,i){const n=this.config;this.parser;const r=this.index.tabix,s=r?this.index.sequenceIndexMap[e]:e;if(void 0===s)return[];const o=this.index.chunksForRange(s,t,i);if(o&&0!==o.length){const s=[];for(let a of o){let o;if(r)o=await this._blockLoader.getData(a.minv,a.maxv);else{const e=qa(n,{range:{start:a.minv.block,size:a.maxv.block-a.minv.block+1}});o=await Qs.loadString(n.url,e)}const c=mh(a.minv.offset?o.slice(a.minv.offset):o);await this._parse(s,c,e,i,t)}return s}return[]}async loadFeaturesFromService(e,t,i){let n;n="function"==typeof this.config.url?this.config.url({chr:e,start:t,end:i}):this.config.url.replace("$CHR",e).replace("$START",t).replace("$END",i);const r=qa(this.config),s=mh(await Qs.loadString(n,r)),o=[];return await this._parse(o,s),o}async _parse(e,t,i,n,r){let s=await this.parser.parseFeatures(t);if(s.sort((function(e,t){return e.chr===t.chr?e.start-t.start:e.chr.localeCompare(t.chr)})),void 0===i)for(let t of s)e.push(t);else{let t=!1;for(let o=0;o<s.length;o++){const a=s[o];if(a.chr===i){if(a.start>n){e.push(a);break}a.end>=r&&a.start<=n&&(t||(t=!0,o>0&&e.push(s[o-1])),e.push(a))}}}}async getIndex(){return this.index?this.index:this.config.indexURL?(this.index=await this.loadIndex(),this.index):void 0}async loadIndex(){return gh(this.config.indexURL,this.config)}async loadFeaturesFromDataURI(){if(this.features){const e=this.features;return delete this.features,e}{const e=vs(this.dataURI);let t=mh(e);this.header=await this.parser.parseHeader(t),this.header instanceof String&&this.header.startsWith("##gff-version 3")&&(this.format="gff3"),t=mh(e);const i=[];return await this._parse(i,t),i}}}const Sh=Mt;class Eh{constructor(e){this.config=e}async readFeatures(e,t,i){let n;n="function"==typeof this.config.url?this.config.url({chr:e,start:t,end:i}):this.config.url.replace("$CHR",e).replace("$START",t).replace("$END",i);let r,s=Object.assign({},this.config);void 0!==this.config.body&&("function"==typeof this.config.body?s.body=this.config.body({chr:e,start:t,end:i}):s.body=this.config.body.replace("$CHR",e).replace("$START",t).replace("$END",i));const o=await Qs.load(n,s);if(o&&(r="function"==typeof this.config.parser?this.config.parser(o):Sh(o)?JSON.parse(o):o),this.config.mappings){let e=Object.keys(this.config.mappings);for(let t of r)for(let i of e)t[i]=t[this.config.mappings[i]]}return r}}const Nh=function(e,t){this.config=e,this.genome=t,this.expandQueryInterval=!1};Nh.prototype.readFeatures=function(e,t,i){const n=Math.max(0,Math.floor(t));let r=Math.ceil(i);if(this.genome){const t=this.genome.getChromosome(e);t&&r>t.bpLength&&(r=t.bpLength)}const s=this.config.url+"?db="+this.config.db+"&table="+this.config.tableName+"&chr="+e+"&start="+n+"&end="+r;return Qs.loadJson(s,this.config).then((function(e){return e?(e.forEach((function(e){e.hasOwnProperty("exonStarts")&&e.hasOwnProperty("exonEnds")&&e.hasOwnProperty("exonCount")&&e.hasOwnProperty("cdsStart")&&e.hasOwnProperty("cdsEnd")&&function(e){var t,i,n,r,s,o;t=e.exonCount,i=e.exonStarts.split(","),n=e.exonEnds.split(","),r=[];for(var a=0;a<t;a++){var c={start:s=parseInt(i[a]),end:o=parseInt(n[a])};(e.cdsStart>o||e.cdsEnd<e.cdsStart)&&(c.utr=!0),e.cdsStart>=s&&e.cdsStart<=o&&(c.cdStart=e.cdsStart),e.cdsEnd>=s&&e.cdsEnd<=o&&(c.cdEnd=e.cdsEnd),r.push(c)}e.exons=r}(e)})),e):null}))};class Bh{featureCaches=[];gtexChrs=new Set(["chr1","chr10","chr11","chr12","chr13","chr14","chr15","chr16","chr17","chr18","chr19","chr2","chr20","chr21","chr22","chr3","chr4","chr5","chr6","chr7","chr8","chr9","chrM","chrX","chrY"]);constructor(e){this.config=e,this.url=e.url,this.tissueId=e.tissueSiteDetailId,this.datasetId=e.datasetId||"gtex_v8"}async readFeatures(e,t,i){const n=e.startsWith("chr")?e:"MT"===e?"chrM":"chr"+e;if(!this.gtexChrs.has(n))return[];const r=Math.floor(t),s=Math.ceil(i),o=this.datasetId,a=this.url+"?chromosome="+n+"&start="+r+"&end="+s+"&tissueSiteDetailId="+this.tissueId+"&datasetId="+o,c=await Qs.loadJson(a,{withCredentials:this.config.withCredentials});return c&&c.singleTissueEqtl?c.singleTissueEqtl.map((e=>new Mh(e))):[]}}class Mh{constructor(e){this.chr=e.chromosome,this.start=e.pos-1,this.end=this.start+1,this.snp=e.snpId,this.phenotype=e.geneSymbol,this.pValue=e.pValue,this.json=e}popupData(){return Object.keys(this.json).map((e=>({name:e,value:this.json[e]})))}}class Rh{constructor(e,t){if(this.config=e,this.genome=t,!e.format)throw Error('Format is required, and must be either "bam" or "cram"');if(this.format=e.format.toUpperCase(),"BAM"!==this.format&&"VCF"!==this.format)throw Error(`htsget format ${e.format} is not supported`)}async readHeaderData(){const e=`${Dh(this.config)}?class=header&format=${this.format}`,t=await Qs.loadJson(e,qa(this.config));return await this.loadUrls(t.htsget.urls)}async readData(e,t,i){const n=`${Dh(this.config)}?format=${this.format}&referenceName=${e}&start=${Math.floor(t)}&end=${Math.ceil(i)}`,r=await Qs.loadJson(n,qa(this.config));return this.loadUrls(r.htsget.urls)}async loadUrls(e){const t=[];for(let i of e)if(i.url.startsWith("data:"))t.push(Promise.resolve(Th(i.url)));else{const e=qa(this.config||{});i.headers&&(e.headers=Object.assign(e.headers||{},i.headers)),t.push(Qs.loadArrayBuffer(i.url,e))}return function(e){let t=0;for(let i of e)t+=i.byteLength;let i=0;const n=new Uint8Array(t);for(let t of e){const e=new Uint8Array(t);n.set(e,i),i+=e.length}return n}(await Promise.all(t))}static async inferFormat(e){try{const t=Dh(e),i=`${t}${t.includes("?")?"&":"?"}class=header`,n=await Qs.loadJson(i,qa(e));if(n.htsget){const t=n.htsget.format;if("BAM"!==t&&"VCF"!==t)throw Error(`htsget format ${t} is not supported`);e.format=t.toLowerCase(),e.sourceType="htsget",e.name||(e.name=await Wa(e.url))}}catch(e){}}}function Dh(e){if(e.url&&e.endpoint&&e.id)return e.url+e.endpoint+e.id;if(e.endpoint&&e.id)return e.endpoint+e.id;if(e.url)return e.url.startsWith("htsget://")?e.url.replace("htsget://","https://"):e.url;throw Error("Must specify either 'url', or 'endpoint' and 'id")}function Th(e){const t=e.split(","),i=t[0].split(":")[1];let n=t[1];n=i.indexOf("base64")>=0?atob(n):decodeURI(n);const r=new Uint8Array(n.length);for(var s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}class Lh extends Rh{constructor(e,t){super(e,t),this.parser=new Yl}async readHeader(){if(!this.header){let e=await this.readHeaderData();fs(e)&&(e=ps(e));const t=mh(e);this.header=await this.parser.parseHeader(t,this.genome),this.chrAliasTable=this.header.chrAliasTable}return this.header}async readFeatures(e,t,i){if(this.config.format&&"VCF"!==this.config.format.toUpperCase())throw Error(`htsget format ${this.config.format} is not supported`);this.chrAliasTable||await this.readHeader();let n=this.chrAliasTable.has(e)?this.chrAliasTable.get(e):e,r=await this.readData(n,t,i);fs(r)&&(r=ps(r));const s=mh(r);return this.parser.parseFeatures(s)}}class zh{chrAliasTable=new Map;constructor(e,t){this.sequenceNames=new Set(e),this.genome=t}async getAliasName(e){if(!this.genome)return e;if(!this.chrAliasTable.has(e)){const t=await this.genome.getAliasRecord(e);if(t){let i;const n=Object.keys(t).filter((e=>"start"!==e&&"end"!==e)).map((e=>t[e])).filter((e=>this.sequenceNames.has(e)));n.length>0&&(i=n[0]),this.chrAliasTable.set(e,i)}else this.chrAliasTable.set(e,void 0)}return this.chrAliasTable.get(e)}}class Hh{constructor(e){this.genome=e}async nextFeature(e,t,i,n){let r=this.genome.chromosomeNames||[e],s=r.indexOf(e);if(s<0)return;const o=Math.min(1e4,n||1e4);let a=i?t:Math.max(t-o,0);for(;s<r.length&&s>=0;){e=r[s];const c=this.genome.getChromosome(e).bpLength;for(;a<c&&a>=0;){let r=i?a+o:Math.min(t,a+o);const s=await this.getFeatures({chr:e,start:a,end:r,visibilityWindow:n});if(s){const e=(e,t)=>e.start-t.start+e.end-t.end,n=Array.from(s);n.sort(e);let r=i?0:n.length-1;for(;r>=0&&r<n.length;){const e=n[r],s=(e.start+e.end)/2;if(i){if(s>t)return e;r++}else{if(s<t)return e;r--}}}a=i?r:a-o}if(i)s++,a=0,t=0;else{if(s--,s<0)break;a=(t=this.genome.getChromosome(r[s]).bpLength)-o}}}async previousFeature(e,t,i,n){let r=this.genome.chromosomeNames||[e],s=r.indexOf(e);if(s<0)return;const o=Math.min(1e4,n||1e4);let a=i?t:Math.max(t-o,0);for(;s<r.length&&s>=0;){e=r[s];const c=this.genome.getChromosome(e).bpLength;for(;a<c&&a>=0;){let r=Math.min(t,a+o);const s=await this.getFeatures({chr:e,start:a,end:r,visibilityWindow:n});if(s){const e=(e,t)=>e.start-t.start+e.end-t.end,n=Array.from(s);n.sort(e);let r=i?0:n.length-1;for(;r>=0&&r<n.length;){const e=n[r],s=(e.start+e.end)/2;if(i){if(s>t)return e;r++}else{if(s<t)return e;r--}}}a=i?r:a-o}if(i)s++,a=0,t=0;else{if(s--,s<0)break;a=(t=this.genome.getChromosome(r[s]).bpLength)-o}}}}class Ph{constructor(e,t){this.config=e,this.genome=t,this.path=e.url,this.groupCache={},this.datasetCache={}}async readHeader(){if(void 0!==this.magic)return this;let e=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:0,size:64e3}})),t=new Ac(new DataView(e));if(this.magic=t.getInt(),this.version=t.getInt(),this.indexPos=t.getLong(),this.indexSize=t.getInt(),t.getInt(),this.version>=2){let e=t.getInt();for(this.windowFunctions=[];e-- >0;)this.windowFunctions.push(t.getString())}this.trackType=t.getString(),this.trackLine=t.getString();let i=t.getInt();for(this.trackNames=[];i-- >0;)this.trackNames.push(t.getString());this.genomeID=t.getString(),this.flags=t.getInt(),this.compressed=!!(1&this.flags),e=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:this.indexPos,size:this.indexSize}})),t=new Ac(new DataView(e)),this.datasetIndex={};let n=t.getInt();for(;n-- >0;){const e=t.getString(),i=t.getLong(),n=t.getInt();this.datasetIndex[e]={position:i,size:n}}for(this.groupIndex={},n=t.getInt();n-- >0;){const e=t.getString(),i=t.getLong(),n=t.getInt();this.groupIndex[e]={position:i,size:n}}return this}async readDataset(e,t,i){const n=e+"_"+t+"_"+i;if(this.datasetCache[n])return this.datasetCache[n];{await this.readHeader();const r=this.version<2?"":"/"+t,s="all"===e.toLowerCase()||void 0===i?"0":i.toString();let o;o="raw"===t?"/"+e+"/raw":"/"+e+"/z"+s+r;const a=this.datasetIndex[o];if(void 0===a)return;const c=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:a.position,size:a.size}}));if(!c)return;const l=new Ac(new DataView(c));let h=l.getInt();const d={};for(;h-- >0;)d[l.getString()]=l.getString();const u=l.getString(),f=l.getFloat();let p=l.getInt();const g=[];for(;p-- >0;)g.push({position:l.getLong(),size:l.getInt()});const m={name:o,attributes:d,dataType:u,tileWidth:f,tiles:g};return this.datasetCache[n]=m,m}}async readRootGroup(){const e=this.genome,t=this.groupCache["/"];if(t)return t;{const t=await this.readGroup("/"),i=t.chromosomes,n=t.maxZoom;n&&(this.maxZoom=Number(n));const r=t.totalCount;r&&(t.totalCount=Number(r));const s={};return i&&i.split(",").forEach((function(t){const i=e.getChromosomeName(t);s[i]=t})),this.chrAliasTable=s,this.groupCache["/"]=t,t}}async readGroup(e){const t=this.groupCache[e];if(t)return t;{await this.readHeader();const t=this.groupIndex[e];if(void 0===t)return;const i=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:t.position,size:t.size}}));if(!i)return;const n=new Ac(new DataView(i)),r={name:e};let s=n.getInt();for(;s-- >0;){const e=n.getString(),t=n.getString();r[e]=t}return this.groupCache[e]=r,r}}async readTiles(e,t){if(e.sort((function(e,t){return e.position-t.position})),0===(e=e.filter((function(e){return e.size>0}))).length)return[];const i=[];for(let n of e){const e=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:n.position,size:n.size}}));let r;try{r=this.compressed?ls(e).buffer:e}catch(e){console.error(e);continue}const s=new Ac(new DataView(r)),o=s.getString();let a;switch(o){case"fixedStep":a=Oh(s,t);break;case"variableStep":a=Uh(s,t);break;case"bed":case"bedWithName":a=qh(s,t,o);break;default:throw"Unknown tile type: "+o}i.push(a)}return i}async readTile(e,t){let i=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:e.position,size:e.size}}));if(this.compressed){i=ls(i).buffer}const n=new Ac(new DataView(i)),r=n.getString();switch(r){case"fixedStep":return Oh(n,t);case"variableStep":return Uh(n,t);case"bed":case"bedWithName":return qh(n,t,r);default:throw"Unknown tile type: "+r}}}function Oh(e,t){const i=e.getInt(),n=e.getInt(),r=e.getFloat(),s=[];let o=t;for(;o-- >0;){let t=i;const n=[];for(;t-- >0;)n.push(e.getFloat());s.push(n)}return{type:"fixedStep",start:n,span:r,data:s,nTracks:t,nPositions:i}}function Uh(e,t){const i=e.getInt(),n=e.getFloat(),r=e.getInt(),s=[];let o=r;for(;o-- >0;)s.push(e.getInt());e.getInt();const a=[];let c=t;for(;c-- >0;){o=r;const t=[];for(;o-- >0;)t.push(e.getFloat());a.push(t)}return{type:"variableStep",tileStart:i,span:n,start:s,data:a,nTracks:t,nPositions:r}}function qh(e,t,i){const n=e.getInt();let r=n;const s=[];for(;r-- >0;)s.push(e.getInt());r=n;const o=[];for(;r-- >0;)o.push(e.getInt());e.getInt();const a=[];let c=t;for(;c-- >0;){let t=n;const i=[];for(;t-- >0;)i.push(e.getFloat());a.push(i)}if("bedWithName"===i){r=n;const t=[];for(;r-- >0;)t.push(e.getString())}return{type:i,start:s,end:o,data:a,nTracks:t,nPositions:n}}class Qh extends Hh{#h={};searchable=!1;constructor(e,t){super(t),this.genome=t,this.reader=new Ph(e,t),this.queryable=!0}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,windowFunction:r="mean"}){return"all"===e.toLowerCase()?this.getWGValues(r,n):this._getFeatures(e,t,i,n,r)}async _getFeatures(e,t,i,n,r){const s=new dc(e,t,i),o=this.genome;if(!this.rootGroup&&(this.rootGroup=await this.reader.readRootGroup(),!this.normalizationFactor)){const e=this.rootGroup.totalCount;e&&(this.normalizationFactor=1e6/e)}s.bpPerPixel=n;const a=function(e,t,i){var n=i.getChromosome(e).bpLength;return Math.ceil(Math.log(Math.max(0,n/(700*t)))/Gh)}(e,n,o);let c=this.reader.chrAliasTable[e],l=this.reader.maxZoom;void 0===c&&(c=e),void 0===l&&(l=-1);const h=a>l?"raw":r,d=await this.reader.readDataset(c,h,a);if(null==d)return[];const u=d.tileWidth,f=Math.floor(t/u),p=Math.floor(i/u),g=await this.reader.readTiles(d.tiles.slice(f,p+1),1),m=[];for(let r of g)switch(r.type){case"bed":Vh(r,e,t,i,n,m);break;case"variableStep":jh(r,e,t,i,n,m);break;case"fixedStep":Wh(r,e,t,i,n,m);break;default:throw"Unknown tile type: "+r.type}return m.sort((function(e,t){return e.start-t.start})),m}get supportsWholeGenome(){return!0}get windowFunctions(){return this.reader.windowFunctions}async getWGValues(e,t){const i=this.#h[e];if(i&&i.bpPerPixel>.8*t&&i.bpPerPixel<1.2*t)return i.values;{const i=[],n=this.genome;if(this.genome.wgChromosomeNames)for(let r of n.wgChromosomeNames){const s=n.getChromosome(r).bpLength;t=s/1e3;const o=await this._getFeatures(r,0,s,t,e);if(o)for(let e of o){const t=Object.assign({},e);t.chr="all",t.start=n.getGenomeCoordinate(e.chr,e.start),t.end=n.getGenomeCoordinate(e.chr,e.end),t._f=e,i.push(t)}}return this.#h[e]={values:i,bpPerPixel:t},i}}}function Vh(e,t,i,n,r,s){const o=e.nPositions,a=e.start,c=e.end,l=e.data[0];for(let e=0;e<o;e++){const r=a[e],o=c[e];if(!(o<i)){if(r>n)break;s.push({chr:t,start:r,end:o,value:l[e]})}}}function jh(e,t,i,n,r,s){const o=e.nPositions,a=e.start,c=e.span,l=e.data[0];for(let e=0;e<o;e++){const r=a[e],o=r+c;if(!(o<i)){if(r>n)break;s.push({chr:t,start:r,end:o,value:l[e]})}}}function Wh(e,t,i,n,r,s){const o=e.nPositions;let a=e.start;const c=e.span,l=e.data[0];for(let e=0;e<o;e++){const r=a+c;if(a>n)break;r>=i&&(Number.isNaN(l[e])||s.push({chr:t,start:a,end:r,value:l[e]})),a=r}}var Gh=Math.log(2);class $h{constructor(e,t,i,n){this.header=e,this.nameToId=t,this.idToName=i,this.sumLengths=n}static parseTree(e,t,i=!1){{const n=e.getInt(),r=e.getInt(),s=e.getInt(),o=e.getInt(),a=e.getLong(),c=e.getLong(),l={magic:n,blockSize:r,keySize:s,valSize:o,itemCount:a,reserved:c},h=new Map,d=[];let u=0;const f=n=>{n>=0&&(e.position=n);const r=e.getByte();e.getByte();const a=e.getUShort();if(1===r)for(let t=0;t<a;t++){let t,n=e.getFixedLengthString(s);if(8!==o)throw Error(`Unexpected "valSize" value in chromosome tree. Expected 8, actual value is ${o}`);{t=e.getInt();const r=e.getInt();u+=r,i&&(n=i.getChromosomeName(n)),h.set(n,t),d[t]=n}}else for(let i=0;i<a;i++){e.getFixedLengthString(s);const i=e.getLong()-t,n=e.position;f(i),e.position=n}};return f(e),new $h(l,h,d,u)}}}class Kh{static magic=610839776;littleEndian=!0;nodeCache=new Map;constructor(e,t,i){this.path=e,this.config=t,this.startOffset=i}async init(){const e=await this.#t(this.startOffset,48);let t=e.getInt();if(t!==Kh.magic&&(e.setPosition(0),this.littleEndian=!this.littleEndian,e.littleEndian=this.littleEndian,t=e.getInt(),t!==Kh.magic))throw Error(`Bad magic number ${t}`);const i=e.getUInt(),n=e.getLong(),r=e.getUInt(),s=e.getUInt(),o=e.getUInt(),a=e.getUInt(),c=e.getLong(),l=e.getUInt(),h=e.getUInt(),d=this.startOffset+48;return this.header={magic:t,blockSize:i,itemCount:n,startChromIx:r,startBase:s,endChromIx:o,endBase:a,endFileOffset:c,itemsPerSlot:l,reserved:h,rootNodeOffset:d},this}async#t(e,t){const i=await Qs.loadArrayBuffer(this.path,qa(this.config,{range:{start:e,size:t}}));return new Ac(new DataView(i),this.littleEndian)}async findLeafItemsOverlapping(e,t,i,n){const r=[],s=async o=>{const a=await this.readNode(o);for(let o of a.items)Yh(o,e,t,i,n)&&(1===a.type?r.push(o):await s(o.childOffset))};return await s(this.header.rootNodeOffset),r}async readNode(e){const t=e;if(this.nodeCache.has(t))return this.nodeCache.get(t);let i=await this.#t(e,4);const n=i.getByte(),r=1===n;i.getByte();const s=i.getUShort();let o=s*(r?32:24);i=await this.#t(e+4,o);const a=[];for(let e=0;e<s;e++){let e={isLeaf:r,startChrom:i.getInt(),startBase:i.getInt(),endChrom:i.getInt(),endBase:i.getInt(),childOffset:i.getLong()};r&&(e.dataSize=i.getLong(),e.dataOffset=e.childOffset),a.push(e)}const c={type:n,items:a};return this.nodeCache.set(t,c),c}}function Yh(e,t,i,n,r){return e?(n>e.startChrom||n===e.startChrom&&r>=e.startBase)&&(t<e.endChrom||t===e.endChrom&&i<=e.endBase):(console.log("null item for "+t+" "+i+" "+r),!1)}class Xh{ixFile;ixxFile;bufferCache=new Map;constructor(e,t){this.ixFile=t,this.ixxFile=e}async search(e,t){const i=e.split(" ")[0].toLowerCase(),n=await this._getBuffer(i,t);if(!n)return;const r=n.slice(0,n.lastIndexOf("\n")).split("\n").filter((e=>!!e)),s=[];for(let e of r){const t=e.split(" ")[0];if(t.startsWith(i)&&s.push(e),t.slice(0,i.length)>i)break}if(0!==s.length){const e=new Map;for(let t of s){const[i,...n]=t.split(" ");e.set(i,n.map((e=>e.split(",")[0])))}return e}}async getIndex(e){return this.index||(this.index=await this._readIndex()),this.index}async _readIndex(e){return(await Qs.loadString(this.ixxFile)).split("\n").filter((e=>!!e)).map((e=>{const t=e.length-10,i=e.slice(0,t),n=e.slice(t);return[i,Number.parseInt(n,16)]}))}async _getBuffer(e,t){let i=0,n=65536;const r=await this.getIndex(t);for(let t=0;t<r.length;t++){const[s,o]=r[t],a=Math.min(s.length,e.length);s.slice(0,a)<e&&(i=o,n=o+65536)}const s=n-i;if(!(s<0)){if(this.bufferCache.has(i))return this.bufferCache.get(i);{const e=await Qs.loadString(this.ixFile,{range:{start:i,size:s}});return this.bufferCache.set(i,e),e}}}}class Zh{chrAliasTable=new Map;rpTreeCache=new Map;constructor(e,t){this.path=e.url,this.format=e.format||"bigwig",this.genome=t,this.config=e,this.bufferSize=512e3,this.loader=$a(this.path)?new sd(this.path):Qs,e.searchTrix&&(this._trix=new Xh(`${e.searchTrix}x`,e.searchTrix))}async readWGFeatures(e,t){await this.loadHeader();const i=this.chromTree.idToName.length-1,n=this.chromTree.idToName[0],r=this.chromTree.idToName[i];return this.readFeatures(n,0,r,Number.MAX_VALUE,e,t)}async readFeatures(e,t,i,n,r,s="mean"){t||(t=0),n||(n=Number.MAX_SAFE_INTEGER),await this.loadHeader();let o,a,c=await this.#d(e),l=await this.#d(i);if(void 0===c||void 0===l)return[];if("bigwig"===this.type){const e=await this.getZoomHeaders();let t=r?function(e,t){let i;for(let n=0;n<t.length;n++){const r=t[n];if(r.reductionLevel<e){i=r;break}}return i}(r,e):void 0;t?(o=t.indexOffset,a=rd):(o=this.header.fullIndexOffset,a=id)}else o=this.header.fullIndexOffset,a=nd.call(this);const h=await this.loadRPTree(o),d=await h.findLeafItemsOverlapping(c,t,l,n);if(d&&0!==d.length){let e=Number.MAX_VALUE,i=0;for(let t of d)e=Math.min(e,t.dataOffset),i=Math.max(i,t.dataOffset+t.dataSize);const r=i-e,o=await this.loader.loadArrayBuffer(this.config.url,qa(this.config,{range:{start:e,size:r}})),h=[];for(let i of d){const r=new Uint8Array(o,i.dataOffset-e,i.dataSize);let d;d=this.header.uncompressBuffSize>0?ls(r):r,a.call(this,new DataView(d.buffer),c,t,l,n,h,this.chromTree.idToName,s,this.littleEndian)}return h.sort((function(e,t){return e.start-t.start})),h}return[]}async#d(e){if(this.chrAliasTable.has(e)&&void 0===(e=this.chrAliasTable.get(e)))return;let t=this.chromTree.nameToId.get(e);if(void 0===t&&this.genome){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>this.chromTree.nameToId.has(e)));e.length>0&&(n=e[0],t=this.chromTree.nameToId.get(e[0]))}this.chrAliasTable.set(e,n)}return t}get searchable(){return"bigbed"===this.type}async search(e){if(this.header||await this.loadHeader(),!this.header||!this.header.extraIndexCount)return;const t=await this._searchForRegions(e);if(t){const i=await this._loadFeaturesForRange(t.offset,t.length);if(i){const t=i.filter((t=>{for(let i of Object.keys(t)){const n=t[i];if(Mt(n)&&n.toLowerCase()===e.toLowerCase())return!0}return!1}));return t.length>0?t.reduce(((e,t)=>e.end-e.start>t.end-t.start?e:t),i[0]):void 0}}}async _searchForRegions(e){const t=await this.#u();if(t){if(this._trix){const t=e.toLowerCase(),i=await this._trix.search(t);i&&i.has(t)&&(e=i.get(t)[0])}for(let i of t){const t=await i.search(e);if(t)return t}}}async#u(){if(void 0===this._searchTrees&&this.header.extraIndexOffsets&&this.header.extraIndexOffsets.length>0){this._searchTrees=[];for(let e of this.header.extraIndexOffsets){const t=await _c.loadBpTree(this.path,this.config,e);this._searchTrees.push(t)}}return this._searchTrees}async getZoomHeaders(){return this.zoomLevelHeaders||await this.loadHeader(),this.zoomLevelHeaders}async loadHeader(){if(this.header)return this.header;{let e,t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:{start:0,size:64}}));this.littleEndian=!0;let i=new Ac(new DataView(t),this.littleEndian),n=i.getUInt();if(2291137574===n)this.type="bigwig";else if(2273964779===n)this.type="bigbed";else{this.littleEndian=!1,i.littleEndian=!1,i.position=0;let e=i.getUInt();654085990===e?this.type="bigwig":3958540679===e&&(this.type="bigbed")}e={bwVersion:i.getUShort(),nZoomLevels:i.getUShort(),chromTreeOffset:i.getLong(),fullDataOffset:i.getLong(),fullIndexOffset:i.getLong(),fieldCount:i.getUShort(),definedFieldCount:i.getUShort(),autoSqlOffset:i.getLong(),totalSummaryOffset:i.getLong(),uncompressBuffSize:i.getInt(),extensionOffset:i.getLong()};const r=64;let s={start:r,size:e.fullDataOffset-r+4};t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:s}));const o=e.nZoomLevels;i=new Ac(new DataView(t),this.littleEndian),this.zoomLevelHeaders=[],this.firstZoomDataOffset=Number.MAX_SAFE_INTEGER;for(let e=1;e<=o;e++){const t=o-e,n=new Jh(t,i);this.firstZoomDataOffset=Math.min(n.dataOffset,this.firstZoomDataOffset),this.zoomLevelHeaders[t]=n}if(e.autoSqlOffset>0){i.position=e.autoSqlOffset-r;const t=i.getString();t&&(this.autoSql=function(e){let t;const i=[];let n=!1;const r=e.trim().split(/\s*[\r\n]+\s*/g);for(let e of r)if(e.startsWith("table"))t=e.split(/\s+/)[1].trim();else if(e.startsWith("("))n=!0;else if(e.startsWith(")"));else if(n&&e.length>0){const t=e.indexOf(";"),n=e.substr(0,t).split(/\s+/),r=e.substr(t+1).replace(/"/g,"").trim();i.push({type:n[0],name:n[1],description:r})}return{table:t,fields:i}}(t))}if(e.totalSummaryOffset>0&&(i.position=e.totalSummaryOffset-r,this.totalSummary=new ed(i)),!(e.chromTreeOffset>0))throw"BigWig chromosome tree offset <= 0";return i.position=e.chromTreeOffset-r,this.chromTree=await $h.parseTree(i,r,this.genome),this.chrNames=new Set(this.chromTree.idToName),i.position=e.fullDataOffset-r,e.dataCount=i.getInt(),this.featureDensity=e.dataCount/this.chromTree.sumLengths,this.header=e,e.extensionOffset>0&&await this.loadExtendedHeader(e.extensionOffset),this.header}}async loadExtendedHeader(e){let t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:{start:e,size:64}})),i=new Ac(new DataView(t),this.littleEndian);i.getUShort();const n=i.getUShort(),r=i.getLong();if(0===n)return;let s=56*n;t=await this.loader.loadArrayBuffer(this.path,qa(this.config,{range:{start:r,size:s}})),i=new Ac(new DataView(t),this.littleEndian);const o=[],a=[],c=[];for(let e=0;e<n;e++){o.push(i.getUShort());const e=i.getUShort();c.push(i.getLong()),a.push(i.getInt());for(let t=0;t<e;t++)i.getUShort(),a.push(i.getUShort())}this.header.extraIndexCount=n,this.header.extraIndexOffsets=c}async loadRPTree(e){let t=this.rpTreeCache.get(e);return t||(t=new Kh(this.path,this.config,e),await t.init(),this.rpTreeCache.set(e,t),t)}async getType(){return await this.loadHeader(),this.type}async getTrackType(){return await this.loadHeader(),"bigwig"===this.type?"wig":this.autoSql&&"chromatinInteract"===this.autoSql.table?"interact":"annotation"}async _loadFeaturesForRange(e,t){const i=await this.loader.loadArrayBuffer(this.config.url,qa(this.config,{range:{start:e,size:t}})),n=new Uint8Array(i),r=this.header.uncompressBuffSize>0?ls(n):n,s=[];return nd.call(this).call(this,new DataView(r.buffer),0,0,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,s,this.chromTree.idToName),s}}class Jh{constructor(e,t){this.index=e,this.reductionLevel=t.getInt(),this.reserved=t.getInt(),this.dataOffset=t.getLong(),this.indexOffset=t.getLong()}}class ed{constructor(e){e?(this.basesCovered=e.getLong(),this.minVal=e.getDouble(),this.maxVal=e.getDouble(),this.sumData=e.getDouble(),this.sumSquares=e.getDouble(),td.call(this)):(this.basesCovered=0,this.minVal=0,this.maxVal=0,this.sumData=0,this.sumSquares=0,this.mean=0,this.stddev=0)}}function td(){let e=this.basesCovered;if(e>0){this.mean=this.sumData/e,this.stddev=Math.sqrt(this.sumSquares/(e-1));let t=this.minVal<0?this.mean-2*this.stddev:0,i=this.maxVal>0?this.mean+2*this.stddev:0;this.defaultRange={min:t,max:i}}}function id(e,t,i,n,r,s,o,a,c){const l=new Ac(e,c),h=l.getInt(),d=l.getInt();let u=d,f=l.getInt();const p=l.getInt(),g=l.getInt(),m=l.getByte();l.getByte();let w=l.getUShort();if(h>=t&&h<=n){let e=0;for(;w-- >0;){let a;switch(m){case 1:u=l.getInt(),f=l.getInt(),a=l.getFloat();break;case 2:u=l.getInt(),a=l.getFloat(),f=u+g;break;case 3:a=l.getFloat(),u=d+e*p,f=u+g,e++}if(!(h<t||h===t&&f<i)){if(h>n||h===n&&u>=r)break;if(Number.isFinite(a)){const e=o[h];s.push({chr:e,start:u,end:f,value:a})}}}}}function nd(){const e=function(e,t,i,n){if("biginteract"===n||i&&("chromatinInteract"===i.table||"interact"===i.table))return function(e,t){return e.chr1=t[5],e.start1=Number.parseInt(t[6]),e.end1=Number.parseInt(t[7]),e.chr2=t[10],e.start2=Number.parseInt(t[11]),e.end2=Number.parseInt(t[12]),e.name=t[0],e.score=Number(t[1]),e.value=Number(t[2]),e.color="."===t[4]?void 0:"0"===t[4]?"rgb(0,0,0)":t[4],e};{const n=e-3;return function(r,s){if(n>0&&(r.name=s[0]),n>1&&(r.score=Number(s[1])),n>2&&(r.strand=s[2]),n>3&&(r.cdStart=parseInt(s[3])),n>4&&(r.cdEnd=parseInt(s[4])),n>5&&"."!==s[5]&&"0"!==s[5]&&"-1"!==s[5]){const e=_s.createColorString(s[5]);r.color=e.startsWith("rgb")?e:void 0}if(n>8){const e=parseInt(s[6]),t=s[7].split(","),i=s[8].split(","),n=[];for(let s=0;s<e;s++){const e=r.start+parseInt(i[s]),o=e+parseInt(t[s]);n.push({start:e,end:o})}!function(e,t,i){for(let n of e){const e=n.end,r=n.start;e<t||r>i?n.utr=!0:(t>=r&&t<=e&&(n.cdStart=t),i>=r&&i<=e&&(n.cdEnd=i))}}(n,r.cdStart,r.cdEnd),r.exons=n}if(i)for(let n=e;n<t;n++)if(n<i.fields.length){const e=i.fields[n].name,t=s[n-3];r[e]=t}}}}(this.header.definedFieldCount,this.header.fieldCount,this.autoSql,this.format);return function(t,i,n,r,s,o,a,c,l){const h=new Ac(t,l);for(;h.remLength()>=13;){const t=h.getInt(),c=a[t],l=h.getInt(),d=h.getInt(),u=h.getString();if(!(t<i||t===i&&d<n)){if(t>r||t===r&&l>=s)break;if(d>0){const t={chr:c,start:l,end:d};o.push(t);const i=u.split("\t");e(t,i)}}}}}function rd(e,t,i,n,r,s,o,a,c){const l=new Ac(e,c);for(;l.remLength()>=32;){const e=l.getInt(),c=l.getInt(),h=l.getInt(),d=l.getInt(),u=l.getFloat(),f=l.getFloat(),p=l.getFloat();let g;switch(l.getFloat(),a){case"min":g=u;break;case"max":g=f;break;default:g=0===d?0:p/d}if(!(e<t||e===t&&h<i)){if(e>n||e===n&&c>=r)break;if(Number.isFinite(g)){const t=o[e];s.push({chr:t,start:c,end:h,value:g})}}}}class sd{constructor(e){this.data=vs(e).buffer}loadArrayBuffer(e,t){const i=t.range;return i?this.data.slice(i.start,i.start+i.size):this.data}async dataViewForRange(e,t){const i=Math.min(this.data.byteLength-e.start,e.size);return t?new Uint8Array(this.data,e.start,i):new DataView(this.data,e.start,i)}}class od extends Hh{queryable=!0;#h={};windowFunctions=["mean","min","max"];constructor(e,t){super(t),this.reader=new Zh(e,t),this.genome=t,this.format=e.format||"bigwig"}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,windowFunction:r}){await this.reader.loadHeader();const s="bigwig"===this.reader.type;let o;return o="all"===e.toLowerCase()?s?await this.getWGValues(r,n):[]:await this.reader.readFeatures(e,t,e,i,n,r),s||Tl(o),o}async getHeader(){return this.reader.loadHeader()}async defaultVisibilityWindow(){return"bigwig"===this.reader.type?-1:this.reader.featureDensity?Math.floor(1e4/this.reader.featureDensity):-1}async getWGValues(e,t){const i=this.genome,n=this.#h[e];if(n&&n.bpPerPixel>.8*t&&n.bpPerPixel<1.2*t)return n.values;{const n=await this.reader.readWGFeatures(t,e);let r=[];for(let e of n){const t=e.chr,n=i.getCumulativeOffset(t);if(void 0===n)continue;const s=Object.assign({},e);s.chr="all",s.start=n+e.start,s.end=n+e.end,s._f=e,r.push(s)}return r.sort(((e,t)=>e.start-t.start)),this.#h[e]={values:r,bpPerPixel:t},r}}supportsWholeGenome(){return"bigwig"===this.reader.type}async trackType(){return this.reader.getTrackType()}get searchable(){return this.reader.searchable}async search(e){return this.reader.search(e)}}const ad=.01;function cd(e,t,i,n){if(void 0===this.dataRange||void 0===this.dataRange.max||void 0===this.dataRange.min)return;xo.fillRect(e,0,0,t,i,{fillStyle:"white"}),n&&xo.fillRect(e,t-4-2,0,4,i,{fillStyle:n});const r=void 0!==this.flipAxis&&this.flipAxis,s=.95*t-8-5,o=.95*t-5,a={font:"normal 10px Arial",textAlign:"right",fillStyle:"black",strokeStyle:"black"};xo.strokeLine(e,s,ad*i,o,ad*i,a),xo.fillText(e,l(r?this.dataRange.min:this.dataRange.max),s+4,ad*i+12,a);const c=.99*i;function l(e){return 0===e?"0":Math.abs(e)>=10?e.toFixed():Math.abs(e)>=1?e.toFixed(1):Math.abs(e)>=.1?e.toFixed(2):e.toExponential(1)}xo.strokeLine(e,s,c,o,c,a),xo.fillText(e,l(r?this.dataRange.max:this.dataRange.min),s+4,c-4,a),xo.strokeLine(e,o,ad*i,o,c,a)}class ld extends Hl{static defaults={height:50,flipAxis:!1,logScale:!1,windowFunction:"mean",graphType:"bar",normalize:void 0,scaleFactor:void 0,overflowColor:"rgb(255, 32, 255)",baselineColor:"lightGray",summarize:!0};constructor(e,t){super(e,t)}init(e){super.init(e),this.type="wig",this.featureType="numeric",this.resolutionAware=!0,this.paintAxis=cd;const t=e.format?e.format.toLowerCase():e.format;e.featureSource?(this.featureSource=e.featureSource,delete e.featureSource):this.featureSource="bigwig"===t?new od(e,this.browser.genome):"tdf"===t?new Qh(e,this.browser.genome):Ad(e,this.browser.genome),void 0===e.max||!0===e.autoscale?this.autoscale=!0:this.dataRange={min:e.min||0,max:e.max}}async postInit(){const e=await this.getHeader();this.disposed||e&&this.setTrackProperties(e)}async getFeatures(e,t,i,n){const r=this.windowFunction,s=await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:this.visibilityWindow,windowFunction:r});if(this.normalize&&this.featureSource.normalizationFactor){const e=this.featureSource.normalizationFactor;for(let t of s)t.value*=e}if(this.scaleFactor){const e=this.scaleFactor;for(let t of s)t.value*=e}return!this.summarize||"mean"!==r&&"min"!==r&&"max"!==r?s:hd(s,t,n,r)}menuItemList(){const e=[];if(void 0!==this.flipAxis){function t(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}e.push("<hr>"),e.push({label:"Flip y-axis",click:t})}return this.featureSource.windowFunctions&&e.push(...this.wigSummarizationItems()),e.push(...this.numericDataMenuItems()),e}wigSummarizationItems(){const e=this.featureSource.windowFunctions,t=[];t.push("<hr/>"),t.push("<div>Windowing function</div>");for(const i of e){const n=Bt(Dl(i,this.windowFunction===i));function r(){this.windowFunction=i,this.trackView.updateViews()}t.push({object:n,click:r})}return t}async getHeader(){return"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader()),this.header}getScaleFactor(e,t,i,n){const r=!0===n?e<0?-Math.log10(Math.abs(e)+1):Math.log10(Math.abs(e)+1):e;return i/((!0===n?Math.log10(Math.abs(t)+1):t)-r)}computeYPixelValue(e,t){return(this.flipAxis?e-this.dataRange.min:this.dataRange.max-e)*t}computeYPixelValueInLogScale(e,t){let i=this.dataRange.max,n=this.dataRange.min;return n=n<0?-Math.log10(Math.abs(n)+1):Math.log10(Math.abs(n)+1),i=i<0?-Math.log10(Math.abs(i)+1):Math.log10(Math.abs(i)+1),e=e<0?-Math.log10(Math.abs(e)+1):Math.log10(e+1),(this.flipAxis?e-n:i-e)*t}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=e.pixelHeight-1,a=r+s*n+1,c=this.getScaleFactor(this.dataRange.min,this.dataRange.max,o,this.logScale),l=e=>this.logScale?this.computeYPixelValueInLogScale(e,c):this.computeYPixelValue(e,c);if(t&&t.length>0&&(void 0===this.dataRange.min&&(this.dataRange.min=0),this.dataRange.max>this.dataRange.min)){let s,c=-1;const h=l(0);for(let d of t){if(d.end<r)continue;if(d.start>a)break;const t=(d.start-r)/n;if(isNaN(t))continue;let u=l(d.value);const f=(d.end-r)/n-t,p=e.alpha?_s.addAlpha(this.getColorForFeature(d),e.alpha):this.getColorForFeature(d);if("line"===this.graphType)void 0!==s&&xo.strokeLine(i,c,s,t,u,{fillStyle:p,strokeStyle:p}),xo.strokeLine(i,t,u,t+f,u,{fillStyle:p,strokeStyle:p});else if("points"===this.graphType){const e=this.config.pointSize||3,n=t+f/2;xo.fillCircle(i,n,u,e/2,{fillStyle:p,strokeStyle:p}),d.value>this.dataRange.max?xo.fillCircle(i,n,e/2,e/2,3,{fillStyle:this.overflowColor}):d.value<this.dataRange.min&&xo.fillCircle(i,n,o-e/2,e/2,3,{fillStyle:this.overflowColor})}else{const e=Math.min(o,u-h);xo.fillRect(i,t,h,f,e,{fillStyle:p}),d.value>this.dataRange.max?xo.fillRect(i,t,0,f,3,{fillStyle:this.overflowColor}):d.value<this.dataRange.min&&xo.fillRect(i,t,o-2,f,3,{fillStyle:this.overflowColor})}c=t+f,s=u}if(this.dataRange.min<0){let t=this.dataRange.max,n=this.dataRange.min;n=!0===this.logScale?n<0?-Math.log10(Math.abs(n)+1):Math.log10(Math.abs(n)+1):n,t=!0===this.logScale?t<0?-Math.log10(Math.abs(t)+1):Math.log10(Math.abs(t)+1):t;const r=t/(t-n),s=this.flipAxis?(1-r)*o:r*o;xo.strokeLine(i,0,s,e.pixelWidth,s,{strokeStyle:this.baselineColor})}}if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=l(t.y),n={strokeStyle:t.color,strokeWidth:2};t.dotted?xo.dashedLine(e.context,0,i,e.pixelWidth,i,5,n):xo.strokeLine(e.context,0,i,e.pixelWidth,i,n)}}popupData(e,t){if(void 0===t&&(t=this.clickedFeatures(e)),t&&t.length>0){const i=e.genomicLocation,n=[];t.sort((function(e,t){return Math.abs((e.start+e.end)/2-i)-Math.abs((t.start+t.end)/2-i)}));const r=t.length>10?t.slice(0,10):t;r.sort((function(e,t){return e.start-t.start}));for(let e of r)if(e){n.length>0&&n.push("<hr/>");let t=e.end-e.start==1?Rt(Math.floor(e.start)+1):Rt(Math.floor(e.start)+1)+"-"+Rt(Math.floor(e.end));n.push({name:"Position:",value:t}),n.push({name:"Value:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",value:Rt(e.value.toFixed(4))})}return r.length<t.length&&n.push("<hr/>..."),n}return[]}get supportsWholeGenome(){return!this.config.indexURL&&!1!==this.config.supportsWholeGenome}getColorForFeature(e){let t=e.value<0&&this.altColor?this.altColor:this.color||"rgb(150, 150, 150)";return"function"==typeof t?t(e.value):t}dispose(){this.trackView=void 0}}function hd(e,t,i,n="mean"){if(i<=1||!e||0===e.length)return e;const r=e[0].chr,s=i,o=[],a=e=>{const i=t+e.bin*s,a=i+s;let c;switch(n){case"mean":c=e.sumData/e.count;break;case"max":c=e.max;break;case"min":c=e.min;break;default:throw Error(`Unknown window function: ${n}`)}const l=`${n} of ${e.count} values`;o.push({chr:r,start:i,end:a,value:c,description:l})};let c;for(let i of e){let e=Math.floor((i.start-t)/s);const n=Math.floor((i.end-t)/s);if(c&&e===c.bin&&(c.add(i),e++),!c||n>c.bin){if(c&&a(c),n>e){const e=t+n*s;o.push({chr:r,start:i.start,end:e,value:i.value})}c=new dd(n,i)}}c&&a(c);const l=[];let h=o[0];for(let e of o)h.value===e.value&&e.start<=h.end?h.end=e.end:(l.push(h),h=e);return l.push(h),l}class dd{constructor(e,t){this.bin=e,this.sumData=t.value,this.count=1,this.min=t.value,this.max=t.value}add(e){this.sumData+=e.value,this.max=Math.max(e.value,this.max),this.min=Math.min(e.value,this.min),this.count++}get mean(){return this.sumData/this.count}}class ud extends Hh{constructor(e,t){super(t),this.config=e||{},this.genome=t,this.sourceType=void 0===e.sourceType?"file":e.sourceType,this.maxWGCount=e.maxWGCount||1e4,this.windowFunctions=["mean","min","max","none"];const i=new Set(["bigwig","bw","bigbed","bb","biginteract","biggenepred","bignarrowpeak","tdf"]);if(this.queryable=e.indexURL||!0===e.queryable,e.reader)this.reader=e.reader,this.queryable=!1!==e.queryable;else{if("ga4gh"===e.sourceType)throw Error("Unsupported source type 'ga4gh'");"eqtl"!==e.type&&"qtl"!==e.type||"gtex-ws"!==e.sourceType?"htsget"===e.sourceType?(this.reader=new Lh(e,t),this.queryable=!0):"ucscservice"===e.sourceType?(this.reader=new Nh(e.source),this.queryable=!0):"custom"===e.sourceType?(this.reader=new Eh(e.source),this.queryable=!1!==e.source.queryable):"service"===e.sourceType?(this.reader=new Ih(e,t),this.queryable=!0):(this.reader=new Ih(e,t),void 0!==e.queryable?this.queryable=e.queryable:(i.has(e.format)||this.reader.indexed)&&(this.queryable=!0)):(this.reader=new Bh(e),this.queryable=!0)}this.searchable=!1!==e.searchable}async defaultVisibilityWindow(){if(this.reader&&"function"==typeof this.reader.defaultVisibilityWindow)return this.reader.defaultVisibilityWindow()}async trackType(){const e=await this.getHeader();return e?e.type:void 0}async getHeader(){if(!this.header)if(this.reader&&"function"==typeof this.reader.readHeader){const e=await this.reader.readHeader();e?(this.header=e,e.format&&(this.config.format=e.format)):this.header={}}else this.header={};return this.header}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r,windowFunction:s}){const o="all"===e.toLowerCase();if(t=t||0,i=i||Number.MAX_SAFE_INTEGER,(o&&!this.wgFeatures&&this.supportsWholeGenome()||this.config.disableCache||!this.featureCache||!this.featureCache.containsRange(new dc(e,t,i)))&&await this.loadFeatures(e,t,i,r),o){if(!this.wgFeatures)if(this.supportsWholeGenome())if("wig"===this.config.type){const e=await Ll(this.featureCache.getAllFeatures(),this.genome,1e6);this.wgFeatures=hd(e,0,n,s)}else this.wgFeatures=await Ll(this.featureCache.getAllFeatures(),this.genome,this.maxWGCount);else this.wgFeatures=[];return this.wgFeatures}return this.featureCache.queryFeatures(e,t,i)}async findFeatures(e){return this.featureCache?this.featureCache.findFeatures(e):[]}supportsWholeGenome(){return!this.queryable}getAllFeatures(){return this.queryable||!this.featureCache?[]:this.featureCache.getAllFeatures()}async loadFeatures(e,t,i,n){await this.getHeader();const r=this.reader;let s=t,o=i,a=e;if(!this.chrAliasManager&&this.reader&&this.reader.sequenceNames&&(this.chrAliasManager=new zh(this.reader.sequenceNames,this.genome)),this.chrAliasManager&&(a=await this.chrAliasManager.getAliasName(e)),(!n||n<=0)&&!1!==this.config.expandQuery){const e=this.genome?this.genome.getChromosome(a):void 0;s=0,o=Math.max(e?e.bpLength:Number.MAX_SAFE_INTEGER,i)}else if(n>i-t&&!1!==this.config.expandQuery){let e=Math.min(4.1*(i-t),n);this.config.minQuerySize&&e<this.config.minQuerySize&&(e=this.config.minQuerySize),s=Math.max(0,(t+i-e)/2),o=s+e}let c=await r.readFeatures(a,s,o);void 0===this.queryable&&(this.queryable=r.indexed);const l=this.queryable?new dc(e,s,o):void 0;if(c){if("wig"!==this.config.format&&"junctions"!==this.config.type){zl(c,this.config.maxRows||Number.MAX_SAFE_INTEGER)}this.featureCache=new Zs(c,this.genome,l),this.searchable&&this.addFeaturesToDB(c,this.config)}else this.featureCache=new Zs([],l)}addFeaturesToDB(e,t){this.featureMap||(this.featureMap=new Map);const i=t.searchableFields||["name","transcript_id","gene_id","gene_name","id"];for(let t of e)for(let e of i){let i;if("function"==typeof t.getAttributeValue&&(i=t.getAttributeValue(e)),i){if(i=i.replaceAll(" ","+").toUpperCase(),this.featureMap.has(i)){const e=this.featureMap.get(i);if(t.end-t.start<e.end-e.start)continue}this.featureMap.set(i,t)}}}search(e){if(this.featureMap)return this.featureMap.get(e.toUpperCase())}}class fd extends Hh{constructor(e,t){super(t),this.config=e,this.genome=t,this.queryable=!1,this.searchable=!1!==e.searchable,this.updateFeatures(e.features)}updateFeatures(e){zl(e=function(e,t){if(t)for(let i of e)i.chr=t.getChromosomeName(i.chr);return e}(e,this.genome)),this.config.mappings&&function(e,t){let i=Object.keys(t);e.forEach((function(e){i.forEach((function(i){e[i]=e[t[i]]}))}))}(e,this.config.mappings),this.featureCache=new Zs(e,this.genome),(this.searchable||this.config.searchableFields)&&this.addFeaturesToDB(e,this.config)}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){const s=this.genome,o=s?s.getChromosomeName(e):e;return"all"===o.toLowerCase()?Ll(this.featureCache.getAllFeatures(),this.genome,this.maxWGCount):this.featureCache.queryFeatures(o,t,i)}getAllFeatures(){return this.featureCache.getAllFeatures()}supportsWholeGenome(){return!0}addFeaturesToDB(e,t){this.featureMap||(this.featureMap=new Map);const i=t.searchableFields||["name"];for(let t of e)for(let e of i){let i;if("function"==typeof t.getAttributeValue&&(i=t.getAttributeValue(e)),i||(i=t[e]),i){i=i.replaceAll(" ","+");const e=this.featureMap.get(i.toUpperCase());if(e&&e.end-e.start>t.end-t.start)continue;this.featureMap.set(i.toUpperCase(),t)}}}search(e){if(this.featureMap)return this.featureMap.get(e.toUpperCase())}}class pd{constructor({chr:e,locus:t,accession:i,aliases:n,features:r,sequence:s}){this.chr=e,this.locus=t,this.accession=i,this.aliases=n,this.features=r,this.sequence=s,this.bpLength=s.length}toJSON(){return{gbkURL:this.url}}getSequenceRecord(e){return{chr:this.chr,bpLength:this.bpLength}}get chromosomeNames(){return[this.chr]}getFirstChromosomeName(){return this.chr}get id(){return this.accession}get name(){return this.locus}get initialLocus(){return this.chr}get description(){return this.locus}get infoURL(){return this.url}showWholeGenomeView(){return!1}getHomeChromosomeName(){return this.chr}getChromosomeName(e){return e}getChromosomeDisplayName(e){return this.chr}getChromosome(e){if(e===this.chr)return{name:this.chr,bpLength:this.bpLength}}async loadChromosome(e){return this.getChromosome(e)}async getAliasRecord(e){}getCytobands(e){return[]}getChromosomes(){return[this.getChromosome(this.chr)]}get wgChromosomeNames(){}getGenomeCoordinate(e,t){if(e===this.chr)return t}getChromosomeCoordinate(e){return{chr:this.chr,position:e}}getCumulativeOffset(e){return 0}getGenomeLength(){return this.bpLength}async getSequence(e,t,i){return e===this.chr?this.sequence.substring(t,i):void 0}getSequenceInterval(e,t,i){return e===this.chr?new uc(this.chr,0,this.sequence.length,this.sequence):void 0}}const gd=/\s+/,md=new Map;async function wd(e){let t=md.get(e);if(!t){t=function(e){if(!e)return null;const t=mh(e);let i=t.nextLine();const n=i.split(/\s+/);if("LOCUS"!==n[0].toUpperCase())throw Error("Expected `LOCUS` line. Found: "+i);const r=n[1].trim();let s,o;do{if(i=t.nextLine(),i.startsWith("ACCESSION")){const e=i.split(gd);if(e.length<2)throw Error("Genbank file missing ACCESSION number.");s=e[1].trim()}else if(i.startsWith("ALIASES")){const e=i.split(gd);e.length>1&&(o=e[1].split(","))}}while(i&&!i.startsWith("FEATURES"));const a=s||r,c=function(e,t){const i=[];let n,r,s,o=0;for(;;)if(r=t.nextLine(),""!==r){if(!r||r.startsWith("ORIGIN"))break;if(r.length<6)o<10&&console("Unexpected line in genbank file (skipping): "+r),o++;else if(" "!==r.charAt(5)){let t=r.substring(5,21).trim();s={chr:e,type:t,attributes:{},getAttributeValue:function(e){return this.attributes[e]}},n=r.substring(21),"source"!==t.toLowerCase()&&i.push(s)}else{let t=r.substring(21).trim();if(t.length>0)if(47===t.charCodeAt(0)){if(47===n.charCodeAt(0)){let e=n.split("=",2);if(e.length>1){let t=e[0].length>1?e[0].substring(1):"",i=Fd(e[1]);s.attributes[t]=i}}else{const t=n.includes("complement")?"-":"+";s.strand=t;let i=n.replace("join","").replace("order","").replace("complement","").replace("(","").replace(")","");if(i.includes("..")){i=i.replace("<","").replace(">","");const n=bd(i,e,t),r=n[0];s.start=r.start;const o=n[n.length-1];s.end=o.end,n.length>1&&(s.exons=n)}else s.start=parseInt(i)-1,s.end=s.start+1}n=t}else n+=t}}return i}(a,t),l=function(e){let t,i="";for(;(t=e.nextLine())&&!t.startsWith("//");){t=t.trim();const e=t.split(/\s+/);for(let t=1;t<e.length;t++)i+=e[t]}return i}(t);return new pd({chr:a,locus:r,accession:s,aliases:o,features:c,sequence:l})}(await Qs.loadString(e,{})),t.url=e,md.set(e,t)}return t}function bd(e,t,i){const n=e.split(","),r=[];e.includes("complement");for(const e of n){const n=e.split("..");let s=0;try{s=parseInt(n[0])-1}catch(e){console.error(e)}let o=s+1;n.length>1&&(o=parseInt(n[1])),r.push({chr:t,start:s,end:o,strand:i})}return r.sort((function(e,t){return e.start-t.start})),r}function Fd(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.substring(1,e.length-2)),e}class vd extends Hh{constructor(e,t){super(t),this.config=e,this.searchable=!0}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){if(!this.featureSource){const e=await wd(this.config.url);this.featureSource=new fd({genome:this.config.genome,features:e.features,searchableFields:["gene","db_xref","locus_tag","transcript_id"]})}return this.featureSource.getFeatures({chr:e,start:t,end:i})}supportsWholeGenome(){return!1}search(e){return this.featureSource.search(e)}}const yd=new Set(["bigwig","bw","bigbed","bb","biginteract","biggenepred","bignarrowpeak"]);function Ad(e,t){const i=e.format?e.format.toLowerCase():void 0;return e.features?new fd(e,t):yd.has(i)?new od(e,t):"tdf"===i?new Qh(e,t):"gbk"===i?new vd(e,t):new ud(e,t)}function Cd(e){return(3-e.readingFrame)%3}function _d(e){return e.cdStart||e.start}function xd(e){return e.cdEnd||e.end}const kd=.25;function Id(e,t,i){let n=(e.start-t)/i,r=(e.end-t)/i,s=r-n;return s<3&&(s=3,n-=1.5),{px:n,px1:r,pw:s}}function Sd(e,t,i,n,r,s){try{r.save(),r.fillStyle=this.color,r.strokeStyle=this.color;const n=this.getColorForFeature(e);let o,a;r.fillStyle=n,r.strokeStyle=n,"SQUISHED"===this.displayMode&&void 0!==e.row?(o=this.featureHeight/2,a=this.margin+this.squishedRowHeight*e.row):"EXPANDED"===this.displayMode&&void 0!==e.row?(o=this.featureHeight,a=this.margin+this.expandedRowHeight*e.row):(o=this.featureHeight,a=this.margin);const c=s.pixelWidth,l=a+o/2,h=o/2,d=l-h/2,u=e.exons?e.exons.length:0,f=Id(e,t,i),p=this.arrowSpacing,g="+"===e.strand?1:"-"===e.strand?-1:0;if(0===u){const e=Math.max(0,f.px),t=Math.min(c,f.px1),i=t-e;if(r.fillRect(e,a,i,o),0!==g){r.fillStyle="white",r.strokeStyle="white";for(let i=e+p/2;i<t;i+=p)xo.strokeLine(r,i-2*g,l-2,i,l),xo.strokeLine(r,i-2*g,l+2,i,l);r.fillStyle=n,r.strokeStyle=n}}else{xo.strokeLine(r,f.px+1,l,f.px1-1,l);const u=Math.max(0,f.px)+p/2,m=Math.min(c,f.px1);for(let e=u;e<m;e+=p)xo.strokeLine(r,e-2*g,l-2,e,l),xo.strokeLine(r,e-2*g,l+2,e,l);for(let u=0;u<e.exons.length;u++){const f=e.exons[u];let m,w=Math.round((f.start-t)/i),b=Math.round((f.end-t)/i),F=Math.max(1,b-w);if(!(w+F<0)){if(w>c)break;if(f.utr)r.fillRect(w,d,F,h);else{if(f.cdStart&&(m=Math.round((f.cdStart-t)/i),r.fillRect(w,d,m-w,h),F-=m-w,w=m),f.cdEnd&&(m=Math.round((f.cdEnd-t)/i),r.fillRect(m,d,b-m,h),F-=b-m,b=m),F=Math.max(F,1),r.fillRect(w,a,F,o),void 0!==f.readingFrame&&s.bpPerPixel<kd&&s.sequenceInterval){const i=u>0&&void 0!==e.exons[u-1].readingFrame?e.exons[u-1]:void 0,n=u<e.exons.length-1&&void 0!==e.exons[u+1].readingFrame?e.exons[u+1]:void 0;Ed.call(this,r,e.strand,i,f,n,t,s.bpPerPixel,a,o,s.sequenceInterval)}if(F>p+5&&0!==g&&s.bpPerPixel>kd){r.fillStyle="white",r.strokeStyle="white";for(let e=w+p/2;e<b;e+=p)xo.strokeLine(r,e-2*g,l-2,e,l),xo.strokeLine(r,e-2*g,l+2,e,l);r.fillStyle=n,r.strokeStyle=n}}}}}s.drawLabel&&"SQUISHED"!==this.displayMode&&Nd.call(this,r,e,f.px,f.px1,a,s.referenceFrame,s)}finally{r.restore()}}function Ed(e,t,i,n,r,s,o,a,c,l){const h=["rgb(124,124,204)","rgb(12, 12, 120)"];e.save();const d=(t,i,n,r,d,u)=>{const f=Math.round((i-s)/o),p=Math.round((n-s)/o)-f;let g;if(void 0===r){if(l.hasSequence(i,n)){const e=l.getSequence(i,n);if(e&&3===e.length){const i="+"===t?e:cc(e.split("").reverse().join(""));g=Gd[i]}}}else g=r;e.fillStyle="M"===r||"M"===g&&0===u?"#83f902":"STOP"===g?"#ff2101":h[d],e.fillRect(f,a,p,c),g&&(e.save(),((t,i,n,r,s)=>{"STOP"===s&&(s="*");const o=e.measureText(s).width;xo.fillText(e,s,n+(i-o)/2,r-4,{fillStyle:"#ffffff"})})(0,p,f,a+c,g),e.restore());const m=n-i;return m>0&&m<3?{start:i,end:n}:void 0},u=Cd(n);let f,p,g,m,w,b=_d(n),F=xd(n),v=1;if("+"===t){for(u>0&&(b+=u),v=1,w=0,f=b;f<F;w++,f+=3)m=v%2,p=Math.min(F,f+3),g=d(t,f,p,void 0,v%2,w),++v;if(u>0||g){const e=u>0?Bd.call(this,t,u,b-u,b,g,i,n,r,l):Bd.call(this,t,void 0,void 0,void 0,g,i,n,r,l);if(e){const{left:i,rite:n}=e;i&&d(t,b-u,b,i.aminoAcidLetter,0,void 0),n&&d(t,g.start,g.end,n.aminoAcidLetter,m,void 0)}}}else{for(u>0&&(F-=u),v=1,w=0,w=0,p=F;p>b;w++,p-=3)m=v%2,f=Math.max(b,p-3),g=d(t,f,p,void 0,v%2,w),++v;if(u>0||g){const e=u>0?Bd.call(this,t,u,F,F+u,g,i,n,r,l):Bd.call(this,t,void 0,void 0,void 0,g,i,n,r,l);if(e){const{left:i,rite:n}=e;n&&d(t,F,F+u,n.aminoAcidLetter,0,void 0),i&&d(t,g.start,g.end,i.aminoAcidLetter,m,void 0)}}}e.restore()}function Nd(e,t,i,n,r,s,o){try{e.save();let s=t.name;if(void 0===s&&t.gene&&(s=t.gene.name),void 0===s&&(s=t.id||t.ID),!s||"."===s)return;let a=o.pixelXOffset||0;const c=Math.max(i,-a);let l,h=(c+Math.min(n,-a+o.viewportWidth))/2;"COLLAPSED"===this.displayMode&&"SLANT"===this.labelDisplayMode&&(l={rotate:{angle:45}});const d=function(e,t){return t?e+20:e+25}(r,l);let u=this.getColorForFeature(t),f=this.browser.qtlSelections.hasPhenotype(t.name);const p={textAlign:"SLANT"===this.labelDisplayMode?void 0:"center",fillStyle:u,strokeStyle:u},g=e.measureText(s),m=h-g.width/2,w=h+g.width/2,b=o.rowLastLabelX[t.row]||-Number.MAX_SAFE_INTEGER;(o.labelAllFeatures||m>b||f)&&(o.rowLastLabelX[t.row]=w,"y"===o.axis?(e.save(),xo.labelTransformWithContext(e,h),xo.fillText(e,s,h,d,p,l),e.restore()):(e.clearRect(h-g.width/2-1,d-g.actualBoundingBoxAscent-1,g.width+2,g.actualBoundingBoxAscent+g.actualBoundingBoxDescent+2),xo.fillText(e,s,h,d,p,l)))}finally{e.restore()}}function Bd(e,t,i,n,r,s,o,a,c){let l,h,d="",u="",f="";const p={left:void 0,rite:void 0};if("+"===e){if(t){if(u=c.getSequence(i,n),!u)return;if([l,h]=[xd(s)-(3-t),xd(s)],d=c.getSequence(l,h),!d)return;f=d+u,p.left={triplet:f,aminoAcidLetter:Gd[f]}}if(r){if(d=c.getSequence(r.start,r.end),!d)return;const e=Cd(a),t=_d(a);if(u=c.getSequence(t,t+e),!u)return;f=d+u,p.rite={triplet:f,aminoAcidLetter:Gd[f]}}}else{if(t){if(d=c.getSequence(i,n),void 0===d)return;if([l,h]=[_d(a),_d(a)+(3-t)],u=c.getSequence(l,h),void 0===u)return;f=d+u,f=cc(f.split("").reverse().join("")),p.rite={triplet:f,aminoAcidLetter:Gd[f]}}if(r){if(u=c.getSequence(r.start,r.end),void 0===u)return;const e=Cd(s),t=xd(s);if(d=c.getSequence(t-e,t),void 0===d)return;f=d+u,f=cc(f.split("").reverse().join("")),p.left={triplet:f,aminoAcidLetter:Gd[f]}}}return p}const Md=new Set(["nonsense","missense","stop-loss","frameshift","cds-indel"]),Rd=new Set(["coding-synon"]),Dd=new Set(["splice-3","splice-5"]),Td=new Set(["untranslated-5","untranslated-3"]);function Ld(e,t,i,n,r){var s,o,a,c,l,h,d=Id(e,t,i),u=this.margin,f=this.snpColors.length;switch(s="squished"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight,this.colorBy){case"function":c=e.func,h=c.split(","),l=h.map((function(e){return Md.has(e)||Dd.has(e)?f-1:Rd.has(e)?f-2:Td.has(e)?f-3:0})),o=l.reduce((function(e,t){return Math.max(e,t)}));break;case"class":o="deletion"===(a=e.class)?f-1:"mnp"===a?f-2:"microsatellite"===a||"named"===a?f-3:0}r.fillStyle=this.snpColors[o],r.fillRect(d.px,u,d.pw,s)}function zd(e,t,i,n,r){const s="EXPANDED"===this.displayMode?this.expandedRowHeight:this.squishedRowHeight;let o=this.margin;"COLLAPSED"!==this.displayMode&&void 0!==e.row&&(o+=e.row*s);const a=o+.5*s,c=a-.5*s,l=a+.5*s,h=Math.round((e.junction_left-t)/i),d=Math.round((e.junction_right-t)/i);r.beginPath(),r.moveTo(h,a),r.bezierCurveTo(h,c,d,c,d,a),r.lineWidth=1+Math.log(e.num_junction_reads)/Math.log(2),r.strokeStyle="blue",r.stroke();const u=e.spanning_frag_coords;for(let e=0;e<u.length;e++){const n=u[e],s=Math.round((n.left-t)/i),o=Math.round((n.right-t)/i);r.beginPath(),r.moveTo(s,a),r.bezierCurveTo(s,l,o,l,o,a),r.lineWidth=1,r.strokeStyle="purple",r.stroke()}}class Hd extends Hl{static defaults={type:"annotation",maxRows:1e3,displayMode:"EXPANDED",margin:10,featureHeight:14,useScore:!1};constructor(e,t){super(e,t)}init(e){super.init(e),this.labelDisplayMode=e.labelDisplayMode,e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):"blat"!==e.type&&(this.featureSource=e.featureSource?e.featureSource:Ad(e,this.browser.genome)),"FusionJuncSpan"===e.type?(this.render=e.render||zd,this.squishedRowHeight=e.squishedRowHeight||50,this.expandedRowHeight=e.expandedRowHeight||50,this.height=e.height||this.margin+2*this.expandedRowHeight):"snp"===e.type?(this.render=e.render||Ld,this.snpColors=["rgb(0,0,0)","rgb(0,0,255)","rgb(0,255,0)","rgb(255,0,0)"],this.colorBy="function",this.expandedRowHeight=e.expandedRowHeight||10,this.squishedRowHeight=e.squishedRowHeight||5,this.height=e.height||30):(this.render=e.render||Sd,this.arrowSpacing=30,function(e){e.browser.on&&(e.browser.on("trackdragend",t),e.browser.on("trackremoved",i));function t(){e.trackView&&"SQUISHED"!==e.displayMode&&e.trackView.repaintViews()}function i(n){e.browser.un&&e===n&&(e.browser.un("trackdragend",t),e.browser.un("trackremoved",i))}}(this),this.squishedRowHeight=e.squishedRowHeight||15,this.expandedRowHeight=e.expandedRowHeight||30,this.height=e.height||this.margin+2*this.expandedRowHeight,e.colorBy&&(e.colorBy.field&&(e.colorTable=e.colorBy.pallete||e.colorBy.palette,e.colorBy=e.colorBy.field),this.colorBy=e.colorBy,e.colorTable?this.colorTable=new ao(e.colorTable):this.colorTable=new oo("Set1")))}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow()),this}get searchable(){return this.featureSource.searchable}async search(e){return this.featureSource&&this.featureSource.searchable?this.featureSource.search(e):void 0}get supportsWholeGenome(){return void 0!==this.config.supportsWholeGenome?this.config.supportsWholeGenome:this.featureSource&&"function"==typeof this.featureSource.supportsWholeGenome?this.featureSource.supportsWholeGenome():!(void 0!==this.visibilityWindow||!1!==this.config.indexed&&this.config.indexURL)||void 0}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}computePixelHeight(e){if("COLLAPSED"===this.displayMode)return this.margin+this.expandedRowHeight;{let t=0;if(e&&"function"==typeof e.forEach)for(let i of e)i.row&&i.row>t&&(t=i.row);return this.margin+(t+1)*("SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight)}}draw(e){const{features:t,context:i,bpPerPixel:n,bpStart:r,bpEnd:s,pixelWidth:o,pixelHeight:a,referenceFrame:c}=e;if(n<kd&&(e.sequenceInterval=this.browser.genome.getSequenceInterval(c.chr,r,s)),this.isMergedTrack||xo.fillRect(i,0,e.pixelTop,o,a,{fillStyle:"rgb(255, 255, 255)"}),t){const c=[];e.rowLastX=[],e.rowLastLabelX=[];for(let i of t)if(i.start>r&&i.end<s){const t="COLLAPSED"===this.displayMode?0:i.row||0;c[t]?c[t]++:c[t]=1,e.rowLastX[t]=-Number.MAX_SAFE_INTEGER,e.rowLastLabelX[t]=-Number.MAX_SAFE_INTEGER}const l=o/Math.max(1,Math.max(...c.filter((e=>!isNaN(e)))));let h=[];const d=[];for(let o of t){if(o.end<r)continue;if(o.start>s)break;"COLLAPSED"===this.displayMode&&this.browser.qtlSelections.hasPhenotype(o.name)&&d.push(o);const t="COLLAPSED"===this.displayMode?0:o.row;e.drawLabel=e.labelAllFeatures||l>10;const c=Math.ceil((o.end-r)/n),u=h[t];if(!u||c>u){this.render.call(this,o,r,n,a,i,e);const s=Math.floor((o.start-r)/n);u&&s-u<=0&&(i.globalAlpha=.5,xo.strokeLine(i,s,0,s,a,{strokeStyle:"rgb(255, 255, 255)"}),i.globalAlpha=1),h[t]=c}}for(let t of d)e.drawLabel=!0,this.render.call(this,t,r,n,a,i,e)}else console.log("No feature list")}clickedFeatures(e){const t=e.y-this.margin,i=super.clickedFeatures(e);let n;switch(this.displayMode){case"SQUISHED":n=Math.floor(t/this.squishedRowHeight);break;case"EXPANDED":n=Math.floor(t/this.expandedRowHeight);break;default:n=void 0}return i.filter((function(e){return void 0===n||void 0===e.row||n===e.row}))}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=[];for(let e of t){const t=e._f||e,r="function"==typeof t.popupData?t.popupData(i):this.extractPopupData(t);if(r){n.length>0&&n.push("<hr/><hr/>");const s=this.infoURL||this.config.infoURL;for(let t of r)if(n.push(t),s&&t.name&&"name"===t.name.toLowerCase()&&t.value&&Mt(t.value)&&!t.value.startsWith("<")){const i=s.replace("$$",e.name);t.value=`<a target=_blank href=${i}>${t.value}</a>`}const o="gff"===this.config.format||"gff3"===this.config.format||"gtf"===this.config.format;if(t.exons&&t.exons.length>1)for(let e=0;e<t.exons.length;e++){const r=t.exons[e];if(i>=r.start&&i<=r.end){const i=o?r.number:"-"===t.strand?t.exons.length-e:e+1;i&&(n.push("<hr/>"),n.push({name:"Exon Number",value:i}));break}}}}return n}menuItemList(){const e=[];if(this.render===Ld){e.push("<hr/>");for(const i of["function","class"]){const n=Bt(Dl(`Color by ${i}`,i===this.colorBy));function r(){this.colorBy=i,this.trackView.repaintViews()}e.push({object:n,click:r})}}e.push("<hr/>");const t={COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"};for(const s of["COLLAPSED","SQUISHED","EXPANDED"]){const o=Bt(Dl(t[s],s===this.displayMode));function a(){this.displayMode=s,this.config.displayMode=s,this.trackView.checkContentHeight(),this.trackView.repaintViews()}e.push({object:o,click:a})}return e}contextMenuItemList(e){const t=this.clickedFeatures(e);if(void 0===t||0===t.length)return;t.length>1&&t.sort(((e,t)=>t.end-t.start-(e.end-e.start)));const i=t[0];if(i.end-i.start<=1e6){const e=[{label:"View feature sequence",click:async()=>{let e=await this.browser.genome.getSequence(i.chr,i.start,i.end);e?"-"===i.strand&&(e=lc(e)):e="Unknown sequence",this.browser.alert.present(e)}}];return Za()&&void 0!==navigator.clipboard&&e.push({label:"Copy feature sequence",click:async()=>{let e=await this.browser.genome.getSequence(i.chr,i.start,i.end);e?"-"===i.strand&&(e=lc(e)):e="Unknown sequence";try{await navigator.clipboard.writeText(e)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),e.push("<hr/>"),e}}description(){if(Ld===this.render){let e="<html>"+this.name+"<hr/>";return e+="<em>Color By Function:</em><br>",e+='<span style="color:red">Red</span>: Coding-Non-Synonymous, Splice Site<br>',e+='<span style="color:green">Green</span>: Coding-Synonymous<br>',e+='<span style="color:blue">Blue</span>: Untranslated<br>',e+='<span style="color:black">Black</span>: Intron, Locus, Unknown<br><br>',e+="<em>Color By Class:</em><br>",e+='<span style="color:red">Red</span>: Deletion<br>',e+='<span style="color:green">Green</span>: MNP<br>',e+='<span style="color:blue">Blue</span>: Microsatellite, Named<br>',e+='<span style="color:black">Black</span>: Indel, Insertion, SNP',e+="</html>",e}return super.description()}getColorForFeature(e){const t=e._f||e;let i;if(e.name&&this.browser.qtlSelections.hasPhenotype(e.name))i=this.browser.qtlSelections.colorForGene(e.name);else if(this.altColor&&"-"===t.strand)i="function"==typeof this.altColor?this.altColor(t):this.altColor;else if(this.color)i="function"==typeof this.color?this.color(t):this.color;else if(this.colorBy){const e=t.getAttributeValue?t.getAttributeValue(this.colorBy):t[this.colorBy];i=this.colorTable.getColor(e)}else t.color&&(i=t.color);if(i||(i="rgb(0, 0, 150)"),t.alpha&&1!==t.alpha)i=_s.addAlpha(i,t.alpha);else if(this.useScore&&t.score&&!Number.isNaN(t.score)){const e=function(e,t,i){const n=(t-e)/9,r=Math.floor((i-e)/n);return Math.min(1,.2+.8*r/9)}(this.config.min?this.config.min:this.viewLimitMin?this.viewLimitMin:0,this.config.max?this.config.max:this.viewLimitMax?this.viewLimitMax:1e3,t.score);t.alpha=e,i=_s.addAlpha(i,e)}return i}dispose(){this.trackView=void 0}}class Pd{constructor(t){if(this.config=t,this.browser=t.browser,this.columnFormat=t.columnFormat,this.tableRowSelectionList=[],this.tableDOM=e({class:"igv-roi-table"}),t.width){let[e]=t.width.split("px");e=parseInt(e,10),this.tableDOM.style.width=`${Math.min(e,1600)}px`}t.parent.appendChild(this.tableDOM),this.headerDOM=t,this.tableColumnTitles=this.tableDOM,this.tableRowContainer=this.tableDOM,this.footerDOM=t.gotoButtonHandler}set headerDOM({browser:t,parent:i,headerTitle:n,dismissHandler:r}){const s=e();this.tableDOM.appendChild(s);const o=e();s.appendChild(o),o.innerHTML=n;const a=e();s.appendChild(a),a.appendChild(l("times")),this.boundDismissHandler=function(e){e.stopPropagation(),r()}.bind(this),a.addEventListener("click",this.boundDismissHandler);const{y:c}=t.root.getBoundingClientRect(),{y:h}=i.getBoundingClientRect(),d=-(h-c);p(this.tableDOM,s,{minX:0,minY:d}),this.tableDOM.style.display="none",this._headerDOM=s}set tableColumnTitles(t){const i=e({class:"igv-roi-table-column-titles"});t.appendChild(i);for(const{label:t,width:n}of this.columnFormat){const r=e();i.appendChild(r),r.style.width=n,r.innerText=t}this._tableColumnTitlesDOM=i}get tableColumnTitles(){return this._tableColumnTitlesDOM}set tableRowContainer(t){const i=e({class:"igv-roi-table-row-container"});t.appendChild(i),this._tableRowContainerDOM=i}get tableRowContainer(){return this._tableRowContainerDOM}set footerDOM(t){const i=e();this.tableDOM.appendChild(i);const n=e({class:"igv-roi-table-button"});i.appendChild(n),n.id="igv-roi-table-view-button",n.textContent="Go To",n.style.pointerEvents="none",this._footerDOM=i,this.gotoButton=n,this.boundGotoButtonHandler=t.bind(this),this.gotoButton.addEventListener("click",this.boundGotoButtonHandler)}tableRowDOMHelper(e){e.addEventListener("mousedown",(t=>{t.stopPropagation(),e.classList.toggle("igv-roi-table-row-selected"),e.classList.contains("igv-roi-table-row-selected")?e.classList.remove("igv-roi-table-row-hover"):e.classList.add("igv-roi-table-row-hover"),this.setTableRowSelectionState(e.classList.contains("igv-roi-table-row-selected"))})),e.addEventListener("mouseover",(t=>{e.classList.contains("igv-roi-table-row-selected")?e.classList.remove("igv-roi-table-row-hover"):e.classList.add("igv-roi-table-row-hover")})),e.addEventListener("mouseout",(t=>{e.classList.remove("igv-roi-table-row-hover")}))}clearTable(){const e=this.tableRowContainer.querySelectorAll(".igv-roi-table-row");for(let t of e)t.remove()}setTableRowSelectionState(e){e?this.tableRowSelectionList.push(1):this.tableRowSelectionList.pop(),this.gotoButton.style.pointerEvents=this.tableRowSelectionList.length>0?"auto":"none"}present(){this.tableDOM.style.left="0px";const{y:e}=this.browser.root.getBoundingClientRect(),{y:t}=this.config.parent.getBoundingClientRect();this.tableDOM.style.top=e-t+"px",this.tableDOM.style.display="flex"}dismiss(){this.tableDOM.style.display="none"}isVisible(){return"none"!==this.tableDOM.style.display}dispose(){this.tableDOM.innerHTML="",this.tableDOM.remove();for(const e of Object.keys(this))this[e]=void 0;document.removeEventListener("click",this.boundDismissHandler)}}class Od extends Pd{constructor(e){super(Object.assign({width:"1024px"},e)),this.descriptionDOM=e}set descriptionDOM(t){if(t.description){let i;i=e({class:"igv-roi-table-description"}),this.tableDOM.insertBefore(i,this.tableColumnTitles),i.style.height="auto",i.innerHTML="BLAT result for query sequence:",i=e({class:"igv-roi-table-description"}),this.tableDOM.insertBefore(i,this.tableColumnTitles),i.style.height="auto",i.style.maxHeight="128px",i.innerHTML=t.description,i=e({class:"igv-roi-table-goto-explainer"}),this.tableDOM.insertBefore(i,this.tableColumnTitles),i.innerHTML="Select one or more rows and click Go To to view the regions"}}tableRowDOM(t){const i=e({class:"igv-roi-table-row"}),n=t.map((e=>isFinite(e)?Rt(e):e));for(let t=0;t<n.length;t++){const r=e();i.appendChild(r);const s=this.columnFormat[t];r.style.width=s.width||"fit-content",r.innerText=n[t]}return this.tableRowDOMHelper(i),i}renderTable(e){if(Array.from(this.tableRowContainer.querySelectorAll(".igv-roi-table-row")).forEach((e=>e.remove())),e.length>0)for(let t of e){const e=this.tableRowDOM(t);this.tableRowContainer.appendChild(e)}}static getColumnFormatConfiguration(){return[{label:"chr",width:"7%"},{label:"start",width:"12%"},{label:"end",width:"12%"},{label:"strand",width:"5%"},{label:"score",width:"5%"},{label:"match",width:"5%"},{label:"mis-match",width:"7%"},{label:"rep. match",width:"7%"},{label:"N's",width:"3%"},{label:"Q gap count",width:"9%"},{label:"Q gap bases",width:"9%"},{label:"T gap count",width:"9%"},{label:"T gap bases",width:"9%"}]}static gotoButtonHandler(e){e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected"),i=[];for(const e of t){const t=[];e.querySelectorAll("div").forEach((e=>t.push(e.innerText)));const[n,r,s]=t;i.push(`${n}:${r}-${s}`)}for(const e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");this.setTableRowSelectionState(!1),this.browser.search(i.join(" "))}}const Ud="https://igv.org/services/blatUCSC.php";async function qd({url:e,userSeq:t,db:i}){if(e=e||Ud,!i)throw Error("Blat database is not defined");const n=await async function(e="",t,i){const n=new URLSearchParams;n.append("userSeq",t),n.append("db",i);const r=await fetch(e,{method:"post",body:n});return r.json()}(e,t,i);n.fields;return n.blat.map(Kc)}const Qd=25e3;class Vd extends Hd{constructor(e,t){super(e,t),this.name||(this.name="Blat Results"),this.sequence=e.sequence,this.table=void 0,e.features&&(this._features=e.features,this.featureSource=new fd({features:e.features},this.browser.genome),delete e.features)}async postInit(){if(!this.featureSource){const e=this.browser.genome.id,t=this.browser.config.blatServerURL,i=await qd({url:t,userSeq:this.sequence,db:e});this._features=i,this.featureSource=new fd({features:i},this.browser.genome)}}openTableView(){if(void 0===this.table){const e=this._features.map((e=>[e.chr,e.start+1,e.end,e.strand,e.score,e.matches,e.misMatches,e.repMatches,e.nCount,e.qNumInsert,e.qBaseInsert,e.tNumInsert,e.tBaseInsert])),t={browser:this.browser,parent:this.browser.columnContainer,headerTitle:this.config.title,description:this.sequence,dismissHandler:()=>{this.table.dismiss(),this.table.dispose(),this.table=void 0},columnFormat:Od.getColumnFormatConfiguration(),gotoButtonHandler:Od.gotoButtonHandler};this.table=new Od(t),this.table.renderTable(e)}this.table.present()}menuItemList(){const e=super.menuItemList();return e.push("<hr/>"),e.push({label:"Open table view",click:function(){this.openTableView()}}),e}dispose(){super.dispose(),this.table&&this.table.popover.parentElement.removeChild(this.table.popover)}}async function jd({sequence:e,browser:t,name:i,title:n}){if(e.length>Qd)t.alert.present(`Sequence size exceeds maximum allowed length (${e.length} > 25000)`);else try{const r=t.genome.id,s=t.config.blatServerURL||"https://igv.org/services/blatUCSC.php",o={type:"blat",name:i||"blat results",title:n||"blat results",sequence:e,altColor:"rgb(176, 176, 236)",color:"rgb(236, 176, 176)",searchable:!1,features:await qd({url:s,userSeq:e,db:r})};(await t.loadTrack(o)).openTableView()}catch(e){t.alert.present(`Error performing blat search: ${e}`)}}const Wd=Number.MIN_SAFE_INTEGER,Gd={TTT:"F",TTC:"F",TTA:"L",TTG:"L",CTT:"L",CTC:"L",CTA:"L",CTG:"L",ATT:"I",ATC:"I",ATA:"I",ATG:"M",GTT:"V",GTC:"V",GTA:"V",GTG:"V",TCT:"S",TCC:"S",TCA:"S",TCG:"S",CCT:"P",CCC:"P",CCA:"P",CCG:"P",ACT:"T",ACC:"T",ACA:"T",ACG:"T",GCT:"A",GCC:"A",GCA:"A",GCG:"A",TAT:"Y",TAC:"Y",TAA:"STOP",TAG:"STOP",CAT:"H",CAC:"H",CAA:"Q",CAG:"Q",AAT:"N",AAC:"N",AAA:"K",AAG:"K",GAT:"D",GAC:"D",GAA:"E",GAG:"E",TGT:"C",TGC:"C",TGA:"STOP",TGG:"W",CGT:"R",CGC:"R",CGA:"R",CGG:"R",AGT:"S",AGC:"S",AGA:"R",AGG:"R",GGT:"G",GGC:"G",GGA:"G",GGG:"G"},$d={},Kd=["A","G","C","T","Y","R","W","S","K","M","D","V","H","B","N","X"],Yd=["T","C","G","A","R","Y","W","S","M","K","H","B","D","V","N","X"];for(let SA=0;SA<Kd.length;SA++)$d[Kd[SA]]=Yd[SA],$d[Kd[SA].toLowerCase()]=Yd[SA].toLowerCase();const Xd=115;class Zd{constructor(e,t){this.config=e,this.browser=t,this.type="sequence",this.removable=!0===e.removable,this.name=e.name,this.id=e.id,this.sequenceType=e.sequenceType||"dna",this.disableButtons=!1,this.order=e.order||Wd,this.ignoreTrackMenu=!1,this.reversed=!0===e.reversed,this.frameTranslate=!0===e.frameTranslate,this.height=this.frameTranslate?Xd:25,e.url&&(e.fastaURL=e.url),e.fastaURL||(this.id=e.id||"sequence")}menuItemList(){return[{name:this.reversed?"Forward":"Reverse",click:()=>{this.reversed=!this.reversed,this.trackView.repaintViews()}},{name:this.frameTranslate?"Close Translation":"Three-frame Translate",click:()=>{if(this.frameTranslate=!this.frameTranslate,this.frameTranslate){for(let e of this.trackView.viewports)e.setContentHeight(Xd);this.trackView.setTrackHeight(Xd)}else{for(let e of this.trackView.viewports)e.setContentHeight(25);this.trackView.setTrackHeight(25)}this.trackView.repaintViews()}}]}contextMenuItemList(e){const t=e.viewport;if(t.referenceFrame.bpPerPixel<=1){const e=t.getWidth()*t.referenceFrame.bpPerPixel,i=t.referenceFrame.chr,n=Math.floor(t.referenceFrame.start),r=Math.ceil(n+e),s=[{label:this.reversed?"View visible sequence (reversed)...":"View visible sequence...",click:async()=>{let e=await this.browser.genome.getSequence(i,n,r);e?this.reversed&&(e=lc(e)):e="Unknown sequence",this.browser.alert.present(e)}}];return Za()&&s.push({label:"Copy visible sequence",click:async()=>{let e=await this.browser.genome.getSequence(i,n,r);e?this.reversed&&(e=lc(e)):e="Unknown sequence";try{await navigator.clipboard.writeText(e)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),s.push({label:"BLAT read sequence",click:async()=>{let e=await this.browser.genome.getSequence(i,n,r);if(e){this.reversed&&(e=lc(e));const t=`blat: ${i}:${n+1}-${r}`,s=`blat: ${i}:${n+1}-${r}`;jd({sequence:e,browser:this.browser,name:t,title:s})}}}),s.push("<hr/>"),s}}translateSequence(e){const t=[[],[],[]];for(let i of[0,1,2]){let n=i;for(;e.length-n>=3;){let r=e.slice(n,n+3);this.reversed&&(r=r.split("").reverse().join(""));const s=Gd[r.toUpperCase()]||"";t[i].push({codons:r,aminoA:s}),n+=3}}return t}async getSequenceSource(){return this.config.fastaURL?(this.fasta||(this.fasta=new Jd(this.config,this.browser.genome),await this.fasta.init()),this.fasta):this.browser.genome}async getFeatures(e,t,i,n){if(t=Math.floor(t),i=Math.floor(i),n&&n>10)return null;{const n=await this.getSequenceSource();return{bpStart:t,sequence:await n.getSequence(e,t,i)}}}draw(e){const t=e.context;if(e.features){let i=e.features.sequence;if(!i)return;this.reversed&&(i=i.split("").map((function(e){return $d[e]})).join(""));const n=e.features.bpStart,r=1+e.bpStart+e.pixelWidth*e.bpPerPixel;for(let s=Math.floor(e.bpStart);s<=r;s++){const r=Math.floor(s-n);if(r>=0&&r<i.length){const n=(s-e.bpStart)/e.bpPerPixel,o=1/e.bpPerPixel,a=i[r],c=this.fillColor(a.toUpperCase());if(e.bpPerPixel>.1)xo.fillRect(t,n,5,o,10,{fillStyle:c});else{const i=n+.5*(o-t.measureText(a).width);"y"===e.axis?(t.save(),xo.labelTransformWithContext(t,i),xo.strokeText(t,a,i,15,{strokeStyle:c}),t.restore()):xo.strokeText(t,a,i,15,{strokeStyle:c})}}}if(this.frameTranslate){let r=25;const s=this.translateSequence(i);for(let i=0;i<s.length;i++){const o=s[i];for(let s=0;s<o.length;s++){let a=0==s%2?"rgb(160,160,160)":"rgb(224,224,224)";const c=o[s],l=n+i+3*s-e.bpStart,h=Math.floor(l/e.bpPerPixel),d=Math.floor((l+3)/e.bpPerPixel),u=Math.round((h+d)/2);if(d<0)continue;if(h>e.pixelWidth)break;let f=c.aminoA;c.aminoA.indexOf("STOP")>-1?(a="rgb(255, 0, 0)",f="STOP"):"M"===c.aminoA&&(a="rgb(0, 153, 0)",f="START"),xo.fillRect(t,h,r,d-h,25,{fillStyle:a}),e.bpPerPixel<=.1&&xo.strokeText(t,f,u-t.measureText(f).width/2,r+15)}r+=30}}}}get supportsWholeGenome(){return!1}computePixelHeight(e){return this.height=this.frameTranslate?Xd:25,this.height}fillColor(e){return this.color?this.color:"dna"===this.sequenceType?this.browser.nucleotideColors[e]||"gray":"rgb(0, 0, 150)"}getState(){const e={type:"sequence"};return this.order!==Wd&&(e.order=this.order),this.reversed&&(e.revealed=!0),e}}class Jd{constructor(e,t){this.config=e,this.genome=t}async init(){this.fasta=await Bc(this.config),this.chrNameMap=new Map;for(let e of this.fasta.chromosomeNames)this.chrNameMap.set(this.genome.getChromosomeName(e),e)}async getSequence(e,t,i){const n=this.chrNameMap.has(e)?this.chrNameMap.get(e):e;return this.fasta.getSequence(n,t,i)}}class eu{constructor(e,t,i,n){this.guid=s(),this.trackView=e,this.referenceFrame=i,this.browser=e.browser,this.$viewport=Bt('<div class="igv-viewport">'),t.appendChild(this.$viewport.get(0)),e.track.height&&(this.$viewport.get(0).style.height=`${e.track.height}px`),e.track instanceof Zd&&(this.alert=new La(this.$viewport.get(0))),this.contentTop=0,this.contentHeight=this.$viewport.height(),this.$viewport.width(n),this.initializationHelper()}initializationHelper(){}showMessage(e){this.messageDiv||(this.messageDiv=document.createElement("div"),this.messageDiv.className="igv-viewport-message",this.$viewport.append(Bt(this.messageDiv))),this.messageDiv.textContent=e,this.messageDiv.style.display="inline-block"}hideMessage(e){this.messageDiv&&(this.messageDiv.style.display="none")}setTrackLabel(e){}startSpinner(){}stopSpinner(){}checkZoomIn(){return!0}shift(){}setTop(e){this.contentTop=e,this.$viewport.height()}async loadFeatures(){}clearCache(){}repaint(){}draw(e,t,i){console.log("Viewport - draw(drawConfiguration, features, roiFeatures)")}checkContentHeight(e){let t=this.trackView.track;if(e=e||this.cachedFeatures,"FILL"===t.displayMode)this.setContentHeight(this.$viewport.height());else if("function"==typeof t.computePixelHeight&&e&&e.length>0){let i=t.computePixelHeight(e);i!==this.contentHeight&&this.setContentHeight(i)}}getContentHeight(){return this.contentHeight}setContentHeight(e){this.contentHeight=e}isLoading(){return!1}saveSVG(){}isVisible(){return this.$viewport.width()}setWidth(e){this.$viewport.width(e)}getWidth(){return this.$viewport.width()}getContentTop(){return this.contentTop}containsPosition(e,t){console.log("Viewport - containsPosition(chr, position)")}addMouseHandlers(){}removeMouseHandlers(){}dispose(){this.$viewport.get(0).remove();for(let e of Object.keys(this))this[e]=void 0}}
31
31
  /*!!
32
32
  * Canvas 2 Svg v1.0.19
33
33
  * A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.
@@ -39,7 +39,7 @@ function(e){var t,i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v="sizzle"+1*new Date,y=e.
39
39
  * Kerry Liu
40
40
  *
41
41
  * Copyright (c) 2014 Gliffy Inc.
42
- */function tu(e,t){var i,n=Object.keys(t);for(i=0;i<n.length;i++)e=e.replace(new RegExp("\\{"+n[i]+"\\}","gi"),t[n[i]]);return e}function iu(e){var t,i,n;if(!e)throw new Error("cannot create a random attribute name for an undefined object");t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="";do{for(i="",n=0;n<12;n++)i+=t[Math.floor(51*Math.random())]}while(e[i]);return i}function nu(e){var t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[e]||t.alphabetic}function ru(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}const su=function(e,t){var i,n,r,s={};for(e=e.split(","),t=t||10,i=0;i<e.length;i+=2)n="&"+e[i+1]+";",r=parseInt(e[i],t),s[n]="&#"+r+";";return s["\\xa0"]="&#160;",s}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),ou={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class au{constructor(e,t){this.__root=e,this.__ctx=t}addColorStop(e,t){var i,n=this.__ctx.__createElement("stop");n.setAttribute("offset",e),t&&-1!==t.indexOf("rgba")?(i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t),n.setAttribute("stop-color",tu("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),n.setAttribute("stop-opacity",i[4])):n.setAttribute("stop-color",t),this.__root.appendChild(n)}}class cu{constructor(e,t){this.__root=e,this.__ctx=t}}class lu{constructor(e){if(!(this instanceof lu))return new lu(e);if(this.config=e,this.width=e.width,this.height=e.height,this.enableMirroring=e.enableMirroring||!1,this.canvas=this,this.__document=document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.isSVG=!0,this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__createElement("svg"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__root.setAttribute("overflow","visible"),e.viewbox){const t=e.viewbox.x+" "+e.viewbox.y+" "+e.viewbox.width+" "+e.viewbox.height;this.__root.setAttribute("viewBox",t),this.viewbox=e.viewbox}this.__ids={},this.__defs=this.__createElement("defs"),this.__root.appendChild(this.__defs),this.multiLocusGap=e.multiLocusGap;let t={id:"svg_output_backdrop",width:"100%",height:"100%",fill:e.backdropColor||"white"},i=this.__createElement("rect",t);this.__root.appendChild(i),this.__rootGroup=this.__createElement("g",{id:"root-group"}),this.__root.appendChild(this.__rootGroup),this.__currentElement=this.__rootGroup}setWidth(e){this.width=e,this.__root.setAttribute("width",this.width);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+e+" "+this.config.viewbox.height;this.__root.setAttribute("viewBox",t)}setHeight(e){this.height=e,this.__root.setAttribute("height",this.height);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+this.config.viewbox.width+" "+e;this.__root.setAttribute("viewBox",t)}__createElement(e,t,i){void 0===t&&(t={});let n=this.__document.createElementNS("http://www.w3.org/2000/svg",e);i&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let e of Object.keys(t))n.setAttribute(e,t[e]);return n}__setDefaultStyles(){var e,t,i=Object.keys(ou);for(e=0;e<i.length;e++)this[t=i[e]]=ou[t].canvas}__applyStyleState(e){var t,i,n=Object.keys(e);for(t=0;t<n.length;t++)this[i=n[t]]=e[i]}__getStyleState(){var e,t,i={},n=Object.keys(ou);for(e=0;e<n.length;e++)i[t=n[e]]=this[t];return i}__applyStyleToCurrentElement(e){var t=this.__currentElement,i=this.__currentElementsToStyle;i&&(t.setAttribute(e,""),t=i.element,i.children.forEach((function(t){t.setAttribute(e,"")})));var n,r,s,o,a,c=Object.keys(ou);for(n=0;n<c.length;n++)if(r=ou[c[n]],s=this[c[n]],r.apply)if(s instanceof cu){if(s.__ctx)for(;s.__ctx.__defs.childNodes.length;)o=s.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[o]=o,this.__defs.appendChild(s.__ctx.__defs.childNodes[0]);t.setAttribute(r.apply,tu("url(#{id})",{id:s.__root.getAttribute("id")}))}else if(s instanceof au)t.setAttribute(r.apply,tu("url(#{id})",{id:s.__root.getAttribute("id")}));else if(r&&-1!==r.apply.indexOf(e)&&r.svg!==s)if("stroke"!==r.svgAttr&&"fill"!==r.svgAttr||!s||-1===s.indexOf("rgba")){var l=r.svgAttr;if("globalAlpha"===c[n]&&(l=e+"-"+r.svgAttr,t.getAttribute(l)))continue;t.setAttribute(l,s)}else{a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(s),t.setAttribute(r.svgAttr,tu("rgb({r},{g},{b})",{r:a[1],g:a[2],b:a[3]}));var h=a[4],d=this.globalAlpha;null!=d&&(h*=d),t.setAttribute(r.svgAttr+"-opacity",h)}}__closestGroupOrSvg(e){return"g"===(e=e||this.__currentElement).nodeName||"svg"===e.nodeName?e:this.__closestGroupOrSvg(e.parentNode)}getSerializedSvg(e){var t,i,n,r,s,o=(new XMLSerializer).serializeToString(this.__root);if(e)for(t=Object.keys(su),i=0;i<t.length;i++)n=t[i],r=su[n],(s=new RegExp(n,"gi")).test(o)&&(o=o.replace(s,r));return o}getSvg(){return this.__root}saveWithTranslationAndClipRect(e,t,i,n,r,s){const o=`${e}_clip_rect`;let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a);const c={x:"0",y:s.toString(),width:n.toString(),height:r.toString()};a.appendChild(this.__createElement("rect",c));const l=this.__createElement("g");l.setAttribute("transform",tu("translate({x},{y})",{x:t,y:i})),l.setAttribute("clip-path",tu("url(#{id})",{id:o}));const h=this.__closestGroupOrSvg();h.appendChild(l),this.__groupStack.push(h),this.__currentElement=l,this.__stack.push(this.__getStyleState())}save(){var e=this.__createElement("g"),t=this.__closestGroupOrSvg();this.__groupStack.push(t),t.appendChild(e),this.__currentElement=e,this.__stack.push(this.__getStyleState())}restore(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var e=this.__stack.pop();this.__applyStyleState(e)}__addTransform(e){var t=this.__closestGroupOrSvg();if(t.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:t,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var i=this.__createElement("g");t.appendChild(i),this.__currentElement=i}var n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=e,this.__currentElement.setAttribute("transform",n)}addTrackGroupWithTranslationAndClipRect(e,t,i,n,r,s){const o=e+"_clip_rect";let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a),a.appendChild(this.__createElement("rect",{x:"0",y:s.toString(),width:n.toString(),height:r.toString()}));let c=this.__createElement("g");this.__rootGroup.appendChild(c),c.setAttribute("transform",tu("translate({x},{y})",{x:t,y:i})),c.setAttribute("id",e+"_group"),c.setAttribute("clip-path",tu("url(#{id})",{id:o})),this.__currentElement=c}scale(e,t){void 0===t&&(t=e),this.__addTransform(tu("scale({x},{y})",{x:e,y:t}))}rotate(e){var t=180*e/Math.PI;this.__addTransform(tu("rotate({angle},{cx},{cy})",{angle:t,cx:0,cy:0}))}translate(e,t){this.__addTransform(tu("translate({x},{y})",{x:e,y:t}))}transform(e,t,i,n,r,s){this.__addTransform(tu("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:t,c:i,d:n,e:r,f:s}))}beginPath(){var e;this.__currentDefaultPath="",this.__currentPosition={},e=this.__createElement("path",{},!0),this.__closestGroupOrSvg().appendChild(e),this.__currentElement=e}__applyCurrentDefaultPath(){var e=this.__currentElement;"path"===e.nodeName?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)}__addPathCommand(e){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=e}moveTo(e,t){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:t},this.__addPathCommand(tu("M {x} {y}",{x:e,y:t}))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(e,t){this.__currentPosition={x:e,y:t},this.__currentDefaultPath&&this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(tu("L {x} {y}",{x:e,y:t})):this.__addPathCommand(tu("M {x} {y}",{x:e,y:t}))}bezierCurveTo(e,t,i,n,r,s){this.__currentPosition={x:r,y:s},this.__addPathCommand(tu("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:t,cp2x:i,cp2y:n,x:r,y:s}))}quadraticCurveTo(e,t,i,n){this.__currentPosition={x:i,y:n},this.__addPathCommand(tu("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:t,x:i,y:n}))}arcTo(e,t,i,n,r){var s=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(void 0!==s&&void 0!==o){if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(s===e&&o===t||e===i&&t===n||0===r)this.lineTo(e,t);else{var a=ru([s-e,o-t]),c=ru([i-e,n-t]);if(a[0]*c[1]!=a[1]*c[0]){var l=a[0]*c[0]+a[1]*c[1],h=Math.acos(Math.abs(l)),d=ru([a[0]+c[0],a[1]+c[1]]),u=r/Math.sin(h/2),f=e+u*d[0],p=t+u*d[1],g=[-a[1],a[0]],m=[c[1],-c[0]],w=function(e){var t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)},b=w(g),F=w(m);this.lineTo(f+g[0]*r,p+g[1]*r),this.arc(f,p,r,b,F)}else this.lineTo(e,t)}}}stroke(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(e,t,i,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.lineTo(e,t),this.closePath()}fillRect(e,t,i,n){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var r,s,o,a={x:e,y:t,width:i,height:n};(!this.viewbox||(r=this.viewbox,s=a,r.x<s.x+s.width&&r.x+r.width>s.x&&r.y<s.y+s.height&&r.y+r.height>s.y))&&(o=this.__createElement("rect",a,!0),this.__closestGroupOrSvg().appendChild(o),this.__currentElement=o,this.__applyStyleToCurrentElement("fill"))}strokeRect(e,t,i,n){var r;r=this.__createElement("rect",{x:e,y:t,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}strokeEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"stroke")}fillEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"fill")}__ellipse(e,t,i,n,r,s,o,a,c){const l={cx:e,cy:t,rx:i,ry:n},h=this.__createElement("ellipse",l,!0);this.__closestGroupOrSvg().appendChild(h),this.__currentElement=h,this.__applyStyleToCurrentElement(c)}__clearCanvas(){for(var e=this.__closestGroupOrSvg().getAttribute("transform"),t=this.__root.childNodes[1],i=t.childNodes,n=i.length-1;n>=0;n--)i[n]&&t.removeChild(i[n]);this.__currentElement=t,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(e,t,i,n){if(0!==e||0!==t||i!==this.width||n!==this.height){var r,s=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:e,y:t,width:i,height:n,fill:"#FFFFFF"},!0),s.appendChild(r)}else this.__clearCanvas()}createLinearGradient(e,t,i,n){var r=this.__createElement("linearGradient",{id:iu(this.__ids),x1:e+"px",x2:i+"px",y1:t+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(r),new au(r,this)}createRadialGradient(e,t,i,n,r,s){var o=this.__createElement("radialGradient",{id:iu(this.__ids),cx:n+"px",cy:r+"px",r:s+"px",fx:e+"px",fy:t+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new au(o,this)}__parseFont(){var e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i.exec(this.font),t={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(t.decoration="underline"),this.__fontHref&&(t.href=this.__fontHref),t}__wrapTextLink(e,t){if(e.href){var i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.href),i.appendChild(t),i}return t}__applyText(e,t,i,n){var r,s,o=this.__parseFont(),a=this.__closestGroupOrSvg(),c=this.__createElement("text",{"font-family":o.family,"font-size":o.size,"font-style":o.style,"font-weight":o.weight,"text-decoration":o.decoration,x:t,y:i,"text-anchor":(r=this.textAlign,s={left:"start",right:"end",center:"middle",start:"start",end:"end"},s[r]||s.start),"dominant-baseline":nu(this.textBaseline)},!0);c.appendChild(this.__document.createTextNode(e)),this.__currentElement=c,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(o,c))}fillText(e,t,i){this.__applyText(e,t,i,"fill")}strokeText(e,t,i){this.__applyText(e,t,i,"stroke")}measureText(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)}arc(e,t,i,n,r,s){if(n!==r){(n%=2*Math.PI)===(r%=2*Math.PI)&&(r=(r+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var o=e+i*Math.cos(r),a=t+i*Math.sin(r),c=e+i*Math.cos(n),l=t+i*Math.sin(n),h=s?0:1,d=0,u=r-n;u<0&&(u+=2*Math.PI),d=s?u>Math.PI?0:1:u>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(tu("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:d,sweepFlag:h,endX:o,endY:a})),this.__currentPosition={x:o,y:a}}}clip(){var e=this.__closestGroupOrSvg(),t=this.__createElement("clipPath"),i=iu(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),t.setAttribute("id",i),t.appendChild(this.__currentElement),this.__defs.appendChild(t),e.setAttribute("clip-path",tu("url(#{id})",{id:i})),e.appendChild(n),this.__currentElement=n}drawImage(){var e,t,i,n,r,s,o,a,c,l,h,d,u,f=Array.prototype.slice.call(arguments),p=f[0],g=0,m=0;if(3===f.length)e=f[1],t=f[2],i=r=p.width,n=s=p.height;else if(5===f.length)e=f[1],t=f[2],i=f[3],n=f[4],r=p.width,s=p.height;else{if(9!==f.length)throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);g=f[1],m=f[2],r=f[3],s=f[4],e=f[5],t=f[6],i=f[7],n=f[8]}o=this.__closestGroupOrSvg(),this.__currentElement;var w="translate("+e+", "+t+")";if(p instanceof lu){if((a=p.getSvg().cloneNode(!0)).childNodes&&a.childNodes.length>1){for(c=a.childNodes[0];c.childNodes.length;)u=c.childNodes[0].getAttribute("id"),this.__ids[u]=u,this.__defs.appendChild(c.childNodes[0]);if(l=a.childNodes[1]){var b,F=l.getAttribute("transform");b=F?F+" "+w:w,l.setAttribute("transform",b),o.appendChild(l)}}}else"CANVAS"!==p.nodeName&&"IMG"!==p.nodeName||((h=this.__createElement("image")).setAttribute("width",i),h.setAttribute("height",n),h.setAttribute("preserveAspectRatio","none"),(g||m||r!==p.width||s!==p.height)&&((d=this.__document.createElement("canvas")).width=i,d.height=n,d.getContext("2d").drawImage(p,g,m,r,s,0,0,i,n),p=d),h.setAttribute("transform",w),h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===p.nodeName?p.toDataURL():p.getAttribute("src")),o.appendChild(h))}createPattern(e,t){let i,n=this.__document.__createElement("pattern"),r=iu(this.__ids);return n.setAttribute("id",r),n.setAttribute("width",e.width),n.setAttribute("height",e.height),"CANVAS"===e.nodeName||"IMG"===e.nodeName?(i=this.__createElement("image"),i.setAttribute("width",e.width),i.setAttribute("height",e.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===e.nodeName?e.toDataURL():e.getAttribute("src")),n.appendChild(i),this.__defs.appendChild(n)):e instanceof lu&&(n.appendChild(e.__root.childNodes[1]),this.__defs.appendChild(n)),new cu(n,this)}setLineDash(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}function hu(e){if(e.startsWith("GCF")||e.startsWith("GCA")&&e.length>=13){return"https://hgdownload.soe.ucsc.edu/hubs/"+e.substring(0,3)+"/"+e.substring(4,7)+"/"+e.substring(7,10)+"/"+e.substring(10,13)+"/"+e+"/hub.txt"}}class du{static supportedTypes=new Set(["bigBed","bigWig","bigGenePred","vcfTabix"]);static filterTracks=new Set(["cytoBandIdeo","assembly","gap","gapOverlap","allGaps","cpgIslandExtUnmasked","windowMasker"]);static async loadHub(e){const t=e.lastIndexOf("/"),i=e.substring(0,t+1),n=await pu(e);let r;if("genome"===n[1].type){const e=n[1];if(e.hasProperty("groups")){const t=i+e.getProperty("groups");r=await pu(t)}}return new du(e,n,r)}constructor(e,t,i){this.url=e;const n=e.lastIndexOf("/");if(this.baseURL=e.substring(0,n+1),"hub"!==t[0].type)throw Error("Unexpected hub.txt file -- does the first line start with 'hub'?");if(this.hubStanza=t[0],"on"!==this.hubStanza.getProperty("useOneFile"))throw Error("Only 'useOneFile' hubs are currently supported");if(t.length<2)throw Error("Expected at least 2 stanzas, hub and genome");if("genome"!==t[1].type)throw Error(`Unexpected hub file -- expected "genome" stanza but found "${t[1].type}"`);this.genomeStanza=t[1],this.trackStanzas=[];for(let e=2;e<t.length;e++)"track"===t[e].type&&this.trackStanzas.push(t[e]);if(i){this.groupStanzas=i,this.groupPriorityMap=new Map;for(let e of i)e.hasProperty("priority")&&this.groupPriorityMap.set(e.getProperty("name"),10*Number.parseInt(e.getProperty("priority")))}}getDefaultPosition(){return this.genomeStanza.getProperty("defaultPos")}getGenomeConfig(e={}){const t=this.genomeStanza.getProperty("genome"),i=this.hubStanza.getProperty("shortLabel")||this.genomeStanza.getProperty("scientificName")||this.genomeStanza.getProperty("organism")||this.genomeStanza.getProperty("description"),n=i+(i?` (${t})`:` ${t}`),r={hubURL:this.url,id:t,name:n,twoBitURL:this.baseURL+this.genomeStanza.getProperty("twoBitPath"),nameSet:"ucsc",wholeGenomeView:!1,showChromosomeWidget:!1};if(this.genomeStanza.hasProperty("defaultPos")){const e=this.genomeStanza.getProperty("defaultPos");if(e){const t=e.lastIndexOf(":");r.locus=t>0?e.substring(0,t):e}}this.genomeStanza.hasProperty("blat")&&(r.blat=this.baseURL+this.genomeStanza.getProperty("blat")),this.genomeStanza.hasProperty("chromAliasBb")&&(r.chromAliasBbURL=this.baseURL+this.genomeStanza.getProperty("chromAliasBb")),this.genomeStanza.hasProperty("chromAlias")&&(r.aliasURL=this.baseURL+this.genomeStanza.getProperty("chromAlias")),this.genomeStanza.hasProperty("twoBitBptURL")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptURL")),this.genomeStanza.hasProperty("twoBitBptUrl")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptUrl")),e.includeChromSizes&&this.genomeStanza.hasProperty("chromSizes")&&(r.chromSizesURL=this.baseURL+this.genomeStanza.getProperty("chromSizes")),this.hubStanza.hasProperty("longLabel")?r.description=this.hubStanza.getProperty("longLabel").replace("/","\n"):(r.description=r.id,this.genomeStanza.hasProperty("description")&&(r.description+=`\n${this.genomeStanza.getProperty("description")}`),this.genomeStanza.hasProperty("organism")&&(r.description+=`\n${this.genomeStanza.getProperty("organism")}`),this.genomeStanza.hasProperty("scientificName")&&(r.description+=`\n${this.genomeStanza.getProperty("scientificName")}`),this.genomeStanza.hasProperty("htmlPath")&&(r.infoURL=this.baseURL+this.genomeStanza.getProperty("htmlPath")));const s=this.trackStanzas.filter((e=>"cytoBandIdeo"===e.name&&e.hasProperty("bigDataUrl")));s.length>0&&(r.cytobandBbURL=this.baseURL+s[0].getProperty("bigDataUrl"));return r.tracks=this.#f((e=>!du.filterTracks.has(e.name)&&"hide"!==e.getProperty("visibility"))),r}getGroupedTrackConfigurations(){const e=new Map;for(let t of this.#f()){if("cytoBandIdeo"===t.name)continue;const i=t.group||"other";e.has(i)?e.get(i).push(t):e.set(i,[t])}const t=this.groupStanzas?new Map(this.groupStanzas.map((e=>[e.getProperty("name"),e]))):new Map;return Array.from(e.keys()).map((i=>({label:t.has(i)?t.get(i).getProperty("label"):i,tracks:e.get(i)})))}#f(e){return this.trackStanzas.filter((t=>du.supportedTypes.has(t.format)&&t.hasProperty("bigDataUrl")&&(!e||e(t)))).map((e=>this.#p(e)))}#p(e){const t=e.format,i={id:e.getProperty("track"),name:e.getProperty("shortLabel"),format:t,url:this.baseURL+e.getProperty("bigDataUrl"),displayMode:e.displayMode};if("vcfTabix"===t&&(i.indexURL=i.url+".tbi"),e.hasProperty("longLabel")&&e.hasProperty("html")?(i.description&&(i.description+="<br/>"),i.description=`<a target="_blank" href="${this.baseURL+e.getProperty("html")}">${e.getProperty("longLabel")}</a>`):e.hasProperty("longLabel")&&(i.description=e.getProperty("longLabel")),e.hasProperty("autoScale")&&(i.autoscale="on"===e.getProperty("autoScale").toLowerCase()),e.hasProperty("maxHeightPixels")){const t=e.getProperty("maxHeightPixels").split(":");i.maxHeight=Number.parseInt(t[0]),i.height=Number.parseInt(t[1]),i.minHeight=Number.parseInt(t[2])}if(e.hasProperty("color")){const t=e.getProperty("color");i.color=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("altColor")){const t=e.getProperty("altColor");i.altColor=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("viewLimits")){const t=e.getProperty("viewLimits").split(":");let n,r;t.length>1&&(n=Number.parseInt(t[0]),r=Number.parseInt(t[1])),Number.isNaN(r)||Number.isNaN(n)?console.warn(`Unexpected viewLimits value in track line: ${properties.viewLimits}`):(i.min=n,i.max=r)}if(e.hasProperty("itemRgb"),"hide"===e.getProperty("visibility")&&(i.visible=!1),e.hasProperty("url")&&(i.infoURL=e.getProperty("url")),e.hasProperty("searchIndex")&&(i.searchIndex=e.getProperty("searchIndex")),e.hasProperty("searchTrix")&&(i.searchTrix=this.baseURL+e.getProperty("searchTrix")),e.hasProperty("group")&&(i.group=e.getProperty("group"),this.groupPriorityMap&&this.groupPriorityMap.has(i.group))){const e=this.groupPriorityMap.get(i.group)+1;i.order=e,this.groupPriorityMap.set(i.group,e)}return i}}function uu(e){const t=e.indexOf(" ");return t>0?e.substring(0,t):e}class fu{properties=new Map;constructor(e,t){this.type=e,this.name=t}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.has(e)?this.properties.get(e):this.parent?this.parent.getProperty(e):void 0}hasProperty(e){return!!this.properties.has(e)||!!this.parent&&this.parent.hasProperty(e)}get format(){const e=this.getProperty("type");if(e)return uu(e)}get displayMode(){let e=this.getProperty("visibility");if(!e)return"COLLAPSED";switch(e=e.toLowerCase(),e){case"dense":default:return"COLLAPSED";case"pack":return"EXPANDED";case"squish":return"SQUISHED"}}}async function pu(e){const t=await fetch(e),i=(await t.text()).split(/\n|\r\n|\r/g),n=[];let r,s=!0;for(let e of i){const t=gu(e),i=e.indexOf(" ",t);if(i<0)s=!0;else{const o=e.substring(t,i).trim();if(o.startsWith("#"))continue;const a=e.substring(i+1).trim();if(s){const e=new fu(o,a);n.push(e),r=e,s=!1}r.setProperty(o,a)}}return function(e){const t=new Map;for(let i of e)t.set(i.name,i);for(let i of e)if(i.properties.has("parent")){const e=uu(i.properties.get("parent"));i.parent=t.get(e)}return e}(n)}function gu(e){let t=0;for(t=0;t<e.length;t++){const i=e.charAt(t);if(" "!==i&&"\t"!==i)break}return t}const mu={initializeGenomes:async function(e){if(!mu.KNOWN_GENOMES){const t={};if(!1!==e.loadDefaultGenomes){const r="https://igv.org/genomes/genomes.json";n(await Qs.loadJson(r,{timeout:5e3}))}const i=e.genomeList||e.genomes;if(i)if("string"==typeof i){n(await Qs.loadJson(i,{}))}else n(i);function n(e){return e.forEach((function(e){t[e.id]=e})),t}mu.KNOWN_GENOMES=t}},isWholeGenomeView:function(e){return"all"===e.toLowerCase()},expandReference:async function(e,t){if(Mt(t)&&t.startsWith("{"))try{t=JSON.parse(t)}catch(e){}let i;if(Mt(t)?i=t:t.genome?i=t.genome:void 0===t.id||t.fastaURL||t.twobitURL||(i=t.id),i){let t=mu.KNOWN_GENOMES[i];if(!t){if((i.startsWith("GCA_")||i.startsWith("GCF_"))&&i.length>=13)try{const e=hu(i);t=(await du.loadHub(e)).getGenomeConfig()}catch(e){console.error(e)}t||e.present(new Error(`Unknown genome id: ${i}`),void 0)}return t}return t}};let wu,bu,Fu=0,vu=0,yu=[];class Au extends eu{constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.$spinner=Bt("<div>",{class:"igv-loading-spinner-container"}),this.$viewport.append(this.$spinner),this.$spinner.append(Bt("<div>"));const e=this.trackView.track;"sequence"!==e.type&&(this.$zoomInNotice=this.createZoomInNotice(this.$viewport)),"sequence"!==e.id&&(this.$trackLabel=Bt('<div class="igv-track-label">'),this.$viewport.append(this.$trackLabel),this.setTrackLabel(e.name||""),!1===this.browser.doShowTrackLabels&&this.$trackLabel.hide()),this.stopSpinner(),this.addMouseHandlers()}setContentHeight(e){super.setContentHeight(e),this.featureCache&&(this.featureCache.redraw=!0)}setTrackLabel(e){this.$trackLabel.empty(),this.$trackLabel.html(e);const t=this.$trackLabel.text();this.$trackLabel.attr("title",t)}startSpinner(){this.$spinner.show()}stopSpinner(){this.$spinner&&this.$spinner.hide()}checkZoomIn(){if(this.trackView.track&&"sequence"===this.trackView.track.type&&this.referenceFrame.bpPerPixel>10)return Bt(this.canvas).remove(),this.canvas=void 0,!1;if(!this.viewIsReady())return!1;if((()=>{if("all"!==this.referenceFrame.chr.toLowerCase()||this.trackView.track.supportsWholeGenome){const e=this.trackView.track.visibilityWindow;return void 0!==e&&e>0&&this.referenceFrame.bpPerPixel*this.$viewport.width()>e}return!0})()){if(this.canvas&&(Bt(this.canvas).remove(),this.canvas=void 0),this.trackView.track.autoHeight){const e=this.trackView.minHeight||0;this.setContentHeight(e)}return this.$zoomInNotice&&this.$zoomInNotice.show(),!1}return this.$zoomInNotice&&this.$zoomInNotice.hide(),!0}shift(){const e=this.referenceFrame;this.canvas&&this.canvas._data&&this.canvas._data.referenceFrame.chr===this.referenceFrame.chr&&this.canvas._data.bpPerPixel===e.bpPerPixel&&(this.canvas._data.pixelShift=Math.round((this.canvas._data.bpStart-e.start)/e.bpPerPixel),this.canvas.style.left=this.canvas._data.pixelShift+"px")}genomicRange(){return{start:this.referenceFrame.start,end:this.referenceFrame.start+this.referenceFrame.bpPerPixel*this.$viewport.width()}}setTop(e){if(super.setTop(e),this.canvas){const t=this.$viewport.height(),i=e+this.canvas._data.pixelTop,n=i+this.canvas._data.pixelHeight;(i>0||n<t)&&this.repaint()}else this.repaint();if(this.canvas&&this.canvas._data){let t=e+this.canvas._data.pixelTop;this.canvas.style.top=`${t}px`}}async loadFeatures(){const e=this.referenceFrame,t=e.chr,i=await this.browser.genome.loadChromosome(t),n=i?i.bpLength:Number.MAX_SAFE_INTEGER,r=this.$viewport.width()*e.bpPerPixel,s=Math.floor(Math.max(0,e.start-r)),o=Math.ceil(Math.min(n,e.start+r+r));if(!this.loading||this.loading.start!==s||this.loading.end!==o){this.loading={start:s,end:o},this.startSpinner();try{const i=this.trackView.track,n=await this.getFeatures(i,t,s,o,e.bpPerPixel);if(n){let r=[];if(i.roiSets&&i.roiSets.length>0)for(let n of i.roiSets){const i=await n.getFeatures(t,s,o,e.bpPerPixel);r.push({track:n,features:i})}const a=i&&i.resolutionAware,c=this.windowFunction;return this.featureCache=new Cu(t,s,o,e.bpPerPixel,n,r,a,c),this.loading=!1,this.hideMessage(),this.stopSpinner(),this.featureCache}}catch(e){this.trackView&&!0!==this.trackView.disposed&&(this.showMessage("Error loading track data"),this.browser.alert.present(e),console.error(e))}finally{this.loading=!1,this.stopSpinner()}}}get track(){return this.trackView.track}get windowFunction(){return this.track?this.track.windowFunction:void 0}repaintDimensions(){const e=mu.isWholeGenomeView(this.referenceFrame.chr),t=e?this.$viewport.width():3*this.$viewport.width(),i=this.referenceFrame.bpPerPixel;return{bpStart:this.referenceFrame.start-(e?0:this.$viewport.width()*i),bpEnd:e?Number.MAX_SAFE_INTEGER:this.referenceFrame.start+2*this.$viewport.width()*i+1,pixelWidth:t}}repaint(){if(void 0===this.featureCache)return;const{features:e,roiFeatures:t}=this.featureCache,{bpStart:i,bpEnd:n,pixelWidth:r}=this.repaintDimensions(),s=this.$viewport.height(),o=this.getContentHeight(),a=t?Math.max(o,s):o,c=Math.min(a,3*s);if(0===r||0===c)return void(this.canvas&&Bt(this.canvas).remove());const l=Math.max(0,-this.contentTop-Math.floor(c/3)),h=this.referenceFrame.bpPerPixel,d=Math.round((i-this.referenceFrame.start)/h),u=(this.contentTop||0)+l,f=document.createElement("canvas");f.style.position="relative",f.style.display="block",f.style.width=r+"px",f.style.height=c+"px",f.style.left=d+"px",f.style.top=u+"px";const p="FILL"===this.trackView.track.displayMode||!1!==this.trackView.track.supportHiDPI?window.devicePixelRatio:1;f.width=p*r,f.height=p*c;const g=f.getContext("2d");g.scale(p,p),g.translate(0,-l);const m={context:g,pixelXOffset:d,pixelWidth:r,pixelHeight:c,pixelTop:l,bpStart:i,bpEnd:n,bpPerPixel:h,pixelShift:d,windowFunction:this.windowFunction,referenceFrame:this.referenceFrame,selection:this.selection,viewport:this,viewportWidth:this.$viewport.width()};this.draw(m,e,t),this.canvas&&Bt(this.canvas).remove(),f._data=m,this.canvas=f,this.$viewport.append(Bt(f))}refresh(){if(!this.canvas||!this.featureCache)return;const e=this.canvas._data;e.context.clearRect(0,0,this.canvas.width,this.canvas.height);const{features:t,roiFeatures:i}=this.featureCache;this.draw(e,t,i)}draw(e,t,i){if(t&&(e.features=t,this.trackView.track.draw(e)),i&&i.length>0)for(let t of i)e.features=t.features,t.track.draw(e)}containsPosition(e,t){return this.referenceFrame.chr===e&&t>=this.referenceFrame.start&&t<=this.referenceFrame.calculateEnd(this.getWidth())}isLoading(){return this.loading}savePNG(){if(!this.canvas)return;const e=this.canvas._data,t=e?e.pixelTop:0,i=window.devicePixelRatio,n=this.$viewport.width()*i,r=this.$viewport.height()*i,s=-Bt(this.canvas).position().left*i,o=(-this.contentTop-t)*i,a=this.canvas.getContext("2d").getImageData(s,o,n,r),c=document.createElement("canvas"),l=c.getContext("2d");c.width=a.width,c.height=a.height,l.putImageData(a,0,0);Pt((this.$trackLabel.text()?this.$trackLabel.text():"image")+".png",c.toDataURL("image/png"))}saveSVG(){let{width:e,height:t}=this.browser.columnContainer.getBoundingClientRect();const i=new lu({width:e,height:8e3,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:e,height:8e3}}),n={deltaX:32,deltaY:32};this.renderSVGContext(i,n,!1),i.setHeight(t);const r=(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,""),o=this.browser.referenceFrameList.indexOf(this.referenceFrame),a=i.getSerializedSvg(!0),c=URL.createObjectURL(new Blob([a],{type:"application/octet-stream"}));Pt(`${`${r}_referenceFrame_${o}_guid_${s()}`}.svg`,c)}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){if(!(this.$zoomInNotice&&this.$zoomInNotice.is(":visible"))){const{width:n,height:r}=this.$viewport.get(0).getBoundingClientRect(),o=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${s()}`,a=t,c=i+this.contentTop,l=-this.contentTop;e.saveWithTranslationAndClipRect(o,a,c,n,r,l);let{start:h,bpPerPixel:d}=this.referenceFrame;const u={context:e,viewport:this,referenceFrame:this.referenceFrame,top:l,pixelTop:l,pixelWidth:n,pixelHeight:r,bpStart:h,bpEnd:h+n*d,bpPerPixel:d,viewportWidth:n,selection:this.selection},f=this.featureCache?this.featureCache.features:void 0,p=this.featureCache?this.featureCache.roiFeatures:void 0;this.draw(u,f,p),e.restore()}if(n&&this.$trackLabel&&this.browser.doShowTrackLabels){const{x:n,y:r,width:s,height:o}=((e,t)=>{const{x:i,y:n,width:r,height:s}=e.getBoundingClientRect(),{x:o,y:a,width:c,height:l}=t.getBoundingClientRect();return{x:o-i,y:a-n,width:c,height:l}})(this.$viewport.get(0),this.$trackLabel.get(0));this.renderTrackLabelSVG(e,t+n,i+r,s,o)}}renderTrackLabelSVG(e,t,i,n,r){const o=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_track_label_guid_${s()}`;e.saveWithTranslationAndClipRect(o,t,i,n,r,0),e.fillStyle="white",e.fillRect(0,0,n,r),e.font="12px Arial",e.fillStyle="rgb(68, 68, 68)";const{width:a}=e.measureText(this.$trackLabel.text()),c=.25*(n-a),l=.7*(r-12);e.fillText(this.$trackLabel.text(),c,r-l),e.strokeStyle="rgb(68, 68, 68)",e.strokeRect(0,0,n,r),e.restore()}get cachedFeatures(){return this.featureCache?this.featureCache.features:[]}clearCache(){this.featureCache=void 0,this.canvas&&(this.canvas._data=void 0)}async getFeatures(e,t,i,n,r){if(this.featureCache&&this.featureCache.containsRange(t,i,n,r,this.windowFunction))return this.featureCache.features;if("function"==typeof e.getFeatures){const s=await e.getFeatures(t,i,n,r,this);return this.checkContentHeight(s),s}}needsRepaint(){if(!this.canvas)return!0;const e=this.canvas._data;return!e||this.referenceFrame.start<e.bpStart||this.referenceFrame.end>e.bpEnd||this.referenceFrame.chr!==e.referenceFrame.chr||this.referenceFrame.bpPerPixel!=e.bpPerPixel||this.windowFunction!=e.windowFunction}needsReload(){if(!this.featureCache)return!0;const{chr:e,bpPerPixel:t}=this.referenceFrame,{bpStart:i,bpEnd:n}=this.repaintDimensions();return!this.featureCache.containsRange(e,i,n,t,this.windowFunction)}createZoomInNotice(e){const t=Bt("<div>",{class:"igv-zoom-in-notice-container"});e.append(t);const i=Bt("<div>");return t.append(i),i.text("Zoom in to see features"),t.hide(),t}viewIsReady(){return this.browser&&this.browser.referenceFrameList&&this.referenceFrame}addMouseHandlers(){const e=this.$viewport.get(0);this.addViewportContextMenuHandler(e);const t=e=>{this.enableClick=!0,this.browser.mouseDownOnViewport(e,this),r(e)};e.addEventListener("mousedown",t),e.addEventListener("touchstart",t);const i=e=>{this.browser.dragObject||this.browser.isScrolling?(this.browser.cancelTrackPan(),this.enableClick=!1):(this.browser.cancelTrackPan(),this.browser.endTrackDrag())};e.addEventListener("mouseup",i),e.addEventListener("touchend",i),"function"==typeof this.trackView.track.hoverText&&e.addEventListener("mousemove",(e=>{if(0===e.buttons&&Date.now()-vu>100){vu=Date.now();const t=this.createClickState(e);if(t){const e=this.trackView.track.hoverText(t);e?this.$viewport[0].setAttribute("title",e):this.$viewport[0].removeAttribute("title")}}})),this.addViewportClickHandler(this.$viewport.get(0)),this.trackView.track.name&&"sequence"!==this.trackView.track.config.type&&this.addTrackLabelClickHandler(this.$trackLabel.get(0))}addViewportContextMenuHandler(e){e.addEventListener("contextmenu",(e=>{if(this.browser.dragObject)return!1;const t=this.createClickState(e);if(void 0===t)return!1;e.preventDefault();let i=[];if("function"==typeof this.trackView.track.contextMenuItemList){const e=this.trackView.track.contextMenuItemList(t);e&&(i=e)}i.length>0&&i.push({label:Bt("<HR>")}),i.push({label:"Save Image (PNG)",click:()=>this.savePNG()}),i.push({label:"Save Image (SVG)",click:()=>this.saveSVG()}),this.browser.menuPopup.presentTrackContextMenu(e,i)}))}addViewportClickHandler(e){e.addEventListener("click",(e=>{if(this.enableClick&&this.canvas){if(3===e.which||e.ctrlKey)return;if(this.browser.dragObject||this.browser.isScrolling)return;e.preventDefault();const t=a(e,this.$viewport.get(0)).x,i=a(e,this.canvas).x,n=this.referenceFrame;Math.floor(n.start+n.toBP(i));const r=Date.now();if(r-Fu<this.browser.constants.doubleClickDelay){wu&&(window.clearTimeout(wu),wu=void 0);const e=Math.round(n.start+n.toBP(t));let i;if("all"===this.referenceFrame.chr.toLowerCase()){const t=this.browser.genome.getChromosomeCoordinate(e).chr;if(1===this.browser.referenceFrameList.length)i=t;else{const e=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));e[this.browser.referenceFrameList.indexOf(this.referenceFrame)]=t,i=e.join(" ")}this.browser.search(i)}else this.browser.zoomWithScaleFactor(.5,e,this.referenceFrame)}else"function"==typeof this.trackView.track.popupData&&(wu=setTimeout((()=>{const t=this.getPopupContent(e);if(t)if(!1===e.shiftKey){if(bu&&bu.dispose(),yu.length>0){for(const e of yu)e.dispose();yu.length=0}bu=new ic(this.$viewport.get(0).parentElement,!0,void 0,(()=>{bu.dispose()})),bu.presentContentWithEvent(e,t)}else{let i=new ic(this.$viewport.get(0).parentElement,!0,void 0,(()=>{const e=yu.indexOf(i);yu.splice(e,1),i.dispose()}));yu.push(i),i.presentContentWithEvent(e,t)}window.clearTimeout(wu),wu=void 0}),this.browser.constants.doubleClickDelay));Fu=r}}))}addTrackLabelClickHandler(e){e.addEventListener("click",(e=>{e.stopPropagation();const{track:t}=this.trackView;let i;"function"==typeof t.description?i=t.description():t.description&&(i=`<div>${t.description}</div>`),i&&(void 0===this.popover&&(this.popover=new ic(this.browser.columnContainer,!0,t.name||"",void 0)),this.popover.presentContentWithEvent(e,i))}))}createClickState(e){if(!this.canvas)return;const t=this.referenceFrame,i=a(e,this.$viewport.get(0)),n=a(e,this.canvas),r=t.start+t.toBP(i.x);return{event:e,viewport:this,referenceFrame:t,genomicLocation:r,y:i.y-this.contentTop,canvasX:n.x,canvasY:n.y}}getPopupContent(e){const t=this.createClickState(e);if(void 0===t)return;let i=this.trackView.track;const n=i.popupData(t),r=this.browser.fireEvent("trackclick",[i,n]);let s;return void 0===r||!0===r?n&&n.length>0&&(s=n.map((e=>{if(e.name){const t=`<span>${e.name}</span>&nbsp&nbsp&nbsp${e.value}`;return`<div title="${e.value}">${t}</div>`}return"<hr>"===e?e:e.html?e.html:`<div title="${e}">${e}</div>`})).join("")):"string"==typeof r&&(s=r),s}dispose(){this.popover&&this.popover.dispose(),super.dispose()}}class Cu{constructor(e,t,i,n,r,s,o,a){this.chr=e,this.bpStart=t,this.bpEnd=i,this.bpPerPixel=n,this.features=r,this.roiFeatures=s,this.multiresolution=o,this.windowFunction=a}containsRange(e,t,i,n,r){if(r&&r!==this.windowFunction)return!1;const s=this.multiresolution?this.bpPerPixel/n:1;return t>=this.bpStart&&i<=this.bpEnd&&e===this.chr&&s>.5&&s<2}overlapsRange(e,t,i){return this.chr===e&&i>=this.bpStart&&t<=this.bpEnd}}const _u=function(e,t){const{r:i,g:n,b:r}=no[e];return`rgba(${i},${n},${r},${t})`}("nickel",2/16),xu=_u;class ku{constructor(e,t){if(this.url=e.url,e.name&&(this.name=e.name),this.isUserDefined=e.isUserDefined,e.featureSource)this.featureSource=e.featureSource;else if(e.features)this.featureSource=new Su(e.features,t);else{if(!e.format)throw Error("ROI configuration must define either features or file format");this.featureSource=Ad(e,t)}!0===this.isUserDefined?(this.color=e.color||xu,this.headerColor="rgba(155,185,129)"):(this.color=e.color||_u,this.headerColor="rgb(190,190,190)"),this.isVisible=void 0===e.isVisible||e.isVisible}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}async getAllFeatures(){return"function"==typeof this.featureSource.getAllFeatures?await this.featureSource.getAllFeatures():{}}addFeature(e){this.featureSource.addFeature(e)}removeFeature(e){this.featureSource.removeFeature(e)}toJSON(){if(this.url)return{name:this.name,color:this.color,url:this.url,isUserDefined:this.isUserDefined,isVisible:this.isVisible};{const e=this.featureSource.getAllFeatures(),t=[];for(let i of Object.keys(e))for(let n of e[i])t.push(n);return{name:this.name,color:this.color,features:t,isUserDefined:this.isUserDefined,isVisible:this.isVisible}}}dispose(){for(let e of Object.keys(this))this[e]=void 0}}function Iu(e,t,i,n){let r=Math.round((e-i)/n);let s=Math.round((t-i)/n)-r;return s<3&&(s=3,r-=1),{x:r,width:s}}class Su{constructor(e,t){this.featureMap={},this.genome=t;for(let i of e){const e=t?t.getChromosomeName(i.chr):i.chr;let n=this.featureMap[e];n||(n=[],this.featureMap[e]=n),n.push(i)}for(let e of Object.keys(this.featureMap))this.featureMap[e].sort(((e,t)=>e.start-t.start))}async getFeatures({chr:e,start:t,end:i}){if("all"===e.toLowerCase())return Ll(this.featureMap,this.genome);{const n=this.featureMap[e];return n?n.filter((e=>e.end>t&&e.start<i)):[]}}getAllFeatures(){return this.featureMap}supportsWholeGenome(){return!0}addFeature(e){let t=this.featureMap[e.chr];t||(t=[],this.featureMap[e.chr]=t),t.push(e),t.sort(((e,t)=>e.start-t.start))}removeFeature({chr:e,start:t,end:i}){if(this.featureMap[e]){const n=`${e}-${t}-${i}`;this.featureMap[e]=this.featureMap[e].filter((e=>n!==`${e.chr}-${e.start}-${e.end}`))}}}class Eu{constructor(t,i,n,r){this.rulerViewport=t,this.rulerSweeper=e({class:"igv-ruler-sweeper"}),i.appendChild(this.rulerSweeper),this.browser=n,this.referenceFrame=r,this.isMouseHandlers=void 0,this.addBrowserObserver()}addBrowserObserver(){this.boundObserverHandler=(()=>{this.referenceFrame&&(mu.isWholeGenomeView(this.referenceFrame.chr)?this.removeMouseHandlers():this.addMouseHandlers())}).bind(this),this.browser.on("locuschange",this.boundObserverHandler)}removeBrowserObserver(){this.browser.off("locuschange",this.boundObserverHandler)}addMouseHandlers(){if(!0===this.isMouseHandlers)return;let e,t,i,n,r,s;this.boundContentMouseDownHandler=function(s){e=!0,t=!0;const{x:o}=a(s,this.rulerViewport.contentDiv);n=i=o,r=1,this.rulerSweeper.style.display="block",this.rulerSweeper.style.backgroundColor=!0===s.shiftKey?xu:"rgba(68, 134, 247, 0.25)",this.rulerSweeper.style.left=`${n}px`,this.rulerSweeper.style.width=`${r}px`}.bind(this),this.rulerViewport.contentDiv.addEventListener("mousedown",this.boundContentMouseDownHandler),this.boundDocumentMouseMoveHandler=function(o){let c;if(e&&t){const{x:e}=a(o,this.rulerViewport.contentDiv);c=Math.max(Math.min(e,this.rulerViewport.contentDiv.clientWidth),0),s=c-i,r=Math.abs(s),this.rulerSweeper.style.width=`${r}px`,s<0&&(n=i+s,this.rulerSweeper.style.left=`${n}px`)}}.bind(this),document.addEventListener("mousemove",this.boundDocumentMouseMoveHandler),this.boundDocumentMouseUpHandler=function(i){let s;if(!0===e&&!0===t&&(e=t=void 0,this.rulerSweeper.style.display="none",r>1)){s={start:Math.floor(this.referenceFrame.calculateEnd(n)),end:Math.floor(this.referenceFrame.calculateEnd(n+r))};!0===i.shiftKey?this.browser.roiManager.updateUserDefinedROISet(Object.assign({chr:this.referenceFrame.chr},s)):(Va(this.browser.genome.getChromosome(this.referenceFrame.chr).bpLength,s,this.browser.minimumBases()),function(e,t,i){e.start=Math.round(t.start),e.end=Math.round(t.end),e.bpPerPixel=(e.end-e.start)/i}(this.referenceFrame,s,this.rulerViewport.contentDiv.clientWidth),this.browser.updateViews(this.referenceFrame))}}.bind(this),document.addEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!0}removeMouseHandlers(){this.rulerViewport.contentDiv.removeEventListener("mousedown",this.boundContentMouseDownHandler),document.removeEventListener("mousemove",this.boundDocumentMouseMoveHandler),document.removeEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!1}dispose(){this.removeBrowserObserver(),this.removeMouseHandlers(),this.rulerSweeper.remove()}}function Nu(e){if(Bu[e])return Bu[e];if(Bu["chr"+e]){const t=Bu["chr"+e];return Bu[e]=t,t}{const t=_s.randomRGB(0,255);return Bu[e]=t,t}}const Bu={chrX:"rgb(204, 153, 0)",chrY:"rgb(153, 204, 0)",chrUn:"rgb(50, 50, 50)",chr1:"rgb(80, 80, 255)",chrI:"rgb(139, 155, 187)",chr2:"rgb(206, 61, 50)",chrII:"rgb(206, 61, 50)",chr2a:"rgb(216, 71, 60)",chr2b:"rgb(226, 81, 70)",chr3:"rgb(116, 155, 88)",chrIII:"rgb(116, 155, 88)",chr4:"rgb(240, 230, 133)",chrIV:"rgb(240, 230, 133)",chr5:"rgb(70, 105, 131)",chr6:"rgb(186, 99, 56)",chr7:"rgb(93, 177, 221)",chr8:"rgb(128, 34, 104)",chr9:"rgb(107, 215, 107)",chr10:"rgb(213, 149, 167)",chr11:"rgb(146, 72, 34)",chr12:"rgb(131, 123, 141)",chr13:"rgb(199, 81, 39)",chr14:"rgb(213, 143, 92)",chr15:"rgb(122, 101, 165)",chr16:"rgb(228, 175, 105)",chr17:"rgb(59, 27, 83)",chr18:"rgb(205, 222, 183)",chr19:"rgb(97, 42, 121)",chr20:"rgb(174, 31, 99)",chr21:"rgb(231, 199, 111)",chr22:"rgb(90, 101, 94)",chr23:"rgb(204, 153, 0)",chr24:"rgb(153, 204, 0)",chr25:"rgb(51, 204, 0)",chr26:"rgb(0, 204, 51)",chr27:"rgb(0, 204, 153)",chr28:"rgb(0, 153, 204)",chr29:"rgb(10, 71, 255)",chr30:"rgb(71, 117, 255)",chr31:"rgb(255, 194, 10)",chr32:"rgb(255, 209, 71)",chr33:"rgb(153, 0, 51)",chr34:"rgb(153, 26, 0)",chr35:"rgb(153, 102, 0)",chr36:"rgb(128, 153, 0)",chr37:"rgb(51, 153, 0)",chr38:"rgb(0, 153, 26)",chr39:"rgb(0, 153, 102)",chr40:"rgb(0, 128, 153)",chr41:"rgb(0, 51, 153)",chr42:"rgb(26, 0, 153)",chr43:"rgb(102, 0, 153)",chr44:"rgb(153, 0, 128)",chr45:"rgb(214, 0, 71)",chr46:"rgb(255, 20, 99)",chr47:"rgb(0, 214, 143)",chr48:"rgb(20, 255, 177)"};let Mu,Ru;class Du extends Au{constructor(e,t,i,n){super(e,t,i,n)}get contentDiv(){return this.$viewport.get(0)}initializationHelper(){let e;this.$multiLocusCloseButton=Bt("<div>",{class:"igv-multi-locus-close-button"}),this.$viewport.append(this.$multiLocusCloseButton),this.$multiLocusCloseButton.get(0).appendChild(l("times-circle")),this.$multiLocusCloseButton.click((()=>{this.browser.removeMultiLocusPanel(this.referenceFrame)})),this.$rulerLabel=Bt("<div>",{class:"igv-multi-locus-ruler-label"}),this.$viewport.append(this.$rulerLabel),e=document.createElement("div"),this.$rulerLabel.append(Bt(e)),this.$rulerLabel.get(0).addEventListener("click",(async e=>{e.stopPropagation(),await this.browser.gotoMultilocusPanel(this.referenceFrame)})),this.$tooltip=Bt("<div>",{class:"igv-ruler-tooltip"}),this.$tooltip.height(this.$viewport.height()),this.$viewport.append(this.$tooltip),this.$tooltipContent=Bt("<div>"),this.$tooltip.append(this.$tooltipContent),this.rulerSweeper=new Eu(this,this.$viewport.get(0).parentElement,this.browser,this.referenceFrame),this.attachMouseHandlers(mu.isWholeGenomeView(this.referenceFrame.chr)),this.$tooltip.hide(),this.dismissLocusLabel()}presentLocusLabel(e){this.$multiLocusCloseButton.show(),this.$rulerLabel.show(),this.$rulerLabel.get(0).style.backgroundColor=Nu(this.referenceFrame.chr);const t=this.$rulerLabel.get(0).querySelector("div"),{width:i}=this.$rulerLabel.get(0).getBoundingClientRect();t.innerHTML=`${this.referenceFrame.getMultiLocusLabel(e)}`;const{width:n}=t.getBoundingClientRect();n/i>.5&&(t.innerHTML=`${this.referenceFrame.getMultiLocusLabelBPLengthOnly(e)}`)}dismissLocusLabel(){this.$rulerLabel.hide(),this.$multiLocusCloseButton.hide()}attachMouseHandlers(e){if(this.namespace=`.ruler_track_viewport_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}`,this.$viewport.off(this.namespace),!0===e){const e=this.browser.referenceFrameList.indexOf(this.referenceFrame),t=`click${this.namespace}`;this.$viewport.on(t,(t=>{const{x:i}=a(t,this.$viewport.get(0)),n=Math.round(this.referenceFrame.start+this.referenceFrame.toBP(i));let r;const{chr:s}=this.browser.genome.getChromosomeCoordinate(n);if(1===this.browser.referenceFrameList.length)r=s;else{let t=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));t[e]=s,r=t.join(" ")}this.browser.search(r)})),this.$viewport.get(0).style.cursor="pointer"}else this.$viewport.get(0).style.cursor="default"}mouseMove(e){if(!0===this.browser.doShowCursorGuide){void 0===Ru?(Ru=this,this.$tooltip.show()):Ru.guid!==this.guid?(Ru.$tooltip&&Ru.$tooltip.hide(),this.$tooltip.show(),Ru=this):this.$tooltip.show();if(this.browser.isMultiLocusWholeGenomeView()||mu.isWholeGenomeView(this.referenceFrame.chr))return void this.$tooltip.hide();const{x:t}=a(e,this.$viewport.get(0)),{start:i,end:n,bpPerPixel:r}=this.referenceFrame,s=Math.round(.5+i+Math.max(0,t)*r);this.$tooltipContent.text(Rt(s));const{width:o}=this.$tooltipContent.get(0).getBoundingClientRect(),{width:c}=this.$viewport.get(0).getBoundingClientRect();return this.$tooltip.css({left:`${ys.clamp(t,0,c-o)}px`}),clearTimeout(Mu),Mu=setTimeout((()=>{this.$tooltip&&this.$tooltip.hide()}),1e4),{start:i,bp:s,end:n}}}startSpinner(){}stopSpinner(){}dispose(){this.rulerSweeper.dispose(),super.dispose()}}class Tu extends Au{featureCache=new Lu;constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.canvas=document.createElement("canvas"),this.canvas.className="igv-ideogram-canvas",this.$viewport.append(Bt(this.canvas)),this.ideogram_ctx=this.canvas.getContext("2d"),this.addMouseHandlers()}async getFeatures(e,t,i,n){return this.featureCache.containsRange(e)?this.featureCache.get(e):this.loadFeatures()}async loadFeatures(){const e=this.referenceFrame.chr,t=await this.referenceFrame.genome.getCytobands(e);return this.featureCache.set(e,t),t}repaint(){if(void 0===this.featureCache)return;const{width:e,height:t}=this.$viewport[0].getBoundingClientRect();xo.configureHighDPICanvas(this.ideogram_ctx,e,t);const i=this.referenceFrame.chr,n=this.featureCache.get(i),r={context:this.ideogram_ctx,pixelWidth:e,pixelHeight:t,referenceFrame:this.referenceFrame,features:n};this.trackView.track.draw(r)}addMouseHandlers(){this.addViewportClickHandler(this.$viewport.get(0))}addViewportClickHandler(e){this.boundClickHandler=function(e){const{xNormalized:t,width:i}=a(e,this.ideogram_ctx.canvas),{bpLength:n}=this.browser.genome.getChromosome(this.referenceFrame.chr),r=this.referenceFrame.bpPerPixel*i/n;let s=t;s-r/2<0&&(s=r/2);s+r/2>1&&(s=1-r/2);const o=Math.round((s-r/2)*n),c=Math.round((s+r/2)*n);this.referenceFrame.start=o,this.referenceFrame.end=c,this.referenceFrame.bpPerPixel=(c-o)/i,this.browser.updateViews(this.referenceFrame,this.browser.trackViews,!0)}.bind(this),e.addEventListener("click",this.boundClickHandler)}setWidth(e){this.$viewport.width(e)}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){const{width:r,height:o}=this.$viewport.get(0).getBoundingClientRect(),a=`ideogram_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${s()}`,c=t,l=i+this.contentTop,h=-this.contentTop;e.saveWithTranslationAndClipRect(a,c,l,r,o,h),this.trackView.track.draw({context:e,pixelWidth:r,pixelHeight:o,referenceFrame:this.referenceFrame,features:this.featureCache.get(this.referenceFrame.chr)}),e.restore()}startSpinner(){}stopSpinner(){}}class Lu{features=new Map;containsRange(e){return this.features.has(e)}set(e,t){this.features.set(e,t)}get(e){return this.features.get(e)}}function zu(e,t,i,n){if("ruler"===e.track.type)return new Du(e,t,i,n);if("ideogram"===e.track.id)return new Tu(e,t,i,n);{const r=new Au(e,t,i,n);return i.viewport=r,r}}const Hu=["rgb(255, 0, 0)","rgb(0, 255, 0)","rgb(0, 0, 255)","rgb(255, 0, 255)","rgb(0, 255, 255)","rgb(128, 0, 128)","rgb(255, 165, 0)","rgb(255, 105, 180)","rgb(255, 127, 80)","rgb(220, 20, 60)","rgb(255, 99, 71)","rgb(173, 216, 230)","rgb(144, 238, 144)","rgb(224, 255, 255)","rgb(250, 250, 210)","rgb(152, 251, 152)","rgb(70, 130, 180)","rgb(102, 205, 170)"].map((e=>{const[t,i,n]=e.split(","),[r,s]=t.split("("),[o,a]=n.split(")");return[s,i,o]})),Pu=ro("magnesium"),Ou=["#sampleTable","#sampleMapping","#colors"];class Uu{static emptySpaceReplacement="|";sampleDictionary={};attributeNames=[];sampleMappingDictionary={};colorDictionary={};attributeRangeLUT={};constructor(e){e.tracks.some((e=>"function"==typeof e.getSamples)).length>0&&e.sampleInfoControl.setButtonVisibility(!0),this.initialize()}initialize(){this.sampleInfoFiles=[],this.attributeNames=[],this.sampleDictionary={},this.sampleMappingDictionary={},this.colorDictionary={},this.attributeRangeLUT={},this.initialized=!1}get attributeCount(){return this.attributeNames?this.attributeNames.length:0}isInitialized(){return this.initialized}hasAttributes(){return this.attributeCount>0}getAttributes(e){const t=0===Object.keys(this.sampleMappingDictionary)?e:this.sampleMappingDictionary[e]||e;return this.sampleDictionary[t]}async loadSampleInfoFile(e){try{const t=await Qs.loadString(e);this.#g(t),this.sampleInfoFiles.push(e)}catch(e){console.error(e.message)}}#g(e){const t=function(e){const t={},i=e.split(/\r?\n|\r/).map((e=>e.trim())).filter((e=>""!==e));let n;Ou.includes(i[0])||(n="#sampleTable",t[n]=[]);for(const e of i)Ou.includes(e)?(n=e,t[n]=[]):n&&!1===e.startsWith("#")&&t[n].push(e);return t}(e);for(const[e,i]of Object.entries(t))switch(e){case"#sampleTable":this.#m(i);break;case"#sampleMapping":this.#w(i);break;case"#colors":this.#b(i)}this.initialized=!0}getAttributeColor(e,t){let i;if("-"===t)i=ro("snow");else if("string"==typeof t&&this.colorDictionary[t])i=this.colorDictionary[t]();else if(this.colorDictionary[e])i=this.colorDictionary[e](t);else if("string"==typeof t)i="NA"===t?Pu:function(e){let t=0;for(let i=0;i<e.length;i++)t=e.charCodeAt(i)+((t<<5)-t);let i=[];for(let e=0;e<3;e++){const n=t>>8*e&255;i.push(n)}return`rgb(${i.join(", ")})`}(t);else{const[n,r]=this.attributeRangeLUT[e],s=.2,o=Math.max((t-n)/(r-n),s),[a,c,l]=Hu[Object.keys(this.attributeRangeLUT).indexOf(e)];i=`rgba(${a},${c},${l},${o})`}return i}getSortedSampleKeysByAttribute(e,t,i){i=i||1;const n=e.filter((e=>"number"==typeof this.getAttributes(e)[t])),r=e.filter((e=>"string"==typeof this.getAttributes(e)[t])),s=(e,n)=>{const r=this.getAttributes(e)[t],s=this.getAttributes(n)[t];return"string"==typeof r&&"string"==typeof s?i*r.localeCompare(s):"number"==typeof r&&"number"==typeof s?i*(r-s):void 0};return n.sort(s),r.sort(s),-1===i?[...n,...r]:[...r,...n]}toJSON(){const e=[];for(const t of this.sampleInfoFiles){const i={url:t},n=Hl.localFileInspection(i);e.push(n)}return e}#m(e){const t=e.shift().split("\t").filter((e=>e.length>0));t.shift();const i=t.map((e=>e.split(" ").join(Uu.emptySpaceReplacement))),n=e.filter((e=>e.length>0));let r;for(const e of n){const t=e.split("\t"),n=t.shift();void 0===r&&(r={}),r[n]={};for(let e=0;e<t.length;e++){const s={};""===t[e]?s[i[e]]="-":s[i[e]]=t[e],Object.assign(r[n],s)}}for(const[e,t]of Object.entries(r))r[e]=Qu(t);const s=function(e,t){const i={};for(const n of Object.values(t))for(const t of e){let e=n[t];void 0===i[t]&&(i[t]=[]),i[t].push(e)}const n=e=>"number"==typeof e,r=e=>"string"==typeof e;for(const e of Object.keys(i)){const t=i[e],s=new Set(t),o=Array.from(s);if(!0===o.some(r)&&!0===o.some(n)?i[e]=o.filter((e=>!r(e))):i[e]=o,!i[e].some(r)){const t=i[e].slice();i[e]=[Math.min(...t),Math.max(...t)]}}return i}(i,r);qu(this.attributeRangeLUT,s);const o=new Set(this.attributeNames);for(const e of i)o.has(e)||this.attributeNames.push(e);qu(this.sampleDictionary,r)}#w(e){for(const t of e){const[e,i]=t.split("\t");this.sampleMappingDictionary[e]=i}}#b(e){const t=(e,t,i)=>{let n;switch(t){case 0:n=e.split(" ").join(Uu.emptySpaceReplacement);break;case 1:n=e.includes(":")?e.split(":").map((e=>parseFloat(e))):e;break;case 2:case 3:n=`rgb(${e})`}return n},i=e.map((e=>e.split("\t").map(t))),n=i.filter((e=>3===e.length&&!e.includes("*"))).filter((([e,t,i])=>!Array.isArray(t))),r={};for(const e of n){const[t,i,n]=e;void 0===r[t]&&(r[t]={}),r[t][i.toUpperCase()]=n}for(const[e,t]of Object.entries(r)){const i=Object.assign({},t);this.colorDictionary[e]=e=>{const t=e.toUpperCase();return i[t]||ro("snow")}}const s=i.filter((e=>Array.isArray(e[1])));for(const e of s){const[t,i]=e[1],n=e[0];if(3===e.length){const[r,s,o]=uo(e[2]);this.colorDictionary[n]=e=>{e=ys.clamp(e,t,i);return lo(r,s,o,(e-t)/(i-t))}}else if(4===e.length){const[t,i]=e[1],[n,r,s,o]=e;this.colorDictionary[n]=e=>{e=ys.clamp(e,t,i);return fo(s,o,(e-t)/(i-t))}}}const o=i.filter((e=>3===e.length&&e.includes("*")));for(const e of o)if("*"===e[1]){const[t,i,n]=e;this.colorDictionary[t]=e=>{if("NA"===e)return Pu;{const[i,r]=this.attributeRangeLUT[t],s=(e-i)/(r-i),[o,a,c]=uo(n);return lo(o,a,c,s)}}}else if("*"===e[0]){const[t,i,n]=e;this.colorDictionary[i]=()=>n}}}function qu(e,t){for(const[i,n]of Object.entries(t))i in e&&e[i]===n||(e[i]=n)}function Qu(e){const t=Object.assign({},e);for(const[e,i]of Object.entries(t))"string"!=typeof i||isNaN(i)||(t[e]=Number(i));return t}const Vu=16,ju=Rt;class Wu{constructor(e){this.browser=e,this.height=40,this.name="",this.id="ruler",this.disableButtons=!0,this.ignoreTrackMenu=!0,this.order=.01*Number.MIN_SAFE_INTEGER,this.removable=!1,this.type="ruler"}async getFeatures(e,t,i){return[]}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpPerPixel:r,bpStart:s}){mu.isWholeGenomeView(t.chr)?this.drawWholeGenome({context:e,pixelWidth:i,pixelHeight:n,bpPerPixel:r}):this.doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:s})}drawWholeGenome({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n}){e.save(),xo.fillRect(e,0,0,t,i,{fillStyle:"white"});for(let t of this.browser.genome.wgChromosomeNames){let r=this.browser.genome.getCumulativeOffset(t),s=this.browser.genome.getChromosome(t).bpLength,o=Math.round(r/n),a=Math.round(s/n);this.renderChromosomeRect(e,o,0,a,i,t)}e.restore()}doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:r}){e.clearRect(0,0,i,n);const s=function(e,t){if(e<10)return new Gu(1,"bp",1);const i=Math.floor(Math.log10(e));let n="bp",r=1;i>9?(n="gb",r=1e9):i>6?(n="mb",r=1e6):i>3&&(n="kb",r=1e3);const s=Math.pow(10,i-1),o=e/s,a=75,c=Math.pow(10,i-1),l=Math.pow(10,i)/2;return new Gu(o<a&&!0!==t?c:l,n,r)}(Math.floor(t.toBP(i)),e.isSVG);let o=Math.floor(r/s.majorTick)-1;const{tickDelta:a,labelLength:c}=function(e,t,i,n,r){const s=l(t,c(1+n,r),i)-l(t,c(n,r),i),o=`${Rt(Math.floor(c(n,r)/r.unitMultiplier))} ${r.majorUnit}`,a=Math.floor(e.measureText(o).width);return{tickDelta:s,labelLength:a};function c(e,t){return Math.floor(e*t.majorTick)}function l(e,t,i){return Math.round(e.toPixels(t-1-i+.5))}}(e,t,r,o,s);let l,h;this.browser.referenceFrameList.indexOf(t);let d=a;const u=.25*c;do{h=Math.floor(o*s.majorTick);const i=`${Rt(Math.floor(h/s.unitMultiplier))} ${s.majorUnit}`;l=Math.round(t.toPixels(h-1-r+.5));const n=Math.round(l-e.measureText(i).width/2);n>0&&u+c<=d&&(xo.fillText(e,i,n,this.height-8),d=0),l>0&&xo.strokeLine(e,l,this.height-6,l,this.height-2),h=Math.floor((1+o)*s.majorTick);let f=l+(Math.round(t.toPixels(h-1-r+.5))-l)/2;f>0&&xo.strokeLine(e,f,this.height-6,f,this.height-2),++o,d+=a}while(l<i);xo.strokeLine(e,0,this.height-2,i,this.height-2)}renderChromosomeRect(e,t,i,n,r,s){e.textAlign="center",e.textBaseline="middle",e.font="12px sans-serif",xo.strokeLine(e,t+n,i,t+n,i+r,{strokeStyle:_s.greyScale(191)});const o=(s=this.browser.genome.getChromosomeDisplayName(s)).startsWith("chr")?s.substring(3):s;n>e.measureText(o).width&&xo.fillText(e,o,t+n/2,i+r/2,{fillStyle:_s.greyScale(68)})}get supportsWholeGenome(){return!0}dispose(){}}class Gu{constructor(e,t,i){this.majorTick=e,this.minorTick=e/10,this.majorUnit=t,this.unitMultiplier=i}description(e){console.log((e||"")+" tick "+ju(this.majorTick)+" label width "+ju(this.labelWidthBP)+" multiplier "+this.unitMultiplier)}}class $u{constructor(t,i,n){this.guid=s(),this.trackView=t,this.browser=t.browser,this.viewport=e({class:"igv-viewport"}),i.appendChild(this.viewport),this.viewport.style.height=`${t.track.height}px`,null===this.viewport.previousElementSibling&&(this.viewport.style.zIndex=16,this.viewport.style.overflow="visible"),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.ctx.font="10px verdana",this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(n),this.addMouseHandlers()}resizeCanvas(){const e=window.devicePixelRatio,t=this.browser.getSampleInfoViewportWidth();let i;if(this.browser.trackViews.length>1&&null===this.viewport.previousElementSibling){const[e,t]=[this.browser.ideogramTrackView.track,this.browser.rulerTrackView.track];i=e.height+t.height}else i=this.viewport.clientHeight;if(this.canvas.width!==t*e||this.canvas.height!==i*e){const n=this.canvas;n.width=t*e,n.height=i*e,n.style.width=`${t}px`,n.style.height=`${i}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(e,e),null===this.viewport.previousElementSibling&&xo.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:ro("snow")})}}setTop(e){"function"==typeof this.trackView.track.getSamples&&(this.contentTop=e,this.repaint())}setWidth(e){this.viewport.innerWidth=e,this.resizeCanvas()}setHeight(e){const t=this.browser.getSampleInfoViewportWidth();this.viewport.style.width=`${t}px`,this.viewport.style.height=`${e}px`;const i=window.devicePixelRatio;this.canvas.width=t*i,this.canvas.height=e*i,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(i,i),null===this.viewport.previousElementSibling&&xo.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:ro("snow")})}async repaint(){if(this.resizeCanvas(),"function"==typeof this.trackView.track.getSamples){const e=this.trackView.track.getSamples();e.names&&e.names.length>0&&this.draw({context:this.ctx,samples:e})}else null===this.viewport.previousElementSibling&&(this.browser.rulerTrackView&&this.browser.rulerTrackView.setTrackHeight(!0===this.browser.sampleInfoControl.showSampleInfo?this.calculateSampleInfoColumnHeight():40,!0),this.renderSampleInfoColumns(this.ctx))}calculateSampleInfoColumnHeight(){const e=this.browser.sampleInfo.attributeNames.map((e=>this.ctx.measureText(e).width));return 4+Math.min(Math.max(...e),128)}draw({context:e,samples:t}){if(e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillStyle=ro("snow"),e.fillRect(0,0,e.canvas.width,e.canvas.height),t&&t.names.length>0){const i=this.browser.sampleInfo.attributeNames,n=this.viewport.getBoundingClientRect().height;let r=1;const s=t.height;r=s-2*r<=1?0:1;let o=this.contentTop+t.yOffset;this.hitList={};for(const a of t.names){if(o>n)break;if(o+s>0){const t=this.browser.sampleInfo.getAttributes(a);if(t){const n=Object.entries(t);for(const t of n){const[n,a]=t;e.fillStyle=this.browser.sampleInfo.getAttributeColor(n,a);const c=8+i.indexOf(n)*Vu,l=o+r,h=s-2*r;e.fillRect(c,l,15,h);const d=`${Math.floor(c)}#${Math.floor(l)}#16#${Math.ceil(h)}`;this.hitList[d]=`${n}#${a}`}}}o+=s}}}renderSampleInfoColumns(e){const t=(e,t,i,n,r,s)=>{e.save(),e.font="10px verdana",e.translate(i+r/2,n+s),e.rotate(-Math.PI/2),e.textAlign="left",e.fillStyle=ro("lead"),e.fillText(t,2,2),e.restore()},i=this.browser.sampleInfo.attributeNames;this.hitList={};for(let n=0;n<i.length;n++){const r=8+n*Vu,s=15,o=Math.round(e.canvas.height/window.devicePixelRatio);xo.fillRect(e,r,0,s,o,{fillStyle:ro("snow")}),t(e,i[n],r,0,s,o);const a=`${Math.floor(r)}#0#${s}#${Math.ceil(o)}`;this.hitList[a]=`${i[n]}`}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:o,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${s()}`;e.saveWithTranslationAndClipRect(c,t,i+r,o,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.addMouseMoveHandler()}addMouseMoveHandler(){this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList);if(null===this.viewport.previousElementSibling){const i=(t,i)=>{const{marginTop:n}=window.getComputedStyle(i),{x:r,y:s}=a(e,this.browser.columnContainer.querySelector(".igv-sample-info-column"));return{x:Math.floor(r),y:Math.floor(s-parseInt(n,10))}},n=this.browser.columnContainer.querySelector(".igv-sample-info-column"),{x:r,y:s}=i(n,this.viewport);n.setAttribute("title","");for(const[e,i]of t){const[t,o,a,c]=e.split("#").map((e=>parseInt(e,10)));if(!(r<t||r>t+a||s<o||s>o+c)){n.setAttribute("title",`${i}`);break}}}else{const{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){const[e,t]=r.split("#");this.viewport.setAttribute("title",`${e.split(Uu.emptySpaceReplacement).join(" ")}: ${"-"===t?"":t}`);break}}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}show(){this.viewport.style.display="block"}hide(){this.viewport.style.display="none"}}class Ku{constructor(t,i,n,r){this.guid=s(),this.trackView=t,this.browser=t.browser,this.viewport=e({class:"igv-viewport"}),i.appendChild(this.viewport),t.track.height&&(this.viewport.style.height=`${t.track.height}px`),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.trackScrollDelta=0,this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(r),this.addMouseHandlers()}checkCanvas(){const e=this.browser.sampleNameViewportWidth||0;this.ctx.canvas.width=e*window.devicePixelRatio,this.ctx.canvas.style.width=`${e}px`,this.ctx.canvas.height=this.viewport.clientHeight*window.devicePixelRatio,this.ctx.canvas.style.height=`${this.viewport.clientHeight}px`,this.ctx.scale(window.devicePixelRatio,window.devicePixelRatio)}setTop(e){if("function"==typeof this.trackView.track.getSamples){this.contentTop=e;const t=this.trackView.track.getSamples();this.repaint(t)}}setWidth(e){this.viewport.innerWidth=e,this.checkCanvas()}async repaint(e){if(e.names.length>0&&!0===this.browser.showSampleNames&&(this.checkCanvas(),this.draw({context:this.ctx,samples:e}),void 0===this.browser.sampleNameViewportWidth)){const t=e.names.map((e=>this.ctx.measureText(e).width));this.browser.sampleNameViewportWidth=Math.min(200,4+Math.ceil(Math.max(...t))),this.browser.layoutChange()}}draw({context:e,samples:t}){if(xo.fillRect(e,0,0,e.canvas.width,t.height,{fillStyle:ro("snow")}),t&&t.names.length>0){const i=this.viewport.getBoundingClientRect().height,n=t.height,r=n-2<=1?0:1;let s=this.contentTop+t.yOffset;this.hitList={};for(const o of t.names){if(s>i)break;if(s+n>0){const t=n-2*r;Yu(e,o,0+2,s+r,e.canvas.width,t)}s+=n}}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:o,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${s()}`;e.saveWithTranslationAndClipRect(c,t,i+r,o,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.boundClickHandler=function(e){e.preventDefault();const t={label:"Name Panel Width",value:this.browser.sampleNameViewportWidth,callback:e=>{this.browser.sampleNameViewportWidth=parseInt(e),this.browser.layoutChange()}};this.browser.inputDialog.present(t,e)}.bind(this),this.viewport.addEventListener("contextmenu",this.boundClickHandler),this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList),{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){this.viewport.setAttribute("title",`${r}`);break}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("contextmenu",this.boundClickHandler),this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}}function Yu(e,t,i,n,r,s){const o=Math.min(s,10);e.font=`${o}px sans-serif`,e.textAlign="start",e.fillStyle=ro("lead");const a=i,c=e.measureText(t),l=n+s/2+(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent)/2;e.fillText(t,a,l)}class Xu{constructor(t){this.popover=e({class:"igv-menu-popup"}),t.appendChild(this.popover),this.parent=t;const i=e({class:"igv-menu-popup-header"});this.popover.appendChild(i),u(i,(()=>this.popover.style.display="none")),this.popoverContent=e(),this.popover.appendChild(this.popoverContent),p(this.popover,i),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()})),this.popover.style.display="none"}presentMenuList(e,t){if(Zu(this.parent),t.length>0){this.popoverContent.innerHTML="";const i=this.parseMenuList(e,t);for(let e of i){e.init&&e.init();let t=e.object;0===i.indexOf(e)&&t.removeClass("igv-track-menu-border-top"),t.hasClass("igv-track-menu-border-top")||t.hasClass("igv-menu-popup-check-container")||t.is("div")&&t.addClass("igv-menu-popup-shim"),this.popoverContent.appendChild(t.get(0))}this.popover.style.display="flex";const{width:n}=this.popover.getBoundingClientRect();this.popover.style.left=-n+"px",this.popover.style.top="0px"}}parseMenuList(e,t){return t.map(((t,i)=>{let n;if(t.name?(n=Bt("<div>"),n.text(t.name)):t.object?n=t.object:"string"==typeof t.label?(n=Bt("<div>"),n.html(t.label)):"string"==typeof t&&(n=t.startsWith("<")?Bt(t):Bt("<div>"+t+"</div>")),0===i&&n.addClass("igv-track-menu-border-top"),t.click||t.dialog){const i=i=>{if(i.preventDefault(),i.stopPropagation(),t.click)if(e.track.selected){const n=e.browser.getSelectedTrackViews();if(!0===t.doAllMultiSelectedTracks)t.click.call(e.track,i);else if("removeTrack"===t.menuItemType){const r=()=>{e.browser.overlayTrackButton.setVisibility(!1);for(const{track:e}of n)t.click.call(e,i)},s={html:`Are you sure you want to delete ${n.length} tracks?`,callback:r};e.browser.menuUtils.dialog.present(s,i)}else for(const{track:e}of n)t.click.call(e,i)}else t.click.call(e.track,i);else t.dialog&&t.dialog.call(e.track,i);this.popover.style.display="none"};n.on("click",i),n.on("touchend",(e=>i(e))),n.on("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}return{object:n,init:t.init||void 0}}))}presentTrackContextMenu(t,n){this.popoverContent.innerHTML="";const r=function(t,n){return t.map((t=>{let r;if("string"==typeof t&&"<hr/>"===t)r=document.createElement("hr");else if("string"==typeof t)r=e({class:"context-menu"}),r.innerHTML=t;else if("Node"==typeof t)r=t;else{if("function"==typeof t.init&&t.init(),"checkbox"===t.type)r=Dl("Show all bases",t.value);else if("color"===t.type){const s=new Da(n.parentElement);s.configure({color:"grey"}),r=e({class:"context-menu"}),"string"==typeof t.label&&(r.innerHTML=t.label);const o=e=>{s.show(),i(n),e.preventDefault(),e.stopPropagation()};r.addEventListener("click",o),r.addEventListener("touchend",o),r.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}else r=e({class:"context-menu"}),"string"==typeof t.label&&(r.innerHTML=t.label);if(t.click&&"color"!==t.type){function a(e){t.click(),i(n),e.preventDefault(),e.stopPropagation()}r.addEventListener("click",a),r.addEventListener("touchend",a),r.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}}return{el:r,init:t.init}}))}(n,this.popover);for(let{el:e}of r)this.popoverContent.appendChild(e);!function(e,t){t.style.display="flex";const{x:i,y:n}=a(e,t.parentNode),{width:r}=t.getBoundingClientRect(),s=i+r,{width:o}=t.parentNode.getBoundingClientRect();t.style.left=`${s>o?i-(s-o):i}px`,t.style.top=`${n}px`}(t,this.popover)}hide(){this.popover.style.display="none"}dispose(){this.popoverContent.innerHTML="",this.popover.innerHTML="",Object.keys(this).forEach((function(e){this[e]=void 0}))}}const Zu=e=>{const t=e.querySelectorAll(".igv-menu-popup");for(const e of t)e.style.display="none"};class Ju{constructor(t,i,n,r,s,o,a){this.browser=t,this.button=e({class:"igv-navbar-text-button"}),i.appendChild(this.button),Array.isArray(n)?(this.textContent=n[0],this.title=n[1]):this.textContent=this.title=n,this.buttonLabel=r,this.imageDictionary={image:`url("data:image/svg+xml,${encodeURIComponent(s)}")`,imageHover:`url("data:image/svg+xml,${encodeURIComponent(o)}")`},this.responsiveKey="text",this.configureButton(this.textContent,this.title),this.setState(a),t.on("navbar-resize",(e=>{this.navbarResizeHandler(e)}))}navbarResizeHandler(e){const t="igv-navbar-icon-button"===e?"image":"text";t!==this.responsiveKey&&(this.responsiveKey=t,this.configureButton(this.textContent,this.title),this.setState(void 0))}configureButton(e,t){this.groupElement=void 0,this.button.title=t,this.button.innerHTML="",this.button.style.backgroundImage="none",this.button.classList.remove("igv-navbar-icon-button"),this.button.classList.remove("igv-navbar-text-button"),"text"===this.responsiveKey?this.configureTextButton(e):this.configureIconButton()}configureTextButton(e){this.button.classList.add("igv-navbar-text-button");const t=document.createElement("div");t.innerHTML=this.buttonLabel;const i=t.firstChild;this.button.appendChild(i),this.groupElement=i.querySelector("#igv-navbar-button-group");i.querySelector("#igv-navbar-button-label").textContent=e}configureIconButton(){this.button.classList.add("igv-navbar-icon-button")}setState(e){void 0!==e&&(this.doHover=e),"text"===this.responsiveKey?this.setTextButtonState(this.doHover):this.setIconButtonState(this.doHover)}setTextButtonState(e){this.groupElement.classList.remove(...this.groupElement.classList);const t=!0===e?"igv-navbar-text-button-svg-hover":"igv-navbar-text-button-svg-inactive";this.groupElement.classList.add(t)}setIconButtonState(e){this.button.style.backgroundImage=!0===e?this.imageDictionary.imageHover:this.imageDictionary.image}show(){this.button.style.display="flex"}hide(){this.button.style.display="none"}setVisibility(e){!0===e?this.show():this.hide()}static currentNavbarButtonClass(e){return e.$navigation.get(0).querySelector(".igv-navbar-text-button")?"igv-navbar-text-button":"igv-navbar-icon-button"}}const ef='<svg width="80px" height="18px" viewBox="0 0 80 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="79" height="17" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>';class tf extends Hl{static defaults={autoscale:void 0,alpha:.5,height:50};constructor(e,t,i){super(e,t),this.type="merged",this.paintAxis=cd,this.graphType=e.graphType,this.tracks=i||[]}async postInit(){if(this.config.tracks){for(let e of this.config.tracks){const t=await this.browser.createTrack(e);t?this.tracks.push(t):console.warn("Could not create track "+e),"function"==typeof t.postInit&&await t.postInit()}this.config.tracks.every((e=>void 0!==e.autoscale||void 0!==e.max))||(this.config.autoscale=void 0===this.config.max)}for(let e of this.tracks)e.isMergedTrack=!0;if(this.config.autoscale?this.autoscale=this.config.autoscale:void 0!==this.config.max&&this.setDataRange({min:this.config.min||0,max:this.config.max}),void 0!==this.config.flipAxis)for(let e of this.tracks)e.flipAxis=this.config.flipAxis;if(void 0!==this.config.logScale)for(let e of this.tracks)e.logScale=this.config.logScale;this.resolutionAware=this.tracks.some((e=>e.resolutionAware))}set flipAxis(e){this.config.flipAxis=e;for(let t of rf(this.tracks))t.flipAxis=e}get flipAxis(){return rf(this.tracks).every((e=>e.flipAxis))}set logScale(e){this.config.logScale=e;for(let t of rf(this.tracks))t.logScale=e}get logScale(){return rf(this.tracks).every((e=>e.logScale))}get height(){return this._height}set height(e){if(this.config.height=e,this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}set autoscale(e){if(this._autoscale=e,!1===e&&this.tracks)for(let e of this.tracks)e.autoscale=!1}get autoscale(){return this._autoscale}setDataRange({min:e,max:t}){this.autoscale=!1;for(const i of rf(this.tracks))i.dataRange={min:e,max:t},i.autoscale=!1,i.autoscaleGroup=!1}set dataRange({min:e,max:t}){for(const i of rf(this.tracks))i.dataRange={min:e,max:t}}get dataRange(){if(this.tracks){const e=rf(this.tracks);if(e.length>0){const t=e[0].dataRange;if(e.every((e=>e.dataRange&&e.dataRange.min===t.min&&e.dataRange.max===t.max)))return t}}}menuItemList(){const e=[];return rf(this.tracks).length>0&&(void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e.push(...this.numericDataMenuItems())),e.push("<hr/>"),e.push(this.overlayTrackAlphaAdjustmentMenuItem()),e.push(this.trackSeparationMenuItem()),e}async getFeatures(e,t,i,n){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n))),s=await Promise.all(r);if(s.every((e=>0===e.length)))return new nf([],[]);{const e=this.tracks.map((e=>e.name));return new nf(s,e)}}draw(e){const t=e.features;for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t.featureArrays[i],n.alpha=this.alpha,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}}popupData(e){const t=this.clickedFeatures(e);if(t&&t.length===this.tracks.length){const i=[];let n=!0;for(let r=0;r<t.length;r++)if(r>0&&i.push("<hr/>"),i.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${t[r].trackName}</div>`),t[r].features.length>0){n=!1;const s=this.tracks[r].popupData(e,t[r].features);i.push(...s)}else i.push("Missing or 0 value(s)");return!0===n?[]:i}}clickedFeatures(e){const t=e.viewport.cachedFeatures;if(!t||!t.featureArrays||!Array.isArray(t.featureArrays)||0===t.featureArrays.length)return[];const i=e.genomicLocation,n=[],r=e.referenceFrame.bpPerPixel>.2?3*e.referenceFrame.bpPerPixel:.2,s=i-r,o=i+r;for(let e=0;e<t.featureArrays.length;e++){const i=to(t.featureArrays[e],s,o);n.push({trackName:t.trackNames[e],features:i})}return n}get supportsWholeGenome(){return this.tracks.every((e=>e.supportsWholeGenome))}getState(){const e=super.getState(),t=[];for(let e of this.tracks)t.push(e.getState());return e.tracks=t,e}updateScales(e){let t;if(this.autoscale){t=!0;let i=[];for(let t of e){if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,r=n+e.toBP(t.getWidth()),s=t.featureCache.features;this.autoscale&&(i.push({value:s.getMax(n,r)}),i.push({value:s.getMin(n,r)}))}const e=Qa(i);for(const t of rf(this.tracks))t.dataRange=e}}else{let i=-1;for(let n of this.tracks)if(++i,n.autoscale){t=!0;let r=[];for(let t of e)if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,s=n+e.toBP(t.getWidth()),o=t.featureCache.features.featureArrays[i];if(o)for(let e of o)if(!(e.end<n)){if(e.start>s)break;r.push(e)}}n.dataRange=Qa(r)}}return t}overlayTrackAlphaAdjustmentMenuItem(){const t=e();return t.innerText="Set transparency",{object:Bt(t),dialog:function(e){const t={label:"Transparency",value:this.alpha,min:0,max:1,scaleFactor:1e3,callback:e=>{this.alpha=Math.max(.001,e),this.repaintViews()}};this.browser.sliderDialog.present(t,e)}}}trackSeparationMenuItem(){const e=Bt("<div>");return e.text("Separate tracks"),{object:e,click:function(e){const t=this.autoscale,i=this.name,n=this.tracks,r=this.browser,s=this.order;r.removeTrack(this);for(let e of n)e.order=s,t&&(e.autoscaleGroup=i),e.isMergedTrack=!1,r.addTrack(e.config,e);r.updateViews()}}}}class nf{constructor(e,t){this.featureArrays=e,this.trackNames=t}getMax(e,t){let i=-Number.MAX_VALUE;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(!(void 0===r.value||Number.isNaN(r.value)||r.end<e)){if(r.start>t)break;i=Math.max(i,r.value)}return i!==-Number.MAX_VALUE?i:100}getMin(e,t){let i=0;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(void 0!==r.value&&!Number.isNaN(r.value)){if(r.end<e)continue;if(r.start>t)break;i=Math.min(i,r.value)}return i}}const rf=e=>e?e.filter((e=>void 0!==e.dataRange||void 0!==e.autoscale||void 0!==e.autoscaleGroup)):[];class sf extends Ju{constructor(e,t){super(e,t,"Overlay Tracks",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks">\n <rect id="backdrop" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#737373" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#737373" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#737373" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks Hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks-Hover">\n <rect id="backdrop-copy" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#FFFFFF" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#FFFFFF" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#FFFFFF" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border-copy" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>this.setState(!1)));this.boundMouseClickHandler=(()=>{this.setVisibility(!1),of.call(this)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(!0)}}function of(e){if(!0===af(this.browser)){const e=this.browser.getSelectedTrackViews().map((({track:e})=>e));for(const t of e)t.selected=!1;const t=[];for(let i of e)"merged"===i.type?t.push(...i.tracks):t.push(i);const i={name:"Overlay",type:"merged",autoscale:!1,alpha:.5,height:Math.max(...e.map((({height:e})=>e))),order:Math.min(...e.map((({order:e})=>e)))},n=new tf(i,this.browser,t);for(const t of e)this.browser.removeTrack(t);this.browser.addTrack(i,n)}}function af(e){const t=e.getSelectedTrackViews();if(t&&t.length>1){const e=new Set(["wig","merged"]);return t.filter((({track:t})=>e.has(t.type))).length>1}return!1}const cf=new Set(["sequence","ruler","ideogram"]),lf=new Set(["ruler","sequence","ideogram"]);class hf{constructor(e,t,i){this.namespace=`trackview-${s()}`,this.browser=e,this.track=i,i.trackView=this,this.addDOMToColumnContainer(e,t,e.referenceFrameList)}startSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].startSpinner()}stopSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].stopSpinner()}addDOMToColumnContainer(e,t,i){this.axis=this.createAxis(e,this.track),this.createViewports(e,t,i),this.sampleInfoViewport=new $u(this,e.columnContainer.querySelector(".igv-sample-info-column"),e.getSampleInfoViewportWidth()),this.sampleNameViewport=new Ku(this,e.columnContainer.querySelector(".igv-sample-name-column"),void 0,e.getSampleNameViewportWidth()),this.createTrackScrollbar(e),this.createTrackDragHandle(e),this.createTrackGearPopup(e)}createViewports(e,t,i){this.viewports=[];const n=e.calculateViewportWidth(i.length),r=t.querySelectorAll(".igv-column");for(let e=0;e<r.length;e++){const t=zu(this,r[e],i[e],n);this.viewports.push(t)}}createAxis(t,i){const n=e();if(t.columnContainer.querySelector(".igv-axis-column").appendChild(n),n.dataset.tracktype=i.type,n.style.height=`${i.height}px`,"function"==typeof i.paintAxis){const{width:e,height:t}=n.getBoundingClientRect();this.axisCanvas=document.createElement("canvas"),this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`,n.appendChild(this.axisCanvas)}if(!1===mo.has(this.track.type)){const t=e();n.appendChild(t);const i='<input type="checkbox" name="track-select">',r=document.createRange().createContextualFragment(i).firstChild;t.appendChild(r),r.checked=this.track.selected||!1,r.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation(),this.track.selected=e.target.checked,this.setDragHandleSelectionState(e.target.checked),this.browser.overlayTrackButton.setVisibility(af(this.browser))})),this.setTrackSelectionState(n,!1)}return n}resizeAxisCanvas(e,t){this.axis.style.width=`${e}px`,this.axis.style.height=`${t}px`,"function"==typeof this.track.paintAxis&&(this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`)}renderSVGContext(e,{deltaX:t,deltaY:i}){!function(e,t,i,n,r){if("function"==typeof t.paintAxis){const{y:o,width:a,height:c}=i.getBoundingClientRect(),l=`${(t.name||t.id).replace(/\W/g,"")}_axis_guid_${s()}`;e.saveWithTranslationAndClipRect(l,n,o+r,a,c,0),t.paintAxis(e,a,c),e.restore()}}(e,this.track,this.axisCanvas,t,i);const{width:n}=this.axis.getBoundingClientRect(),{y:r}=this.viewports[0].$viewport.get(0).getBoundingClientRect();let o={deltaX:n+t,deltaY:r+i};for(let t of this.viewports){t.renderSVGContext(e,o);const{width:i}=t.$viewport.get(0).getBoundingClientRect();o.deltaX+=i}if(!0===this.browser.sampleInfo.isInitialized()&&!0===this.browser.sampleInfoControl.showSampleInfo){this.sampleInfoViewport.renderSVGContext(e,o);const{width:t}=this.sampleInfoViewport.viewport.getBoundingClientRect();o.deltaX+=t}!0===this.browser.showSampleNames&&this.sampleNameViewport.renderSVGContext(e,o)}presentColorPicker(e){if(!1===lf.has(this.track.type)){const t=[],i=this.track.color||this.track.defaultColor;Mt(i)&&t.push(i),this.track.altColor&&Mt(this.track.altColor)&&t.push(this.track.altColor);let n=t.map((e=>e.startsWith("#")?e:e.startsWith("rgb(")?_s.rgbToHex(e):_s.colorNameToHex(e))),r={color:e=>{this.track.color=io(e),this.repaintViews()},altColor:e=>{this.track.altColor=io(e),this.repaintViews()}};const s=this.browser.getSelectedTrackViews();s.length>0&&new Set(s).has(this)?(r={color:e=>{for(let t of s)t.track.color=e,t.repaintViews()}},this.browser.genericColorPicker.configure(n,r)):this.browser.genericColorPicker.configure(n,r),this.browser.genericColorPicker.setActiveColorHandler(e),this.browser.genericColorPicker.show()}}setTrackHeight(e,t){t||(this.track.minHeight&&(e=Math.max(this.track.minHeight,e)),this.track.maxHeight&&(e=Math.min(this.track.maxHeight,e))),this.track.height=e,this.resizeAxisCanvas(this.axis.clientWidth,this.track.height),"function"==typeof this.track.paintAxis&&this.paintAxis();for(let{$viewport:t}of this.viewports)t.height(e);if(this.sampleInfoViewport.setHeight(e),this.sampleNameViewport.viewport.style.height=`${e}px`,"function"!=typeof this.track.computePixelHeight)for(let t of this.viewports)t.setContentHeight(e);this.repaintViews(),this.updateScrollbar(),this.dragHandle.style.height=`${e}px`,this.gearContainer.style.height=`${e}px`}updateScrollbar(){const e=this.viewports[0].$viewport.height();if(this.outerScroll.style.height=`${e}px`,!1===cf.has(this.track.type)){const t=this.maxViewportContentHeight(),i=Math.round(e/t*e);t>e?(this.innerScroll.style.display="block",this.innerScroll.style.height=`${i}px`):this.innerScroll.style.display="none"}}moveScroller(e){const t=Bt(this.innerScroll).position().top+e,i=Math.min(Math.max(0,t),this.outerScroll.clientHeight-this.innerScroll.clientHeight);Bt(this.innerScroll).css("top",`${i}px`);const n=this.maxViewportContentHeight(),r=-Math.round(i*(n/this.viewports[0].$viewport.height()));for(let e of this.viewports)e.setTop(r);this.sampleInfoViewport.setTop(r),this.sampleNameViewport.trackScrollDelta=e,this.sampleNameViewport.setTop(r)}isLoading(){for(let e of this.viewports)if(e.isLoading())return!0}repaintViews(){for(let e of this.viewports)e.isVisible()&&e.repaint();"function"==typeof this.track.paintAxis&&this.paintAxis(),this.repaintSampleInfo(),this.repaintSamples()}repaintSampleInfo(){this.sampleInfoViewport.repaint()}repaintSamples(){if("function"==typeof this.track.getSamples){const e=this.track.getSamples();e.names&&e.names.length>0&&this.sampleNameViewport.repaint(e)}}setTrackLabelName(e){this.viewports.forEach((t=>t.setTrackLabel(e)))}resize(e){for(let t of this.viewports)t.setWidth(e)}async updateViews(){if(!this.browser||!this.browser.referenceFrameList)return;const e=this.viewports.filter((e=>e.isVisible()));if(e.forEach((e=>e.shift())),this.browser.dragObject)return;const t=e.filter((e=>e.needsRepaint())).filter((e=>e.checkZoomIn())),i=t.filter((e=>e.needsReload()));for(let e of i)await e.loadFeatures();if(this.disposed)return;if(this.track&&"function"==typeof this.track.variantRowCount&&i.length>0){let e=0;for(let t of this.viewports)t.featureCache&&t.featureCache.features&&(e=Math.max(e,t.featureCache.features.reduce(((e,t)=>Math.max(e,t.row||0)),0)));if(this.track.nVariantRows!==e+1){this.track.variantRowCount(e+1);for(let e of this.viewports)e.checkContentHeight()}}let n;if("merged"===this.track.type)n=this.track.updateScales(e);else if(this.track.autoscale){let t=[];for(let i of e){const e=i.referenceFrame,n=e.start,r=n+e.toBP(i.getWidth());if(i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const e=i.featureCache.features.getMax(n,r);if(t.push({value:e}),"function"==typeof i.featureCache.features.getMin){const e=i.featureCache.features.getMin(n,r);t.push({value:e})}}else{const e=to(i.featureCache.features,n,r);for(let i of e)t.push(i)}}"function"==typeof this.track.doAutoscale?this.track.dataRange=this.track.doAutoscale(t):this.track.dataRange=Qa(t)}const r=this.track.autoscale||this.track.autoscaleGroup||"ruler"===this.track.type||n||this.track.groupBy;for(let i of e)t.includes(i)?i.repaint():r&&i.refresh();this.adjustTrackHeight(),this.repaintSampleInfo(),this.repaintSamples(),this.updateRulerViewportLabels()}clearCachedFeatures(){for(let e of this.viewports)e.clearCache()}updateRulerViewportLabels(){const e=this.browser.calculateViewportWidth(this.viewports.length);for(let t of this.viewports)"ruler"===this.track.type&&(this.viewports.length>1?t.presentLocusLabel(e):t.dismissLocusLabel())}async getInViewFeatures(){if(!this.browser||!this.browser.referenceFrameList)return[];let e=[];const t=this.viewports.filter((e=>e.isVisible()));for(let i of t){const t=i.referenceFrame,{chr:n,start:r,bpPerPixel:s}=i.referenceFrame,o=r+t.toBP(i.getWidth());if((!i.featureCache||!i.featureCache.containsRange(n,r,o,s))&&await i.loadFeatures(),i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const t=i.featureCache.features.getMax(r,o);e.push({value:t})}else{const t="function"==typeof i.featureCache.queryFeatures?i.featureCache.queryFeatures(n,r,o):to(i.featureCache.features,r,o);e=e.concat(t)}}return e}checkContentHeight(){for(let e of this.viewports)e.checkContentHeight();this.adjustTrackHeight()}adjustTrackHeight(){var e=this.maxViewportContentHeight();if(this.track.autoHeight?this.setTrackHeight(e,!1):this.track.paintAxis&&this.paintAxis(),!1===cf.has(this.track.type)){const t=this.viewports[0].getContentTop(),i=this.viewports[0].$viewport.height(),n=Math.min(0,i-e);if(t<n)for(let e of this.viewports)e.setTop(n);this.updateScrollbar()}}viewportsToReload(e){return this.viewports.filter((t=>{if(!t.isVisible())return!1;if(t.checkZoomIn()){const i=t.referenceFrame,n=t.referenceFrame.chr,r=i.start,s=r+i.toBP(Bt(t.contentDiv).width()),o=i.bpPerPixel;return e||!t.tile||t.tile.invalidate||!t.tile.containsRange(n,r,s,o)}return!1}))}createTrackScrollbar(t){const i=e();if(t.columnContainer.querySelector(".igv-scrollbar-column").appendChild(i),i.style.height=`${this.track.height}px`,this.outerScroll=i,!1===cf.has(this.track.type)){const n=e();i.appendChild(n),this.innerScroll=n,this.addTrackScrollMouseHandlers(t)}}createTrackDragHandle(t){"sequence"!==this.track.type&&!0===mo.has(this.track.type)?this.dragHandle=e({class:"igv-track-drag-shim"}):(this.dragHandle=e({class:"igv-track-drag-handle"}),this.dragHandle.classList.add("igv-track-drag-handle-color")),t.columnContainer.querySelector(".igv-track-drag-column").appendChild(this.dragHandle),this.dragHandle.style.height=`${this.track.height}px`,this.addTrackDragMouseHandlers(t)}createTrackGearPopup(t){if(this.gearContainer=e(),t.columnContainer.querySelector(".igv-gear-menu-column").appendChild(this.gearContainer),this.gearContainer.style.height=`${this.track.height}px`,!0===this.track.ignoreTrackMenu);else{function i(e){if(e.preventDefault(),e.stopPropagation(),"none"===this.trackGearPopup.popover.style.display){for(const e of t.trackViews.filter((e=>e!==this&&void 0!==e.trackGearPopup)))e.trackGearPopup.popover.style.display="none";this.trackGearPopup.presentMenuList(this,t.menuUtils.trackMenuItemList(this))}else this.trackGearPopup.popover.style.display="none"}this.gear=e(),this.gearContainer.appendChild(this.gear),this.gear.appendChild(l("cog")),this.trackGearPopup=new Xu(this.gear),this.boundTrackGearClickHandler=i.bind(this),this.gear.addEventListener("click",this.boundTrackGearClickHandler)}}addTrackScrollMouseHandlers(e){this.boundTrackScrollMouseDownHandler=function(t){t.stopPropagation();const{y:i}=r(t);Bt(this.innerScroll).data("yDown",i.toString()),this.boundColumnContainerMouseMoveHandler=function(e){e.stopPropagation();const{y:t}=r(e);this.moveScroller(t-parseInt(Bt(this.innerScroll).data("yDown"))),Bt(this.innerScroll).data("yDown",t.toString())}.bind(this),e.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),this.innerScroll.addEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.boundColumnContainerMouseUpHandler=function(t){e.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),e.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),e.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseUpHandler)}removeTrackScrollMouseHandlers(){!1===cf.has(this.track.type)&&(this.innerScroll.removeEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.browser.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.browser.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.browser.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseMoveHandler))}addTrackDragMouseHandlers(e){if("sequence"===this.track.type||!1===mo.has(this.track.type)){let t;function i(i){i.preventDefault(),t=i.target,!1===this.track.selected&&(t.classList.remove("igv-track-drag-handle-color"),t.classList.add("igv-track-drag-handle-hover-color")),e.startTrackDrag(this)}function n(i){e.endTrackDrag(),t&&i.target!==t&&!1===this.track.selected&&(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-color")),t=void 0}function r(i){i.preventDefault(),void 0===t&&!1===this.track.selected&&(i.target.classList.remove("igv-track-drag-handle-color"),i.target.classList.add("igv-track-drag-handle-hover-color")),e.updateTrackDrag(this)}function s(e){e.preventDefault(),void 0===t&&!1===this.track.selected&&(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color"))}this.boundTrackDragMouseDownHandler=i.bind(this),this.dragHandle.addEventListener("mousedown",this.boundTrackDragMouseDownHandler),this.boundDocumentTrackDragMouseUpHandler=n.bind(this),document.addEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.boundTrackDragMouseEnterHandler=r.bind(this),this.dragHandle.addEventListener("mouseenter",this.boundTrackDragMouseEnterHandler),this.dragHandle.addEventListener("mouseout",(e=>{e.preventDefault(),void 0===t&&!1===this.track.selected&&(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color"))})),this.boundTrackDragMouseOutHandler=s.bind(this),this.dragHandle.addEventListener("mouseout",this.boundTrackDragMouseOutHandler)}}removeTrackDragMouseHandlers(){"ideogram"===this.track.type||"ruler"===this.track.type||(this.dragHandle.removeEventListener("mousedown",this.boundTrackDragMouseDownHandler),document.removeEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.dragHandle.removeEventListener("mouseup",this.boundTrackDragMouseEnterHandler),this.dragHandle.removeEventListener("mouseout",this.boundTrackDragMouseOutHandler))}removeTrackGearMouseHandlers(){!0===this.track.ignoreTrackMenu||this.gear.removeEventListener("click",this.boundTrackGearClickHandler)}removeDOMFromColumnContainer(){this.axis.remove(),this.removeViewportsFromColumnContainer(),this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove()}removeViewportsFromColumnContainer(){for(let e of this.viewports)e.$viewport.remove()}dispose(){this.axis.remove();for(let e of this.viewports)e.dispose();this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove(),"function"==typeof this.track.dispose&&this.track.dispose();for(let e of Object.keys(this))this[e]=void 0;this.alert&&this.alert.container.remove(),this.disposed=!0}paintAxis(){if("function"==typeof this.track.paintAxis){const{width:e,height:t}=this.axisCanvas.getBoundingClientRect(),i=window.devicePixelRatio||1;this.axisCanvas.height=i*t,this.axisCanvas.width=i*e;const n=this.axisCanvas.getContext("2d");if(n.scale(i,i),this.track.autoscaleGroup){if(void 0===wo[this.track.autoscaleGroup]){const e=so.Dark2,t=Math.floor(Math.random()*so.Dark2.length);wo[this.track.autoscaleGroup]=e[t]}const i=_s.addAlpha(wo[this.track.autoscaleGroup],.75);this.track.paintAxis(n,e,t,i)}else this.track.paintAxis(n,e,t,void 0)}}maxViewportContentHeight(){return Math.max(...this.viewports.map((e=>e.getContentHeight())))}setTrackSelectionState(e,t){const i=e.querySelector("div");if(!1!==t)i.style.display="grid";else{i.querySelector("[name=track-select]").checked=this.track.selected,this.dragHandle&&this.setDragHandleSelectionState(!1),i.style.display="none"}}setDragHandleSelectionState(e){const t=this.dragHandle;e?(t.classList.remove("igv-track-drag-handle-color"),t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-selected-color")):(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.remove("igv-track-drag-handle-selected-color"),t.classList.add("igv-track-drag-handle-color"))}}function df(e){this.thresholds=e.thresholds,this.colors=e.colors}function uf(e){this.scale=e,this.lowColor="rgb("+e.lowR+","+e.lowG+","+e.lowB+")",this.highColor="rgb("+e.highR+","+e.highG+","+e.highB+")",this.diff=e.high-e.low}df.prototype.getColor=function(e){for(let t of this.thresholds)if(e<t)return this.colors[this.thresholds.indexOf(t)];return this.colors[this.colors.length-1]},uf.prototype.getColor=function(e){var t,i=this.scale;return e<=i.low?this.lowColor:e>=i.high?this.highColor:(t=(e-i.low)/this.diff,"rgb("+Math.floor(i.lowR+t*(i.highR-i.lowR))+","+Math.floor(i.lowG+t*(i.highG-i.lowG))+","+Math.floor(i.lowB+t*(i.highB-i.lowB))+")")};class ff{constructor(e){this.color=e}getColor(){return this.color}}const pf={threshold:2e3,r:0,g:0,b:255};class gf{constructor(e){e=e||pf,this.threshold=e.threshold,this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[],this.nbins=2e3,this.binsize=this.threshold/this.nbins}setThreshold(e){this.threshold=e,this.cache=[],this.binsize=this.threshold/this.nbins}getThreshold(){return this.threshold}setColorComponents(e){this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[]}getColorComponents(){return{r:this.r,g:this.g,b:this.b}}equals(e){return JSON.stringify(this)===JSON.stringify(e)}getColor(e){const t=Math.floor(Math.min(this.threshold,e)/this.binsize);if(void 0===this.cache[t]){const i=(ys.clamp(e,0,this.threshold)-0)/(this.threshold-0);this.cache[t]=`rgba(${this.r},${this.g},${this.b}, ${i})`}return this.cache[t]}stringify(){return this.threshold+","+this.r+","+this.g+","+this.b}static parse(e){var t,i;return e.startsWith("R:")?(t=e.substring(2).split(":"),(i=new RatioColorScale(Number.parseFloat(t[0]))).positiveScale=n(t[1]),i.negativeScale=n(t[2]),i):n(e);function n(e){var t,i;return t={threshold:(i=e.split(","))[0],r:i[1],g:i[2],b:i[3]},new gf(t)}}}class mf{constructor(e){this.config=e,this.url=e.path||e.url}async read(e,t){const i={start:e,size:t};return Qs.loadArrayBuffer(this.url,{range:i})}}class wf{constructor(e){this.file=e}async read(e,t){const i=this.file;return void 0!==e?i.slice(e,e+t).arrayBuffer():i.arrayBuffer()}}class bf{constructor(e,t){this.file=e,this.rateLimiter=t}async read(e,t){const i=this.file,n=this.rateLimiter;return new Promise((function(r,s){n.limiter((async function(i){try{const n=await i.read(e,t);r(n)}catch(e){s(e)}}))(i)}))}}class Ff{constructor(e){this.file=e.file,this.size=e.size||64e3,this.position=0,this.bufferStart=0,this.bufferLength=0,this.buffer=void 0}async read(e,t){const i=e,n=e+t,r=this.bufferStart,s=this.bufferStart+this.bufferLength;if(t>this.size)return this.buffer=void 0,this.bufferStart=0,this.bufferLength=0,this.file.read(e,t);if(i>=r&&n<=s){const e=i-r,n=e+t;return this.buffer.slice(e,n)}if(i<r&&n>r){const n=r-i,s=await this.file.read(e,n),o=t-n;if(o>0){const e=this.buffer.slice(0,o);return vf(s,e)}return s}if(!(i<s&&n>s))return this.buffer=await this.file.read(e,this.size),this.bufferStart=e,this.bufferLength=this.buffer.byteLength,this.buffer.slice(0,t);{const e=s-i,n=this.bufferLength-e,r=this.buffer.slice(n,this.bufferLength),o=t-e;if(!(o>0))return r;try{this.buffer=await this.file.read(s,this.size),this.bufferStart=s,this.bufferLength=this.buffer.byteLength;const e=this.buffer.slice(0,o);return vf(r,e)}catch(e){if(e.code&&416===e.code)return r;throw e}}}}var vf=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer};const yf=function(e,t){this.littleEndian=void 0===t||t,this.position=0,this.view=e,this.length=e.byteLength};function Af(e,t){this.block=e,this.offset=t}yf.prototype.available=function(){return this.length-this.position},yf.prototype.remLength=function(){return this.length-this.position},yf.prototype.hasNext=function(){return this.position<this.length-1},yf.prototype.getByte=function(){var e=this.view.getUint8(this.position,this.littleEndian);return this.position++,e},yf.prototype.getShort=function(){var e=this.view.getInt16(this.position,this.littleEndian);return this.position+=2,e},yf.prototype.getUShort=function(){var e=this.view.getUint16(this.position,this.littleEndian);return this.position+=2,e},yf.prototype.getInt=function(){var e=this.view.getInt32(this.position,this.littleEndian);return this.position+=4,e},yf.prototype.getUInt=function(){var e=this.view.getUint32(this.position,this.littleEndian);return this.position+=4,e},yf.prototype.getLong=function(){var e=[];e[0]=this.view.getUint8(this.position),e[1]=this.view.getUint8(this.position+1),e[2]=this.view.getUint8(this.position+2),e[3]=this.view.getUint8(this.position+3),e[4]=this.view.getUint8(this.position+4),e[5]=this.view.getUint8(this.position+5),e[6]=this.view.getUint8(this.position+6),e[7]=this.view.getUint8(this.position+7);var t=0;if(this.littleEndian)for(var i=e.length-1;i>=0;i--)t=256*t+e[i];else for(i=0;i<e.length;i++)t=256*t+e[i];return this.position+=8,t},yf.prototype.getString=function(e){for(var t,i="";0!=(t=this.view.getUint8(this.position++))&&(i+=String.fromCharCode(t),!e||i.length!=e););return i},yf.prototype.getFixedLengthString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>0&&(n+=String.fromCharCode(i));return n},yf.prototype.getFixedLengthTrimmedString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>32&&(n+=String.fromCharCode(i));return n},yf.prototype.getFloat=function(){var e=this.view.getFloat32(this.position,this.littleEndian);return this.position+=4,e},yf.prototype.getDouble=function(){var e=this.view.getFloat64(this.position,this.littleEndian);return this.position+=8,e},yf.prototype.skip=function(e){return this.position+=e,this.position},yf.prototype.getVPointer=function(){var e=this.position,t=this.view.getUint8(e+1)<<8|this.view.getUint8(e),i=4294967296*(255&this.view.getUint8(e+6))+16777216*(255&this.view.getUint8(e+5))+65536*(255&this.view.getUint8(e+4))+256*(255&this.view.getUint8(e+3))+(255&this.view.getUint8(e+2));return this.position+=8,new Af(i,t)},Af.prototype.isLessThan=function(e){return this.block<e.block||this.block===e.block&&this.offset<e.offset},Af.prototype.isGreaterThan=function(e){return this.block>e.block||this.block===e.block&&this.offset>e.offset},Af.prototype.print=function(){return this.block+":"+this.offset};class Cf{constructor(e,t){this.chr1=e,this.chr2=t}getKey(){return this.chr1.name+"_"+this.chr2.name+"_"+this.zoom.unit+"_"+this.zoom.binSize}getBlockNumbers(e,t,i){if(e.chr==this.chr2&&t.chr===this.chr1){const i=e;e=t,t=i}const n=this.chr1===this.chr2,r=this.zoom.binSize,s=this.blockBinCount,o=this.blockColumnCount;return i<9||!n?function(){const i=e.start/r,a=e.end/r,c=t.start/r,l=t.end/r,h=Math.floor(i/s),d=Math.floor((a-1)/s),u=Math.floor(c/s),f=Math.floor((l-1)/s),p=[];for(let e=u;e<=f;e++)for(let t=h;t<=d;t++){let i;i=n&&e<t?t*o+e:e*o+t,p.includes(i)||p.push(i)}return p}():function(){const i=e.start/r,n=e.end/r,a=t.start/r,c=t.end/r,l=Math.floor((i+a)/2/s),h=Math.floor((n+c)/2/s),d=Math.floor(Math.log2(1+Math.abs(i-c)/Math.sqrt(2)/s)),u=Math.floor(Math.log2(1+Math.abs(n-a)/Math.sqrt(2)/s)),f=(n-a)*(i-c)<0?0:Math.min(d,u),p=Math.max(d,u),g=[];for(let e=f;e<=p;e++)for(let t=l;t<=h;t++){const i=e*o+t;g.push(i)}return g}()}static parseMatrixZoomData(e,t,i){const n=new Cf(e,t),r=i.getString(),s=i.getInt(),o=i.getFloat(),a=i.getFloat(),c=i.getFloat(),l=i.getFloat(),h=i.getInt();n.blockBinCount=i.getInt(),n.blockColumnCount=i.getInt();const d=i.getInt();n.zoom={index:s,unit:r,binSize:h},n.blockIndex=new _f(d,i);const u=o/(e.size/h)/(t.size/h);return n.averageCount=u,n.sumCounts=o,n.stdDev=c,n.occupiedCellCount=a,n.percent95=l,n}}class _f{constructor(e,t){for(this.blockIndex={};e-- >0;){const e=t.getInt(),i=t.getLong(),n=t.getInt();this.blockIndex[e]={filePosition:i,size:n}}}getBlockIndexEntry(e){return this.blockIndex[e]}}class xf{constructor(e,t,i){this.chr1=e,this.chr2=t,this.bpZoomData=[],this.fragZoomData=[];for(let e of i)"BP"===e.zoom.unit?this.bpZoomData.push(e):this.fragZoomData.push(e)}findZoomForResolution(e,t){const i="FRAG"===t?this.fragZoomData:this.bpZoomData;for(let t=1;t<i.length;t++){if(i[t].zoom.binSize<e)return t-1}return i.length-1}getZoomData(e,t){const i="BP"===(t=t||"BP")?this.bpZoomData:this.fragZoomData;for(let t=0;t<i.length;t++){var n=i[t];if(e===n.zoom.binSize)return n}}getZoomDataByIndex(e,t){return("FRAG"===t?this.fragZoomData:this.bpZoomData)[e]}static getKey(e,t){if(e>t){const i=e;e=t,t=i}return`${e}_${t}`}static parseMatrix(e,t){const i=new yf(new DataView(e)),n=i.getInt(),r=i.getInt(),s=t[n],o=t[r];let a=i.getInt();const c=[];for(;a-- >0;){const e=Cf.parseMatrixZoomData(s,o,i);c.push(e)}return new xf(n,r,c)}}class kf{constructor(e,t,i){this.bin1=e,this.bin2=t,this.counts=i}getKey(){return this.bin1+"_"+this.bin2}}class If{constructor(e=10){this.max=e,this.map=new Map}get(e){let t=this.map.get(e);return t&&(this.map.delete(e),this.map.set(e,t)),t}set(e,t){this.map.has(e)?this.map.delete(e):this.map.size===this.max&&this.map.delete(this.first()),this.map.set(e,t)}has(e){return this.map.has(e)}clear(){this.map.clear()}first(){return this.map.keys().next().value}}class Sf{constructor(e,t,i,n){this.file=e,this.filePosition=t,this.nValues=i,this.dataType=n,this.cache=void 0}async getValues(e,t){if(!this.cache||e<this.cache.start||t>this.cache.end){const i=Math.max(0,e-1e3),n=Math.min(this.nValues,t+1e3),r=this.filePosition+i*this.dataType,s=n-i,o=s*this.dataType,a=await this.file.read(r,o);if(!a)return;const c=new yf(new DataView(a)),l=[];for(let e=0;e<s;e++)l[e]=8===this.dataType?c.getDouble():c.getFloat();this.cache={start:i,end:n,values:l}}const i=e-this.cache.start,n=i+(t-e);return this.cache.values.slice(i,n)}getKey(){return Sf.getKey(this.type,this.chrIdx,this.unit,this.resolution)}static getNormalizationVectorKey(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}}var Ef={"hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined.hic":"54386046426,55860","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fprimary.hic":"33860030033,37504","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Freplicate.hic":"30849652794,55832","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fmaternal.hic":"1380542661,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fpaternal.hic":"1389001777,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2Fcombined.hic":"13433880319,35723","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC001.hic":"3409347253,35975","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC002.hic":"4529947083,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC003.hic":"6894962500,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC004.hic":"3395593338,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC005.hic":"5204128636,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC006.hic":"3278363811,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC007.hic":"3585547340,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC008.hic":"4134197273,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC009.hic":"2851728310,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC010.hic":"1754216102,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC011.hic":"1716829574,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC012.hic":"4367980375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC013.hic":"2309654671,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC014.hic":"5324950266,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC015.hic":"3132333594,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC016.hic":"3159154704,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC017.hic":"3262554627,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC018.hic":"3014216364,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC019.hic":"5025753246,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC020.hic":"5861584507,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC021.hic":"3542263275,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC022.hic":"5061949378,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC023.hic":"4816423919,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC024.hic":"2683781104,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC025.hic":"6522701781,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC026.hic":"6748846520,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC027.hic":"5642693007,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC028.hic":"2098921691,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC029.hic":"3886454027,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC030.hic":"2288984204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC031.hic":"2115342419,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fpellet%2FHIC032.hic":"2063314324,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fsupernatant%2FHIC033.hic":"1933908457,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC034.hic":"13555514595,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC035.hic":"6129650900,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC036.hic":"4307445019,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC037.hic":"9375139867,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2Fcombined.hic":"11664249584,33929","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_DpnII.hic":"7003537290,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC038.hic":"2099825544,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC039.hic":"2096900138,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC040.hic":"2593642141,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC041.hic":"2263919098,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC042.hic":"2684774693,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_noXlink.hic":"5574807456,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC043.hic":"2986114347,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC044.hic":"1916378621,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC045.hic":"746463126,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC046.hic":"2338476164,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC047.hic":"1167496250,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC048.hic":"2231690794,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC049.hic":"2782308678,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC050.hic":"3633531346,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC051.hic":"4063486444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC052.hic":"929756278,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC053.hic":"2489657204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC054.hic":"4036419444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC055.hic":"4284185549,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC056.hic":"4410546240,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fdilution%2FHIC057.hic":"1491998259,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2Fcombined.hic":"7266425111,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC058.hic":"6532635593,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC059.hic":"400684530,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC060.hic":"645352187,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC061.hic":"736291871,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC062.hic":"762731037,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC063.hic":"682917431,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fdilution%2FHIC064.hic":"4550171307,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2Fcombined.hic":"11897184911,35789","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC065.hic":"5425943567,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC066.hic":"5942869818,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC067.hic":"5191049261,35647","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fdilution%2FHIC068.hic":"2713318801,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2Fcombined.hic":"12641555389,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC069.hic":"5630177461,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC070.hic":"5926611269,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC071.hic":"2486191351,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC072.hic":"2281343366,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC073.hic":"2173074239,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC074.hic":"2463700999,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2Fcombined.hic":"14661922519,35639","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC075.hic":"3685310515,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC076.hic":"5833658487,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC077.hic":"2406346486,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC078.hic":"5241454987,35919","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC079.hic":"6297234263,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2Fcombined.hic":"9193858096,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC080.hic":"5171405536,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC081.hic":"3489767688,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC082.hic":"4243339375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fdilution%2FHIC083.hic":"1497495406,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2Fcombined.hic":"7923332224,35593","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC084.hic":"867699123,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC085.hic":"3669518514,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC086.hic":"5306474712,35595","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC087.hic":"1490963755,36397","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2Fcombined.hic":"8956382853,50248","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC088.hic":"1874185366,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC089.hic":"1301165236,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC090.hic":"1105246282,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC091.hic":"1338325770,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC092.hic":"1307918730,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC093.hic":"755136918,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC094.hic":"1606583694,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC095.hic":"2039711245,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC096.hic":"1909573053,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC097.hic":"1826710712,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC098.hic":"1998793575,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC099.hic":"1007740962,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC100.hic":"736464120,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC101.hic":"980505082,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC102.hic":"1116083646,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC103.hic":"1096994310,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC104.hic":"841063882,32102","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC105.hic":"107742864,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC106.hic":"134295912,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC107.hic":"110228014,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC108.hic":"102761401,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC109.hic":"100461491,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC110.hic":"88828472,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC111.hic":"81471064,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC112.hic":"92297035,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC113.hic":"65503916,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC114.hic":"49181188,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC115.hic":"46471102,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC116.hic":"64284432,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC117.hic":"60434076,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC118.hic":"45248563,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC119.hic":"60288782,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC120.hic":"136888414,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC121.hic":"125009003,33681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC122.hic":"154011688,34127","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC123.hic":"177663372,35293","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC124.hic":"382186226,35245","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC125.hic":"158160717,35271","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC127.hic":"110261177,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC128.hic":"246131875,35509","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC129.hic":"260160119,35667","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC130.hic":"117479562,34681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC131.hic":"81508929,34673","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC132.hic":"105959102,34895","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC133.hic":"91504812,33451","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC134.hic":"52222546,33737","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC135.hic":"57763085,34159","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC136.hic":"50618489,33731","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC137.hic":"193163606,33363","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC138.hic":"229876152,33777","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC139.hic":"201783666,33571","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC140.hic":"281163862,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC141.hic":"275969727,33935","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC142.hic":"275020431,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC144.hic":"223834810,34177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC145.hic":"296632653,33937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC146.hic":"290945216,33961","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC147.hic":"234459964,34231","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC148.hic":"295457850,34039","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC149.hic":"113569632,35695","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC150.hic":"304381897,33963","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC151.hic":"289314545,33805","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC152.hic":"284320182,33803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC153.hic":"401393947,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC154.hic":"188065488,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC155.hic":"299157119,33967","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC156.hic":"279289244,33787","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC157.hic":"254852119,33917","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC158.hic":"195969660,33477","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC159.hic":"185720388,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC160.hic":"227709279,33599","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC161.hic":"157225076,33209","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC162.hic":"105703444,32033","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC163.hic":"122665658,32121","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC164.hic":"228048231,33761","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC165.hic":"114440819,32011","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC166.hic":"285147558,33891","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC167.hic":"363116754,33943","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC168.hic":"119592158,31937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC169.hic":"236853872,33785","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC170.hic":"195187639,33395","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC171.hic":"208044058,33309","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC172.hic":"144645916,32877","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC173.hic":"119115941,32203","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC175.hic":"178030481,33525","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC176.hic":"117220136,32169","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC177.hic":"128586196,32659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC178.hic":"191419141,33629","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC179.hic":"141556748,32959","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC180.hic":"199825102,33185","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC181.hic":"301022688,33783","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC182.hic":"185384453,33205","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC183.hic":"202189264,36367","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC184.hic":"37464475,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC185.hic":"161938278,36099","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC186.hic":"133853166,36179","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC188.hic":"128068030,36237","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC189.hic":"148053886,36177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC190.hic":"198946958,35803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC191.hic":"226584564,36063","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC192.hic":"194412797,36341","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC193.hic":"176408194,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC194.hic":"207215649,36055","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC195.hic":"175185530,36315","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC196.hic":"168969337,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC197.hic":"121231252,36339","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC198.hic":"92713752,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC199.hic":"105130500,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC200.hic":"114526350,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC201.hic":"122689717,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhap1%2Fin-situ%2Fcombined.hic":"9614983328,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fctbp_8_4_17%2Fall_intra_megabase_michrom.hic":"154205644,10960","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xa-combined.hic":"8843305329,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXa-chrX-diploid.hic":"11173520,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-combined.hic":"13365182403,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-chrX-diploid.hic":"17343459,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC002.hic":"4279298739,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC003.hic":"3027365532,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC004.hic":"2896130835,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC005.hic":"4717830071,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC006.hic":"5066210154,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC007.hic":"3069516128,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xi-combined.hic":"14551096423,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXi-chrX-diploid.hic":"17362477,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC008.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC009.hic":"2935931663,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC010.hic":"2019085070,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC011.hic":"6087610814,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC012.hic":"2809618194,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC013.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fcombined.hic":"6950423609,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fpaternal.hic":"220592749,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fmaternal.hic":"323233095,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC014.hic":"3183235800,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC015.hic":"1739539801,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC016.hic":"1105912758,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC017.hic":"1060773319,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC018.hic":"1203679874,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC019.hic":"3321955269,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Frhesus%2FDarrowHuntley-2015%2FHIC020.hic":"7108980626,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fcola%2FDarrowHuntley-2015%2FHIC021.hic":"3906448676,34955","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Faedes%2Fcombined.hic":"390780490,2245","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Fhs2-hic.hic":"1960284186,33561","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2FCpipJ3.hic":"766279097,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2Fupdated_O%2FSnyder_O.hic":"8046980555,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2FA_inter.hic":"10986005145,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2Fcombined.hic":"30439217680,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2Fcombined.hic":"33255540403,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F20min_withdraw_combined.hic":"11078436933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F40min_withdraw_combined.hic":"11031830038,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F60min_withdraw_combined.hic":"10312725340,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F180min_withdraw_combined.hic":"10038610214,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC001.hic":"8004335785,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC002.hic":"8453215933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC003.hic":"9118406189,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC004.hic":"5973342894,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC005.hic":"6846576837,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC006.hic":"6075148017,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC007.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC008.hic":"6844159653,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC009.hic":"7282063059,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC010.hic":"10410578833,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC011.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC012.hic":"7223422850,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC013.hic":"7435986997,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC014.hic":"9120113605,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2Fcombined.hic":"4170577904,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC015.hic":"1504084990,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC016.hic":"1686244500,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC017.hic":"1804802410,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC018.hic":"1533942067,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2Fcombined.hic":"4572390198,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC019.hic":"1543609666,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC020.hic":"1814133288,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC021.hic":"1942698243,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC022.hic":"1873587413,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC049.hic":"405127557,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC060.hic":"326681741,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC061.hic":"300908673,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC050.hic":"481758242,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC051.hic":"417577401,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC052.hic":"419353227,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC053.hic":"411554953,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC054.hic":"386655891,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC055.hic":"402170701,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_240min%2FRao-2017-HIC057.hic":"735906308,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC058.hic":"443789827,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC059.hic":"491422615,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC062.hic":"320261375,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC063.hic":"306590499,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC032S.hic":"367051742,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC033S.hic":"344555339,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC036S.hic":"349392947,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC037S.hic":"317714554,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC040S.hic":"266786397,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC041S.hic":"279445530,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC044S.hic":"898418269,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC045S.hic":"961006347,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC064.hic":"833576408,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC065.hic":"840881418,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC066.hic":"980958864,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC067.hic":"882023129,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC068.hic":"1110292630,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC069.hic":"1001747023,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FCP190_HiChIP.hic":"144107588,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27ac_HiChIP_combined.hic":"43171370,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27me3_HiChIP_combined.hic":"42906472,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2_ChIAPET.hic":"41992430,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2S2_HiChIP.hic":"145842743,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FArabidopsis_Wang2015_Liu2016.hic":"1134391078,4984","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FElegans_Crane2015.hic":"387127568,8758","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FNcrassa_Galazka2016.hic":"26555511,27725","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPfalciparum_trophozoite_Ay2014.hic":"15640893,13948","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-A.hic":"6897251,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-B.hic":"4959088,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-A.hic":"5232286,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-B.hic":"5105292,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-A.hic":"6900072,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-B.hic":"8653258,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-A.hic":"7999058,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-B.hic":"8774657,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc.hic":"23671753603,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep1.hic":"23671754721,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep2.hic":"22269909910,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fhffc6_rep1.hic":"19016661622,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_NcoI.hic":"480725203,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2F302NH.hic":"99948617,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FK562.hic":"470263605,36151","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_HindIII.hic":"293706559,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_rep_HindIII.hic":"309673862,36087","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep1.hic":"1531151371,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep2.hic":"2851437676,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmouse-rep1.hic":"582052544,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep1.hic":"698509182,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep2.hic":"461410393,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep1.hic":"691045338,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep2.hic":"668888336,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Fsexton%2Fcombined.hic":"50650087,4486","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-hindiii.hic":"1071142023,16500","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-mboi.hic":"1508851093,16448","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Fnon-tcc-hindiii.hic":"395179229,36093","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-combined.hic":"1050423847,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-hindiii%2Fsplit-read-run.hic":"9599984876,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fhesc-hindiii.hic":"1952555632,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fimr90-hindiii.hic":"9691260435,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-cortex.hic":"3712072953,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr18.hic":"2083350075,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr2.hic":"3362049644,16360","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr7.hic":"1658399854,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr15.hic":"866691249,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr2.hic":"3304782795,16386","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-1.hic":"23673506,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-2.hic":"26873280,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-3.hic":"31066362,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-4.hic":"16807724,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-5.hic":"28665065,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-6.hic":"13124158,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-7.hic":"15118945,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-8.hic":"68316814,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-9.hic":"18965101,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-10.hic":"17020666,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Fcombined.hic":"6526601242,36427","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep1.hic":"1861562891,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep2.hic":"3061013635,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep3.hic":"1564588211,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep4.hic":"1255543175,36153","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep5.hic":"974683253,36179","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep6.hic":"1040805629,36053","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Fcombined.hic":"8424080116,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep1.hic":"2697976702,36295","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep3.hic":"1718610467,36159","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep4.hic":"2029519405,36101","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep5.hic":"985310855,36069","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep6.hic":"1418750480,35967","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fmhh-call-4-cell-line.hic":"538380253,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fprimary-b-all.hic":"773764191,35793","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fnormal-b-cell-line.hic":"336271459,35005","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Frl-cell-line.hic":"484807998,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-biorep.hic":"135932435,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep1.hic":"160355961,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep2.hic":"188809887,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fpre-prob-egs.hic":"2237792858,15483","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-egs.hic":"5744720377,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-fa.hic":"2174866215,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhct116-rnapii-pilot.hic":"396366166,35999","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhela-rnapii-pilot.hic":"882516759,35107","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-pilot.hic":"1131576189,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-saturated.hic":"571583828,36291","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fmcf7-rnapii-saturated.hic":"1282547841,36035","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fnb4-rnapii-pilot.hic":"761614686,34861","hicfiles.s3.amazonaws.com%2Fexternal%2Fjung%2Fmouse_sperm.hic":"1730231642,29184","hicfiles.s3.amazonaws.com%2Fexternal%2Ftang%2Fgm12878.hic":"1953518212,20505","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791299.hic":"5723484,11956","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791297.hic":"16534743,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv.hic":"5094525579,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep1.hic":"2574358912,36373","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep2.hic":"3417099433,36243","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev.hic":"4785157552,36323","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep1.hic":"2648268465,36321","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep2.hic":"2994727980,36107","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf.hic":"5391791815,36063","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep1.hic":"3325842095,36269","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep2.hic":"3096215920,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl.hic":"3830902383,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl-rep1.hic":"1346712252,36079","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl_rep2.hic":"3098067367,36271","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-0h-hiseq.hic":"38174042,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq.hic":"26506099,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq-non-crosslinked_control.hic":"3545496,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-36h-hiseq.hic":"70754194,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fg1mid-r1.hic":"200863476,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r1.hic":"249021190,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r2.hic":"212341157,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-0-25fa.hic":"583572265,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-1fa.hic":"354502306,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-0-25fa.hic":"149308791,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-98percent.hic":"778175225,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-1fa.hic":"158091047,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-ns-r1.hic":"801670039,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-m-r1.hic":"875922086,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r1.hic":"130959943,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r2.hic":"237861106,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT.hic":"496104039,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT-adv-cre.hic":"438608517,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep1.hic":"446205712,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep2.hic":"386354767,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep1.hic":"621998722,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep2.hic":"583840829,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep1.hic":"801290988,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep2.hic":"819406658,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep1.hic":"792825269,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep2.hic":"746189884,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT.hic":"309353372,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT-OHT.hic":"274229679,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R1.hic":"1490362251,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R3.hic":"2403664421,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R1.hic":"1377124538,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R3.hic":"2646201369,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2Fcrh6-mutant.hic":"105261071,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2FWT.hic":"127506388,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2FCol.hic":"153638500,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn1.hic":"211213220,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn4.hic":"134236837,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fxie%2Fprimary.hic":"92936173,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt337.hic":"318737891,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt67.hic":"348123956,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt337.hic":"251107279,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt67.hic":"351840994,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2FCol0.hic":"345969497,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fclf28-swn7.hic":"299585025,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fcmt3-11.hic":"253427706,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fddm1-2.hic":"303626924,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fmet1-3.hic":"347697973,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fsuvh4-suvh5-suvh6.hic":"263122019,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNase-HiC-WG-K562.hic":"892955840,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNaseHiC-WG-H1.hic":"696922695,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-K562-rep1.hic":"341917716,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargeredDNaseHiC-lincRNA-K562-rep2.hic":"214841185,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep1.hic":"616326137,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep2.hic":"579654013,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-H1-rep1.hic":"519810544,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-K562-rep1.hic":"199553123,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII.hic":"1319373594,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_HinfI.hic":"1465493873,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII_HinfI_combo.hic":"753062558,5814","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-10A.hic":"2784956115,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-7.hic":"2700457411,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbatullin%2Fsperm.hic":"501052169,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep1.hic":"1450697530,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep2.hic":"1189371558,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Fcombined.hic":"2262007875,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Finactive.hic":"4444564,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Factive.hic":"3993495,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep1.hic":"1650838357,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep2.hic":"1258038606,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski.hic":"499827296,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_dnase.hic":"4298088401,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_in_situ_dnase.hic":"609321852,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain.hic":"1028196506,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep1.hic":"1283306,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep2.hic":"1263227,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FNcoI_rep1.hic":"4380906,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined.hic":"1829549643,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined_randomized.hic":"1859742654,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_GM_cohesin.hic":"1231264781,17932","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_cohesin_all.hic":"1152008628,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_Oct4.hic":"912828146,16438","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FSCC4KO.hic":"1767906138,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FDKO.hic":"1487228787,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_1.14.hic":"1189751862,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_3.3.hic":"1155057696,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWT.hic":"1522401568,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2Fmega_Liverpool%2Fmega.hic":"2612171975,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2836_Liverpool1%2FLiverpool1.hic":"191729195,2245","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2861_Liverpool2%2FLiverpool2.hic":"1637096030,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2862_Liverpool3%2FLiverpool3.hic":"1160045602,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC.hic":"11857786247,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC_CanyonDel.hic":"8139168836,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Ftcell.hic":"9871547081,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Fep.hic":"17479335373,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2FTh1_ensemble.hic":"1690592868,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FES_mapq30.hic":"32930498831,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FNPC_mapq30.hic":"55053730986,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FCN_mapq30.hic":"53138031154,32386","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_72_hours_WT.hic":"16492991184,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_WT.hic":"23057795398,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_MYC_KO.hic":"21245554876,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_TSA.hic":"13933346059,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_oligomycin.hic":"21902506832,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-mES_WT.hic":"9451969795,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_WT.hic":"3600188564,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_WT.hic":"1309503359,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_HU_treated.hic":"1477252396,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_flavopiridol.hic":"15711773490,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FPGP1F_mega_090118%2FPGP1F_mega_090118_30.hic":"24786676166,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7145%2FHIC7145_30.hic":"4554644616,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7146%2FHIC7146_30.hic":"4174848944,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7147%2FHIC7147_30.hic":"5062229182,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7862%2FHIC7862_30.hic":"4520990620,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7863%2FHIC7863_30.hic":"4330354773,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7864%2FHIC7864_30.hic":"5880640268,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7865%2FHIC7865_30.hic":"4431632469,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7866%2FHIC7866_30.hic":"4686000222,36479","encode-public.s3.amazonaws.com%2F2018%2F10%2F19%2Fb122542b-306c-4631-bdc3-2e155e89af55%2FENCFF718AWL.hic":"39544267907,58932","encode-public.s3.amazonaws.com%2F2019%2F02%2F15%2F8e787cd8-e388-4bc2-a236-7a5e6f39e0c0%2FENCFF999YXX.hic":"9255069996,56883","encode-public.s3.amazonaws.com%2F2019%2F02%2F08%2Ffc1d9d5d-8fa0-4e29-9080-3da674d9490d%2FENCFF543USQ.hic":"5005263062,36479","s3.us-east-1.wasabisys.com%2Fhicfiles%2Finternal%2FLCL_mega_42B_500bp_30.hic":"106482584851,22829","www.encodeproject.org%2Ffiles%2FENCFF925QIF%2F%40%40download%2FENCFF925QIF.hic":"51712684396,54779","www.encodeproject.org%2Ffiles%2FENCFF259YUS%2F%40%40download%2FENCFF259YUS.hic":"24640030444,54779","www.encodeproject.org%2Ffiles%2FENCFF783KQI%2F%40%40download%2FENCFF783KQI.hic":"27209249856,54779","www.encodeproject.org%2Ffiles%2FENCFF318JAP%2F%40%40download%2FENCFF318JAP.hic":"28636979242,54779","www.encodeproject.org%2Ffiles%2FENCFF512PQA%2F%40%40download%2FENCFF512PQA.hic":"28124104361,54779","www.encodeproject.org%2Ffiles%2FENCFF591MHA%2F%40%40download%2FENCFF591MHA.hic":"37373387202,54779","www.encodeproject.org%2Ffiles%2FENCFF197OWW%2F%40%40download%2FENCFF197OWW.hic":"41826180893,54779","www.encodeproject.org%2Ffiles%2FENCFF317OIA%2F%40%40download%2FENCFF317OIA.hic":"34741636038,54779","www.encodeproject.org%2Ffiles%2FENCFF522YLZ%2F%40%40download%2FENCFF522YLZ.hic":"24064692329,54779","www.encodeproject.org%2Ffiles%2FENCFF420JTA%2F%40%40download%2FENCFF420JTA.hic":"21202405177,54779","www.encodeproject.org%2Ffiles%2FENCFF871ZDJ%2F%40%40download%2FENCFF871ZDJ.hic":"10124815680,18679","www.encodeproject.org%2Ffiles%2FENCFF349RZY%2F%40%40download%2FENCFF349RZY.hic":"4446702705,36479","www.encodeproject.org%2Ffiles%2FENCFF738YON%2F%40%40download%2FENCFF738YON.hic":"3338049584,35947","www.encodeproject.org%2Ffiles%2FENCFF406KJN%2F%40%40download%2FENCFF406KJN.hic":"4132875306,36479","www.encodeproject.org%2Ffiles%2FENCFF081NPN%2F%40%40download%2FENCFF081NPN.hic":"34495587443,54779","www.encodeproject.org%2Ffiles%2FENCFF946RZW%2F%40%40download%2FENCFF946RZW.hic":"34571955193,54779","www.encodeproject.org%2Ffiles%2FENCFF602CHT%2F%40%40download%2FENCFF602CHT.hic":"30674798032,54779","www.encodeproject.org%2Ffiles%2FENCFF150DKS%2F%40%40download%2FENCFF150DKS.hic":"12618769864,36479","www.encodeproject.org%2Ffiles%2FENCFF614IPZ%2F%40%40download%2FENCFF614IPZ.hic":"42450060331,54779","www.encodeproject.org%2Ffiles%2FENCFF571ZQR%2F%40%40download%2FENCFF571ZQR.hic":"15230068871,47429","www.encodeproject.org%2Ffiles%2FENCFF705MKK%2F%40%40download%2FENCFF705MKK.hic":"38686554702,54779","www.encodeproject.org%2Ffiles%2FENCFF658KTB%2F%40%40download%2FENCFF658KTB.hic":"13195884405,47429","www.encodeproject.org%2Ffiles%2FENCFF435JYN%2F%40%40download%2FENCFF435JYN.hic":"17192139674,54779","www.encodeproject.org%2Ffiles%2FENCFF016JKX%2F%40%40download%2FENCFF016JKX.hic":"37266736642,54779","www.encodeproject.org%2Ffiles%2FENCFF294GFP%2F%40%40download%2FENCFF294GFP.hic":"36389843399,54779","www.encodeproject.org%2Ffiles%2FENCFF700CYI%2F%40%40download%2FENCFF700CYI.hic":"60482012152,54779","www.encodeproject.org%2Ffiles%2FENCFF962EDB%2F%40%40download%2FENCFF962EDB.hic":"39394328182,54779","www.encodeproject.org%2Ffiles%2FENCFF467OGP%2F%40%40download%2FENCFF467OGP.hic":"35572788855,54779","www.encodeproject.org%2Ffiles%2FENCFF556RLR%2F%40%40download%2FENCFF556RLR.hic":"34826921187,54779","www.encodeproject.org%2Ffiles%2FENCFF309UNV%2F%40%40download%2FENCFF309UNV.hic":"48510618174,54779","www.encodeproject.org%2Ffiles%2FENCFF653HCO%2F%40%40download%2FENCFF653HCO.hic":"41079007620,54779","www.encodeproject.org%2Ffiles%2FENCFF120DSV%2F%40%40download%2FENCFF120DSV.hic":"12790195576,47429","www.encodeproject.org%2Ffiles%2FENCFF284OEA%2F%40%40download%2FENCFF284OEA.hic":"46007570339,54779","www.encodeproject.org%2Ffiles%2FENCFF035BLF%2F%40%40download%2FENCFF035BLF.hic":"63868871985,54779","www.encodeproject.org%2Ffiles%2FENCFF094KKX%2F%40%40download%2FENCFF094KKX.hic":"42151419971,54779","www.encodeproject.org%2Ffiles%2FENCFF965BPU%2F%40%40download%2FENCFF965BPU.hic":"42717376107,54779","www.encodeproject.org%2Ffiles%2FENCFF842DUO%2F%40%40download%2FENCFF842DUO.hic":"39553892515,54779","www.encodeproject.org%2Ffiles%2FENCFF417GBZ%2F%40%40download%2FENCFF417GBZ.hic":"45544785452,54779","www.encodeproject.org%2Ffiles%2FENCFF499BVX%2F%40%40download%2FENCFF499BVX.hic":"40900674170,54779","www.encodeproject.org%2Ffiles%2FENCFF136XCV%2F%40%40download%2FENCFF136XCV.hic":"47700392974,54779","www.encodeproject.org%2Ffiles%2FENCFF224HKR%2F%40%40download%2FENCFF224HKR.hic":"40426005932,54779","www.encodeproject.org%2Ffiles%2FENCFF711XSR%2F%40%40download%2FENCFF711XSR.hic":"41434581949,54779","www.encodeproject.org%2Ffiles%2FENCFF660JWA%2F%40%40download%2FENCFF660JWA.hic":"54201632697,54779","www.encodeproject.org%2Ffiles%2FENCFF081PMO%2F%40%40download%2FENCFF081PMO.hic":"53428285130,54779","www.encodeproject.org%2Ffiles%2FENCFF799QGA%2F%40%40download%2FENCFF799QGA.hic":"1228682189,36479","www.encodeproject.org%2Ffiles%2FENCFF473CAA%2F%40%40download%2FENCFF473CAA.hic":"1077514950,36479","www.encodeproject.org%2Ffiles%2FENCFF663FRL%2F%40%40download%2FENCFF663FRL.hic":"39843938245,54779","www.encodeproject.org%2Ffiles%2FENCFF341WOY%2F%40%40download%2FENCFF341WOY.hic":"34792598619,54779","www.encodeproject.org%2Ffiles%2FENCFF515ZBF%2F%40%40download%2FENCFF515ZBF.hic":"41779230923,54779","www.encodeproject.org%2Ffiles%2FENCFF545GBW%2F%40%40download%2FENCFF545GBW.hic":"38351980358,54779","www.encodeproject.org%2Ffiles%2FENCFF252ANV%2F%40%40download%2FENCFF252ANV.hic":"37668839771,54779","www.encodeproject.org%2Ffiles%2FENCFF912NDK%2F%40%40download%2FENCFF912NDK.hic":"21196851956,54779","www.encodeproject.org%2Ffiles%2FENCFF683PLM%2F%40%40download%2FENCFF683PLM.hic":"21849338763,54779","www.encodeproject.org%2Ffiles%2FENCFF355NFJ%2F%40%40download%2FENCFF355NFJ.hic":"47880627268,54779","www.encodeproject.org%2Ffiles%2FENCFF507WEW%2F%40%40download%2FENCFF507WEW.hic":"35777782924,54779","www.encodeproject.org%2Ffiles%2FENCFF241MSL%2F%40%40download%2FENCFF241MSL.hic":"22507408288,54779","www.encodeproject.org%2Ffiles%2FENCFF135MUT%2F%40%40download%2FENCFF135MUT.hic":"24168734040,54779","www.encodeproject.org%2Ffiles%2FENCFF459FRB%2F%40%40download%2FENCFF459FRB.hic":"37166770103,54779","www.encodeproject.org%2Ffiles%2FENCFF705YZH%2F%40%40download%2FENCFF705YZH.hic":"44679182442,54779","www.encodeproject.org%2Ffiles%2FENCFF395INO%2F%40%40download%2FENCFF395INO.hic":"56727346538,54779","www.encodeproject.org%2Ffiles%2FENCFF736ITL%2F%40%40download%2FENCFF736ITL.hic":"49036286185,54779","www.encodeproject.org%2Ffiles%2FENCFF546TZN%2F%40%40download%2FENCFF546TZN.hic":"33195126348,54779","www.encodeproject.org%2Ffiles%2FENCFF706SFK%2F%40%40download%2FENCFF706SFK.hic":"3271831702,36479","www.encodeproject.org%2Ffiles%2FENCFF922ERE%2F%40%40download%2FENCFF922ERE.hic":"12476647122,36479","www.encodeproject.org%2Ffiles%2FENCFF876OWE%2F%40%40download%2FENCFF876OWE.hic":"1538692704,47429","www.encodeproject.org%2Ffiles%2FENCFF227XJZ%2F%40%40download%2FENCFF227XJZ.hic":"1925617685,36479","www.encodeproject.org%2Ffiles%2FENCFF053BXY%2F%40%40download%2FENCFF053BXY.hic":"1032237652,36479","www.encodeproject.org%2Ffiles%2FENCFF014VMM%2F%40%40download%2FENCFF014VMM.hic":"1564021703,36479","www.encodeproject.org%2Ffiles%2FENCFF563XES%2F%40%40download%2FENCFF563XES.hic":"1489180508,36479","www.encodeproject.org%2Ffiles%2FENCFF482LGO%2F%40%40download%2FENCFF482LGO.hic":"1208778887,36479","www.encodeproject.org%2Ffiles%2FENCFF216QQM%2F%40%40download%2FENCFF216QQM.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF256UOW%2F%40%40download%2FENCFF256UOW.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF791UZC%2F%40%40download%2FENCFF791UZC.hic":"37029615181,54779","www.encodeproject.org%2Ffiles%2FENCFF911AHQ%2F%40%40download%2FENCFF911AHQ.hic":"34246649165,54779","www.encodeproject.org%2Ffiles%2FENCFF491AOR%2F%40%40download%2FENCFF491AOR.hic":"558663570,36479","www.encodeproject.org%2Ffiles%2FENCFF307PDL%2F%40%40download%2FENCFF307PDL.hic":"525321519,36479","www.encodeproject.org%2Ffiles%2FENCFF773ITV%2F%40%40download%2FENCFF773ITV.hic":"295464771,36479","www.encodeproject.org%2Ffiles%2FENCFF198SSL%2F%40%40download%2FENCFF198SSL.hic":"500142476,36479","www.encodeproject.org%2Ffiles%2FENCFF251UEF%2F%40%40download%2FENCFF251UEF.hic":"567443575,36479","www.encodeproject.org%2Ffiles%2FENCFF942LTN%2F%40%40download%2FENCFF942LTN.hic":"4430960222,36479","www.encodeproject.org%2Ffiles%2FENCFF543USQ%2F%40%40download%2FENCFF543USQ.hic":"5005263062,36479","www.encodeproject.org%2Ffiles%2FENCFF434XQU%2F%40%40download%2FENCFF434XQU.hic":"25506511674,54779","www.encodeproject.org%2Ffiles%2FENCFF318GOM%2F%40%40download%2FENCFF318GOM.hic":"44750824314,54779","www.encodeproject.org%2Ffiles%2FENCFF004TKY%2F%40%40download%2FENCFF004TKY.hic":"20705661833,54779","www.encodeproject.org%2Ffiles%2FENCFF493YNC%2F%40%40download%2FENCFF493YNC.hic":"53407154984,54779","www.encodeproject.org%2Ffiles%2FENCFF334XXU%2F%40%40download%2FENCFF334XXU.hic":"14341194962,47429","www.encodeproject.org%2Ffiles%2FENCFF569RJM%2F%40%40download%2FENCFF569RJM.hic":"1922066634,36479","www.encodeproject.org%2Ffiles%2FENCFF076LWH%2F%40%40download%2FENCFF076LWH.hic":"39406255845,54779","www.encodeproject.org%2Ffiles%2FENCFF977XWK%2F%40%40download%2FENCFF977XWK.hic":"20563512962,54779","www.encodeproject.org%2Ffiles%2FENCFF127TPS%2F%40%40download%2FENCFF127TPS.hic":"21032070512,54779","www.encodeproject.org%2Ffiles%2FENCFF480KLP%2F%40%40download%2FENCFF480KLP.hic":"33115569647,54779","www.encodeproject.org%2Ffiles%2FENCFF281ILS%2F%40%40download%2FENCFF281ILS.hic":"28236353584,54779","www.encodeproject.org%2Ffiles%2FENCFF129LMU%2F%40%40download%2FENCFF129LMU.hic":"35247096013,54779","www.encodeproject.org%2Ffiles%2FENCFF759YCW%2F%40%40download%2FENCFF759YCW.hic":"16058537743,32102","www.encodeproject.org%2Ffiles%2FENCFF045YOM%2F%40%40download%2FENCFF045YOM.hic":"19775445828,32102","www.encodeproject.org%2Ffiles%2FENCFF013TGD%2F%40%40download%2FENCFF013TGD.hic":"4208420532,36479","www.encodeproject.org%2Ffiles%2FENCFF929RPW%2F%40%40download%2FENCFF929RPW.hic":"1974260276,36479","www.encodeproject.org%2Ffiles%2FENCFF996XEO%2F%40%40download%2FENCFF996XEO.hic":"2072918865,36479","www.encodeproject.org%2Ffiles%2FENCFF097SKJ%2F%40%40download%2FENCFF097SKJ.hic":"1983524001,36479","www.encodeproject.org%2Ffiles%2FENCFF464KRA%2F%40%40download%2FENCFF464KRA.hic":"1957300131,36479","www.encodeproject.org%2Ffiles%2FENCFF406HHC%2F%40%40download%2FENCFF406HHC.hic":"3854527235,36479","www.encodeproject.org%2Ffiles%2FENCFF080DPJ%2F%40%40download%2FENCFF080DPJ.hic":"19953768024,47429","www.encodeproject.org%2Ffiles%2FENCFF621AIY%2F%40%40download%2FENCFF621AIY.hic":"26781700010,54779","www.encodeproject.org%2Ffiles%2FENCFF366ERB%2F%40%40download%2FENCFF366ERB.hic":"1049184239,36479","www.encodeproject.org%2Ffiles%2FENCFF997RGL%2F%40%40download%2FENCFF997RGL.hic":"2521167549,36479","www.encodeproject.org%2Ffiles%2FENCFF029MPB%2F%40%40download%2FENCFF029MPB.hic":"1854711185,36479","www.encodeproject.org%2Ffiles%2FENCFF043EEE%2F%40%40download%2FENCFF043EEE.hic":"2924133032,36479","www.encodeproject.org%2Ffiles%2FENCFF920CJR%2F%40%40download%2FENCFF920CJR.hic":"3011577886,36479","www.encodeproject.org%2Ffiles%2FENCFF928NJV%2F%40%40download%2FENCFF928NJV.hic":"2778936244,36479","www.encodeproject.org%2Ffiles%2FENCFF894GLR%2F%40%40download%2FENCFF894GLR.hic":"2831733099,36479","www.encodeproject.org%2Ffiles%2FENCFF303PCK%2F%40%40download%2FENCFF303PCK.hic":"688704435,36479","www.encodeproject.org%2Ffiles%2FENCFF999YXX%2F%40%40download%2FENCFF999YXX.hic":"9255069996,56883","www.encodeproject.org%2Ffiles%2FENCFF685BLG%2F%40%40download%2FENCFF685BLG.hic":"16797022992,47429","www.encodeproject.org%2Ffiles%2FENCFF188SSH%2F%40%40download%2FENCFF188SSH.hic":"16797023050,47429","www.encodeproject.org%2Ffiles%2FENCFF465ESX%2F%40%40download%2FENCFF465ESX.hic":"13489465953,32102","www.encodeproject.org%2Ffiles%2FENCFF493SFI%2F%40%40download%2FENCFF493SFI.hic":"30033046818,54779","www.encodeproject.org%2Ffiles%2FENCFF235LCO%2F%40%40download%2FENCFF235LCO.hic":"38572174589,54779","www.encodeproject.org%2Ffiles%2FENCFF625VNK%2F%40%40download%2FENCFF625VNK.hic":"45202258438,54779","www.encodeproject.org%2Ffiles%2FENCFF304HMS%2F%40%40download%2FENCFF304HMS.hic":"36994445315,54779","www.encodeproject.org%2Ffiles%2FENCFF605CEN%2F%40%40download%2FENCFF605CEN.hic":"40358346301,54779","www.encodeproject.org%2Ffiles%2FENCFF086ORS%2F%40%40download%2FENCFF086ORS.hic":"22650781304,54779","www.encodeproject.org%2Ffiles%2FENCFF237UKR%2F%40%40download%2FENCFF237UKR.hic":"41516707246,54779","www.encodeproject.org%2Ffiles%2FENCFF004YZQ%2F%40%40download%2FENCFF004YZQ.hic":"71900665326,54779","www.encodeproject.org%2Ffiles%2FENCFF104THR%2F%40%40download%2FENCFF104THR.hic":"15172410632,54779","www.encodeproject.org%2Ffiles%2FENCFF807IRK%2F%40%40download%2FENCFF807IRK.hic":"17346637451,54779","www.encodeproject.org%2Ffiles%2FENCFF193CQL%2F%40%40download%2FENCFF193CQL.hic":"55726903245,54779","www.encodeproject.org%2Ffiles%2FENCFF700DEX%2F%40%40download%2FENCFF700DEX.hic":"20231399798,54779","www.encodeproject.org%2Ffiles%2FENCFF234MDO%2F%40%40download%2FENCFF234MDO.hic":"24635312640,54779","www.encodeproject.org%2Ffiles%2FENCFF181ROW%2F%40%40download%2FENCFF181ROW.hic":"26883606497,54779","www.encodeproject.org%2Ffiles%2FENCFF896OFN%2F%40%40download%2FENCFF896OFN.hic":"36952196833,54779","www.encodeproject.org%2Ffiles%2FENCFF573OPJ%2F%40%40download%2FENCFF573OPJ.hic":"36685546919,54779","www.encodeproject.org%2Ffiles%2FENCFF028RXH%2F%40%40download%2FENCFF028RXH.hic":"31053919206,54779","www.encodeproject.org%2Ffiles%2FENCFF156GGD%2F%40%40download%2FENCFF156GGD.hic":"35284134289,54779","www.encodeproject.org%2Ffiles%2FENCFF496GEU%2F%40%40download%2FENCFF496GEU.hic":"44659660933,54779","www.encodeproject.org%2Ffiles%2FENCFF945TUH%2F%40%40download%2FENCFF945TUH.hic":"3898570191,35639","www.encodeproject.org%2Ffiles%2FENCFF698KFV%2F%40%40download%2FENCFF698KFV.hic":"4427896684,35751","www.encodeproject.org%2Ffiles%2FENCFF239BHZ%2F%40%40download%2FENCFF239BHZ.hic":"1718552021,36479","www.encodeproject.org%2Ffiles%2FENCFF277LAN%2F%40%40download%2FENCFF277LAN.hic":"4542391336,36479","www.encodeproject.org%2Ffiles%2FENCFF397CMD%2F%40%40download%2FENCFF397CMD.hic":"2832016430,36479","www.encodeproject.org%2Ffiles%2FENCFF778OYA%2F%40%40download%2FENCFF778OYA.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF775VSU%2F%40%40download%2FENCFF775VSU.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF812THZ%2F%40%40download%2FENCFF812THZ.hic":"9667720429,36479","www.encodeproject.org%2Ffiles%2FENCFF777KBU%2F%40%40download%2FENCFF777KBU.hic":"5058284320,36479","www.encodeproject.org%2Ffiles%2FENCFF688KOY%2F%40%40download%2FENCFF688KOY.hic":"4198695833,36479","www.encodeproject.org%2Ffiles%2FENCFF223UBX%2F%40%40download%2FENCFF223UBX.hic":"1206064037,36479","www.encodeproject.org%2Ffiles%2FENCFF273XBU%2F%40%40download%2FENCFF273XBU.hic":"44085607579,54779","www.encodeproject.org%2Ffiles%2FENCFF952JZV%2F%40%40download%2FENCFF952JZV.hic":"44728845246,54779","www.encodeproject.org%2Ffiles%2FENCFF643NDM%2F%40%40download%2FENCFF643NDM.hic":"35877886780,54779","www.encodeproject.org%2Ffiles%2FENCFF586MQY%2F%40%40download%2FENCFF586MQY.hic":"71158037547,54779","www.encodeproject.org%2Ffiles%2FENCFF251VFA%2F%40%40download%2FENCFF251VFA.hic":"40089479399,54779","www.encodeproject.org%2Ffiles%2FENCFF033WGK%2F%40%40download%2FENCFF033WGK.hic":"30802023728,54779","www.encodeproject.org%2Ffiles%2FENCFF649OHR%2F%40%40download%2FENCFF649OHR.hic":"28203184265,54779","www.encodeproject.org%2Ffiles%2FENCFF782WVZ%2F%40%40download%2FENCFF782WVZ.hic":"37248221674,54779","www.encodeproject.org%2Ffiles%2FENCFF579CAR%2F%40%40download%2FENCFF579CAR.hic":"39662025395,54779","www.encodeproject.org%2Ffiles%2FENCFF514XWQ%2F%40%40download%2FENCFF514XWQ.hic":"1319613701,36479","www.encodeproject.org%2Ffiles%2FENCFF666USK%2F%40%40download%2FENCFF666USK.hic":"15051670107,32102","www.encodeproject.org%2Ffiles%2FENCFF047SDP%2F%40%40download%2FENCFF047SDP.hic":"1357076705,16438","www.encodeproject.org%2Ffiles%2FENCFF584LEP%2F%40%40download%2FENCFF584LEP.hic":"9314176858,36479","www.encodeproject.org%2Ffiles%2FENCFF671SOE%2F%40%40download%2FENCFF671SOE.hic":"3273732256,16438","www.encodeproject.org%2Ffiles%2FENCFF702LAP%2F%40%40download%2FENCFF702LAP.hic":"1800427500,31682","www.encodeproject.org%2Ffiles%2FENCFF339PON%2F%40%40download%2FENCFF339PON.hic":"5394351199,31514","www.encodeproject.org%2Ffiles%2FENCFF741QPR%2F%40%40download%2FENCFF741QPR.hic":"4271510019,30139","www.encodeproject.org%2Ffiles%2FENCFF103ANX%2F%40%40download%2FENCFF103ANX.hic":"4439745804,30083","www.encodeproject.org%2Ffiles%2FENCFF395SBC%2F%40%40download%2FENCFF395SBC.hic":"1596732351,31850","www.encodeproject.org%2Ffiles%2FENCFF289WNN%2F%40%40download%2FENCFF289WNN.hic":"8632980535,32102","www.encodeproject.org%2Ffiles%2FENCFF381EAU%2F%40%40download%2FENCFF381EAU.hic":"1702476311,36479","www.encodeproject.org%2Ffiles%2FENCFF976FEY%2F%40%40download%2FENCFF976FEY.hic":"1448279040,36479","www.encodeproject.org%2Ffiles%2FENCFF485LVS%2F%40%40download%2FENCFF485LVS.hic":"1593610856,36479","www.encodeproject.org%2Ffiles%2FENCFF143VJV%2F%40%40download%2FENCFF143VJV.hic":"1422312076,36479","www.encodeproject.org%2Ffiles%2FENCFF588NHX%2F%40%40download%2FENCFF588NHX.hic":"3943637009,36479","www.encodeproject.org%2Ffiles%2FENCFF768UBD%2F%40%40download%2FENCFF768UBD.hic":"24786676166,36479","www.encodeproject.org%2Ffiles%2FENCFF965PEE%2F%40%40download%2FENCFF965PEE.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF702IFC%2F%40%40download%2FENCFF702IFC.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF288DNV%2F%40%40download%2FENCFF288DNV.hic":"10313429504,36479","www.encodeproject.org%2Ffiles%2FENCFF698HWZ%2F%40%40download%2FENCFF698HWZ.hic":"10962849269,47429","www.encodeproject.org%2Ffiles%2FENCFF355OWW%2F%40%40download%2FENCFF355OWW.hic":"3219571601,36479","www.encodeproject.org%2Ffiles%2FENCFF177TYX%2F%40%40download%2FENCFF177TYX.hic":"10325679706,36479","www.encodeproject.org%2Ffiles%2FENCFF542BHD%2F%40%40download%2FENCFF542BHD.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF684IFW%2F%40%40download%2FENCFF684IFW.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF592UHE%2F%40%40download%2FENCFF592UHE.hic":"21363948089,32102","www.encodeproject.org%2Ffiles%2FENCFF779XIS%2F%40%40download%2FENCFF779XIS.hic":"9517383271,36479","www.encodeproject.org%2Ffiles%2FENCFF518PSL%2F%40%40download%2FENCFF518PSL.hic":"7500581463,36479","www.encodeproject.org%2Ffiles%2FENCFF275GBB%2F%40%40download%2FENCFF275GBB.hic":"7889407162,36479","www.encodeproject.org%2Ffiles%2FENCFF634KXI%2F%40%40download%2FENCFF634KXI.hic":"6430702966,36479","www.encodeproject.org%2Ffiles%2FENCFF337QPM%2F%40%40download%2FENCFF337QPM.hic":"8529733887,36479","www.encodeproject.org%2Ffiles%2FENCFF162KMP%2F%40%40download%2FENCFF162KMP.hic":"5615896908,36479","www.encodeproject.org%2Ffiles%2FENCFF992VTE%2F%40%40download%2FENCFF992VTE.hic":"7328975027,36479","www.encodeproject.org%2Ffiles%2FENCFF464WXY%2F%40%40download%2FENCFF464WXY.hic":"5715339664,36479","www.encodeproject.org%2Ffiles%2FENCFF752EGH%2F%40%40download%2FENCFF752EGH.hic":"1733758743,36479","www.encodeproject.org%2Ffiles%2FENCFF474UJM%2F%40%40download%2FENCFF474UJM.hic":"222309548,18679","www.encodeproject.org%2Ffiles%2FENCFF531UPZ%2F%40%40download%2FENCFF531UPZ.hic":"1827756846,36479","www.encodeproject.org%2Ffiles%2FENCFF022VHA%2F%40%40download%2FENCFF022VHA.hic":"244983451,18679","www.encodeproject.org%2Ffiles%2FENCFF732NGR%2F%40%40download%2FENCFF732NGR.hic":"1679484567,36479","www.encodeproject.org%2Ffiles%2FENCFF513VSF%2F%40%40download%2FENCFF513VSF.hic":"28397932940,36479","www.encodeproject.org%2Ffiles%2FENCFF750AOC%2F%40%40download%2FENCFF750AOC.hic":"36471430712,47429","www.encodeproject.org%2Ffiles%2FENCFF219YOB%2F%40%40download%2FENCFF219YOB.hic":"2859767211,26979","www.encodeproject.org%2Ffiles%2FENCFF604YDD%2F%40%40download%2FENCFF604YDD.hic":"3549694085,26979","www.encodeproject.org%2Ffiles%2FENCFF746AMV%2F%40%40download%2FENCFF746AMV.hic":"2954867135,26979","www.encodeproject.org%2Ffiles%2FENCFF845ZEB%2F%40%40download%2FENCFF845ZEB.hic":"2763039282,26979","www.encodeproject.org%2Ffiles%2FENCFF570LWS%2F%40%40download%2FENCFF570LWS.hic":"2861588289,26979","www.encodeproject.org%2Ffiles%2FENCFF883YVR%2F%40%40download%2FENCFF883YVR.hic":"2433679887,26979","www.encodeproject.org%2Ffiles%2FENCFF056VLK%2F%40%40download%2FENCFF056VLK.hic":"2502986910,26979","www.encodeproject.org%2Ffiles%2FENCFF532DUQ%2F%40%40download%2FENCFF532DUQ.hic":"3172615899,26979","www.encodeproject.org%2Ffiles%2FENCFF723PYJ%2F%40%40download%2FENCFF723PYJ.hic":"10292839095,36479","www.encodeproject.org%2Ffiles%2FENCFF991SGJ%2F%40%40download%2FENCFF991SGJ.hic":"13072407683,32102","www.encodeproject.org%2Ffiles%2FENCFF885UZI%2F%40%40download%2FENCFF885UZI.hic":"1201881201,16438","www.encodeproject.org%2Ffiles%2FENCFF287KXA%2F%40%40download%2FENCFF287KXA.hic":"14705801988,32102","www.encodeproject.org%2Ffiles%2FENCFF335HYI%2F%40%40download%2FENCFF335HYI.hic":"20366756545,32102","www.encodeproject.org%2Ffiles%2FENCFF121YPY%2F%40%40download%2FENCFF121YPY.hic":"2760104016,26979","www.encodeproject.org%2Ffiles%2FENCFF675SJE%2F%40%40download%2FENCFF675SJE.hic":"3751779995,26979","www.encodeproject.org%2Ffiles%2FENCFF876LAW%2F%40%40download%2FENCFF876LAW.hic":"4032376256,26979","www.encodeproject.org%2Ffiles%2FENCFF740KVX%2F%40%40download%2FENCFF740KVX.hic":"3202490322,26979","www.encodeproject.org%2Ffiles%2FENCFF977OQV%2F%40%40download%2FENCFF977OQV.hic":"2919735477,26979","www.encodeproject.org%2Ffiles%2FENCFF525EFN%2F%40%40download%2FENCFF525EFN.hic":"2394748073,26979","www.encodeproject.org%2Ffiles%2FENCFF690QRC%2F%40%40download%2FENCFF690QRC.hic":"3183023394,26979","www.encodeproject.org%2Ffiles%2FENCFF452FWS%2F%40%40download%2FENCFF452FWS.hic":"2951805127,26979","www.encodeproject.org%2Ffiles%2FENCFF089KBG%2F%40%40download%2FENCFF089KBG.hic":"2531936700,26979","www.encodeproject.org%2Ffiles%2FENCFF939ARM%2F%40%40download%2FENCFF939ARM.hic":"3066385212,26979","www.encodeproject.org%2Ffiles%2FENCFF401ZAN%2F%40%40download%2FENCFF401ZAN.hic":"3008677144,26979","www.encodeproject.org%2Ffiles%2FENCFF378RZT%2F%40%40download%2FENCFF378RZT.hic":"2830232168,26979","www.encodeproject.org%2Ffiles%2FENCFF304AVD%2F%40%40download%2FENCFF304AVD.hic":"6164439305,50358","www.encodeproject.org%2Ffiles%2FENCFF453DBX%2F%40%40download%2FENCFF453DBX.hic":"6775246670,36479","www.encodeproject.org%2Ffiles%2FENCFF590VOM%2F%40%40download%2FENCFF590VOM.hic":"6443478922,36479","www.encodeproject.org%2Ffiles%2FENCFF246DOF%2F%40%40download%2FENCFF246DOF.hic":"6837914659,36479","www.encodeproject.org%2Ffiles%2FENCFF125FXX%2F%40%40download%2FENCFF125FXX.hic":"9736232550,36479","www.encodeproject.org%2Ffiles%2FENCFF241RAY%2F%40%40download%2FENCFF241RAY.hic":"7686758397,36479","www.encodeproject.org%2Ffiles%2FENCFF415XWQ%2F%40%40download%2FENCFF415XWQ.hic":"6973092068,36479","www.encodeproject.org%2Ffiles%2FENCFF374EBH%2F%40%40download%2FENCFF374EBH.hic":"8557459058,36479","www.encodeproject.org%2Ffiles%2FENCFF263YWR%2F%40%40download%2FENCFF263YWR.hic":"331586820,18679","www.encodeproject.org%2Ffiles%2FENCFF280CGS%2F%40%40download%2FENCFF280CGS.hic":"1743569614,36479","www.encodeproject.org%2Ffiles%2FENCFF553ZNS%2F%40%40download%2FENCFF553ZNS.hic":"1717253636,36479","www.encodeproject.org%2Ffiles%2FENCFF451VOI%2F%40%40download%2FENCFF451VOI.hic":"1626927468,36479","www.encodeproject.org%2Ffiles%2FENCFF420MQO%2F%40%40download%2FENCFF420MQO.hic":"31055961677,36479","www.encodeproject.org%2Ffiles%2FENCFF301BWY%2F%40%40download%2FENCFF301BWY.hic":"38902429246,47429","www.encodeproject.org%2Ffiles%2FENCFF606XNW%2F%40%40download%2FENCFF606XNW.hic":"1009699327,36479","www.encodeproject.org%2Ffiles%2FENCFF439ZOU%2F%40%40download%2FENCFF439ZOU.hic":"12381714313,36479","www.encodeproject.org%2Ffiles%2FENCFF499SYK%2F%40%40download%2FENCFF499SYK.hic":"13182654663,47429","www.encodeproject.org%2Ffiles%2FENCFF532LFI%2F%40%40download%2FENCFF532LFI.hic":"8286030286,36479","www.encodeproject.org%2Ffiles%2FENCFF020DPP%2F%40%40download%2FENCFF020DPP.hic":"23521952420,47429","www.encodeproject.org%2Ffiles%2FENCFF306VTV%2F%40%40download%2FENCFF306VTV.hic":"23521952480,47429","www.encodeproject.org%2Ffiles%2FENCFF399IHE%2F%40%40download%2FENCFF399IHE.hic":"10216571232,36479","www.encodeproject.org%2Ffiles%2FENCFF944AII%2F%40%40download%2FENCFF944AII.hic":"12567308552,47429","www.encodeproject.org%2Ffiles%2FENCFF230HVV%2F%40%40download%2FENCFF230HVV.hic":"8629849711,36479","www.encodeproject.org%2Ffiles%2FENCFF174LAF%2F%40%40download%2FENCFF174LAF.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF898HRO%2F%40%40download%2FENCFF898HRO.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF429MOR%2F%40%40download%2FENCFF429MOR.hic":"1455757398,36479","www.encodeproject.org%2Ffiles%2FENCFF061NXV%2F%40%40download%2FENCFF061NXV.hic":"1710915891,36479","www.encodeproject.org%2Ffiles%2FENCFF434PYS%2F%40%40download%2FENCFF434PYS.hic":"1832274903,36479","www.encodeproject.org%2Ffiles%2FENCFF704HHX%2F%40%40download%2FENCFF704HHX.hic":"1768142834,36479","www.encodeproject.org%2Ffiles%2FENCFF349DPM%2F%40%40download%2FENCFF349DPM.hic":"4316041260,36479","www.encodeproject.org%2Ffiles%2FENCFF718AWL%2F%40%40download%2FENCFF718AWL.hic":"39544267907,58932","www.encodeproject.org%2Ffiles%2FENCFF065LSP%2F%40%40download%2FENCFF065LSP.hic":"24929805283,55874","www.encodeproject.org%2Ffiles%2FENCFF632MFV%2F%40%40download%2FENCFF632MFV.hic":"22333105467,55798","www.encodeproject.org%2Ffiles%2FENCFF179HVU%2F%40%40download%2FENCFF179HVU.hic":"2659219603,36479","www.encodeproject.org%2Ffiles%2FENCFF791SPZ%2F%40%40download%2FENCFF791SPZ.hic":"2537491657,36479","www.encodeproject.org%2Ffiles%2FENCFF211ZWF%2F%40%40download%2FENCFF211ZWF.hic":"3512141227,36479","www.encodeproject.org%2Ffiles%2FENCFF614BNU%2F%40%40download%2FENCFF614BNU.hic":"5252155462,36479","www.encodeproject.org%2Ffiles%2FENCFF891DLM%2F%40%40download%2FENCFF891DLM.hic":"2549095612,36479","www.encodeproject.org%2Ffiles%2FENCFF056EXT%2F%40%40download%2FENCFF056EXT.hic":"2219014704,36479","www.encodeproject.org%2Ffiles%2FENCFF776DSS%2F%40%40download%2FENCFF776DSS.hic":"3920308353,36479","www.encodeproject.org%2Ffiles%2FENCFF814LQF%2F%40%40download%2FENCFF814LQF.hic":"1349480197,36479","www.encodeproject.org%2Ffiles%2FENCFF513ZNA%2F%40%40download%2FENCFF513ZNA.hic":"2638868195,36479","www.encodeproject.org%2Ffiles%2FENCFF692IOL%2F%40%40download%2FENCFF692IOL.hic":"3106768498,36479","www.encodeproject.org%2Ffiles%2FENCFF294WZY%2F%40%40download%2FENCFF294WZY.hic":"2211089761,36479","www.encodeproject.org%2Ffiles%2FENCFF339UWS%2F%40%40download%2FENCFF339UWS.hic":"2142759055,36479","www.encodeproject.org%2Ffiles%2FENCFF835FSK%2F%40%40download%2FENCFF835FSK.hic":"3919821739,36479","www.encodeproject.org%2Ffiles%2FENCFF328BMB%2F%40%40download%2FENCFF328BMB.hic":"2550686152,36479","www.encodeproject.org%2Ffiles%2FENCFF897RTY%2F%40%40download%2FENCFF897RTY.hic":"1323294397,36479","www.encodeproject.org%2Ffiles%2FENCFF306MWH%2F%40%40download%2FENCFF306MWH.hic":"1665386199,36479","www.encodeproject.org%2Ffiles%2FENCFF039YUJ%2F%40%40download%2FENCFF039YUJ.hic":"2335679939,36479","www.encodeproject.org%2Ffiles%2FENCFF468QIN%2F%40%40download%2FENCFF468QIN.hic":"3352516594,36479","www.encodeproject.org%2Ffiles%2FENCFF364WXU%2F%40%40download%2FENCFF364WXU.hic":"3959043175,36479","www.encodeproject.org%2Ffiles%2FENCFF373MSH%2F%40%40download%2FENCFF373MSH.hic":"4429550624,36479","www.encodeproject.org%2Ffiles%2FENCFF959EGQ%2F%40%40download%2FENCFF959EGQ.hic":"2475218228,36479","www.encodeproject.org%2Ffiles%2FENCFF624XMK%2F%40%40download%2FENCFF624XMK.hic":"3527855681,36479","www.encodeproject.org%2Ffiles%2FENCFF445OKS%2F%40%40download%2FENCFF445OKS.hic":"3369125589,36479","www.encodeproject.org%2Ffiles%2FENCFF239QDV%2F%40%40download%2FENCFF239QDV.hic":"1960069888,36479","www.encodeproject.org%2Ffiles%2FENCFF645AVM%2F%40%40download%2FENCFF645AVM.hic":"4969006589,36479","www.encodeproject.org%2Ffiles%2FENCFF494IPI%2F%40%40download%2FENCFF494IPI.hic":"1565483792,36479","www.encodeproject.org%2Ffiles%2FENCFF753IXE%2F%40%40download%2FENCFF753IXE.hic":"2892400648,36479","www.encodeproject.org%2Ffiles%2FENCFF731GXX%2F%40%40download%2FENCFF731GXX.hic":"5131381303,36479","www.encodeproject.org%2Ffiles%2FENCFF369CAQ%2F%40%40download%2FENCFF369CAQ.hic":"4236629448,36479","www.encodeproject.org%2Ffiles%2FENCFF053VBX%2F%40%40download%2FENCFF053VBX.hic":"54305946375,47429","www.encodeproject.org%2Ffiles%2FENCFF555ISR%2F%40%40download%2FENCFF555ISR.hic":"54305946434,47429","www.encodeproject.org%2Ffiles%2FENCFF964RSP%2F%40%40download%2FENCFF964RSP.hic":"12065485229,36479","www.encodeproject.org%2Ffiles%2FENCFF234MZQ%2F%40%40download%2FENCFF234MZQ.hic":"17507142760,47429","www.encodeproject.org%2Ffiles%2FENCFF994CEG%2F%40%40download%2FENCFF994CEG.hic":"17507142760,47429","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb068e787-bbdd-49e2-9f6d-7a0e9f065d6e%2F4DNFIHSUIRFY.hic":"2701182442,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3768b89a-e124-40eb-8acd-94a4fdd35807%2F4DNFIXTAS6EE.hic":"3283740601,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9c513602-5abb-4088-8415-c827c381ab0d%2F4DNFIC3JD6O2.hic":"4896075767,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde954dad-1849-4c23-beb4-bf893b7d76c9%2F4DNFIGY85S4W.hic":"3364151996,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe1befa6e-8067-4296-8db2-67d2a2458985%2F4DNFI2LTNXME.hic":"3699291418,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbb3307fd-7162-477a-87c5-52f12d03befc%2F4DNFID162B9J.hic":"3576428773,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8597cdae-8319-42d9-9175-3f77aaee34e1%2F4DNFIQWS3632.hic":"4022561190,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F327f091d-6a63-47c4-9752-2dff303a13d9%2F4DNFI6GFHB6G.hic":"4239331168,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd70dc3b8-48a7-42c2-bd23-80bc44fc2266%2F4DNFIS5F6EBL.hic":"4404671861,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77df7bf8-6a3d-407a-8968-4ca1e78d2269%2F4DNFIF2D3TL9.hic":"4793989394,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8f7cc35-d2ef-4717-9009-c02154050fbf%2F4DNFI6EIFUZI.hic":"3370273763,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F98449d79-30d1-4e32-801d-07435819a42f%2F4DNFIRKGMZRQ.hic":"4669813207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd4fe1844-2493-4722-8b98-34a93a4bb7d8%2F4DNFIQWD8ZYD.hic":"5379889057,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1ee40499-1de4-47ff-b540-d9a65943c6b8%2F4DNFIX7H3CE2.hic":"4857679239,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac016170-23a7-4111-8773-353d6c150f34%2F4DNFIO21YDCV.hic":"4695989644,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1faea4e7-9a32-466e-a826-0bfdab6cd915%2F4DNFIUE5RAS6.hic":"4788044799,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcbd396ed-11bb-404f-aed9-ef10abc258e6%2F4DNFIFI6NIKJ.hic":"2069414927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3f78db-ae92-4215-bcae-76d30c617e5d%2F4DNFIL5K3MA1.hic":"2585598247,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66fc2893-224e-48b4-bdb0-25e022dedd03%2F4DNFIPV5KFMK.hic":"2060965679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2b39781d-aadc-434f-abe3-562d61308fdd%2F4DNFIW8TIFI5.hic":"1694424195,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6d28f7b-27d3-486f-b5ac-32567416560d%2F4DNFIA6NSSBJ.hic":"2219532611,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F08785616-722e-46bb-ade2-2fdd21324e11%2F4DNFIBKZK63V.hic":"2429136232,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F904b13d3-1203-42a4-812c-963e80c159b1%2F4DNFI3CFMRID.hic":"1233390166,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0ed4afe-5ecf-451d-bb1f-444697e3f558%2F4DNFIYIAUEPW.hic":"1753567534,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4bb9a9b3-12a8-4d2f-8071-4722294c88ea%2F4DNFIC3HAU11.hic":"2271375254,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5abf9c36-c1d1-44dc-8197-74d860d896c0%2F4DNFIM2BMJ33.hic":"1770471113,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa68475db-7816-4cec-b2da-d4ce4a0c7a0e%2F4DNFIBY3UHJB.hic":"2095528423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07c40943-0d0b-4b3e-94a0-8583b0e00b47%2F4DNFIWZEN3FF.hic":"1558559508,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8a39553-2718-4866-9b2a-45d8e9c5ac6f%2F4DNFIE5TEYK7.hic":"1323063102,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294b61ef-5565-4f04-ade9-f921a6686cce%2F4DNFI7H4II2V.hic":"1436947982,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a70ad7-7d34-4302-9c03-eb824bd4e633%2F4DNFIAS8LV1C.hic":"1263105698,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9db804c6-5a91-4cf5-8ae9-e054223afb77%2F4DNFIBXWIH8J.hic":"1587059951,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd1e55906-ec8f-444b-8ce1-2de22a431a76%2F4DNFIO2HBDAI.hic":"1666436393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a4b9b37-8e38-470c-8190-fd4d513c0bbb%2F4DNFIXWCLD4M.hic":"1513511880,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7615b2-5310-4bbf-a605-98761d3a3079%2F4DNFINASC4NQ.hic":"1420358914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F20454014-49cd-4e2d-93da-f40ad52776d5%2F4DNFIZF1KI43.hic":"1377041630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5df04e86-ee2a-45f2-b878-bf1648e2cca5%2F4DNFIQBHR9XC.hic":"1179502734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1cc910-bb3f-4106-802a-73184c58d5ba%2F4DNFIQVMVRP6.hic":"1811976991,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe431986b-0732-460f-92ff-0abd1694d2d0%2F4DNFIJ7OAIFQ.hic":"1685503856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56d0c575-4962-4ea3-92c3-55bd0e17c096%2F4DNFIE8E4ANZ.hic":"1598369564,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb1502fb-a989-4ef9-b800-7eaa7be172ae%2F4DNFIOUSETUP.hic":"1493294709,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Facc2f1c3-8c96-4d21-814a-3a8ba81e7741%2F4DNFIVJ3IIQL.hic":"1472376655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F037fb4c3-8641-4953-a977-cc71f2137582%2F4DNFIHN2QSMX.hic":"1179632606,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16d2c3c0-6d29-4815-b074-b142af90b615%2F4DNFIILDWK8M.hic":"2280059989,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31789849-e4db-45d8-9730-66a048c02d8a%2F4DNFI6XD6JAQ.hic":"2253961696,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fff04947e-e6e8-4d62-8374-ef2ee4104809%2F4DNFIALNLR78.hic":"1914687914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F53e6c1e7-9410-4158-84e6-57c2e683b095%2F4DNFIBT4EAKN.hic":"2296378356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0127900a-258f-4815-97d2-6fd2b043d853%2F4DNFIDJ2JZ7Q.hic":"2558945393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F89f95693-3d28-44eb-9d45-14932f8e258c%2F4DNFI8JFOAJT.hic":"1726440253,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd803d818-b0d4-4796-8d61-a9f3943f3b10%2F4DNFIRZA6EV6.hic":"1805017504,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff9165fb1-0782-4757-a740-5b929e0252bb%2F4DNFIB7QTIMH.hic":"2541020707,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8d916b2-b58e-4cdf-894c-ffcb3bf6ebd9%2F4DNFIJ5DQZVK.hic":"2445734043,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14066a5b-e01a-43c2-a468-b18826174df3%2F4DNFISTWNV9C.hic":"2499319890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd0692151-7f9a-4475-b059-f8802616dded%2F4DNFIBN9K4V9.hic":"1591570769,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70a7ef36-a514-4e45-918f-47c4e9e30ef4%2F4DNFIR8OU6QJ.hic":"1689882108,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F180306cd-8593-413a-ae83-24f19209c5d2%2F4DNFIDSWKFF5.hic":"1596696630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e7b9be7-f465-4434-8e9c-68d1e44a76af%2F4DNFIV239W4L.hic":"2345867406,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F55df948c-941d-4930-854c-6a07557a0c1d%2F4DNFIREVU1Z5.hic":"2254683002,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f590cb7-df3a-498f-81c3-d5ed4179b8ad%2F4DNFIFHU75I5.hic":"2497670883,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8f064770-6008-4f74-bfca-268d4a22d745%2F4DNFIMROE6N4.hic":"9850583704,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa93d0588-76b7-4ccf-933c-4325876b0a53%2F4DNFI5SUHCGZ.hic":"10364705187,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f5f0d6b-0b22-4936-93c9-0944d49c037b%2F4DNFII84FBKM.hic":"8836986129,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12e90fc5-0b76-4e42-b346-58d267f9ad6e%2F4DNFI2J1ODWB.hic":"13410858286,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2702a45-3e8b-4980-bcd5-6bb0e291614f%2F4DNFIJWBWE41.hic":"20515676755,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa0859349-5f06-4ad3-b56f-b1166b34a9eb%2F4DNFIIMZB6Y9.hic":"15350325963,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12685c57-d54a-46fa-9efb-acf34ed77574%2F4DNFICJECID5.hic":"1525002266,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd101a58e-89aa-44fd-96c5-6bf1e2476272%2F4DNFIR6UW2QA.hic":"1264999913,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8c73bf-1335-4af4-b124-e3622d48c5f6%2F4DNFIGOEKBUZ.hic":"1905947578,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcd2477cf-6ed0-4d7b-b4e9-88fb38b0df48%2F4DNFIMDNAEW4.hic":"996444147,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0f03953e-29da-4f2e-8c05-572d0edf4525%2F4DNFI5OSZ3JC.hic":"369361754,22829","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F29d95dbb-005a-4ae1-8b9c-0fec9ec0bbd0%2F4DNFI7KOUGFM.hic":"1227434049,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa441ab7b-afbe-437d-bf98-b6b916558642%2F4DNFIGKX4A32.hic":"883933242,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F941b2f94-2fff-4d3c-aceb-fee4a5ae41a9%2F4DNFI1ORHOTA.hic":"1140970677,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8720ede9-093f-4c00-912f-373283260a16%2F4DNFIWSVLZED.hic":"458091151,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9e17155-2b62-4a68-afb2-31dfa674e169%2F4DNFI6H926RO.hic":"3552863515,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F22f22778-987a-4dc0-97bc-f26eae0156d9%2F4DNFIKTYSPOF.hic":"2939475400,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40f40192-0acb-44cb-8778-8d21afe593fb%2F4DNFIZ4S52BV.hic":"3067438113,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8767374-7018-4e11-9226-bf5612d39ebb%2F4DNFI3APMXHF.hic":"3258874744,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c5140ec-a65a-4186-8c59-2927233eecaa%2F4DNFIQLIKDSD.hic":"2746398416,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8cdedda6-d7d8-4231-a85b-d56fcd962366%2F4DNFIKYXMF1E.hic":"14442148774,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa4d4497-7c6c-4dad-8040-be13ba07ea32%2F4DNFI9815EEJ.hic":"17960817603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9b7b95f-190b-49fe-8047-ef4a8fc59746%2F4DNFIQ2687RT.hic":"15954277087,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F59863d3a-8d7c-49c7-9a41-7f2a58ad24d1%2F4DNFIYDBBSE3.hic":"16499534862,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e80ca41-b3e0-4f4f-a05e-8f95fe96d938%2F4DNFIMOCN1YS.hic":"863725312,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F96f97a01-0020-4f09-93e8-fc8a9fd07218%2F4DNFI6558CM8.hic":"1597967345,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fce9e9334-ee0b-4549-a845-110470ba5986%2F4DNFIQZRKS7Y.hic":"907626411,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaac8209-1015-48da-9e31-2e252dfd8fe0%2F4DNFIX4DLXSE.hic":"1369766288,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F268b7d52-9655-474c-9467-8ba31bb2195c%2F4DNFII3JV8I1.hic":"856656441,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9681f9b5-335a-4f56-afa1-15b58bbb41e8%2F4DNFI5IAH9H1.hic":"1495185175,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e082eab-95aa-4677-88ed-9d7adcc1effb%2F4DNFIK5HY1GP.hic":"2135337789,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31af1ead-4520-4669-957e-424b4b197c33%2F4DNFIFA89L5B.hic":"1975593640,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcc2b78fd-52d4-4e0c-ac93-b84ee82daf7e%2F4DNFICXCFGEI.hic":"2628202920,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff54efece-280f-46ca-95e3-1f8a3cd18820%2F4DNFIK4CECUH.hic":"1901129375,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1181c0c4-afb7-4b6a-9fdc-d868fb2253fc%2F4DNFI1EYIGOC.hic":"1947135384,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1d3e2905-b9b9-4b91-bcb4-8d34746e78f6%2F4DNFI7TLEWUI.hic":"1185758726,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faba3d42f-39cd-4a85-9d3f-835aefb5c803%2F4DNFIVCJKHMN.hic":"687240974,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F27f54fcb-54fe-41a4-b25a-2f8944c89044%2F4DNFIN8F14CS.hic":"1304082029,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb75fedb5-88f4-4bc0-8e38-298df7847a7f%2F4DNFI5LCW273.hic":"12497258313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f22b2a0-3712-496e-92d2-63775ec0e421%2F4DNFIVSCH2CH.hic":"12594733778,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07e47261-5863-44f5-9198-76e263081bea%2F4DNFIZ268JGC.hic":"1499059135,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F682b1ae1-3ac3-40e4-a330-c49f63946952%2F4DNFIJ1P4HBI.hic":"1190211725,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F197e7c89-ea73-41de-8cb2-8c0b1e3bb945%2F4DNFITEGKBIW.hic":"2061501971,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F191f6928-c9a8-44b2-8516-ee4d6005f24b%2F4DNFIE1P6RVH.hic":"1711447310,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F94435086-3701-4b28-a6d0-4a59b24d7615%2F4DNFICJ6I4DO.hic":"1557899940,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa9ac173-d233-41c7-8985-ca91949664e4%2F4DNFIKUG8MEW.hic":"1339072088,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fba6d8ab6-ee18-4ba2-8da9-d631888dd50a%2F4DNFICFZGFAV.hic":"1261083478,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a3ab04-7094-4673-81e4-ac8c9add8eb5%2F4DNFIQXCZVVA.hic":"1084913802,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc1ff488-82af-4579-9424-959184edb139%2F4DNFIB6PJFJ3.hic":"1114571343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f7026ee-987a-41e7-8a61-45510ee3f86b%2F4DNFIX97731O.hic":"1246860402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6186787c-2e72-4925-9729-02121e2e4597%2F4DNFIYQYZOTO.hic":"1212210849,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b98a946-0109-4efa-a13e-cc7a36772125%2F4DNFIPXU7V25.hic":"1696288217,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fea17d041-c6ed-43a1-8047-535f3d19ad44%2F4DNFIL39PR76.hic":"1719284710,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72774afe-f166-42ac-9849-4070b0dadf6d%2F4DNFIYLJ3R3B.hic":"1106419640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a45e733-55f8-4a8e-be24-2ef34c976e25%2F4DNFIL51WBN6.hic":"1327651164,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F086c62b0-a26f-41ae-a5ff-88b8be2bd2aa%2F4DNFI6SFPUDA.hic":"1336964405,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4d9b79c7-af62-4070-84a9-b953903f2732%2F4DNFI2KM22QR.hic":"953067310,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c9889d1-f49e-4639-8e15-2d99d6cd22e7%2F4DNFIVF8Q45U.hic":"984193565,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa080dd7b-b7bb-4eae-a275-572a8b45b2d0%2F4DNFI2RN3WFP.hic":"1046525527,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb81860ca-c227-4b68-a298-1907fd32300a%2F4DNFI4TJTL7A.hic":"1160373401,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F74ab47dc-7b52-421c-845e-6feb33457adf%2F4DNFIYJ4TWB8.hic":"1268416204,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc6582128-a930-4bcc-941e-5c0733bdd4d5%2F4DNFIM6RGKPV.hic":"863347067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11a75514-4450-4295-9eda-18e3678a575a%2F4DNFIL2VWWL5.hic":"860731581,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5eb52a8c-bf14-4225-bf34-14a0aa47c369%2F4DNFIX6ZXCA8.hic":"893462267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66aaa4c0-1f62-4040-8ecc-4e95da23cd18%2F4DNFIEVR81FS.hic":"879736207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F821c6e7f-96f7-47de-b7d9-4970562b3c8e%2F4DNFIAUI6BBI.hic":"996313881,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9252c362-31ab-413d-a47a-cc97bdbf243a%2F4DNFIAFEE9G2.hic":"1103265750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc1a0bf52-2e65-4deb-871f-ede736babd41%2F4DNFIPZBEXCP.hic":"1081257762,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F729f5ce3-d7e0-466d-b781-d18049e63bfa%2F4DNFIWPKRZGU.hic":"973779283,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80b769ee-a717-4825-9db0-dca86f913173%2F4DNFIMD9QNDX.hic":"1158688208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F266290c0-2767-4158-85ab-7274368905b9%2F4DNFIATA1HD5.hic":"1073361089,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc46f18a8-eb24-4d35-b112-36db72bde2f5%2F4DNFIH9U4I7I.hic":"1111124316,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fec91a79e-7de7-49f7-9b3d-d28313aeddc8%2F4DNFIZ95S6TR.hic":"1242494051,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e9390b9-da20-43bb-a8f4-9830f354ddf9%2F4DNFI5ERM9J7.hic":"1271051397,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee8ea82e-b9e4-41ad-bced-5f4fbdaa4fec%2F4DNFI15FPSQL.hic":"1216714120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbed7eb86-8990-42f2-b3ee-5992d6361f7c%2F4DNFIJ3DZPGM.hic":"1035089437,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaa8a324-3bf8-424c-8a86-b8ad325cc20d%2F4DNFINW9P6XF.hic":"1215712740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70631758-6bf8-47a0-92b6-132574886faa%2F4DNFITS16HW8.hic":"1105283847,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe473304b-7bc8-49b8-bba1-ecb9f06914ee%2F4DNFIS3DIH4V.hic":"1036056660,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F10f9224a-111c-402a-ac25-e221ad0af9ef%2F4DNFIY3KDHP6.hic":"1071761024,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17519b96-2bdd-4294-98f0-1535f1aef28e%2F4DNFIO8HVKOL.hic":"953793750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb18f896-4730-4909-86a3-867fc8e76cd6%2F4DNFIMF6CFOM.hic":"708717889,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcfee4d87-0873-40b0-b79f-35dcc8669c1c%2F4DNFIZZ77KD2.hic":"732668723,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8b5d909-8a1b-41bb-bcdd-d108a0bde762%2F4DNFIOLO226X.hic":"951271932,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ce81f6e-b9cf-4ec9-8bd3-517539e4b662%2F4DNFIJMS2ODT.hic":"932509067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F506aa952-5d41-49ff-b658-916bcf88a395%2F4DNFI49F3LJ4.hic":"1208494817,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4dc392d-ca36-4bdf-a27d-173cae34f520%2F4DNFI65MQOIJ.hic":"854630155,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F149ef8d7-e0b4-4e4f-b7e5-7226e2603746%2F4DNFIM4KEPRD.hic":"882790622,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa436f0a8-4f9a-4524-90ac-795c5b8491cf%2F4DNFIIXBIZFC.hic":"848244425,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc8a05dc-7449-4b01-8330-a55db37ca8e6%2F4DNFIWDOOBVE.hic":"1116239020,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faef8b881-28fe-4694-9a95-1d31940e6726%2F4DNFIDT9EB5M.hic":"888289053,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff66f3162-a53d-46f2-8800-3752935d5400%2F4DNFIX2VUNV8.hic":"1226661451,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F36c782e6-2c48-4298-aa43-bd6624da003d%2F4DNFIEQHTV1R.hic":"804665819,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff15d571e-605d-4bcc-a359-0350b57a6815%2F4DNFIFW7GA64.hic":"901568712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2aa2e8b-ac7f-4acb-b4b5-ac5f845840fe%2F4DNFIXGXD67I.hic":"970995551,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F71b6fd7d-b249-4d65-a597-b80b95845399%2F4DNFIA7GB1NB.hic":"956785837,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cbb1418-34db-427f-9273-5174eac81529%2F4DNFIVOJGWNP.hic":"890415052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc69c2ee7-b6c3-4a62-8d4f-913491c9dab8%2F4DNFIW22BNB5.hic":"1075499540,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa268f28f-c6d9-4324-8989-75d2d317af1b%2F4DNFIIFBC8WN.hic":"1045459440,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7361d4-60a6-440b-b5be-072cada98663%2F4DNFI9ZBEBJH.hic":"759395398,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcceaad1a-e01e-4430-8bd6-24ffa6891802%2F4DNFID4SLU53.hic":"921288444,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9eee5854-b33e-4d5a-9ba8-ceffd47e7488%2F4DNFIODI1NUJ.hic":"733159777,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5e1089b0-42e8-441c-99bb-4be99bcec28b%2F4DNFIJL26LFN.hic":"723567970,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F298a429e-ea29-49d3-bfed-fa851e1e7c4c%2F4DNFI5KTF553.hic":"2213661745,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F965d29f0-e4a3-477c-8ae4-faf4a654e69a%2F4DNFIYSPGFGV.hic":"2274989349,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd88acbc1-37b9-4266-9f97-d8fed576d0f3%2F4DNFILOR6D2D.hic":"2595459358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7b6ddbce-0ed1-4272-b8ae-32793e4ea4e4%2F4DNFI1WMMPJQ.hic":"2262433890,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fedc0c8c4-97d8-4372-9a4f-5e0cdf09d7d0%2F4DNFI47P5978.hic":"2146314403,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0edcc389-43a4-44d7-b946-fe3496f93d56%2F4DNFI7XGW6IH.hic":"2302805723,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0a802926-e235-4c80-b521-83a1774dfb46%2F4DNFIK1EJG8I.hic":"2374943035,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c36aedb-6a58-4aa2-9b11-bb440ec174f1%2F4DNFIDQ3THN9.hic":"2341188249,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F846123cd-8828-4e51-8b8a-27deaf293858%2F4DNFI3WPNFWT.hic":"775145629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd06e3ad-0e37-48a3-8367-c7d5912cab03%2F4DNFI9DCUOQ1.hic":"870487824,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2eaf9bf-9584-4cec-8685-bd74038a6c01%2F4DNFIU8AF5ZY.hic":"1276224366,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F219497b5-3f35-473b-9d4e-e1cf21c69561%2F4DNFIHW8NTQX.hic":"28864787856,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4be13558-114a-4f2d-abca-7598e2ff4757%2F4DNFI4OUMWZ8.hic":"17061013588,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49aed637-87a1-4d4d-ae68-e5da82aec05b%2F4DNFIEYQ5ZIR.hic":"13555272651,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa2f48779-4eff-44a6-8a9d-96435aca1ddc%2F4DNFIDZT7PR8.hic":"13425047093,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6ec6b71-27b8-4891-b10a-ab06a5270468%2F4DNFIEJEFCAM.hic":"15394960208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F68b9a7b5-8413-44fc-8c2d-59a67b1c4166%2F4DNFIJ8JKKWJ.hic":"17012681779,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294d45a4-8b5e-456f-a9cb-1cbbbad3a7d2%2F4DNFINEQY95T.hic":"13966775978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd7f3a48-b822-41e2-bd9c-f52b3aff7b6a%2F4DNFII6AN691.hic":"12367300362,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7da44594-0dc8-4e74-8e10-a957aeaea51a%2F4DNFIDBIEXI7.hic":"2015474981,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F085a0453-3784-4eba-80b2-3556e53e2f52%2F4DNFIDKJFK2S.hic":"1983111659,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc370c78c-0a99-4c3f-a29b-2dfafc6a3e86%2F4DNFIPAF4PYT.hic":"3041434294,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F907ce45f-baa5-416d-92de-e86db4bacff1%2F4DNFIWIYYNQ5.hic":"7082321112,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff13afc6b-cf69-4c9d-881f-eed4dd3c28ee%2F4DNFIHMCILEN.hic":"1739157603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7575d891-0e3d-4a77-896a-3e1b3a8d330b%2F4DNFIJBJ6QVH.hic":"5213499748,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0daa830-60d5-4c7c-a2e1-a4ee70b3fee7%2F4DNFIH2A7IKF.hic":"4099503507,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4970a25-91d8-49a7-9a4a-fe0f12cb2b0f%2F4DNFIOL8KGQ2.hic":"2256042055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879f1850-d175-4a86-8a97-12658482e3d1%2F4DNFIWILLD6C.hic":"5476286356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F787f538e-d619-4c8f-985b-78753fb7e57c%2F4DNFIZBXXJAF.hic":"5946467856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8ee785f-1016-4989-9e64-78352621d32f%2F4DNFI8PZOJHN.hic":"8307204961,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8997fa-528c-4531-b25b-a412de6bd472%2F4DNFIGXAMSJY.hic":"6577588285,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87aede55-7610-4283-af0e-c6840429a31e%2F4DNFIWNNO89O.hic":"2871061417,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93b8e020-b337-4685-81dc-40cc8a12b5e9%2F4DNFIXU2KPNQ.hic":"3401717686,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb5cf1bd-59d6-46fe-857d-b86d9756029d%2F4DNFIHBGD6N6.hic":"840028421,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2d1bc088-d838-49b8-85fc-fea78a7353c4%2F4DNFI7J8NI4A.hic":"675705256,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a27b63-fd67-401b-9aa2-2798e6588d21%2F4DNFISFM9VFK.hic":"800145922,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F656c0a9d-7058-4c4b-a3ce-701d929561c1%2F4DNFIJU5XBK7.hic":"966593603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2efacfbd-9c81-4e62-8df7-847d1ab774d5%2F4DNFIPKY8ED1.hic":"3401629450,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa50b6a26-56b5-43f2-b525-fa219fd716f1%2F4DNFIQRTP7NM.hic":"5358852759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5dc7a59-b998-4490-8a76-afbf3b258a49%2F4DNFIBCIA62Q.hic":"5779049277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62b2b237-cb02-45f7-89d9-616cf9ffb678%2F4DNFIV56OFE3.hic":"5818844506,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ac79b4f-cfbf-4b2a-9fc2-898ed6c3e5e1%2F4DNFILIM6FDL.hic":"19637469163,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cff8afa-5a13-4ad4-bcad-91fc3ced759c%2F4DNFIP71EWXC.hic":"17934647326,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F000789fe-9a22-4280-a71c-7ad228fd4cac%2F4DNFIM7ZVQOQ.hic":"700134697,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8d78457f-0c2b-4358-b08c-4d4ef4d9f59d%2F4DNFIS6EYHCX.hic":"628314484,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ca3b4a0-2478-49c9-b4a2-a28430417a32%2F4DNFIKKCMS1Q.hic":"584050634,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5041473-18ec-439d-92b1-8ad98c9b25c0%2F4DNFIBIV8OUN.hic":"522632731,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcf474ec6-abd4-431e-a21c-252fcf5ee6b3%2F4DNFIAUMRM2S.hic":"313395531,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bb1c73e-fb0f-41c4-8620-a938cc8d24a0%2F4DNFI9ZUXG61.hic":"332217525,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F26dfa41e-7e4f-457a-a3ac-72daf8059f3c%2F4DNFIDBFENL7.hic":"359604894,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ed2e68b-189e-4988-bb6d-94e63240a231%2F4DNFI7XAZNNQ.hic":"5312422266,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6f2b1ce0-5205-4680-981e-d91b694dc3e4%2F4DNFISNGDB53.hic":"2008546759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F73c8147f-bc7d-4d33-8a10-a9e7b413ecc6%2F4DNFI1CIGHYC.hic":"2221847625,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F526ae3e3-32cc-4670-970f-1faa9cfafd4d%2F4DNFIQD2DP2F.hic":"5295591503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e803530-47f8-4c56-bb19-fbdcd578d2f0%2F4DNFINHT8P7C.hic":"3159499486,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe705f38-903f-47b7-9b38-f80ebd18a479%2F4DNFIGF8EM7M.hic":"3490552542,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa197328-d6da-4299-a0fd-409ac9892668%2F4DNFIUPG2ZBJ.hic":"5382003751,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe5d52c4-2be7-4812-bca0-cd4bb3025e6b%2F4DNFIH3OTR14.hic":"3224693110,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21935f61-daa8-4df2-aa69-fcd27953b405%2F4DNFIUATRW3Z.hic":"3835865655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72147527-e3e8-4967-bc45-8251249d76c9%2F4DNFI6V7ZQAE.hic":"4382708138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F589f0919-f54d-49ff-a482-e2f453ef7f34%2F4DNFICKMT1CY.hic":"4479068191,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F861946ca-bad8-4a87-96e1-b2eb20b9ef10%2F4DNFIF9BDCNI.hic":"3698151402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff76346ac-97ec-4893-8984-2b75ce1cdc51%2F4DNFIG5O1OQS.hic":"5704288175,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe8b43826-f049-4c3f-b83a-e75fa7aacc85%2F4DNFIHS2SVBQ.hic":"990025510,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46316260-f555-4dd4-9e40-8ae06ca52822%2F4DNFIU95B69H.hic":"1275878544,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff62ef491-a3ae-4f66-ab33-c5673c9e0b65%2F4DNFIYRROFCR.hic":"1522530503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cd617e1-fad4-4fdc-8b4e-cb277650123c%2F4DNFIF7JN3IU.hic":"1463443128,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb20fe2a-0078-4d4a-8a52-d76043d06f40%2F4DNFIB2RYULQ.hic":"1269529700,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d386fcf-1d22-47de-a0d6-0c3a641ca174%2F4DNFIMVDK3SI.hic":"1185489599,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F00e470bd-c533-41b1-923a-4b471824da12%2F4DNFIRLOTXSC.hic":"978217499,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8774fb3-d0c5-43cc-a6c9-eb0ca39841fb%2F4DNFIZAPX6J8.hic":"1100356082,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fab3b826e-614c-448b-860f-a3ebef68a82f%2F4DNFIQD5VCSD.hic":"1322319877,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66c78d2b-993a-4937-95ed-9e2d302ceb3e%2F4DNFIIF6VAGN.hic":"868885799,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5d106fe1-2d80-466e-87aa-46b38ba142c5%2F4DNFI86IEZXH.hic":"751443267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc99490b6-faf9-413f-9c38-3f53018089d6%2F4DNFIP881SR2.hic":"754427927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F39c7e387-e710-4b1d-b757-357dec03f6ad%2F4DNFI42NNCW8.hic":"1166392978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4742a211-43b1-4325-af6f-82490aeb766b%2F4DNFIEV4PKP6.hic":"1102227476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaa73842-1c86-4ad9-8a9e-c189c0b4c01d%2F4DNFIF1DUQHE.hic":"1206699207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd25f24df-0298-4079-bb6f-1c8e1e32392b%2F4DNFIGW55EAY.hic":"1033358104,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc57a7ab5-2778-4fe2-9d64-9a4e95135f12%2F4DNFISZRU6I4.hic":"1539570262,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd89f494a-27ca-46b6-89be-7583f3f6d18c%2F4DNFIBKKDTAP.hic":"350372180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F06725280-cb24-4f22-a267-18b434bfa79e%2F4DNFIJSRQW24.hic":"314361467,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8fe5c3c5-006f-425b-ac6d-ea475e29be78%2F4DNFI3REN89E.hic":"299665258,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8b6ac5c-13b4-427e-9158-cec0b890b6d8%2F4DNFIF5XLHKM.hic":"235668364,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F01ff33fc-fc23-48aa-a6c6-b720d6fe0768%2F4DNFIB6Q538N.hic":"316494853,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F552978c8-abbc-424a-9187-3e34cf802a97%2F4DNFI3ST3F7Y.hic":"296298411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72e66520-5170-4f2e-844a-fbfd0e23b480%2F4DNFIQT4M6UI.hic":"307691265,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb3eb3953-ffe8-4d5a-970c-a16f3b7b9ec3%2F4DNFIFNCC7M2.hic":"364160436,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F37d413fb-afab-41ff-99aa-1678830f7dde%2F4DNFITM9MDJL.hic":"252412426,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf5db92c-aaf1-4086-a0d2-79b28648f172%2F4DNFI3NTD7B3.hic":"227586640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6892f7b-1f8a-4d7d-9605-c67932cd5654%2F4DNFIBED48O1.hic":"328344868,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd64afb07-5ab1-4c4f-8438-2fee37afa86a%2F4DNFISATK9PF.hic":"379669025,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fad11bb63-8692-461c-b698-89c601451321%2F4DNFISRP84FE.hic":"298491537,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F63710ec5-35d2-47dd-bf9a-08d3daa83d67%2F4DNFI2LY7B73.hic":"303150299,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76077d9e-ca75-4301-ab79-88aa49bda495%2F4DNFIXEB4UZO.hic":"711757090,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F34dd4c0e-3487-4fb4-b95f-c4bb66e0fa31%2F4DNFIQWWATGK.hic":"221304476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F48a8cf86-3248-4a8e-8e85-472ec219d49c%2F4DNFI44JLUSL.hic":"284772724,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee399fbf-2a9e-46e2-8364-457713bff508%2F4DNFIM7Q2FQQ.hic":"330729464,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F124d191a-c5c7-49b6-b84b-0d1bad8bef2b%2F4DNFIZK7W8GZ.hic":"293166018,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe351f7cc-7a2c-4515-ae0b-3bb2f91c986a%2F4DNFIMIMLMD3.hic":"240094740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffd1ae249-57b1-41d6-81a6-16b21dcd8f12%2F4DNFI7QUSU5J.hic":"681762505,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46c92c5c-9ad8-4d49-beba-f35c5cd99208%2F4DNFINXUOI5H.hic":"375594313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7350d40-4e9e-4131-9151-bb539d39b431%2F4DNFIIJR2296.hic":"331322302,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfacf37b-1665-45f3-a046-e29e1544e9b0%2F4DNFIJMZUTXR.hic":"361313244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F234e18fb-9990-43bf-9a48-f72722cfa232%2F4DNFIZQPT9EL.hic":"540421873,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b35ab09-2e79-4876-b2bc-d3a8faa26257%2F4DNFIZIXSZ9J.hic":"545066813,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae5118e-807a-46e0-8e92-143d4b282b3d%2F4DNFIDD9IF9T.hic":"237409149,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb34d7f6f-73f7-4b6b-80c7-c8af0f991549%2F4DNFIVC8OQPG.hic":"355121712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ab169fd-cbdd-4f60-8553-a4c6912ad89e%2F4DNFITUPI4HA.hic":"313085022,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4e53712b-d0d9-40c5-afe1-ffa0fad71e59%2F4DNFI5IZNXIO.hic":"341863906,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a91477f-45eb-4a16-affb-fc131f9326b8%2F4DNFII16KXA7.hic":"248904495,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F153729de-0eca-43cc-9b61-61aa8d775b38%2F4DNFIAAH19VM.hic":"668047244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879fd78a-7165-43d9-a0de-ca158b53df30%2F4DNFIVKIY3KV.hic":"247571318,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f901a4-040b-4b04-9fff-94a1780423cd%2F4DNFIVVCWL6C.hic":"198355985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd5b30c5a-654a-463c-9474-39bdc3ce4500%2F4DNFIJRF2273.hic":"343971277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7070280a-8f03-40d0-9fef-e9d9f4d3dae7%2F4DNFI6FCC9ZA.hic":"312013061,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F47049719-9407-4d76-9048-26231045f642%2F4DNFI1CPQ4O3.hic":"352923267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F862c2b5f-44c2-4bd7-9264-b3ca032d3d8d%2F4DNFISXFEDE9.hic":"271745977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feffbe052-39ff-4217-9871-44199ed90818%2F4DNFIF9L6QEQ.hic":"668409334,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa7791854-1b35-4258-90fb-603c55f24642%2F4DNFIPKASX1Q.hic":"312727920,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79cccad6-a78e-4de9-9fe7-08f7e8df663d%2F4DNFIWXZ4JQZ.hic":"151808553,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7e86e0cc-d6f1-4ce0-aba4-c36c6ebb3c4c%2F4DNFIEMQ1O8V.hic":"700533280,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a1b58d3-9ae6-43e4-91cf-49f1fcbbab33%2F4DNFIYWONU7A.hic":"729050356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67bff264-0b0c-4c5c-9d4d-ff5abef2bbe4%2F4DNFISNIE5FH.hic":"7987657997,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3a6a943f-2cc0-4433-a27d-c89f3fdd3309%2F4DNFIV8MLWJB.hic":"6646216171,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e235711-ba90-404d-b4ac-b15990ea8e33%2F4DNFIXSTDPHL.hic":"3146468238,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c89f4bc-e9fc-4ecf-b868-26108dbb7bb2%2F4DNFIQJNOH8U.hic":"2919703928,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1856ff9e-de7a-4fa1-ae0b-3e04b837b5e1%2F4DNFI57XB4A8.hic":"13417594377,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F099bb5b9-6315-4650-8f78-d603f5a046b3%2F4DNFIQ7UKVZV.hic":"9016468637,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3c7a30-0fc4-410d-8d41-247da3eb105d%2F4DNFIWJY8GHD.hic":"7921314766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda99f429-20ab-4d91-bbfe-f8bdea8ed7b1%2F4DNFIN8NKRNF.hic":"4247121358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0ca0f4e3-30ca-4332-b735-e32dce08e1a4%2F4DNFIZYGEHNZ.hic":"4910404663,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F243f48b0-6b59-4f37-ad39-a12e0986f530%2F4DNFIRPYGAV8.hic":"4220073636,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49f1a890-d458-42a6-9c78-99c38b6c7a8f%2F4DNFI6MZTDM1.hic":"375035361,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76bd4768-9343-44ba-a99d-5500e184e39d%2F4DNFIG3BCGPL.hic":"2422923206,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1ed866-eaf6-4906-aa8c-9e39616dde38%2F4DNFIS9YPJ3L.hic":"1593271574,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1e7a5636-bdb6-45fb-85d8-87a7e908de43%2F4DNFIOWGA9AX.hic":"1632314387,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ecc552a-0a6b-49a9-9aa5-9f3fd9b535fd%2F4DNFINKEDSBF.hic":"1458761024,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c03f1d2-bb25-4c94-b5f5-d5cdd01c14b6%2F4DNFIVIXVUK7.hic":"1504818271,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1a4616ff-6d04-4a6a-9773-b80e81da2471%2F4DNFIANHFY16.hic":"1850724180,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd2231870-a78d-4c8b-9cfd-084f2468acb1%2F4DNFIJ67ZFBI.hic":"1473864703,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F859c2dd3-df8a-42b7-86ea-bf6524f75e80%2F4DNFIG3YQQ4V.hic":"1539822829,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8bad667e-6003-4828-9a20-07585fa9c811%2F4DNFIOLKEOME.hic":"3036353747,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F92ea551b-5779-4d31-a0f5-621e4bd0eb21%2F4DNFIVLN8WJE.hic":"2710426318,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61ee79fa-0617-4083-b121-f92ef3a8905c%2F4DNFI2111XQA.hic":"2589549183,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F83ebb98d-e5db-403d-aa23-875293156c0e%2F4DNFI88HXX7D.hic":"2462367030,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6d63671a-8f1d-4159-82c0-931b43464772%2F4DNFIUBM6QK8.hic":"2486020469,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcccb9014-ce15-4032-81ac-222b3d621cb4%2F4DNFIVILEERC.hic":"2052537210,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a07867-4007-4ca5-b066-25d3168208dc%2F4DNFIF7Q43N4.hic":"2091773428,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff738de0f-358b-44bf-97dd-644c8d9b1b1c%2F4DNFID56VJGW.hic":"878913568,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda97c1d4-bb92-4a77-92a7-f7960f88b9dc%2F4DNFIYUR29KO.hic":"983915575,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F54ea363a-99e7-4f55-861e-1644acab7939%2F4DNFIUDPGHO8.hic":"905253594,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcd66a07-55ee-48d9-a157-419cf4ee3eef%2F4DNFISWC2N8T.hic":"1233576358,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40363837-7466-4a1d-b20d-a66d1670b700%2F4DNFICMPHDMI.hic":"516590777,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0b3fa4e6-caeb-40b4-8942-e9c0b03dfe4f%2F4DNFIKMKN736.hic":"634310295,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6a34050-d52b-4880-91cf-d3fe4b0ce982%2F4DNFIN5NLS49.hic":"650451131,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8e63a47b-9fd4-4772-8b0c-10ee589ffb16%2F4DNFI4P8UBRL.hic":"705655033,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d92b666-30cc-4838-9d46-c1f11cee3d3c%2F4DNFISNC3LAI.hic":"176146197,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17f7dc63-a1bc-4970-b389-87d9ee93b753%2F4DNFIVBWPFD7.hic":"749678512,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8897333-4791-4a83-9444-a653e24aee13%2F4DNFITMQRXB7.hic":"254477361,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8712bf31-33d0-4562-ab0b-a1e9cf4fd30c%2F4DNFIUYD3HBY.hic":"995625724,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfaf6383-9cc6-4b5c-9b20-d3bf2e8c3495%2F4DNFIRRSC7P9.hic":"1149985362,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0b70598-5d17-4e0a-8831-6cbe697e69e2%2F4DNFIWKR8FP6.hic":"1151628407,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fccc094a8-23ce-4fd8-9c4a-41f07c045c8f%2F4DNFIQ74RSUY.hic":"931695969,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8eda16f3-af5e-4f1f-b46d-c74df44b76aa%2F4DNFI9IIO5PW.hic":"1077740364,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff283637b-cf2c-4412-ba00-0e3d7e279fad%2F4DNFI8WGJG19.hic":"812086456,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ad8438f-d3d9-42d8-88bf-42845a0dc2d0%2F4DNFIQ5CCESJ.hic":"652559720,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70e3bdcc-caf4-4822-b9c5-85234873db7a%2F4DNFIWTZHB4H.hic":"760694196,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56ed767d-cd8a-4d38-8047-ed1e8bc8cd19%2F4DNFIENYQCDP.hic":"1159428005,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa912fff9-5f90-42b1-a3a6-cbb9eb2cf861%2F4DNFIFATZWPD.hic":"1033325746,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21338ea5-fdee-4ad8-b61c-608fc6cec4bc%2F4DNFI7YRXKEO.hic":"388142539,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0f88647-5631-437b-b48a-4603915e3714%2F4DNFIUY3J7EW.hic":"407344788,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16926af8-ac3b-4f32-97d5-6c0dc6f1596a%2F4DNFIRKUYKP4.hic":"893352368,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93e39aec-6cde-4c5b-bcdf-283faa3163a2%2F4DNFIAQDBJZP.hic":"489922022,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0dc0b1ba-5509-4464-9814-dfe103ff09a0%2F4DNFIC1CLPK7.hic":"565748333,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb50964c7-b025-49d9-b1ed-289bedb59678%2F4DNFI3A3VYWU.hic":"4597459343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4390cea-b330-4022-88c1-9ff8c0a786f7%2F4DNFI6JJQKFJ.hic":"3678393678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c0f730-5da1-4863-9b7a-6cdd31066cff%2F4DNFIK61ILGM.hic":"3324300994,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14b14ac4-ab59-4754-9c43-eacd9d0638e2%2F4DNFIYD8LO9Z.hic":"3227227120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7386f953-8da9-47b0-acb2-931cba810544%2F4DNFIOTPSS3L.hic":"253942497,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6b5d8bd-27dc-4415-a320-53405a16db85%2F4DNFI525PKU5.hic":"305089653,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f922dbc-637b-4c43-b816-f604f0e79ad1%2F4DNFI8Y9SRP2.hic":"1438589609,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6a36d686-716c-4ba8-a9c3-fa8311791d3c%2F4DNFIP25GZGA.hic":"1419100109,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0e535542-2cf2-46e4-ba10-7a0b946a7fb2%2F4DNFITPO1WTY.hic":"3885296184,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c17d228-5052-4c83-880e-af05118e6929%2F4DNFIG4X5Z5F.hic":"2159245890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc3977c00-525b-4556-9a27-061707f8cb76%2F4DNFIXLYR32S.hic":"587852728,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f856506-cbc5-4211-a29d-48a7530c622e%2F4DNFIWI3V5LI.hic":"2318237793,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F38f77979-5eb7-4b6f-9a60-c2451185db98%2F4DNFI2DGL7LH.hic":"2068150664,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe0992a75-7727-405e-95ac-aa97141b51c1%2F4DNFI1VSO8JP.hic":"1807949651,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe925f1aa-2e7b-44e7-bfa8-2084a613ab13%2F4DNFIV5O2ZYO.hic":"2242134377,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F803a6d3c-3972-4939-8ff2-d195c5192090%2F4DNFIEWEWQ8D.hic":"2981341325,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F25104375-a588-46e6-a382-663cee6c332f%2F4DNFICSTCJQZ.hic":"14592996888,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F927aa8a5-24a5-43b7-807a-1e99ac321459%2F4DNFICEGAHRC.hic":"15431307603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c380474-12cd-41f4-b86f-2a29faf12eec%2F4DNFIY3XPKPO.hic":"2550999291,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77da562e-d0ec-45a8-8764-14fa16d995a1%2F4DNFIK9PS9GM.hic":"3401011629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11b26222-d480-40a7-8d53-3ad8500396cb%2F4DNFIF4Y74JR.hic":"2127593378,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93df02c6-1047-43f6-afae-d3598b61eeea%2F4DNFIBBKG9KD.hic":"5724446278,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cd4378a-8f51-4e65-99eb-15f5c80abf8d%2F4DNFIT4I5C6Z.hic":"5419655766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F067881e5-563d-40de-a9e3-caccad887fbc%2F4DNFI2U38HCE.hic":"14749043471,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcb3da9ad-7afe-4d0c-9c2d-261181e7a95c%2F4DNFIETP228R.hic":"9401474797,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F185b7bcc-7bb7-41b7-9ebe-92d4fe159431%2F4DNFIXKC48TK.hic":"11624295594,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F18459b84-dd43-4af6-a05f-bcb773096322%2F4DNFIFPGOWJ6.hic":"2843730862,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffde1e48c-4a0d-4bb1-b84a-e0e45f9a0aa3%2F4DNFIIRMBE8Y.hic":"5820677927,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbabed539-1f0f-4e87-8815-fde596e6024c%2F4DNFIVUGNDD7.hic":"5170782436,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d00531a-e616-469b-af52-5b028270e2ce%2F4DNFIFLJLIS5.hic":"18917549985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a9dad53-b8af-4cb6-9ce3-5c38e4a855c7%2F4DNFIOX3BGNE.hic":"5482775936,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F82fd7b7e-5f47-48d5-bf0d-daaa48a4674d%2F4DNFISPUVQHA.hic":"2177864938,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4c6680f3-9cf6-452f-9dc5-ecebf376775d%2F4DNFI8649RQJ.hic":"3288850368,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2395f001-19d9-4000-9f00-dae3dea708d6%2F4DNFIE8T8JZ8.hic":"1383191843,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24464fa8-bf96-483c-8e9a-c2f626ad6e19%2F4DNFIBM714BP.hic":"1765204569,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F918fc048-fa27-41d2-a63a-d50c511fbb9a%2F4DNFI6CWNUFL.hic":"2431120602,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ff5a0d1-8e54-4cf0-9fe7-339f147c78da%2F4DNFIZ4F74QR.hic":"3211825957,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F355f0412-cb17-452a-b15c-aba16c5a742c%2F4DNFIOUVOX3R.hic":"5547401083,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cac91c5-160a-4b91-a91e-edc309318dd5%2F4DNFIVTDXW6X.hic":"4797344498,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9ac9ec5-6221-4f39-951a-1c5054fc9f1c%2F4DNFICA8Y9TN.hic":"4277557869,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46f62222-b50a-428b-938b-5444951600eb%2F4DNFIDWM3HN5.hic":"4374808431,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F50e4f2a1-9cb6-4192-8199-64d354bfdf96%2F4DNFIBK5TB3N.hic":"3757387253,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4cdd5a8-1a45-4c6a-906b-a9603260d4c8%2F4DNFI3JYF9VS.hic":"5260534916,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8164e99-5778-427d-be26-f0e1b62400f0%2F4DNFIP1GNKUO.hic":"7589365689,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0d72e78a-fc87-4716-8b8e-6dc5650ff2ef%2F4DNFIQYQWPF5.hic":"22022259901,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac58fc15-48c2-4eec-a689-23b677b4b6e7%2F4DNFIW6H9U3S.hic":"6810897169,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31811e40-e3ca-4456-8ba6-2ee66d6c7104%2F4DNFI7J8BQ4P.hic":"7188744676,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62d81a52-d2cb-4bbd-8510-0fe120e786e0%2F4DNFIA3AKFSU.hic":"1763730692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae0b7513-d1a0-4f27-a9d3-348837f42cb6%2F4DNFID68JQY9.hic":"2422880133,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae6a1a7e-1d2d-4fd2-a89f-1799abac8a9c%2F4DNFIL1FQDXE.hic":"1543814834,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80d343c9-bd60-468a-803d-c3e351a958bc%2F4DNFITSIPCSK.hic":"2344682115,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2d61195-a3a6-4d50-b928-546ca67546cb%2F4DNFIJ88LYHR.hic":"3362742962,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31052aba-773a-4500-961b-e0a518245b0c%2F4DNFIJIPWD63.hic":"2529548812,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc93d0710-3fbf-40cc-b0eb-878e2aa659e4%2F4DNFIZUP2BBI.hic":"491996147,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8660baeb-5be1-4ba5-93e4-66499e9a4587%2F4DNFIEBC4AF3.hic":"2993048734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6d08fbc-b836-4776-82ad-8b1b277ae837%2F4DNFI5VO3E1W.hic":"1949322679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3af004a2-a6fa-46dc-8be8-898b847a77be%2F4DNFIFDGVWLU.hic":"2456400803,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd613b4b-2422-492c-8d8f-8afba9c8a182%2F4DNFITVGFNYZ.hic":"1411204423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc340694f-14f3-4638-b09b-98220c20039a%2F4DNFIOW9TTC1.hic":"2611370588,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3effa71b-6aa3-4265-87ba-f8d709d778d7%2F4DNFIOAA3ZEQ.hic":"3123195980,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde75cf8b-9ce1-44fc-8b7b-ca0adea6bae9%2F4DNFIA5ID1S6.hic":"3496246968,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F714f775d-a5a4-4314-83f8-016b9d73200b%2F4DNFIZYU7V81.hic":"4245592042,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ca518af-6e1e-4777-b67b-0fe7f039ce58%2F4DNFIRV6PVUX.hic":"3981520466,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc29b57d5-c263-4372-b396-ab4f55682f5d%2F4DNFIMEANFBY.hic":"3999623376,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4196d3ef-161a-4c18-a57e-005165c6b32a%2F4DNFIGLGQXLC.hic":"4105683321,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe10828b5-9519-4ceb-81e7-7228bfd890de%2F4DNFILS2HLXC.hic":"3804942111,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaac88c7-9bdc-4b1e-aa9f-e675520dfffa%2F4DNFIQS8853L.hic":"5287726781,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faab371b1-bc8d-4e83-998e-5bb977c443ca%2F4DNFIVBYCYGS.hic":"4657988157,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb116add-af8c-4a3b-b106-9f704ba0a175%2F4DNFIE4WWHMF.hic":"5116727268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F033366e2-05a2-4381-9d48-90122892a9e0%2F4DNFIKDUUC3C.hic":"45638237,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7284a446-442d-4a46-aae5-84987e75a7af%2F4DNFIJ5HIRA2.hic":"62201052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F876649a3-6dd3-463a-8b17-5752a98a89c5%2F4DNFIXDFC7EM.hic":"69878143,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cb4ce4d-d474-459f-8b8a-2159d8df8068%2F4DNFIO35EOVR.hic":"70153114,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5c5612fa-18c2-47fb-8074-693b1054e254%2F4DNFI57QGL6U.hic":"54605055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c1472d-cf3a-41d7-8682-cd03b7cc978d%2F4DNFI2AGEBE5.hic":"67930121,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bf4cce8-6e03-422b-a190-e51d4a07d501%2F4DNFI1E6NJQJ.hic":"4893181511,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0eb3aa56-8a23-435d-a07b-8bb545e8d708%2F4DNFI2DNFM1A.hic":"60466977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1201682a-a223-482d-913d-3c3972b8eb65%2F4DNFIIRIHBR2.hic":"48961678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6aee7913-6356-43cf-affa-f2b60dd478f6%2F4DNFIKXNMT46.hic":"39095246,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F357139a3-c9a5-4343-b0a4-b41c45fd03fd%2F4DNFIRV7IRJP.hic":"70916718,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76be3061-6259-42be-a917-19dcba41517b%2F4DNFIFX1XYKZ.hic":"229197441,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff60c348a-a62c-43c3-ac85-f6c28b5f823f%2F4DNFI64CJUZ5.hic":"112428610,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd0b0a14-9703-49af-bb36-2359f96d4d0e%2F4DNFIBPL2HL1.hic":"73972428,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79ac278d-83f7-4c1f-91b2-05c8018c1426%2F4DNFIBRSIPE4.hic":"415430378,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c3b8141-8e67-4211-80dd-3bae88f9e537%2F4DNFIDLDVY14.hic":"112747303,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae703d2-d85c-4ac4-9ce1-14d653927675%2F4DNFI4R1II4P.hic":"210565448,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76e641af-90be-49f8-b126-12c20f856159%2F4DNFINMLRY95.hic":"1590865292,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b416382-ae5d-469f-9e9a-85a3e2ce9793%2F4DNFI8KBXYNL.hic":"4626496956,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa27589a6-86b2-43a2-8218-1f2232d551e6%2F4DNFI53R5IKA.hic":"1536016455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdd3999f5-b36e-4154-a6b9-446656959a3a%2F4DNFIAWVDQ8C.hic":"2210273411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc377953b-0e61-426b-a905-abab2d5a3002%2F4DNFI9VXTBE2.hic":"3384365692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2dbe0377-1db2-4aae-af2b-d87dff728035%2F4DNFIT96Z365.hic":"7692311974,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcfcb009-f006-4ab8-a4c7-af72be58c12c%2F4DNFITUOMFUQ.hic":"6592120312,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f9073d-b2c5-474e-b3d5-7d72cde555cd%2F4DNFIHLQKDN8.hic":"2647703964,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76968cc8-fb9f-485b-85b2-c9289067194b%2F4DNFIL9M97T2.hic":"6186798917,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87d9330b-8d2c-4e9d-85bb-02e572de7a68%2F4DNFIDWGZLHX.hic":"4379708168,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffc01b381-3665-4225-88ee-2e5e9ecb7324%2F4DNFIMEG1QIC.hic":"3587146533,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3144a03c-15c3-4bf9-95f8-ffad2640a1bf%2F4DNFIWSB66VX.hic":"1529739069,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7d3aac0-ba66-494b-ba0c-147631084b98%2F4DNFIH7TH4MF.hic":"6896300679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b13bd19-fbd1-4c68-8855-4f0158d1ce47%2F4DNFIHKWIZ9T.hic":"1954878455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d04e286-30d4-4add-a806-7a929d36419e%2F4DNFIZBBX795.hic":"1350142414,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa26f261-a88a-4cac-9118-ff8e90ab6f61%2F4DNFI9ZWZ5BS.hic":"3410552807,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24e516ce-0b49-4476-b818-cc96471d8765%2F4DNFIPAI8XB5.hic":"4168518737,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac3b06b5-46d4-4c1e-97e9-9a4f353473a7%2F4DNFI1OUWFSC.hic":"10766406904,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76c6aa27-895f-4e82-8ed8-7a85aca84490%2F4DNFIX4PJKXZ.hic":"1463157350,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe6fbe03a-997b-4d72-a3cc-f1ed7bd88a92%2F4DNFIZGCA8AH.hic":"1597664180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61d99a87-4ec6-4116-be99-b483999641c4%2F4DNFI5CGQ46V.hic":"2870576870,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F271ea8cd-53b9-44c9-9fff-1bb5c444b54c%2F4DNFIOCW5AEM.hic":"2463600138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa98ca64a-861a-4a8c-92e9-586af457b1fb%2F4DNFI1UEG1HD.hic":"22480709268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5809b32e-0aea-4cf5-a174-cf162d591a35%2F4DNFI9YAVTI1.hic":"3141182061,25900"};const Nf="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,Bf=new class{constructor(e){this.wait=void 0===e?100:e,this.isCalled=!1,this.calls=[]}limiter(e){const t=this;let i=function(){t.calls.length&&!t.isCalled&&(t.isCalled=!0,t.calls.shift().call(),setTimeout((function(){t.isCalled=!1,i()}),t.wait))};return function(){t.calls.push(e.bind(this,...arguments)),i()}}}(100);class Mf{constructor(e){if(e.alert&&(this.alert=e.alert),this.config=e,this.loadFragData=e.loadFragData,this.fragmentSitesCache={},this.normVectorCache=new If(10),this.normalizationTypes=["NONE"],this.matrixCache=new If(10),this.blockCache=new Tf,e.file)this.file=e.file;else if(e.blob)this.file=new wf(e.blob);else{if(!(e.url||e.path&&!Nf))throw e.path?Error("path property is deprecated, use NodeLocalFile"):Error("Arguments must include file, blob, url, or path");{this.url=e.url||this.path,this.remote=!0;const i=new mf(e);(t=this.url).indexOf("drive.google.com")>=0||t.indexOf("www.googleapis.com/drive")>0?this.file=new bf(i,Bf):this.file=i}}var t}async init(){this.initialized||(await this.readHeaderAndFooter(),this.initialized=!0)}async getVersion(){if(void 0===this.version){const e=await this.file.read(0,128);if(!e)return;const t=new yf(new DataView(e));return this.magic=t.getString(),this.version=t.getInt(),this.version}return this.version}async getMetaData(){return await this.init(),this.meta}async readHeaderAndFooter(){let e=await this.file.read(0,16);if(!e||0===e.byteLength)throw Error("File content is empty");let t=new yf(new DataView(e));if(this.magic=t.getString(),this.version=t.getInt(),this.version<5)throw Error("Unsupported hic version: "+this.version);this.footerPosition=t.getLong(),await this.readFooter();const i=Object.values(this.masterIndex).reduce(((e,t)=>Math.min(e,t.start)),Number.MAX_VALUE)-16;e=await this.file.read(16,i),t=new yf(new DataView(e)),this.genomeId=t.getString(),this.version>=9&&(this.normVectorIndexPosition=t.getLong(),this.normVectorIndexSize=t.getLong()),this.attributes={};let n=t.getInt();for(;n-- >0;)this.attributes[t.getString()]=t.getString();this.chromosomes=[],this.chromosomeIndexMap={};let r=t.getInt(),s=0;for(;r-- >0;){const e={index:s,name:t.getString(),size:this.version<9?t.getInt():t.getLong()};"all"===e.name.toLowerCase()&&(this.wholeGenomeChromosome=e,this.wholeGenomeResolution=Math.round(2*e.size)),this.chromosomes.push(e),this.chromosomeIndexMap[e.name]=e.index,s++}this.bpResolutions=[];let o=t.getInt();for(;o-- >0;)this.bpResolutions.push(t.getInt());if(this.loadFragData){this.fragResolutions=[];let e=t.getInt();if(e>0)for(;e-- >0;)this.fragResolutions.push(t.getInt())}this.chrAliasTable={};for(let e of Object.keys(this.chromosomeIndexMap))e.startsWith("chr")?this.chrAliasTable[e.substr(3)]=e:"MT"===e?this.chrAliasTable.chrM=e:this.chrAliasTable["chr"+e]=e;this.meta={version:this.version,genome:this.genomeId,chromosomes:this.chromosomes,resolutions:this.bpResolutions}}async readFooter(){const e=this.version<9?8:12;let t=await this.file.read(this.footerPosition,e);if(!t)return null;let i=new yf(new DataView(t));const n=this.version<9?i.getInt():i.getLong();let r=i.getInt();const s=196*r;for(t=await this.file.read(this.footerPosition+e,Math.min(s,n)),i=new yf(new DataView(t)),this.masterIndex={};r-- >0;){const e=i.getString(),t=i.getLong(),n=i.getInt();this.masterIndex[e]={start:t,size:n}}if(this.expectedValueVectors={},this.version>5){const e=this.version<9?4:8;this.normExpectedValueVectorsPosition=this.footerPosition+e+n}return this}async printIndexStats(){let e,t=0,i=0;await await this.init();for(let n of Object.keys(this.masterIndex)){const r=this.masterIndex[n];t+=r.size,r.size>i&&(i=r.size,e=n)}console.log(`${i} ${e} ${this.config.url}`)}async getMatrix(e,t){const i=xf.getKey(e,t);if(this.matrixCache.has(i))return this.matrixCache.get(i);{const n=await this.readMatrix(e,t);return this.matrixCache.set(i,n),n}}async readMatrix(e,t){if(await this.init(),e>t){const i=e;e=t,t=i}const i=xf.getKey(e,t),n=this.masterIndex[i];if(!n)return;const r=await this.file.read(n.start,n.size);return r?xf.parseMatrix(r,this.chromosomes):void 0}async getContactRecords(e,t,i,n,r,s=!1){await this.init();const o=this.chromosomeIndexMap[this.getFileChrName(t.chr)],a=this.chromosomeIndexMap[this.getFileChrName(i.chr)];if(o>a||o===a&&t.start>=i.end){const e=t;t=i,i=e}const c=await this.getBlocks(t,i,n,r);if(!c||0===c.length)return[];const l=[],h=t.start/r,d=t.end/r,u=i.start/r,f=i.end/r,p=Math.floor(h),g=Math.ceil(d),m=Math.floor(u),w=Math.ceil(f);for(let o of c)if(o){let a,c,b=e&&"NONE"!==e;const F=this.getFileChrName(t.chr),v=this.getFileChrName(i.chr);if(b){const t=await this.getNormalizationVector(e,F,n,r),i=F===v?t:await this.getNormalizationVector(e,v,n,r);t&&i?(a=await t.getValues(p,g),c=await i.getValues(m,w)):b=!1}for(let e of o.records)if(s||e.bin1>=h&&e.bin1<d&&e.bin2>=u&&e.bin2<f)if(b){const t=e.bin1,i=e.bin2,n=a[t-p]*c[i-m];if(0!==n&&!isNaN(n)){const r=e.counts/n;l.push(new kf(t,i,r))}}else l.push(e);void 0===this.percentile95&&o.records.length>10&&(this.percentile95=Lf(o.records,95))}return l}async getBlocks(e,t,i,n){const r=(e,t)=>`${t.getKey()}_${e}`;await this.init();const s=this.getFileChrName(e.chr),o=this.getFileChrName(t.chr),a=this.chromosomeIndexMap[s],c=this.chromosomeIndexMap[o];if(void 0===a)return console.log("No chromosome named: "+e.chr),[];if(void 0===c)return console.log("No chromosome named: "+t.chr),[];const l=await this.getMatrix(a,c);if(!l)return console.log("No matrix for "+e.chr+"-"+t.chr),[];const h=l.getZoomData(n,i);if(!h){let i=`No data avalailble for resolution: ${n} for map ${e.chr}-${t.chr}`;throw new Error(i)}const d=h.getBlockNumbers(e,t,this.version),u=[],f=[];for(let e of d){const t=r(e,h);this.blockCache.has(n,t)?u.push(this.blockCache.get(n,t)):f.push(e)}const p=f.map((e=>this.readBlock(e,h))),g=await Promise.all(p);for(let e of g)e&&this.blockCache.set(n,r(e.blockNumber,h),e);return u.concat(g)}async readBlock(e,t){const i=await t.blockIndex.getBlockIndexEntry(e);if(i){let n=await this.file.read(i.filePosition,i.size);if(!n)return;n=new ls(new Uint8Array(n)).buffer;const r=new yf(new DataView(n)),s=r.getInt(),o=[];if(this.version<7)for(let e=0;e<s;e++){const e=r.getInt(),t=r.getInt(),i=r.getFloat();o.push(new kf(e,t,i))}else{const e=r.getInt(),t=r.getInt(),i=1===r.getByte(),n=!(this.version<9)&&1==r.getByte(),s=!(this.version<9)&&1==r.getByte(),a=r.getByte();if(1===a){const a=s?r.getInt():r.getShort();for(let c=0;c<a;c++){const a=t+(s?r.getInt():r.getShort()),c=n?r.getInt():r.getShort();for(let t=0;t<c;t++){const t=e+(n?r.getInt():r.getShort()),s=i?r.getFloat():r.getShort();o.push(new kf(t,a,s))}}}else{if(2!=a)throw new Error("Unknown block type: "+a);{const n=r.getInt(),s=r.getShort();for(let a=0;a<n;a++){const n=Math.floor(a/s),c=e+(a-n*s),l=t+n;if(i){const e=r.getFloat();isNaN(e)||o.push(new kf(c,l,e))}else{const e=r.getShort();-32768!=e&&o.push(new kf(c,l,e))}}}}}return new Df(e,t,o,i)}}async hasNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Rf(e,r,i.toString(),n),o=await this.getNormVectorIndex();return o&&o[s]}async isNormalizationValueAvailableAtResolution(e,t,i,n){let r;if(Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}return void 0!==(await this.getNormVectorIndex())[Rf(e,r,i.toString(),n)]}async getNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Rf(e,r,i.toString(),n);if(this.normVectorCache.has(s))return this.normVectorCache.get(s);const o=await this.getNormVectorIndex();if(!o)return void console.log("Normalization vectors not present in this file");if(!1===await this.isNormalizationValueAvailableAtResolution(e,t,i,n)){const t=`Normalization option ${e} not available at resolution ${n}. Will use NONE.`;return console.log(t),void(this.alert&&this.alert(t))}const a=o[s],c=await this.file.read(a.filePosition,8);if(!c)return;const l=new yf(new DataView(c)),h=this.version<9?l.getInt():l.getLong(),d=this.version<9?8:4,u=this.version<9?a.filePosition+4:a.filePosition+8,f=new Sf(this.file,u,h,d);return this.normVectorCache.set(s,f),f}async getNormVectorIndex(){if(!(this.version<6)){if(!this.normVectorIndex){if(!this.config.nvi&&this.remote&&this.url){const e=new URL(this.url),t=encodeURIComponent(e.hostname+e.pathname);Ef.hasOwnProperty(t)&&(this.config.nvi=Ef[t])}if(this.config.nvi){const e=decodeURIComponent(this.config.nvi).split(","),t={start:parseInt(e[0]),size:parseInt(e[1])};return this.readNormVectorIndex(t)}try{return await this.readNormExpectedValuesAndNormVectorIndex(),this.normVectorIndex}catch(e){"416"===e.code||416===e.code?this.normExpectedValueVectorsPosition=void 0:console.error(e)}}return this.normVectorIndex}}async getNormalizationOptions(){return await this.getNormVectorIndex(),this.normalizationTypes}async readNormVectorIndex(e){await this.init(),this.normalizationVectorIndexRange=e;const t=await this.file.read(e.start,e.size),i=new yf(new DataView(t));this.normVectorIndex={};let n=i.getInt();for(;n-- >0;)this.parseNormVectorEntry(i);return this.normVectorIndex}async readNormExpectedValuesAndNormVectorIndex(){if(await this.init(),void 0===this.normExpectedValueVectorsPosition)return;const e=await this.skipExpectedValues(this.normExpectedValueVectorsPosition);let t=4,i=await this.file.read(e,4);if(0===i.byteLength)return;const n=new yf(new DataView(i)).getInt(),r={start:e+t,size:30*n};i=await this.file.read(r.start,r.size),this.normalizedExpectedValueVectors={},this.normVectorIndex={},await async function i(n,r){const s=new yf(new DataView(r));for(;n-- >0;){if(s.available()<100){n++,t+=s.position;const r=Math.max(1e3,30*n),o={start:e+t,size:r},a=await this.file.read(o.start,o.size);return i.call(this,n,a)}this.parseNormVectorEntry(s)}t+=s.position}.call(this,n,i),this.config.nvi=e.toString()+","+t}async skipExpectedValues(e){const t=this.version,i=new Ff({file:this.file,size:256e3}),n={start:e,size:4},r=await i.read(n.start,n.size),s=new yf(new DataView(r)).getInt();return 0===s?e+4:async function e(n,r){let s={start:n,size:500},o=0,a=n,c=await i.read(s.start,s.size),l=new yf(new DataView(c));l.getString(),l.getString(),l.getInt();const h=t<9?l.getInt():l.getLong();o+=l.position+h*(t<9?8:4),s={start:n+o,size:4},c=await i.read(s.start,s.size),l=new yf(new DataView(c));const d=l.getInt();return o+=4+d*(4+(t<9?8:4)),r--,0===r?a+o:e(a+o,r)}(e+4,s)}getZoomIndexForBinSize(e,t){let i;if("BP"===(t=t||"BP"))i=this.bpResolutions;else{if("FRAG"!==t)throw new Error("Invalid unit: "+t);i=this.fragResolutions}for(let t=0;t<i.length;t++)if(i[t]===e)return t;return-1}parseNormVectorEntry(e){const t=e.getString(),i=e.getInt(),n=e.getString(),r=e.getInt(),s=e.getLong(),o=this.version<9?e.getInt():e.getLong(),a=t+"_"+i+"_"+n+"_"+r;this.normalizationTypes.includes(t)||this.normalizationTypes.push(t),this.normVectorIndex[a]={filePosition:s,size:o}}getFileChrName(e){return this.chrAliasTable.hasOwnProperty(e)?this.chrAliasTable[e]:e}}function Rf(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}class Df{constructor(e,t,i,n){this.blockNumber=e,this.zoomData=t,this.records=i,this.idx=n}}class Tf{constructor(){this.resolution=void 0,this.map=new If(6)}set(e,t,i){this.resolution!==e&&this.map.clear(),this.resolution=e,this.map.set(t,i)}get(e,t){return this.resolution===e?this.map.get(t):void 0}has(e,t){return this.resolution===e&&this.map.has(t)}}function Lf(e,t){const i=e.map((e=>e.counts));i.sort((function(e,t){return e-t}));return i[Math.floor(t/100*e.length)]}class zf{constructor(e,t){this.config=e,this.genome=t,this.hicFile=e._hicFile?e._hicFile:new Mf(e),e._hicFile=void 0}async getHeader(){return await this.hicFile.init(),this.hicFile}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){this.hicFile.initialized||await this.hicFile.init();const s=this.hicFile.bpResolutions,o=s[s.length-1];return(await this.hicFile.getContactRecords(void 0,{chr:e,start:t,end:i},{chr:"celltype",start:0,end:1e8},"BP",o)).map((t=>{const i=t.bin1*o;return{chr:e,start:i,end:i+o,value:t.counts,sample:t.bin2.toString()}}))}supportsWholeGenome(){return!1}}function Hf(e,t){const i=new Set(e.attributeNames),n=t[0];if(void 0===e.getAttributes(n))return!1;{const t=Object.keys(e.getAttributes(n));for(const e of t)if(!1===i.has(e))return!1}return!0}class Pf extends Hl{#F=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),this.type=e.type||"seg","maf"===this.type&&(this.type="mut"),this.isLog=e.isLog,this.displayMode=e.displayMode||"EXPANDED",this.height=e.height||300,this.maxHeight=e.maxHeight||500,this.squishedRowHeight=e.sampleSquishHeight||e.squishedRowHeight||2,this.expandedRowHeight=e.sampleExpandHeight||e.expandedRowHeight||13,this.sampleHeight=this.squishedRowHeight,this.sampleKeys=[],e.samples){for(let t of e.samples)this.sampleKeys.push(t);this.explicitSamples=!0}if(e.color)this.color=e.color;else if(e.colorTable)this.colorTable=new ao(e.colorTable);else switch(this.type){case"mut":this.colorTable=new ao(qf);break;case"shoebox":e.colorScale&&(this.sbColorScale=gf.parse(e.colorScale));break;default:this.posColorScale=new uf(e.posColorScale||Of),this.negColorScale=new uf(e.negColorScale||Uf)}const t=Object.assign({},this.config);t.maxWGCount=t.maxWGCount||Number.MAX_SAFE_INTEGER,"shoebox"===this.type?(this.featureSource=new zf(t,this.browser.genome),this.height=e.height||500,this.maxHeight=e.maxHeight||800,this.isLog=!1,this.squishedRowHeight=e.squishedRowHeight||1,this.displayMode=e.displayMode||"SQUISHED",this.visibilityWindow=void 0===e.visibilityWindow?1e6:e.visibilityWindow):this.featureSource=Ad(t,this.browser.genome),this.initialSort=e.sort}async postInit(){"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader(),this.disposed)||this.header&&this.setTrackProperties(this.header)}menuItemList(){const e=[];if(!0===Hf(this.browser.sampleInfo,this.sampleKeys)){e.push("<hr/>"),e.push("Sort by attribute:");for(const n of this.browser.sampleInfo.attributeNames){if(this.sampleKeys.some((e=>{const t=this.browser.sampleInfo.getAttributes(e);return t&&t[n]}))){const r=Bt("<div>");function s(){const e=this.#F.get(n)||1;this.sortByAttribute(n,e),this.#F.set(n,-1*e),this.config.sort={option:"ATTRIBUTE",attribute:n,direction:1===e?"ASC":"DESC"}}r.html(`&nbsp;&nbsp;${n.split(Uu.emptySpaceReplacement).join(" ")}`),e.push({object:r,click:s})}}}const t={SQUISHED:"Squish",EXPANDED:"Expand",FILL:"Fill"};if("shoebox"===this.type&&this.sbColorScale){function o(e){this.browser.inputDialog.present({label:"Color Scale Threshold",value:this.sbColorScale.threshold,callback:()=>{const e=Number(this.browser.inputDialog.value,10);e&&(this.sbColorScale.setThreshold(e),this.trackView.repaintViews())}},e)}e.push("<hr/>"),e.push({object:Bt("<div>Set color scale threshold</div>"),dialog:o})}e.push("<hr/>"),e.push("DisplayMode:");const i="seg"===this.type||"shoebox"===this.type?["SQUISHED","EXPANDED","FILL"]:["SQUISHED","EXPANDED"];for(let a of i){const c=Dl(t[a],a===this.displayMode);e.push({object:Bt(c),click:function(){this.displayMode=a,this.config.displayMode=a,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.trackView.moveScroller(this.trackView.sampleNameViewport.trackScrollDelta)}})}return e}hasSamples(){return!0}getSamples(){return{names:this.sampleKeys,height:this.sampleHeight,yOffset:0}}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:t,end:i});if(this.updateSampleKeys(n),this.initialSort){const e=this.initialSort;if(void 0===e.option||"VALUE"===e.option.toUpperCase())this.sortByValue(e,n);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="DESC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return n}draw({context:e,pixelTop:t,pixelWidth:i,pixelHeight:n,features:r,bpPerPixel:s,bpStart:o}){if(xo.fillRect(e,0,t,i,n,{fillStyle:"rgb(255, 255, 255)"}),r&&r.length>0){if(this.checkForLog(r),"shoebox"===this.type&&!this.sbColorScale){const e=this.featureSource.hicFile.percentile95||2e3;this.sbColorScale=new gf({threshold:e,r:0,g:0,b:255})}const a={};let c;switch(this.sampleKeys.forEach((function(e,t){a[e]=t})),this.displayMode){case"FILL":this.sampleHeight=n/this.sampleKeys.length,c=0;break;case"SQUISHED":this.sampleHeight=this.squishedRowHeight,c=0;break;default:this.sampleHeight=this.expandedRowHeight,c=1}const l=this.sampleHeight;for(let e of r)e.pixelRect=void 0;const h=t+n,d=o+i*s+1,u=s;this.sampleYStart=void 0;for(let i of r){if(i.end<o||i.start>d)continue;const n=i.sampleKey||i.sample;i.row=a[n];const r=i.row*l+c;void 0===this.sampleYStart&&(this.sampleYStart=r);if(r+l<t||r>h)continue;const s=Math.max(i.start,o);let f=Math.round((s-o)/u);const p=Math.min(i.end,d),g=Math.round((p-o)/u);let m,w,b=Math.max(1,g-f);if(this.color?m="function"==typeof this.color?this.color(i):this.color:this.colorTable&&(m=this.colorTable.getColor(i.value.toLowerCase())),"mut"===this.type)w=l-2*c,b<3&&(b=3,f-=1);else if("shoebox"===this.type){m=this.sbColorScale.getColor(i.value);let e=l;if(l<.25){const t=.1+2*Math.abs(t.value);e=Math.min(1,t*l)}w=e-2*c}else{let e=i.value;this.isLog||(e=ys.log2(e/2)),m=e<-.1?this.negColorScale.getColor(e):e>.1?this.posColorScale.getColor(e):"white";let t=l;if(l<.25){const i=.1+2*Math.abs(e);t=Math.min(1,i*l)}w=t-2*c}i.pixelRect={x:f,y:r,w:b,h:w},e.fillStyle=m,e.fillRect(f,r,b,w)}}}checkForLog(e){if(void 0===this.isLog){this.isLog=!1;for(let t of e)if(t.value<0)return void(this.isLog=!0)}}computePixelHeight(e){if(!e)return 0;const t="SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight;return this.updateSampleKeys(e),this.sampleKeys.length*t}async sortByValue(e,t){const i=e.chr;let n,r;if(e.position?(n=e.position-1,r=n+1):(n=e.start,r=e.end),t||(t=await this.featureSource.getFeatures({chr:i,start:n,end:r})),!t)return;this.updateSampleKeys(t);const s={},o="ASC"===e.direction?1:-1,a=()=>{const e=r-n+1;for(let i of t){if(i.end<n)continue;if(i.start>r)break;const t=Math.max(n,i.start),o=(Math.min(r,i.end)-t)/e,a=i.sampleKey||i.sample,c=s[a]||0;s[a]=c+o*i.value}this.sampleKeys.sort((function(e,t){let i=s[e],n=s[t];return i||(i=o*Number.MAX_VALUE),n||(n=o*Number.MAX_VALUE),i===n?0:i>n?o:-1*o}))},c=()=>{for(let e of t){if(e.end<n)continue;if(e.start>r)break;const t=e.sampleKey||e.sample;(!s.hasOwnProperty(t)||e.value.localeCompare(s[t])>0)&&(s[t]=e.value)}this.sampleKeys.sort((function(e,t){let i=s[e]||"",n=s[t]||"";return o*i.localeCompare(n)}))};"mut"===this.type?c():a(),this.trackView.repaintViews()}sortByAttribute(e,t){this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}clickedFeatures(e){const t=super.clickedFeatures(e),i=e.y;return t.filter((function(e){const t=e.pixelRect;return t&&i>=t.y&&i<=t.y+t.h}))}hoverText(e){const t=this.clickedFeatures(e);if(t&&t.length>0)return`${t[0].sample}: ${t[0].value}`}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){i.length>0&&(i.push("<hr/>"),i.push("<hr/>"));const t=e._f||e,n="function"==typeof t.popupData?t.popupData(this.type,this.browser.genome.id):this.extractPopupData(t);Array.prototype.push.apply(i,n)}return i}contextMenuItemList(e){const t=e.genomicLocation,i=t=>{const i=e.viewport.cachedFeatures;this.sortByValue(t,i)},n=e.referenceFrame.toBP(2.5);return["DESC","ASC"].map((r=>{const s="DESC"===r?"descending":"ascending";return{label:"seg"===this.type||"shoebox"===this.type?`Sort by value (${s})`:`Sort by type (${s})`,click:()=>{const s={option:"VALUE",direction:r,chr:e.referenceFrame.chr,start:Math.floor(t-n),end:Math.floor(t+n)};i(s),this.config.sort=s}}}))}get supportsWholeGenome(){return(!1===this.config.indexed||!this.config.indexURL)&&!1!==this.config.supportsWholeGenome}updateSampleKeys(e){if(this.explicitSamples)return;const t=new Set(this.sampleKeys);for(let i of e){const e=i.sampleKey||i.sample;t.has(e)||(this.sampleKeys.push(e),t.add(e))}}}const Of={low:.1,lowR:255,lowG:255,lowB:255,high:1.5,highR:255,highG:0,highB:0},Uf={low:-1.5,lowR:0,lowG:0,lowB:255,high:-.1,highR:255,highG:255,highB:255},qf={indel:"rgb(0,200,0)","targeted region":"rgb(236,155,43)",truncating:"rgb(\t150,0,0)","non-coding transcript":"rgb(0,0,150)",synonymous:"rgb(109,165,95)",silent:"rgb(109,135,80)",missense_mutation:"rgb(72,130,187)",missense:"rgb(72,130,187)","splice site":"rgb(143,83,155)",splice_region:"rgb(143,83,155)",nonsense:"rgb(216, 57,81)",nonsense_mutation:"rgb(216, 57,81)",frame_shift_del:"rgb(226,135,65)",frame_shift_ins:"rgb(226,135,65)",in_frame_del:"rgb(247,235,94)",in_frame_ins:"rgb(247,235,94)","*other*":"rgb(159,91,50)"};class Qf{constructor(e){this.paired=!0,this.firstAlignment=e,this.chr=e.chr,this.readName=e.readName,e.start<e.mate.position?(this.start=e.start,this.scStart=e.scStart,this.connectingStart=e.start+e.lengthOnRef,this.connectingEnd=e.mate.position):(this.start=e.mate.position,this.scStart=this.start,this.connectingStart=e.mate.position,this.connectingEnd=e.start),this.end=Math.max(e.mate.position,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start;let t=Math.max(this.end,e.scStart+e.scLengthOnRef);this.scLengthOnRef=t-this.scStart}setSecondAlignment(e){this.secondAlignment=e;const t=this.firstAlignment;e.start>t.start?this.connectingEnd=e.start:this.connectingStart=e.start+e.lengthOnRef,this.start=Math.min(t.start,e.start),this.end=Math.max(t.start+t.lengthOnRef,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start,this.scStart=Math.min(t.scStart,e.scStart);const i=Math.max(t.scStart+t.scLengthOnRef,e.scStart+e.scLengthOnRef);this.scLengthOnRef=i-this.scStart}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}alignmentContaining(e,t){return this.firstAlignment.containsLocation(e,t)?this.firstAlignment:this.secondAlignment&&this.secondAlignment.containsLocation(e,t)?this.secondAlignment:void 0}popupData(e){let t=this.firstAlignment.popupData(e);return this.secondAlignment&&(t.push("-------------------------------"),t=t.concat(this.secondAlignment.popupData(e))),t}isPaired(){return!0}isMateMapped(){return!0}isProperPair(){return this.firstAlignment.isProperPair()}get fragmentLength(){return Math.abs(this.firstAlignment.fragmentLength)}get firstOfPairStrand(){return this.firstAlignment.firstOfPairStrand}get pairOrientation(){return this.firstAlignment.pairOrientation}hasTag(e){return this.firstAlignment.hasTag(e)||this.secondAlignment&&this.secondAlignment.hasTag(e)}getGroupValue({option:e,tag:t}){switch(e){case"strand":return this.isNegativeStrand()?"-":"+";case"FIRST_IN_PAIR_STRAND":return this.isPaired()?this.isFirstOfPair()?this.isNegativeStrand()?"-":"+":this.isSecondOfPair()?this.isNegativeStrand()?"+":"-":void 0:void 0;case"START":return this.start;case"INSERT_SIZE":return this.fragmentLength;case"MATE_CHR":return this.mate?this.mate.chr:void 0;case"MQ":return this.mq;case"ALIGNED_READ_LENGTH":return this.lengthOnRef;case"TAG":return this.tags()[t];case"PHASE":return this.tags().HP;case"READ_ORDER":return this.isPaired()&&this.isFirstOfPair()?"FIRST":this.isPaired()&&this.isSecondOfPair()?"SECOND":"";default:return}}}class Vf{static instances=new Map;static getKey(e,t,i){const n=""+e+t+i;return Vf.instances.has(n)||Vf.instances.set(n,new Vf(e,t,i)),Vf.instances.get(n)}constructor(e,t,i){this.base=e,this.strand=t,this.modification=i,this.canonicalBase="+"===this.strand?this.base:ac(this.base)}getCanonicalBase(){}toString(){return""+this.base+this.strand+this.modification}static compare(e,t){const i=e.modification,n=t.modification;return i===n?e.strand.charAt(0)-t.strand.charAt(0):jf.has(i)&jf.has(n)?jf.get(i)-jf.get(n):jf.has(i)?1:jf.has(n)?-1:i>n?1:-1}}const jf=new Map(["NONE_C","NONE_T","NONE_G","NONE_A","m","h","f","c","C","g","e","b","T","U","a","A","o","G","n","N"].map(((e,t)=>[e,t])));class Wf{constructor(e,t,i,n){this.base=e,this.modification=i,this.strand=t,this.likelihoods=n,this.canonicalBase="+"==this.strand?this.base:ac(this.base),this.key=Vf.getKey(e,t,i)}containsPosition(e){return this.likelihoods.has(e)}is5mC(){return this.modification.equals("m")&&("C"===this.base&&"+"===this.strand||"G"===this.base&&"-"===this.strand)}fullName(){return Gf.get(this.modification)||this.modification}}const Gf=new Map;Gf.set("m","5mC"),Gf.set("h","5hmC"),Gf.set("f","5fC"),Gf.set("c","5caC"),Gf.set("g","5hmU"),Gf.set("e","5fU"),Gf.set("b","5caU"),Gf.set("a","6mA"),Gf.set("o","8xoG"),Gf.set("n","Xao"),Gf.set("C","Unknown C"),Gf.set("T","Unknown T"),Gf.set("A","Unknown A"),Gf.set("G","Unknown G"),Gf.set("N","Unknown");const $f=new Map([["m","5mC"],["h","5hmC"],["f","5fC"],["c","5caC"],["g","5hmU"],["e","5fU"],["b","5caU"],["a","6mA"],["o","8xoG"],["n","Xao"],["C","Unknown C"],["T","Unknown T"],["A","Unknown A"],["G","Unknown G"],["N","Unknown"]]);function Kf(e){return $f.has(e)?$f.get(e):"Uknown"}function Yf(e){if(!e)return!1;const t=e.length;if(0==t)return!1;for(let i=0;i<t;i++){const t=e.charAt(i);if(t<"0"||t>"9")return!1}return!0}function Xf(e){return e<0?e+256:e}class Zf{allModifications=new Set;simplexModifications=new Set;maxLikelihoods=new Map;nomodLikelihoods=new Map;lastThreshold;incrementCounts(e){if(!e.blocks)return;const t=e.getBaseModificationSets();if(t)for(let i of e.blocks)if("S"!==i.type)for(let e=0;e<i.len;e++){let n,r=e+i.seqOffset,s=0,o=-1,a=255;for(let e of t){const t=Vf.getKey(e.base,e.strand,e.modification);this.allModifications.add(t);const i=e.likelihoods;if(e.containsPosition(r)){const c=Xf(i.get(r));a-=c,c>o&&(s=e.canonicalBase,o=c,n=t)}}if(0!=s){const t=i.start+e,r=Vf.getKey(s,"+","NONE_"+s);this.allModifications.add(r);const c=(e,t,i,n)=>{let r=n.get(i);r||(r=new Map,n.set(i,r));let s=r.get(e);s||(s=[],r.set(e,s)),s.push(t)};c(t,o,n,this.maxLikelihoods),a>o?c(t,a,r,this.nomodLikelihoods):c(t,o,n,this.nomodLikelihoods)}}}getCount(e,t,i,n){this.lastThreshold=i;const r=255*i,s=n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t);if(!s)return 0;const o=s.get(e);if(o){let e=0;for(let t of o){Xf(t)>=r&&e++}return e}return 0}getLikelihoodSum(e,t,i,n){this.lastThreshold=i;const r=255*i,s=(n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t)).get(e);if(s){let e=0;for(let t of s){const i=Xf(t);i>=r&&(e+=i)}return e}return 0}popupData(e,t){const i=[];i.push("<b>Modifications with likelihood > "+100*this.lastThreshold+"%</b>");for(let n of this.maxLikelihoods.keys()){if(this.maxLikelihoods.get(n).has(e)){let r="basemod2"===t;const s=this.getCount(e,n,this.lastThreshold,r);if(s>0){const t=this.getLikelihoodSum(e,n,this.lastThreshold,r)/s*.3921568,o=Kf(n.modification);i.push(o+" ("+n.base+n.strand+"): "+s+" @ average likelihood "+Math.round(t)+"%")}}}return i}computeSimplex(){const e=new Set(Array.from(this.allModifications).filter((e=>"-"===e.strand)).map((e=>e.modification)));for(let t of this.allModifications)"+"!==t.strand||e.has(t.modification)||(this.simplexModifications.add(t.modification),this.simplexModifications.add("NONE_"+t.getCanonicalBase()))}}class Jf{constructor(){this.alignments=[],this.score=void 0}findAlignment(e,t=!1){const i=(e,i)=>i>=e.start&&i<e.start+(t?e.fragmentLength:e.lengthOnRef);let n;for(let r=0;r<this.alignments.length;r++){const s=this.alignments[r];if(e>=s.start&&e<s.start+(t?s.fragmentLength:s.lengthOnRef)){s.paired?s.firstAlignment&&i(s.firstAlignment,e)?n=s.firstAlignment:s.secondAlignment&&i(s.secondAlignment,e)&&(n=s.secondAlignment):n=s;break}}return n}getSortValue({position:e,option:t,tag:i,sortAsPairs:n},r){t||(t="BASE");const s=this.findAlignment(e,n);if(void 0===s)return Number.MAX_VALUE;switch(t){case"NUCLEOTIDE":case"BASE":return function(e,t,i){let n;const r=Math.floor(i)-t.start;r<t.sequence.length&&(n=t.sequence.charAt(r));if(!n)return 0;const s=e.readBaseAt(i),o=e.readBaseQualityAt(i),a=t.coverageMap,c=Math.floor(i-a.bpStart),l=a.coverage[c];let h=0;if(e.insertions)for(let t of e.insertions)t.start===i&&(h=-l.ins);if(s)if(n=n.toUpperCase(),"N"===s&&0===h)h=2;else if(n!==s&&"="!==s||0!==h){if("X"===s||n!==s){h-=l["pos"+s]+l["neg"+s]+o/1e3}}else h=4-o/1e3;else{const e=l.del;e>0?h-=e:0===h&&(h=1)}return h}(s,r,e);case"strand":return s.strand?1:-1;case"START":return s.start;case"TAG":return s.tags()[i];case"READ_NAME":return s.readName;case"INSERT_SIZE":return-Math.abs(s.fragmentLength);case"GAP_SIZE":return-s.gapSizeAt(e);case"MATE_CHR":return s.mate?s.mate.chr:Number.MAX_VALUE;case"MQ":return void 0===s.mq?Number.MAX_VALUE:-s.mq;case"ALIGNED_READ_LENGTH":return-s.lengthOnRef;default:return Number.MAX_VALUE}}}var ep={fr:{F1R2:"LR",F2R1:"LR",F1F2:"LL",F2F1:"LL",R1R2:"RR",R2R1:"RR",R1F2:"RL",R2F1:"RL"},rf:{R1F2:"LR",R2F1:"LR",R1R2:"LL",R2R1:"LL",F1F2:"RR",F2F1:"RR",F1R2:"RL",F2R1:"RL"},ff:{F2F1:"LR",R1R2:"LR",F2R1:"LL",R1F2:"LL",R2F1:"RR",F1R2:"RR",R2R1:"RL",F1F2:"RL"}};class tp{#v=[];baseModificationKeys=new Set;constructor(e,t,i,{samplingWindowSize:n,samplingDepth:r,alleleFreqThreshold:s,colorBy:o}){this.alleleFreqThreshold=void 0===s?.2:s,this.samplingWindowSize=n||100,this.samplingDepth=r||1e3,this.chr=e,this.start=Math.floor(t),this.end=Math.ceil(i),this.length=i-t,this.coverageMap=new np(e,t,i,this.alleleFreqThreshold),this.downsampledIntervals=[],o&&o.startsWith("basemod")&&(this.baseModCounts=new Zf),this.alignments=[],this.pairsCache=new Map,this.downsampledReads=new Set,this.currentBucket=new ip(this.start,this.start+this.samplingWindowSize,this),this.hasPairs=!1}pack({viewAsPairs:e,showSoftClips:t,expectedPairOrientation:i,groupBy:n,displayMode:r}){let s=this.allAlignments();s=e?function(e){const t=new Map,i=e.map((e=>{if(ap(e)){let i=t.get(e.readName);return i?(i.setSecondAlignment(e),t.delete(e.readName),i):(i=new Qf(e),t.set(e.readName,i),i)}return e}));return i}(s):function(e){return e.flatMap((e=>e instanceof Qf?[e.firstAlignment,e.secondAlignment].filter(Boolean):[e]))}(s),this.packAlignmentRows(s,t,i,n,r),this.alignments&&delete this.alignments}packAlignmentRows(e,t,i,n,r){this.#v=[];const s=(e,i)=>{e.sort((function(e,i){return t?e.scStart-i.scStart:e.start-i.start}));const n=new op(i);let r,s=0,o=0;const a=new Set,c=()=>{r=new Jf,n.push(r),s=0,o=0,a.clear()};for(c();e.length>0;)if(o>=0&&o<e.length){const i=e[o];a.add(i),r.alignments.push(i),s=t?i.scStart+i.scLengthOnRef+2:i.start+i.lengthOnRef+2,o=cp(e,(e=>(t?e.scStart:e.start)>s),o)}else e=e.filter((e=>!a.has(e))),c();return n},o=(e,t)=>{e.sort((function(e,t){return e.start-t.start}));const i=new op(t),{start:n,end:r}=this.viewport.genomicRange();for(let t of e)if(t.end<n||t.start>r)this.#v.push(t);else{const e=new Jf;e.alignments.push(t),i.push(e)}return i};if(!e||0===e.length)return new Map;{const t=new Map;if(n)for(let r of e){const e=lp(r,n,i)||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}else t.set("",e);const a=new Map,c=Array.from(t.keys()).sort(function(e){switch(e){case"pairOrientation":return function(){const e=["LL","RR","RL","LR",""];return(t,i)=>e.indexOf(t)-e.indexOf(i)}();case"strand":case"firstOfPairStrand":return up;default:return e&&e.startsWith("base:")?dp:fp}}(n));for(let e of c){const i=t.get(e),n="FULL"===r?o(i,e):s(i,e);a.set(e,n)}this.packedGroups=a}}push(e){this.hasPairs=this.hasPairs||e.isPaired(),this.coverageMap.incCounts(e);const t=e.getBaseModificationSets();if(t)for(let e of t)this.baseModificationKeys.add(e.key);this.baseModCounts&&this.baseModCounts.incrementCounts(e),this.downsampledReads.has(e.readName)?this.currentBucket.downsampledCount++:(e.start>=this.currentBucket.end&&(this.finishBucket(),this.currentBucket=new ip(e.start,e.start+this.samplingWindowSize,this)),this.currentBucket.addAlignment(e))}finish(){void 0!==this.currentBucket&&this.finishBucket(),this.hasAlignments=this.alignments.length>0,this.alignments.sort((function(e,t){return e.start-t.start})),this.baseModCounts&&this.baseModCounts.computeSimplex(),delete this.currentBucket,delete this.pairsCache,delete this.downsampledReads}contains(e,t,i){return this.chr===e&&this.start<=t&&this.end>=i}hasDownsampledIntervals(){return this.downsampledIntervals&&this.downsampledIntervals.length>0}finishBucket(){this.alignments=this.alignments.concat(this.currentBucket.alignments),this.currentBucket.downsampledCount>0&&this.downsampledIntervals.push(new sp(this.currentBucket.start,this.currentBucket.end,this.currentBucket.downsampledCount))}allAlignments(){if(this.alignments)return this.alignments;if(this.packedGroups){const e=Array.from(this.packedGroups.values()).flatMap((e=>e.rows.flatMap((e=>e.alignments))));if(this.#v&&this.#v.length>0)for(let t of this.#v)e.push(t);return e}return[]}getMax(e,t){return this.coverageMap.getMax(e,t)}sortRows(e){if(this.packedGroups)for(let t of this.packedGroups.values())t.sortRows(e,this)}}class ip{constructor(e,t,{samplingDepth:i,downsampledReads:n,pairsCache:r}){this.start=e,this.end=t,this.alignments=[],this.downsampledCount=0,this.samplingDepth=i,this.downsampledReads=n,this.pairsCache=r,this.hasPairs=!1}addAlignment(e){this.hasPairs=this.hasPairs||e.isPaired();const t=this.hasPairs?Math.ceil(this.samplingDepth/2):this.samplingDepth;if(ap(e)){const t=this.pairsCache.get(e.readName);if(t)return t.setSecondAlignment(e),void this.pairsCache.delete(e.readName)}if(this.alignments.length<t)if(ap(e)){const t=new Qf(e);this.pairsCache.set(e.readName,t),this.alignments.push(t)}else this.alignments.push(e);else{const i=Math.floor(Math.random()*(t+this.downsampledCount-1));if(i<t){const t=this.alignments[i];if(this.pairsCache.has(t.readName)&&this.pairsCache.delete(t.readName),ap(e)){const t=new Qf(e);this.pairsCache.set(e.readName,t),this.alignments[i]=t}else this.alignments[i]=e;this.downsampledReads.add(t.readName)}else this.downsampledReads.add(e.readName);this.downsampledCount++}}}class np{constructor(e,t,i,n){this.chr=e,this.bpStart=t,this.length=i-t,this.coverage=new Array(this.length),this.maximum=0,this.threshold=n,this.qualityWeight=!0}getMax(e,t){let i=0;const n=this.coverage.length;for(let r=0;r<n;r++){const n=this.bpStart+r;if(n>t)break;const s=this.coverage[r];n>=e&&s&&(i=Math.max(i,s.total))}return i}incCounts(e){var t=this;if(void 0===e.blocks?i(e):e.blocks.forEach((function(e){i(e)})),e.gaps)for(let i of e.gaps)if("D"===i.type){const e=i.start-t.bpStart;for(let n=e;n<e+i.len;n++)n<0||(this.coverage[n]||(this.coverage[n]=new rp(t.threshold)),this.coverage[n].del++)}if(e.insertions)for(let i of e.insertions){const e=i.start-this.bpStart;e<0||(this.coverage[e]||(this.coverage[e]=new rp(t.threshold)),this.coverage[e].ins++)}function i(i){if("S"===i.type)return;const n=e.seq,r=e.qual,s=i.seqOffset;for(let o=i.start-t.bpStart,a=0;a<i.len;o++,a++){t.coverage[o]||(t.coverage[o]=new rp(t.threshold));const i=null==n?"N":n.charAt(s+a),c=e.strand?"pos"+i:"neg"+i,l=r&&s+a<r.length?r[s+a]:30;t.coverage[o][c]+=1,t.coverage[o]["qual"+i]+=l,t.coverage[o].total+=1,t.coverage[o].qual+=l,t.maximum=Math.max(t.coverage[o].total,t.maximum)}}}getPosCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.posA;case"C":case"c":return n.posC;case"T":case"t":return n.posT;case"G":case"g":return n.posG;case"N":case"n":return n.posN;default:return 0}}getNegCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.negA;case"C":case"c":return n.negC;case"T":case"t":return n.negT;case"G":case"g":return n.negG;case"N":case"n":return n.negN;default:return 0}}getCount(e,t){return this.getPosCount(e,t)+this.getNegCount(e,t)}getTotalCount(e){const t=e-this.bpStart;return t>=0&&t<this.coverage.length?this.coverage[t].total:0}}class rp{constructor(e){this.qualityWeight=!0,this.posA=0,this.negA=0,this.posT=0,this.negT=0,this.posC=0,this.negC=0,this.posG=0,this.negG=0,this.posN=0,this.negN=0,this.pos=0,this.neg=0,this.qualA=0,this.qualT=0,this.qualC=0,this.qualG=0,this.qualN=0,this.qual=0,this.total=0,this.del=0,this.ins=0,this.threshold=e}hoverText(){const e=this.posA+this.posT+this.posC+this.posG+this.posN,t=this.negA+this.negT+this.negC+this.negG+this.negN;return`${this.total} (${e}+, ${t}-)`}isMismatch(e){const t=this.threshold*(this.qualityWeight&&this.qual?this.qual:this.total);let i=0;for(let t of["A","T","C","G"])t!==e&&(i+=this.qualityWeight&&this.qual?this["qual"+t]:this["pos"+t]+this["neg"+t]);return i>=t}}class sp{constructor(e,t,i){this.start=e,this.end=t,this.counts=i}popupData(e){return[{name:"start",value:Math.floor(this.start+1)},{name:"end",value:this.end},{name:"# downsampled:",value:this.counts}]}}class op{pixelTop=0;pixelBottom=0;rows=[];constructor(e){this.name=this.name}push(e){this.rows.push(e)}get length(){return this.rows.length}sortRows(e,t){const i=[],n=[];for(let t of this.rows){void 0!==t.findAlignment(e.position,e.sortAsPairs)?i.push(t):n.push(t)}i.sort(((i,n)=>{const r=e.direction,s=i.getSortValue(e,t),o=n.getSortValue(e,t);if(void 0===o&&void 0!==o)return 1;if(void 0!==s&&void 0===o)return-1;const a=s>o?1:s<o?-1:0;return!0===r?a:-a}));for(let e of n)i.push(e);this.rows=i}}function ap(e){return e.isPaired()&&e.mate&&e.isMateMapped()&&e.chr===e.mate.chr&&(e.isFirstOfPair()||e.isSecondOfPair())&&!(e.isSecondary()||e.isSupplementary())}function cp(e,t,i){let n=i-1,r=e.length;for(;1+n<r;){const i=n+(r-n>>1);t(e[i])?r=i:n=i}return r}function lp(e,t,i){let n,r,s;if(t.startsWith("tag:"))n=t.substring(4),t="tag";else if(t.startsWith("base:")){const e=t.split(":");3===e.length&&(t="base",r=e[1],s=Number.parseInt(e[2].replaceAll(",",""))-1)}switch(t){case"strand":return e.strand?"+":"-";case"firstOfPairStrand":const t=e.firstOfPairStrand;return void 0===t?"":t?"+":"-";case"mateChr":return e.mate&&e.isMateMapped()?e.mate.chr:"";case"pairOrientation":return ep[i][e.pairOrientation]||"";case"chimeric":return e.tags().SA?"chimeric":"";case"supplementary":return e.isSupplementary?"supplementary":"";case"readOrder":return e.isPaired()&&e.isFirstOfPair()?"first":e.isPaired()&&e.isSecondOfPair()?"second":"";case"phase":return e.tags().HP||"";case"tag":return e.tags()[n]||"";case"base":if(e.chr===r&&e.start<=s&&e.end>s){const t=e.readBaseAt(s);return t||"GAP"}return"";default:return}}const hp=new Map([["A",1],["T",2],["C",3],["G",4],["N",5],["GAP",5],["",7]]);function dp(e,t){return hp.has(e)&&hp.has(t)?hp.get(e)-hp.get(t):e.localeCompare(t,void 0,{sensitivity:"base"})}function up(e,t){return e===t?0:e&&t?-e.localeCompare(t):e?1:-1}function fp(e,t){if(e||t){if(e){if(t){if(e===t)return 0;if(ja(e)&&(ja(t),1))return Number.parseFloat(e)-Number.parseFloat(t);{let i=e.toString(),n=t.toString();return i.localeCompare(n,void 0,{sensitivity:"base"})}}return-1}return 1}return 0}class pp{constructor(e){const t=e.split(",");this.chr=t[0],this.start=parseInt(t[1]),this.strand=t[2].charAt(0),this.mapQ=parseInt(t[4]),this.numMismatches=parseInt(t[5]),this.lenOnRef=function(e){let t=0,i="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(r>47&&r<58)i+=e.charAt(n);else{switch(r){case 78:case 68:case 77:case 61:case 88:t+=parseInt(i.toString())}i=""}}return t}(t[3])}printString(){return this.chr+":"+Rt(this.start)+"-"+Rt(this.start+this.lenOnRef)+" ("+this.strand+") = "+Rt(this.lenOnRef)+"bp @MAPQ: "+this.mapQ+" NM: "+this.numMismatches}}function gp(e){return e.split(";").filter((e=>e.length>0)).map((e=>new pp(e)))}const mp={c:1,C:1,s:2,S:2,i:4,I:4,f:4};class wp{constructor(){this.hidden=!1}isMapped(){return!(4&this.flags)}isPaired(){return!!(1&this.flags)}isProperPair(){return!!(2&this.flags)}isFirstOfPair(){return!!(64&this.flags)}isSecondOfPair(){return!!(128&this.flags)}isSecondary(){return!!(256&this.flags)}isSupplementary(){return!!(2048&this.flags)}isFailsVendorQualityCheck(){return!!(512&this.flags)}isDuplicate(){return!!(1024&this.flags)}isMateMapped(){return!(8&this.flags)}isNegativeStrand(){return!!(16&this.flags)}isMateNegativeStrand(){return!!(32&this.flags)}hasTag(e){return(this.tagDict||vp(this.tagBA)).hasOwnProperty(e)}tags(){return this.tagDict||(this.tagBA?(this.tagDict=vp(this.tagBA),this.tagBA=void 0):this.tagDict={}),this.tagDict}getTag(e){return this.tags()[e]}get firstOfPairStrand(){if(this.isPaired()){if(this.isFirstOfPair())return this.strand;if(this.isMateMapped())return this.mate.strand}}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}popupData(e){const t=[];if(e=Math.floor(e),this.insertions){const n=this.seq;for(let r of this.insertions){var i=r.start;if(e===i||e===i-1)return t.push({name:"Insertion",value:n.substr(r.seqOffset,r.len)}),t.push({name:"Location",value:i}),t}}t.push({name:"Read Name",value:this.readName}),t.push("<hr/>"),t.push({name:"Alignment Start",value:Rt(1+this.start),borderTop:!0}),t.push({name:"Read Strand",value:!0===this.strand?"(+)":"(-)",borderTop:!0});let n=this.cigar;if(n&&n.length>50){const e=25;n=`${n.substring(0,e-2)} ... ${n.substring(n.length-e+2)}`}t.push({name:"Cigar",value:n}),t.push({name:"Mapping Quality",value:this.mq}),t.push({name:"Secondary",value:a(this.isSecondary())}),t.push({name:"Supplementary",value:a(this.isSupplementary())}),t.push({name:"Duplicate",value:a(this.isDuplicate())}),t.push({name:"Failed QC",value:a(this.isFailsVendorQualityCheck())}),this.isPaired()&&(t.push("<hr/>"),t.push({name:"First in Pair",value:!this.isSecondOfPair(),borderTop:!0}),t.push({name:"Mate is Mapped",value:a(this.isMateMapped())}),this.pairOrientation&&t.push({name:"Pair Orientation",value:this.pairOrientation}),this.isMateMapped()&&(t.push({name:"Mate Chromosome",value:this.mate.chr}),t.push({name:"Mate Start",value:this.mate.position+1}),t.push({name:"Mate Strand",value:!0===this.mate.strand?"(+)":"(-)"}),t.push({name:"Insert Size",value:this.fragmentLength})));const r=this.tags();if(r.hasOwnProperty("SA")){t.push("<hr/>"),t.push({name:"Supplementary Alignments",value:""});const e=gp(r.SA);if(e){t.push("<ul>");for(let i of e)t.push(`<li>${i.printString()}</li>`);t.push("</ul>")}}const s=new Set(["SA","MD"]);t.push("<hr/>");for(let e in r)s.has(e)||t.push({name:e,value:r[e]});t.push({name:"Hidden Tags",value:"SA, MD"}),t.push("<hr/>"),t.push({name:"Genomic Location: ",value:Rt(1+e)}),t.push({name:"Read Base:",value:this.readBaseAt(e)}),t.push({name:"Base Quality:",value:this.readBaseQualityAt(e)});const o=this.getBaseModificationSets();if(o){const i=this.positionToReadIndex(e);if(void 0!==i){let e=!1;for(let n of o)if(n.containsPosition(i)){e||(t.push("<hr/>"),t.push("<b>Base modifications:</b>"),e=!0);const r=Math.round(100/255*Xf(n.likelihoods.get(i)));t.push(`${n.fullName()} @ likelihood = ${r}%`)}}}return t;function a(e){return e?"Yes":"No"}}readBaseAt(e){const t=Fp(this.blocks,e);if(t){if("*"===this.seq)return"*";{const i=t.seqIndexAt(e);return this.seq[i]}}}readBaseQualityAt(e){const t=Fp(this.blocks,e);if(t){if("*"===this.qual)return 30;{const i=t.seqIndexAt(e);return i>=0&&this.qual&&i<this.qual.length?this.qual[i]:30}}}gapSizeAt(e){if(this.gaps)for(let t of this.gaps)if(e>=t.start&&e<t.start+t.len)return t.len;return 0}softClippedBlocks(){let e,t,i;for(let n of this.blocks)"S"===n.type?i?t=n:e=n:"H"!==n.type&&(i=!0);return{left:e,right:t}}getBaseModificationSets(){if(this.tags(),!this.baseModificationSets&&(this.tagDict.MM||this.tagDict.Mm)){const e=this.tagDict.MM||this.tagDict.Mm,t=this.tagDict.ML||this.tagDict.Ml;!Mt(e)||t&&!Array.isArray(t)||(0===e.length?this.baseModificationSets=bp:this.baseModificationSets=function(e,t,i,n){n&&(i=lc(i));const r=[],s=e.split(";");let o=0;for(let e of s){const s=e.split(","),a=s[0].charAt(0),c=s[0].charAt(1),l=s[0].endsWith(".");if(1==s.length);else{const e=s[0].endsWith(".")||s[0].endsWith("?")?s[0].substring(2,s[0].length-1):s[0].substring(2);let h=[];if(e.length>1)if(Yf(e))h.push(e);else for(let t=0;t<e.length;t++)h.push(e.substring(t,t+1));else h.push(e);const d=new Map;for(let e of h)d.set(e,new Map);let u=1,f=Number.parseInt(s[u++]),p=0,g=0;for(;p<i.length;){if("N"===a||i[p]===a){const e=n?i.length-1-p:p;if(g===f){for(let i of h){const n=t?t[o++]:255;d.get(i).set(e,n)}if(u<s.length)f=Number.parseInt(s[u++]),g=0;else{if(!l)break;f=-1}}else{if(l)for(let t of h)d.get(t).set(e,0);g++}}p++}for(let e of h)r.push(new Wf(a,c,e,d.get(e)))}}return r}(e,t,this.seq,this.isNegativeStrand()))}return this.baseModificationSets}getGroupValue(e,t,i){const n=this;switch(e){case"strand":return n.strand?"+":"-";case"firstOfPairStrand":const e=n.firstOfPairStrand;return void 0===e?"":e?"+":"-";case"mateChr":return n.mate&&n.isMateMapped()?n.mate.chr:"";case"pairOrientation":return ep[i][n.pairOrientation]||"";case"chimeric":return n.tags().SA?"chimeric":"";case"supplementary":return n.isSupplementary?"supplementary":"";case"readOrder":return n.isPaired()&&n.isFirstOfPair()?"first":n.isPaired()&&n.isSecondOfPair()?"second":"";case"phase":return n.tags().HP||"";case"tag":return n.tags()[t]||"";default:return}}positionToReadIndex(e){const t=Fp(this.blocks,e);return t?e-t.start+t.seqOffset:void 0}}const bp=new Set;function Fp(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(t>=n.start&&t<n.start+n.len)return n}}function vp(e){let t=0;const i=e.length,n={};for(;t<i;){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const s=String.fromCharCode(e[t++]);let o;if("A"===s)o=String.fromCharCode(e[t]),t++;else if("i"===s||"I"===s)o=yp(e,t),t+=4;else if("c"===s)o=_p(e,t),t++;else if("C"===s)o=xp(e,t),t++;else if("s"===s||"S"===s)o=Ap(e,t),t+=2;else if("f"===s)o=Cp(e,t),t+=4;else if("Z"===s)for(o="";;){var r=e[t++];if(0===r)break;o+=String.fromCharCode(r)}else{if("B"!==s){o="Error unknown type: "+s,n[i]=o;break}{const r=String.fromCharCode(e[t++]);let s=mp[r];if(void 0===s){n[i]=`Error: unknown element type '${r}'`;break}const a=yp(e,t);t+=4;const c=t+a*s;o=[];const l=new DataView(e.buffer);for(;t<c;){switch(r){case"c":o.push(l.getInt8(t));break;case"C":o.push(l.getUint8(t));break;case"s":o.push(l.getInt16(t));break;case"S":o.push(l.getUint16(t));break;case"i":o.push(l.getInt32(t));break;case"I":o.push(l.getUint32(t));break;case"f":o.push(l.getFloat32(t))}t+=s}}}n[i]=o}return n}function yp(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Ap(e,t){return e[t+1]<<8|e[t]}function Cp(e,t){return new DataView(e.buffer).getFloat32(t)}function _p(e,t){return new DataView(e.buffer).getInt8(t)}function xp(e,t){return new DataView(e.buffer).getUint8(t)}class kp{constructor(e){e&&Object.assign(this,e)}seqIndexAt(e){return Math.floor(e)-this.start+this.seqOffset}}class Ip{constructor(e){e||(e={}),this.vendorFailed=e.vendorFailed=!1!==e.vendorFailed,this.duplicate=e.duplicate=!1!==e.duplicate,this.secondary=e.secondary||!1,this.supplementary=e.supplementary||!1,this.mq=e.mq||0,e.readgroups&&(this.readgroups=new Set(e.readgroups))}pass(e){if(!e.isMapped())return!1;if(this.vendorFailed&&e.isFailsVendorQualityCheck())return!1;if(this.duplicate&&e.isDuplicate())return!1;if(this.secondary&&e.isSecondary())return!1;if(this.supplementary&&e.isSupplementary())return!1;if(e.mq<this.mq)return!1;if(this.readgroups){const t=e.tags().RG;return this.readgroups.has(t)}return!0}}const Sp=["=","A","C","M","G","R","S","V","T","W","Y","H","K","D","B","N"],Ep=["M","I","D","N","S","H","P","=","X","?","?","?","?","?","?","?"],Np=Dp(new Uint8Array([66,65,77,1]),0),Bp=1e4,Mp={readHeader:async function(e,t,i){const n=gs(await Qs.loadArrayBuffer(e,t));return Mp.decodeBamHeader(n,i)},decodeBamHeader:function(e){const t=Dp(e,0);if(t!==Np)throw new Error("BAM header errror: bad magic number. This could be caused by either a corrupt or missing file.");const i=Dp(e,4);let n="";for(var r=0;r<i;++r)n+=String.fromCharCode(e[r+8]);const s=Dp(e,i+8);let o=i+12;const a={},c=[];for(r=0;r<s;++r){const t=Dp(e,o);let i="";for(var l=0;l<t-1;++l)i+=String.fromCharCode(e[o+4+l]);a[i]=r,c[r]=i,o=o+8+t}return{magicNumber:t,size:o,chrNames:c,chrToIndex:a}},bam_tag2cigar:function(e,t,i,n,r,s){function o(e){return"C"===e||"c"===e||"A"===e?1:"S"===e||"s"===e?2:"I"===e||"i"===e||"f"===e?4:0}if(1!==s.length||r.start<0)return!1;for(var a=i+(n+1>>1)+n;a+4<t;){if("CG"===String.fromCharCode(e[a])+String.fromCharCode(e[a+1]))break;var c=String.fromCharCode(e[a+2]);if("B"===c)a+=8+o(c=String.fromCharCode(e[a+3]))*Dp(e,a+4);else if("Z"===c||"H"===c)for(a+=3;0!==e[a++];);else a+=3+o(c)}if(a>=t)return!1;if("B"!==String.fromCharCode(e[a+2])||"I"!==String.fromCharCode(e[a+3]))return!1;var l=Dp(e,a+4),h=a+8;if(h+4*l>t)return!1;var d="",u=0;s.length=0,a=h;for(var f=0;f<l;++f,a+=4){var p=Dp(e,a),g=p>>4,m=Ep[15&p];"M"!==m&&"EQ"!==m&&"X"!==m&&"D"!==m&&"N"!==m&&"="!==m||(u+=g),d=d+g+m,s.push({len:g,ltr:m})}return r.cigar=d,r.lengthOnRef=u,!0},decodeBamRecords:function(e,t,i,n,r,s,o,a){for(;t<e.length;){const u=t+Dp(e,t)+4,f=new wp,p=Dp(e,t+4),g=Dp(e,t+8);if(u>e.length)return;if(p<0){t=u;continue}if(void 0!==r&&(p>r||g>o))return!0;if(void 0!==r&&p<r){t=u;continue}const m=Dp(e,t+12),w=(65280&m)>>8,b=255&m,F=Dp(e,t+16),v=(4294901760&F)>>16,y=65535&F,A=Dp(e,t+20),C=Dp(e,t+24),_=Dp(e,t+28),x=Dp(e,t+32);let k=[];for(let i=0;i<b-1;++i)k.push(String.fromCharCode(e[t+36+i]));k=k.join("");let I=0,S="",E=t+36+b;const N=[];let B;for(let t=0;t<y;++t){var c=Dp(e,E),l=c>>4,h=Ep[15&c];"M"!==h&&"EQ"!==h&&"X"!==h&&"D"!==h&&"N"!==h&&"="!==h||(I+=l),S=S+l+h,E+=4,B={len:l,ltr:h},N.push(B)}if(f.chr=n[p],f.start=g,f.flags=v,f.strand=!(16&v),f.readName=k,f.cigar=S,f.lengthOnRef=I,f.fragmentLength=x,f.mq=w,Mp.bam_tag2cigar(e,u,E,A,f,N),f.end=f.start+f.lengthOnRef,f.end<s){t=u;continue}let M=[];const R=A+1>>1;for(let t=0;t<R;++t){var d=e[E+t];M.push(Sp[(240&d)>>4]),M.push(Sp[15&d])}M=M.slice(0,A).join(""),E+=R;const D=[];for(let t=0;t<A;++t)D.push(e[E+t]);E+=A,C>=0&&(f.mate={chr:n[C],position:_,strand:!(32&v)}),f.seq=M,f.qual=D,f.tagBA=new Uint8Array(e.buffer.slice(E,u)),this.setPairOrientation(f),(void 0===a||a.pass(f))&&(Rp(f,N),i.push(f)),t=u}},decodeSamRecords:function(e,t,i,n,r,s){var o,a,c,l,h,d,u,f,p,g;for(l=(o=Dt(e)).length,a=0;a<l;a++)if(h=o[a].split("\t"),(p=new wp).chr=h[2],p.start=Number.parseInt(h[3])-1,p.flags=Number.parseInt(h[1]),p.readName=h[0],p.strand=!(16&p.flags),p.mq=Number.parseInt(h[4]),p.cigar=h[5],p.fragmentLength=Number.parseInt(h[8]),p.seq=h[9],"*"!==p.chr&&p.isMapped()&&p.chr===i){if(p.start>r)break;if(f=0,(g=Tp(p.cigar)).forEach((function(e){var t=e.len,i=e.ltr;"M"!==i&&"EQ"!==i&&"X"!==i&&"D"!==i&&"N"!==i&&"="!==i||(f+=t)})),p.lengthOnRef=f,!(p.start+f<n)){for(d=h[10],p.qual=[],c=0;c<d.length;c++)p.qual[c]=d.charCodeAt(c)-33;p.tagDict=h.length<11?{}:Lp(h.slice(11)),p.isMateMapped()&&(u=h[6],p.mate={chr:"="===u?p.chr:u,position:Number.parseInt(h[7]),strand:!(32&p.flags)}),this.setPairOrientation(p),(void 0===s||s.pass(p))&&(Rp(p,g),t.push(p))}}},setReaderDefaults:function(e,t){e.filter="function"==typeof t.filter?{pass:t.filter}:new Ip(t.filter),t.readgroup&&(e.filter.readgroups=new Set([t.readgroup])),e.alleleFreqThreshold=void 0===t.alleleFreqThreshold?.2:t.alleleFreqThreshold,e.samplingWindowSize=void 0===t.samplingWindowSize?100:t.samplingWindowSize,e.samplingDepth=void 0===t.samplingDepth?500:t.samplingDepth,e.samplingDepth>Bp&&(console.log("Warning: attempt to set sampling depth > maximum value of "+Bp),e.samplingDepth=Bp)},setPairOrientation:function(e){if(e.isMapped()&&e.mate&&e.isMateMapped()&&e.mate.chr===e.chr){var t=e.strand?"F":"R",i=e.mate,n=i.strand?"F":"R",r=" ",s=" ";e.isFirstOfPair()?(r="1",s="2"):e.isSecondOfPair()&&(r="2",s="1");var o=[],a=e.fragmentLength,c=e.end-e.start;if(0===a)a=(e.start<i.position?i.position+c:i.position-c)-e.start;a>0?(o[0]=t,o[1]=r,o[2]=n,o[3]=s):(o[2]=t,o[3]=r,o[0]=n,o[1]=s),e.pairOrientation=o.join("")}}};function Rp(e,t){const i=[];let n,r,s=0,o=e.start;e.scStart=e.start,e.scLengthOnRef=e.lengthOnRef;for(let a of t){let t;switch(a.ltr){case"H":case"P":break;case"S":t=o,e.scLengthOnRef+=a.len,0===i.length&&(e.scStart-=a.len,t-=a.len),i.push(new kp({start:t,seqOffset:s,len:a.len,type:"S"})),s+=a.len;break;case"N":case"D":void 0===r&&(r=[]),r.push({start:o,len:a.len,type:a.ltr}),o+=a.len;break;case"I":void 0===n&&(n=[]),n.push(new kp({start:o,len:a.len,seqOffset:s,type:"I"})),s+=a.len;break;case"M":case"EQ":case"=":case"X":i.push(new kp({start:o,seqOffset:s,len:a.len,type:"M"})),s+=a.len,o+=a.len;break;default:console.log("Error processing cigar element: "+a.len+a.ltr)}}e.blocks=i,e.insertions=n,e.gaps=r}function Dp(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Tp(e){var t,i,n,r,s,o,a,c,l;for(t=[],i=[],s=null,r=e.length,n=0;n<r;n++)o=e.charAt(n),l=void 0,(l=o.charCodeAt(0))>=48&&l<=57?i.push(o):(a=o,c=Number.parseInt(i.join("")),i=[],null!==s&&s.ltr===a?s.len+=c:(s={len:c,ltr:a},t.push(s)));return t}function Lp(e){var t={};return e.forEach((function(e){var i=e.split(":");t[i[0]]=i[2]})),t}class zp{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.isDataUri=$a(e.url),Mp.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.alignmentCache){let e;if(this.isDataUri){const t=function(e){const t=e.split(","),i=t[0].split(":")[1];let n=t[1];n=i.indexOf("base64")>=0?atob(n):decodeURI(n);const r=new Uint8Array(n.length);for(var s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}(this.bamPath);e=gs(t.buffer)}else{e=gs(await Qs.loadArrayBuffer(this.bamPath,qa(this.config)))}this.alignmentCache=this.#y(e)}const n=await this.#A(e),r=this.alignmentCache.queryFeatures(n,t,i),s=new tp(e,t,i,this.config);for(let e of r)s.push(e);return s.finish(),s}#y(e){const t=[];return this.header=Mp.decodeBamHeader(e),Mp.decodeBamRecords(e,this.header.size,t,this.header.chrNames,void 0,0,Number.MAX_SAFE_INTEGER,this.filter),new Zs(t,this.genome)}async#A(e){const t=new Set(this.header.chrNames);if(t.has(e))return e;if(this.chrAliasTable.has(e))return this.chrAliasTable.get(e);if(this.genome){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>t.has(e)));e.length>0&&(n=e[0])}return this.chrAliasTable.set(e,n),n}return e}}class Hp{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.baiPath=e.indexURL,Mp.setReaderDefaults(this,e),this._blockLoader=new yh(e)}async readAlignments(e,t,i){const n=await this.#C(e),r=new tp(e,t,i,this.config);if(void 0===n)return r;{const e=(await this.getIndex()).chunksForRange(n,t,i);if(!e||0===e.length)return r;for(let s of e){const e=await this._blockLoader.getData(s.minv,s.maxv);if(Mp.decodeBamRecords(e,s.minv.offset,r,this.header.chrNames,n,t,i,this.filter))break}return r.finish(),r}}async#C(e){if(await this.getHeader(),this.chrAliasTable.has(e)&&void 0===(e=this.chrAliasTable.get(e)))return;let t=this.header.chrToIndex[e];if(void 0===t){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>void 0!==this.header.chrToIndex[e]));e.length>0&&(n=e[0],t=this.header.chrToIndex[e[0]])}this.chrAliasTable.set(e,n)}return t}async getHeader(){if(!this.header){const e=this.genome,t=await this.getIndex();let i;if(t.firstBlockPosition){const e=qa(this.config,{range:{start:t.firstBlockPosition,size:26}}),n=ms(await Qs.loadArrayBuffer(this.bamPath,e));i=t.firstBlockPosition+n}else i=64e3;const n=qa(this.config,{range:{start:0,size:i}});this.header=await Mp.readHeader(this.bamPath,n,e)}return this.header}async getIndex(){return this.index||(this.index=await gh(this.baiPath,this.config)),this.index}async getChrIndex(){if(this.chrToIndex)return this.chrToIndex;{const e=await this.getHeader();return this.chrToIndex=e.chrToIndex,this.indexToChr=e.chrNames,this.chrNames=new Set(e.chrNames),this.chrToIndex}}}class Pp{constructor(e,t){this.config=e,this.genome=t;const i={};e.sources.sequences.forEach((function(n){const r=t?t.getChromosomeName(n):n;i[r]=function(e,t,i){const n={url:e.sources.url.replace("$CHR",i)};e.sources.indexURL&&(n.indexURL=e.sources.indexURL.replace("$CHR",i));const r=Object.assign(e,n);return new Hp(r,t)}(e,t,n)})),this.bamReaders=i,Mp.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(this.bamReaders.hasOwnProperty(e)){let n=this.bamReaders[e];return await n.readAlignments(e,t,i)}return new tp(e,t,i,this.config)}}const Op=function(e,t){this.config=e,this.genome=t,Mp.setReaderDefaults(this,e)};function Up(){const e=this,t=this.genome;if(this.header)return Promise.resolve(this.header);{const i=this.config.url+"?file="+this.config.alignmentFile+"&options=-b,-H",n=qa(this.config);return Mp.readHeader(i,n,t).then((function(t){return e.header=t,t}))}}Op.prototype.readAlignments=function(e,t,i){var n=this;return Up.call(n).then((function(r){var s,o;return s=r.chrAliasTable.hasOwnProperty(e)?r.chrAliasTable[e]:e,o=n.config.url+"?reference="+n.config.referenceFile+"&file="+n.config.alignmentFile+"&region="+s+":"+t+"-"+i,Qs.loadString(o,qa(n.config)).then((function(o){var a;return r.chrToIndex[s],a=new tp(e,t,i,n.config),Mp.decodeSamRecords(o,a,s,t,i,n.filter),a}))}))};class qp extends Rh{constructor(e,t){super(e,t),Mp.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.header){const e=gs((await this.readHeaderData()).buffer);this.header=Mp.decodeBamHeader(e,this.genome),this.chrAliasTable=new Map;for(let e of this.header.chrNames)this.chrAliasTable.set(e,this.genome.getChromosomeName(e))}let n=this.chrAliasTable.has(e)?this.chrAliasTable.get(e):e;const r=gs((await this.readData(n,t,i)).buffer);this.header=Mp.decodeBamHeader(r,this.genome);const s=this.header.chrToIndex[e],o=new tp(e,t,i,this.config);return Mp.decodeBamRecords(r,this.header.size,o,this.header.chrNames,s,t,i,this.filter),o.finish(),o}}
42
+ */function tu(e,t){var i,n=Object.keys(t);for(i=0;i<n.length;i++)e=e.replace(new RegExp("\\{"+n[i]+"\\}","gi"),t[n[i]]);return e}function iu(e){var t,i,n;if(!e)throw new Error("cannot create a random attribute name for an undefined object");t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="";do{for(i="",n=0;n<12;n++)i+=t[Math.floor(51*Math.random())]}while(e[i]);return i}function nu(e){var t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[e]||t.alphabetic}function ru(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}const su=function(e,t){var i,n,r,s={};for(e=e.split(","),t=t||10,i=0;i<e.length;i+=2)n="&"+e[i+1]+";",r=parseInt(e[i],t),s[n]="&#"+r+";";return s["\\xa0"]="&#160;",s}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),ou={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class au{constructor(e,t){this.__root=e,this.__ctx=t}addColorStop(e,t){var i,n=this.__ctx.__createElement("stop");n.setAttribute("offset",e),t&&-1!==t.indexOf("rgba")?(i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t),n.setAttribute("stop-color",tu("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),n.setAttribute("stop-opacity",i[4])):n.setAttribute("stop-color",t),this.__root.appendChild(n)}}class cu{constructor(e,t){this.__root=e,this.__ctx=t}}class lu{constructor(e){if(!(this instanceof lu))return new lu(e);if(this.config=e,this.width=e.width,this.height=e.height,this.enableMirroring=e.enableMirroring||!1,this.canvas=this,this.__document=document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.isSVG=!0,this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__createElement("svg"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__root.setAttribute("overflow","visible"),e.viewbox){const t=e.viewbox.x+" "+e.viewbox.y+" "+e.viewbox.width+" "+e.viewbox.height;this.__root.setAttribute("viewBox",t),this.viewbox=e.viewbox}this.__ids={},this.__defs=this.__createElement("defs"),this.__root.appendChild(this.__defs),this.multiLocusGap=e.multiLocusGap;let t={id:"svg_output_backdrop",width:"100%",height:"100%",fill:e.backdropColor||"white"},i=this.__createElement("rect",t);this.__root.appendChild(i),this.__rootGroup=this.__createElement("g",{id:"root-group"}),this.__root.appendChild(this.__rootGroup),this.__currentElement=this.__rootGroup}setWidth(e){this.width=e,this.__root.setAttribute("width",this.width);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+e+" "+this.config.viewbox.height;this.__root.setAttribute("viewBox",t)}setHeight(e){this.height=e,this.__root.setAttribute("height",this.height);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+this.config.viewbox.width+" "+e;this.__root.setAttribute("viewBox",t)}__createElement(e,t,i){void 0===t&&(t={});let n=this.__document.createElementNS("http://www.w3.org/2000/svg",e);i&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let e of Object.keys(t))n.setAttribute(e,t[e]);return n}__setDefaultStyles(){var e,t,i=Object.keys(ou);for(e=0;e<i.length;e++)this[t=i[e]]=ou[t].canvas}__applyStyleState(e){var t,i,n=Object.keys(e);for(t=0;t<n.length;t++)this[i=n[t]]=e[i]}__getStyleState(){var e,t,i={},n=Object.keys(ou);for(e=0;e<n.length;e++)i[t=n[e]]=this[t];return i}__applyStyleToCurrentElement(e){var t=this.__currentElement,i=this.__currentElementsToStyle;i&&(t.setAttribute(e,""),t=i.element,i.children.forEach((function(t){t.setAttribute(e,"")})));var n,r,s,o,a,c=Object.keys(ou);for(n=0;n<c.length;n++)if(r=ou[c[n]],s=this[c[n]],r.apply)if(s instanceof cu){if(s.__ctx)for(;s.__ctx.__defs.childNodes.length;)o=s.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[o]=o,this.__defs.appendChild(s.__ctx.__defs.childNodes[0]);t.setAttribute(r.apply,tu("url(#{id})",{id:s.__root.getAttribute("id")}))}else if(s instanceof au)t.setAttribute(r.apply,tu("url(#{id})",{id:s.__root.getAttribute("id")}));else if(r&&-1!==r.apply.indexOf(e)&&r.svg!==s)if("stroke"!==r.svgAttr&&"fill"!==r.svgAttr||!s||-1===s.indexOf("rgba")){var l=r.svgAttr;if("globalAlpha"===c[n]&&(l=e+"-"+r.svgAttr,t.getAttribute(l)))continue;t.setAttribute(l,s)}else{a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(s),t.setAttribute(r.svgAttr,tu("rgb({r},{g},{b})",{r:a[1],g:a[2],b:a[3]}));var h=a[4],d=this.globalAlpha;null!=d&&(h*=d),t.setAttribute(r.svgAttr+"-opacity",h)}}__closestGroupOrSvg(e){return"g"===(e=e||this.__currentElement).nodeName||"svg"===e.nodeName?e:this.__closestGroupOrSvg(e.parentNode)}getSerializedSvg(e){var t,i,n,r,s,o=(new XMLSerializer).serializeToString(this.__root);if(e)for(t=Object.keys(su),i=0;i<t.length;i++)n=t[i],r=su[n],(s=new RegExp(n,"gi")).test(o)&&(o=o.replace(s,r));return o}getSvg(){return this.__root}saveWithTranslationAndClipRect(e,t,i,n,r,s){const o=`${e}_clip_rect`;let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a);const c={x:"0",y:s.toString(),width:n.toString(),height:r.toString()};a.appendChild(this.__createElement("rect",c));const l=this.__createElement("g");l.setAttribute("transform",tu("translate({x},{y})",{x:t,y:i})),l.setAttribute("clip-path",tu("url(#{id})",{id:o}));const h=this.__closestGroupOrSvg();h.appendChild(l),this.__groupStack.push(h),this.__currentElement=l,this.__stack.push(this.__getStyleState())}save(){var e=this.__createElement("g"),t=this.__closestGroupOrSvg();this.__groupStack.push(t),t.appendChild(e),this.__currentElement=e,this.__stack.push(this.__getStyleState())}restore(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var e=this.__stack.pop();this.__applyStyleState(e)}__addTransform(e){var t=this.__closestGroupOrSvg();if(t.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:t,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var i=this.__createElement("g");t.appendChild(i),this.__currentElement=i}var n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=e,this.__currentElement.setAttribute("transform",n)}addTrackGroupWithTranslationAndClipRect(e,t,i,n,r,s){const o=e+"_clip_rect";let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a),a.appendChild(this.__createElement("rect",{x:"0",y:s.toString(),width:n.toString(),height:r.toString()}));let c=this.__createElement("g");this.__rootGroup.appendChild(c),c.setAttribute("transform",tu("translate({x},{y})",{x:t,y:i})),c.setAttribute("id",e+"_group"),c.setAttribute("clip-path",tu("url(#{id})",{id:o})),this.__currentElement=c}scale(e,t){void 0===t&&(t=e),this.__addTransform(tu("scale({x},{y})",{x:e,y:t}))}rotate(e){var t=180*e/Math.PI;this.__addTransform(tu("rotate({angle},{cx},{cy})",{angle:t,cx:0,cy:0}))}translate(e,t){this.__addTransform(tu("translate({x},{y})",{x:e,y:t}))}transform(e,t,i,n,r,s){this.__addTransform(tu("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:t,c:i,d:n,e:r,f:s}))}beginPath(){var e;this.__currentDefaultPath="",this.__currentPosition={},e=this.__createElement("path",{},!0),this.__closestGroupOrSvg().appendChild(e),this.__currentElement=e}__applyCurrentDefaultPath(){var e=this.__currentElement;"path"===e.nodeName?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)}__addPathCommand(e){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=e}moveTo(e,t){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:t},this.__addPathCommand(tu("M {x} {y}",{x:e,y:t}))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(e,t){this.__currentPosition={x:e,y:t},this.__currentDefaultPath&&this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(tu("L {x} {y}",{x:e,y:t})):this.__addPathCommand(tu("M {x} {y}",{x:e,y:t}))}bezierCurveTo(e,t,i,n,r,s){this.__currentPosition={x:r,y:s},this.__addPathCommand(tu("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:t,cp2x:i,cp2y:n,x:r,y:s}))}quadraticCurveTo(e,t,i,n){this.__currentPosition={x:i,y:n},this.__addPathCommand(tu("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:t,x:i,y:n}))}arcTo(e,t,i,n,r){var s=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(void 0!==s&&void 0!==o){if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(s===e&&o===t||e===i&&t===n||0===r)this.lineTo(e,t);else{var a=ru([s-e,o-t]),c=ru([i-e,n-t]);if(a[0]*c[1]!=a[1]*c[0]){var l=a[0]*c[0]+a[1]*c[1],h=Math.acos(Math.abs(l)),d=ru([a[0]+c[0],a[1]+c[1]]),u=r/Math.sin(h/2),f=e+u*d[0],p=t+u*d[1],g=[-a[1],a[0]],m=[c[1],-c[0]],w=function(e){var t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)},b=w(g),F=w(m);this.lineTo(f+g[0]*r,p+g[1]*r),this.arc(f,p,r,b,F)}else this.lineTo(e,t)}}}stroke(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(e,t,i,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.lineTo(e,t),this.closePath()}fillRect(e,t,i,n){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var r,s,o,a={x:e,y:t,width:i,height:n};(!this.viewbox||(r=this.viewbox,s=a,r.x<s.x+s.width&&r.x+r.width>s.x&&r.y<s.y+s.height&&r.y+r.height>s.y))&&(o=this.__createElement("rect",a,!0),this.__closestGroupOrSvg().appendChild(o),this.__currentElement=o,this.__applyStyleToCurrentElement("fill"))}strokeRect(e,t,i,n){var r;r=this.__createElement("rect",{x:e,y:t,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}strokeEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"stroke")}fillEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"fill")}__ellipse(e,t,i,n,r,s,o,a,c){const l={cx:e,cy:t,rx:i,ry:n},h=this.__createElement("ellipse",l,!0);this.__closestGroupOrSvg().appendChild(h),this.__currentElement=h,this.__applyStyleToCurrentElement(c)}__clearCanvas(){for(var e=this.__closestGroupOrSvg().getAttribute("transform"),t=this.__root.childNodes[1],i=t.childNodes,n=i.length-1;n>=0;n--)i[n]&&t.removeChild(i[n]);this.__currentElement=t,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(e,t,i,n){if(0!==e||0!==t||i!==this.width||n!==this.height){var r,s=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:e,y:t,width:i,height:n,fill:"#FFFFFF"},!0),s.appendChild(r)}else this.__clearCanvas()}createLinearGradient(e,t,i,n){var r=this.__createElement("linearGradient",{id:iu(this.__ids),x1:e+"px",x2:i+"px",y1:t+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(r),new au(r,this)}createRadialGradient(e,t,i,n,r,s){var o=this.__createElement("radialGradient",{id:iu(this.__ids),cx:n+"px",cy:r+"px",r:s+"px",fx:e+"px",fy:t+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new au(o,this)}__parseFont(){var e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i.exec(this.font),t={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(t.decoration="underline"),this.__fontHref&&(t.href=this.__fontHref),t}__wrapTextLink(e,t){if(e.href){var i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.href),i.appendChild(t),i}return t}__applyText(e,t,i,n){var r,s,o=this.__parseFont(),a=this.__closestGroupOrSvg(),c=this.__createElement("text",{"font-family":o.family,"font-size":o.size,"font-style":o.style,"font-weight":o.weight,"text-decoration":o.decoration,x:t,y:i,"text-anchor":(r=this.textAlign,s={left:"start",right:"end",center:"middle",start:"start",end:"end"},s[r]||s.start),"dominant-baseline":nu(this.textBaseline)},!0);c.appendChild(this.__document.createTextNode(e)),this.__currentElement=c,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(o,c))}fillText(e,t,i){this.__applyText(e,t,i,"fill")}strokeText(e,t,i){this.__applyText(e,t,i,"stroke")}measureText(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)}arc(e,t,i,n,r,s){if(n!==r){(n%=2*Math.PI)===(r%=2*Math.PI)&&(r=(r+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var o=e+i*Math.cos(r),a=t+i*Math.sin(r),c=e+i*Math.cos(n),l=t+i*Math.sin(n),h=s?0:1,d=0,u=r-n;u<0&&(u+=2*Math.PI),d=s?u>Math.PI?0:1:u>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(tu("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:d,sweepFlag:h,endX:o,endY:a})),this.__currentPosition={x:o,y:a}}}clip(){var e=this.__closestGroupOrSvg(),t=this.__createElement("clipPath"),i=iu(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),t.setAttribute("id",i),t.appendChild(this.__currentElement),this.__defs.appendChild(t),e.setAttribute("clip-path",tu("url(#{id})",{id:i})),e.appendChild(n),this.__currentElement=n}drawImage(){var e,t,i,n,r,s,o,a,c,l,h,d,u,f=Array.prototype.slice.call(arguments),p=f[0],g=0,m=0;if(3===f.length)e=f[1],t=f[2],i=r=p.width,n=s=p.height;else if(5===f.length)e=f[1],t=f[2],i=f[3],n=f[4],r=p.width,s=p.height;else{if(9!==f.length)throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);g=f[1],m=f[2],r=f[3],s=f[4],e=f[5],t=f[6],i=f[7],n=f[8]}o=this.__closestGroupOrSvg(),this.__currentElement;var w="translate("+e+", "+t+")";if(p instanceof lu){if((a=p.getSvg().cloneNode(!0)).childNodes&&a.childNodes.length>1){for(c=a.childNodes[0];c.childNodes.length;)u=c.childNodes[0].getAttribute("id"),this.__ids[u]=u,this.__defs.appendChild(c.childNodes[0]);if(l=a.childNodes[1]){var b,F=l.getAttribute("transform");b=F?F+" "+w:w,l.setAttribute("transform",b),o.appendChild(l)}}}else"CANVAS"!==p.nodeName&&"IMG"!==p.nodeName||((h=this.__createElement("image")).setAttribute("width",i),h.setAttribute("height",n),h.setAttribute("preserveAspectRatio","none"),(g||m||r!==p.width||s!==p.height)&&((d=this.__document.createElement("canvas")).width=i,d.height=n,d.getContext("2d").drawImage(p,g,m,r,s,0,0,i,n),p=d),h.setAttribute("transform",w),h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===p.nodeName?p.toDataURL():p.getAttribute("src")),o.appendChild(h))}createPattern(e,t){let i,n=this.__document.__createElement("pattern"),r=iu(this.__ids);return n.setAttribute("id",r),n.setAttribute("width",e.width),n.setAttribute("height",e.height),"CANVAS"===e.nodeName||"IMG"===e.nodeName?(i=this.__createElement("image"),i.setAttribute("width",e.width),i.setAttribute("height",e.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===e.nodeName?e.toDataURL():e.getAttribute("src")),n.appendChild(i),this.__defs.appendChild(n)):e instanceof lu&&(n.appendChild(e.__root.childNodes[1]),this.__defs.appendChild(n)),new cu(n,this)}setLineDash(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}function hu(e){if(e.startsWith("GCF")||e.startsWith("GCA")&&e.length>=13){return"https://hgdownload.soe.ucsc.edu/hubs/"+e.substring(0,3)+"/"+e.substring(4,7)+"/"+e.substring(7,10)+"/"+e.substring(10,13)+"/"+e+"/hub.txt"}}class du{static supportedTypes=new Set(["bigBed","bigWig","bigGenePred","vcfTabix"]);static filterTracks=new Set(["cytoBandIdeo","assembly","gap","gapOverlap","allGaps","cpgIslandExtUnmasked","windowMasker"]);static async loadHub(e){const t=e.lastIndexOf("/"),i=e.substring(0,t+1),n=await pu(e);let r;if("genome"===n[1].type){const e=n[1];if(e.hasProperty("groups")){const t=i+e.getProperty("groups");r=await pu(t)}}return new du(e,n,r)}constructor(e,t,i){this.url=e;const n=e.lastIndexOf("/");if(this.baseURL=e.substring(0,n+1),"hub"!==t[0].type)throw Error("Unexpected hub.txt file -- does the first line start with 'hub'?");if(this.hubStanza=t[0],"on"!==this.hubStanza.getProperty("useOneFile"))throw Error("Only 'useOneFile' hubs are currently supported");if(t.length<2)throw Error("Expected at least 2 stanzas, hub and genome");if("genome"!==t[1].type)throw Error(`Unexpected hub file -- expected "genome" stanza but found "${t[1].type}"`);this.genomeStanza=t[1],this.trackStanzas=[];for(let e=2;e<t.length;e++)"track"===t[e].type&&this.trackStanzas.push(t[e]);if(i){this.groupStanzas=i,this.groupPriorityMap=new Map;for(let e of i)e.hasProperty("priority")&&this.groupPriorityMap.set(e.getProperty("name"),10*Number.parseInt(e.getProperty("priority")))}}getDefaultPosition(){return this.genomeStanza.getProperty("defaultPos")}getGenomeConfig(e={}){const t=this.genomeStanza.getProperty("genome"),i=this.hubStanza.getProperty("shortLabel")||this.genomeStanza.getProperty("scientificName")||this.genomeStanza.getProperty("organism")||this.genomeStanza.getProperty("description"),n=i+(i?` (${t})`:` ${t}`),r={hubURL:this.url,id:t,name:n,twoBitURL:this.baseURL+this.genomeStanza.getProperty("twoBitPath"),nameSet:"ucsc",wholeGenomeView:!1,showChromosomeWidget:!1};if(this.genomeStanza.hasProperty("defaultPos")){const e=this.genomeStanza.getProperty("defaultPos");if(e){const t=e.lastIndexOf(":");r.locus=t>0?e.substring(0,t):e}}this.genomeStanza.hasProperty("blat")&&(r.blat=this.baseURL+this.genomeStanza.getProperty("blat")),this.genomeStanza.hasProperty("chromAliasBb")&&(r.chromAliasBbURL=this.baseURL+this.genomeStanza.getProperty("chromAliasBb")),this.genomeStanza.hasProperty("chromAlias")&&(r.aliasURL=this.baseURL+this.genomeStanza.getProperty("chromAlias")),this.genomeStanza.hasProperty("twoBitBptURL")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptURL")),this.genomeStanza.hasProperty("twoBitBptUrl")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptUrl")),e.includeChromSizes&&this.genomeStanza.hasProperty("chromSizes")&&(r.chromSizesURL=this.baseURL+this.genomeStanza.getProperty("chromSizes")),this.hubStanza.hasProperty("longLabel")?r.description=this.hubStanza.getProperty("longLabel").replace("/","\n"):(r.description=r.id,this.genomeStanza.hasProperty("description")&&(r.description+=`\n${this.genomeStanza.getProperty("description")}`),this.genomeStanza.hasProperty("organism")&&(r.description+=`\n${this.genomeStanza.getProperty("organism")}`),this.genomeStanza.hasProperty("scientificName")&&(r.description+=`\n${this.genomeStanza.getProperty("scientificName")}`),this.genomeStanza.hasProperty("htmlPath")&&(r.infoURL=this.baseURL+this.genomeStanza.getProperty("htmlPath")));const s=this.trackStanzas.filter((e=>"cytoBandIdeo"===e.name&&e.hasProperty("bigDataUrl")));s.length>0&&(r.cytobandBbURL=this.baseURL+s[0].getProperty("bigDataUrl"));return r.tracks=this.#f((e=>!du.filterTracks.has(e.name)&&"hide"!==e.getProperty("visibility"))),r}getGroupedTrackConfigurations(){const e=new Map;for(let t of this.#f()){if("cytoBandIdeo"===t.name)continue;const i=t.group||"other";e.has(i)?e.get(i).push(t):e.set(i,[t])}const t=this.groupStanzas?new Map(this.groupStanzas.map((e=>[e.getProperty("name"),e]))):new Map;return Array.from(e.keys()).map((i=>({label:t.has(i)?t.get(i).getProperty("label"):i,tracks:e.get(i)})))}#f(e){return this.trackStanzas.filter((t=>du.supportedTypes.has(t.format)&&t.hasProperty("bigDataUrl")&&(!e||e(t)))).map((e=>this.#p(e)))}#p(e){const t=e.format,i={id:e.getProperty("track"),name:e.getProperty("shortLabel"),format:t,url:this.baseURL+e.getProperty("bigDataUrl"),displayMode:e.displayMode};if("vcfTabix"===t&&(i.indexURL=i.url+".tbi"),e.hasProperty("longLabel")&&e.hasProperty("html")?(i.description&&(i.description+="<br/>"),i.description=`<a target="_blank" href="${this.baseURL+e.getProperty("html")}">${e.getProperty("longLabel")}</a>`):e.hasProperty("longLabel")&&(i.description=e.getProperty("longLabel")),e.hasProperty("autoScale")&&(i.autoscale="on"===e.getProperty("autoScale").toLowerCase()),e.hasProperty("maxHeightPixels")){const t=e.getProperty("maxHeightPixels").split(":");i.maxHeight=Number.parseInt(t[0]),i.height=Number.parseInt(t[1]),i.minHeight=Number.parseInt(t[2])}if(e.hasProperty("color")){const t=e.getProperty("color");i.color=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("altColor")){const t=e.getProperty("altColor");i.altColor=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("viewLimits")){const t=e.getProperty("viewLimits").split(":");let n,r;t.length>1&&(n=Number.parseInt(t[0]),r=Number.parseInt(t[1])),Number.isNaN(r)||Number.isNaN(n)?console.warn(`Unexpected viewLimits value in track line: ${properties.viewLimits}`):(i.min=n,i.max=r)}if(e.hasProperty("itemRgb"),"hide"===e.getProperty("visibility")&&(i.visible=!1),e.hasProperty("url")&&(i.infoURL=e.getProperty("url")),e.hasProperty("searchIndex")&&(i.searchIndex=e.getProperty("searchIndex")),e.hasProperty("searchTrix")&&(i.searchTrix=this.baseURL+e.getProperty("searchTrix")),e.hasProperty("group")&&(i.group=e.getProperty("group"),this.groupPriorityMap&&this.groupPriorityMap.has(i.group))){const e=this.groupPriorityMap.get(i.group)+1;i.order=e,this.groupPriorityMap.set(i.group,e)}return i}}function uu(e){const t=e.indexOf(" ");return t>0?e.substring(0,t):e}class fu{properties=new Map;constructor(e,t){this.type=e,this.name=t}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.has(e)?this.properties.get(e):this.parent?this.parent.getProperty(e):void 0}hasProperty(e){return!!this.properties.has(e)||!!this.parent&&this.parent.hasProperty(e)}get format(){const e=this.getProperty("type");if(e)return uu(e)}get displayMode(){let e=this.getProperty("visibility");if(!e)return"COLLAPSED";switch(e=e.toLowerCase(),e){case"dense":default:return"COLLAPSED";case"pack":return"EXPANDED";case"squish":return"SQUISHED"}}}async function pu(e){const t=await fetch(e),i=(await t.text()).split(/\n|\r\n|\r/g),n=[];let r,s=!0;for(let e of i){const t=gu(e),i=e.indexOf(" ",t);if(i<0)s=!0;else{const o=e.substring(t,i).trim();if(o.startsWith("#"))continue;const a=e.substring(i+1).trim();if(s){const e=new fu(o,a);n.push(e),r=e,s=!1}r.setProperty(o,a)}}return function(e){const t=new Map;for(let i of e)t.set(i.name,i);for(let i of e)if(i.properties.has("parent")){const e=uu(i.properties.get("parent"));i.parent=t.get(e)}return e}(n)}function gu(e){let t=0;for(t=0;t<e.length;t++){const i=e.charAt(t);if(" "!==i&&"\t"!==i)break}return t}const mu={initializeGenomes:async function(e){if(!mu.KNOWN_GENOMES){const t={};if(!1!==e.loadDefaultGenomes){const r="https://igv.org/genomes/genomes.json";n(await Qs.loadJson(r,{timeout:5e3}))}const i=e.genomeList||e.genomes;if(i)if("string"==typeof i){n(await Qs.loadJson(i,{}))}else n(i);function n(e){return e.forEach((function(e){t[e.id]=e})),t}mu.KNOWN_GENOMES=t}},isWholeGenomeView:function(e){return"all"===e.toLowerCase()},expandReference:async function(e,t){if(Mt(t)&&t.startsWith("{"))try{t=JSON.parse(t)}catch(e){}let i;if(Mt(t)?i=t:t.genome?i=t.genome:void 0===t.id||t.fastaURL||t.twobitURL||(i=t.id),i){let t=mu.KNOWN_GENOMES[i];if(!t){if((i.startsWith("GCA_")||i.startsWith("GCF_"))&&i.length>=13)try{const e=hu(i);t=(await du.loadHub(e)).getGenomeConfig()}catch(e){console.error(e)}t||e.present(new Error(`Unknown genome id: ${i}`),void 0)}return t}return t}};let wu,bu,Fu=0,vu=0,yu=[];class Au extends eu{constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.$spinner=Bt("<div>",{class:"igv-loading-spinner-container"}),this.$viewport.append(this.$spinner),this.$spinner.append(Bt("<div>"));const e=this.trackView.track;"sequence"!==e.type&&(this.$zoomInNotice=this.createZoomInNotice(this.$viewport)),"sequence"!==e.id&&(this.$trackLabel=Bt('<div class="igv-track-label">'),this.$viewport.append(this.$trackLabel),this.setTrackLabel(e.name||""),!1===this.browser.doShowTrackLabels&&this.$trackLabel.hide()),this.stopSpinner(),this.addMouseHandlers()}setContentHeight(e){super.setContentHeight(e),this.featureCache&&(this.featureCache.redraw=!0)}setTrackLabel(e){this.$trackLabel.empty(),this.$trackLabel.html(e);const t=this.$trackLabel.text();this.$trackLabel.attr("title",t)}startSpinner(){this.$spinner.show()}stopSpinner(){this.$spinner&&this.$spinner.hide()}checkZoomIn(){if(this.trackView.track&&"sequence"===this.trackView.track.type&&this.referenceFrame.bpPerPixel>10)return Bt(this.canvas).remove(),this.canvas=void 0,!1;if(!this.viewIsReady())return!1;if((()=>{if("all"!==this.referenceFrame.chr.toLowerCase()||this.trackView.track.supportsWholeGenome){const e=this.trackView.track.visibilityWindow;return void 0!==e&&e>0&&this.referenceFrame.bpPerPixel*this.$viewport.width()>e}return!0})()){if(this.canvas&&(Bt(this.canvas).remove(),this.canvas=void 0),this.trackView.track.autoHeight){const e=this.trackView.minHeight||0;this.setContentHeight(e)}return this.$zoomInNotice&&this.$zoomInNotice.show(),!1}return this.$zoomInNotice&&this.$zoomInNotice.hide(),!0}shift(){const e=this.referenceFrame;this.canvas&&this.canvas._data&&this.canvas._data.referenceFrame.chr===this.referenceFrame.chr&&this.canvas._data.bpPerPixel===e.bpPerPixel&&(this.canvas._data.pixelShift=Math.round((this.canvas._data.bpStart-e.start)/e.bpPerPixel),this.canvas.style.left=this.canvas._data.pixelShift+"px")}genomicRange(){return{start:this.referenceFrame.start,end:this.referenceFrame.start+this.referenceFrame.bpPerPixel*this.$viewport.width()}}setTop(e){if(super.setTop(e),this.canvas){const t=this.$viewport.height(),i=e+this.canvas._data.pixelTop,n=i+this.canvas._data.pixelHeight;(i>0||n<t)&&this.repaint()}else this.repaint();if(this.canvas&&this.canvas._data){let t=e+this.canvas._data.pixelTop;this.canvas.style.top=`${t}px`}}async loadFeatures(){const e=this.referenceFrame,t=e.chr,i=await this.browser.genome.loadChromosome(t),n=i?i.bpLength:Number.MAX_SAFE_INTEGER,r=this.$viewport.width()*e.bpPerPixel,s=Math.floor(Math.max(0,e.start-r)),o=Math.ceil(Math.min(n,e.start+r+r));if(!this.loading||this.loading.start!==s||this.loading.end!==o){this.loading={start:s,end:o},this.startSpinner();try{const i=this.trackView.track,n=await this.getFeatures(i,t,s,o,e.bpPerPixel);if(n){let r=[];if(i.roiSets&&i.roiSets.length>0)for(let n of i.roiSets){const i=await n.getFeatures(t,s,o,e.bpPerPixel);r.push({track:n,features:i})}const a=i&&i.resolutionAware,c=this.windowFunction;return this.featureCache=new Cu(t,s,o,e.bpPerPixel,n,r,a,c),this.loading=!1,this.hideMessage(),this.stopSpinner(),this.featureCache}}catch(e){this.trackView&&!0!==this.trackView.disposed&&(this.showMessage("Error loading track data"),this.browser.alert.present(e),console.error(e))}finally{this.loading=!1,this.stopSpinner()}}}get track(){return this.trackView.track}get windowFunction(){return this.track?this.track.windowFunction:void 0}repaintDimensions(){const e=mu.isWholeGenomeView(this.referenceFrame.chr),t=e?this.$viewport.width():3*this.$viewport.width(),i=this.referenceFrame.bpPerPixel;return{bpStart:this.referenceFrame.start-(e?0:this.$viewport.width()*i),bpEnd:e?Number.MAX_SAFE_INTEGER:this.referenceFrame.start+2*this.$viewport.width()*i+1,pixelWidth:t}}repaint(){if(void 0===this.featureCache)return;const{features:e,roiFeatures:t}=this.featureCache,{bpStart:i,bpEnd:n,pixelWidth:r}=this.repaintDimensions(),s=this.$viewport.height(),o=this.getContentHeight(),a=t?Math.max(o,s):o,c=Math.min(a,3*s);if(0===r||0===c)return void(this.canvas&&Bt(this.canvas).remove());const l=Math.max(0,-this.contentTop-Math.floor(c/3)),h=this.referenceFrame.bpPerPixel,d=Math.round((i-this.referenceFrame.start)/h),u=(this.contentTop||0)+l,f=document.createElement("canvas");f.style.position="relative",f.style.display="block",f.style.width=r+"px",f.style.height=c+"px",f.style.left=d+"px",f.style.top=u+"px";const p="FILL"===this.trackView.track.displayMode||!1!==this.trackView.track.supportHiDPI?window.devicePixelRatio:1;f.width=p*r,f.height=p*c;const g=f.getContext("2d");g.scale(p,p),g.translate(0,-l);const m={context:g,pixelXOffset:d,pixelWidth:r,pixelHeight:c,pixelTop:l,bpStart:i,bpEnd:n,bpPerPixel:h,pixelShift:d,windowFunction:this.windowFunction,referenceFrame:this.referenceFrame,selection:this.selection,viewport:this,viewportWidth:this.$viewport.width()};this.draw(m,e,t),this.canvas&&Bt(this.canvas).remove(),f._data=m,this.canvas=f,this.$viewport.append(Bt(f))}refresh(){if(!this.canvas||!this.featureCache)return;const e=this.canvas._data;e.context.clearRect(0,0,this.canvas.width,this.canvas.height);const{features:t,roiFeatures:i}=this.featureCache;this.draw(e,t,i)}draw(e,t,i){if(t&&(e.features=t,this.trackView.track.draw(e)),i&&i.length>0)for(let t of i)e.features=t.features,t.track.draw(e)}containsPosition(e,t){return this.referenceFrame.chr===e&&t>=this.referenceFrame.start&&t<=this.referenceFrame.calculateEnd(this.getWidth())}isLoading(){return this.loading}savePNG(){if(!this.canvas)return;const e=this.canvas._data,t=e?e.pixelTop:0,i=window.devicePixelRatio,n=this.$viewport.width()*i,r=this.$viewport.height()*i,s=-Bt(this.canvas).position().left*i,o=(-this.contentTop-t)*i,a=this.canvas.getContext("2d").getImageData(s,o,n,r),c=document.createElement("canvas"),l=c.getContext("2d");c.width=a.width,c.height=a.height,l.putImageData(a,0,0);Pt((this.$trackLabel.text()?this.$trackLabel.text():"image")+".png",c.toDataURL("image/png"))}saveSVG(){let{width:e,height:t}=this.browser.columnContainer.getBoundingClientRect();const i=new lu({width:e,height:8e3,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:e,height:8e3}}),n={deltaX:32,deltaY:32};this.renderSVGContext(i,n,!1),i.setHeight(t);const r=(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,""),o=this.browser.referenceFrameList.indexOf(this.referenceFrame),a=i.getSerializedSvg(!0),c=URL.createObjectURL(new Blob([a],{type:"application/octet-stream"}));Pt(`${`${r}_referenceFrame_${o}_guid_${s()}`}.svg`,c)}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){if(!(this.$zoomInNotice&&this.$zoomInNotice.is(":visible"))){const{width:n,height:r}=this.$viewport.get(0).getBoundingClientRect(),o=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${s()}`,a=t,c=i+this.contentTop,l=-this.contentTop;e.saveWithTranslationAndClipRect(o,a,c,n,r,l);let{start:h,bpPerPixel:d}=this.referenceFrame;const u={context:e,viewport:this,referenceFrame:this.referenceFrame,top:l,pixelTop:l,pixelWidth:n,pixelHeight:r,bpStart:h,bpEnd:h+n*d,bpPerPixel:d,viewportWidth:n,selection:this.selection},f=this.featureCache?this.featureCache.features:void 0,p=this.featureCache?this.featureCache.roiFeatures:void 0;this.draw(u,f,p),e.restore()}if(n&&this.$trackLabel&&this.browser.doShowTrackLabels){const{x:n,y:r,width:s,height:o}=((e,t)=>{const{x:i,y:n,width:r,height:s}=e.getBoundingClientRect(),{x:o,y:a,width:c,height:l}=t.getBoundingClientRect();return{x:o-i,y:a-n,width:c,height:l}})(this.$viewport.get(0),this.$trackLabel.get(0));this.renderTrackLabelSVG(e,t+n,i+r,s,o)}}renderTrackLabelSVG(e,t,i,n,r){const o=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_track_label_guid_${s()}`;e.saveWithTranslationAndClipRect(o,t,i,n,r,0),e.fillStyle="white",e.fillRect(0,0,n,r),e.font="12px Arial",e.fillStyle="rgb(68, 68, 68)";const{width:a}=e.measureText(this.$trackLabel.text()),c=.25*(n-a),l=.7*(r-12);e.fillText(this.$trackLabel.text(),c,r-l),e.strokeStyle="rgb(68, 68, 68)",e.strokeRect(0,0,n,r),e.restore()}get cachedFeatures(){return this.featureCache?this.featureCache.features:[]}clearCache(){this.featureCache=void 0,this.canvas&&(this.canvas._data=void 0)}async getFeatures(e,t,i,n,r){if(this.featureCache&&this.featureCache.containsRange(t,i,n,r,this.windowFunction))return this.featureCache.features;if("function"==typeof e.getFeatures){const s=await e.getFeatures(t,i,n,r,this);return this.checkContentHeight(s),s}}needsRepaint(){if(!this.canvas)return!0;const e=this.canvas._data;return!e||this.referenceFrame.start<e.bpStart||this.referenceFrame.end>e.bpEnd||this.referenceFrame.chr!==e.referenceFrame.chr||this.referenceFrame.bpPerPixel!=e.bpPerPixel||this.windowFunction!=e.windowFunction}needsReload(){if(!this.featureCache)return!0;const{chr:e,bpPerPixel:t}=this.referenceFrame,{bpStart:i,bpEnd:n}=this.repaintDimensions();return!this.featureCache.containsRange(e,i,n,t,this.windowFunction)}createZoomInNotice(e){const t=Bt("<div>",{class:"igv-zoom-in-notice-container"});e.append(t);const i=Bt("<div>");return t.append(i),i.text("Zoom in to see features"),t.hide(),t}viewIsReady(){return this.browser&&this.browser.referenceFrameList&&this.referenceFrame}addMouseHandlers(){const e=this.$viewport.get(0);this.addViewportContextMenuHandler(e);const t=e=>{this.enableClick=!0,this.browser.mouseDownOnViewport(e,this),r(e)};e.addEventListener("mousedown",t),e.addEventListener("touchstart",t);const i=e=>{this.browser.dragObject||this.browser.isScrolling?(this.browser.cancelTrackPan(),this.enableClick=!1):(this.browser.cancelTrackPan(),this.browser.endTrackDrag())};e.addEventListener("mouseup",i),e.addEventListener("touchend",i),"function"==typeof this.trackView.track.hoverText&&e.addEventListener("mousemove",(e=>{if(0===e.buttons&&Date.now()-vu>100){vu=Date.now();const t=this.createClickState(e);if(t){const e=this.trackView.track.hoverText(t);e?this.$viewport[0].setAttribute("title",e):this.$viewport[0].removeAttribute("title")}}})),this.addViewportClickHandler(this.$viewport.get(0)),this.trackView.track.name&&"sequence"!==this.trackView.track.config.type&&this.addTrackLabelClickHandler(this.$trackLabel.get(0))}addViewportContextMenuHandler(e){e.addEventListener("contextmenu",(e=>{if(this.browser.dragObject)return!1;const t=this.createClickState(e);if(void 0===t)return!1;e.preventDefault();let i=[];if("function"==typeof this.trackView.track.contextMenuItemList){const e=this.trackView.track.contextMenuItemList(t);e&&(i=e)}i.length>0&&i.push({label:Bt("<HR>")}),i.push({label:"Save Image (PNG)",click:()=>this.savePNG()}),i.push({label:"Save Image (SVG)",click:()=>this.saveSVG()}),this.browser.menuPopup.presentTrackContextMenu(e,i)}))}addViewportClickHandler(e){e.addEventListener("click",(e=>{if(this.enableClick&&this.canvas){if(3===e.which||e.ctrlKey)return;if(this.browser.dragObject||this.browser.isScrolling)return;e.preventDefault();const t=a(e,this.$viewport.get(0)).x,i=a(e,this.canvas).x,n=this.referenceFrame;Math.floor(n.start+n.toBP(i));const r=Date.now();if(r-Fu<this.browser.constants.doubleClickDelay){wu&&(window.clearTimeout(wu),wu=void 0);const e=Math.round(n.start+n.toBP(t));let i;if("all"===this.referenceFrame.chr.toLowerCase()){const t=this.browser.genome.getChromosomeCoordinate(e).chr;if(1===this.browser.referenceFrameList.length)i=t;else{const e=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));e[this.browser.referenceFrameList.indexOf(this.referenceFrame)]=t,i=e.join(" ")}this.browser.search(i)}else this.browser.zoomWithScaleFactor(.5,e,this.referenceFrame)}else"function"==typeof this.trackView.track.popupData&&(wu=setTimeout((()=>{const t=this.getPopupContent(e);if(t)if(!1===e.shiftKey){if(bu&&bu.dispose(),yu.length>0){for(const e of yu)e.dispose();yu.length=0}bu=new ic(this.$viewport.get(0).parentElement,!0,void 0,(()=>{bu.dispose()})),bu.presentContentWithEvent(e,t)}else{let i=new ic(this.$viewport.get(0).parentElement,!0,void 0,(()=>{const e=yu.indexOf(i);yu.splice(e,1),i.dispose()}));yu.push(i),i.presentContentWithEvent(e,t)}window.clearTimeout(wu),wu=void 0}),this.browser.constants.doubleClickDelay));Fu=r}}))}addTrackLabelClickHandler(e){e.addEventListener("click",(e=>{e.stopPropagation();const{track:t}=this.trackView;let i;"function"==typeof t.description?i=t.description():t.description&&(i=`<div>${t.description}</div>`),i&&(void 0===this.popover&&(this.popover=new ic(this.browser.columnContainer,!0,t.name||"",void 0)),this.popover.presentContentWithEvent(e,i))}))}createClickState(e){if(!this.canvas)return;const t=this.referenceFrame,i=a(e,this.$viewport.get(0)),n=a(e,this.canvas),r=t.start+t.toBP(i.x);return{event:e,viewport:this,referenceFrame:t,genomicLocation:r,y:i.y-this.contentTop,canvasX:n.x,canvasY:n.y}}getPopupContent(e){const t=this.createClickState(e);if(void 0===t)return;let i=this.trackView.track;const n=i.popupData(t),r=this.browser.fireEvent("trackclick",[i,n]);let s;return void 0===r||!0===r?n&&n.length>0&&(s=n.map((e=>{if(e.name){const t=`<span>${e.name}</span>&nbsp&nbsp&nbsp${e.value}`;return`<div title="${e.value}">${t}</div>`}return"<hr>"===e?e:e.html?e.html:`<div title="${e}">${e}</div>`})).join("")):"string"==typeof r&&(s=r),s}dispose(){this.popover&&this.popover.dispose(),super.dispose()}}class Cu{constructor(e,t,i,n,r,s,o,a){this.chr=e,this.bpStart=t,this.bpEnd=i,this.bpPerPixel=n,this.features=r,this.roiFeatures=s,this.multiresolution=o,this.windowFunction=a}containsRange(e,t,i,n,r){if(r&&r!==this.windowFunction)return!1;const s=this.multiresolution?this.bpPerPixel/n:1;return t>=this.bpStart&&i<=this.bpEnd&&e===this.chr&&s>.5&&s<2}overlapsRange(e,t,i){return this.chr===e&&i>=this.bpStart&&t<=this.bpEnd}}const _u=function(e,t){const{r:i,g:n,b:r}=no[e];return`rgba(${i},${n},${r},${t})`}("nickel",2/16),xu=_u;class ku{constructor(e,t){if(this.url=e.url,e.name&&(this.name=e.name),this.isUserDefined=e.isUserDefined,e.featureSource)this.featureSource=e.featureSource;else if(e.features)this.featureSource=new Su(e.features,t);else{if(!e.format)throw Error("ROI configuration must define either features or file format");this.featureSource=Ad(e,t)}!0===this.isUserDefined?(this.color=e.color||xu,this.headerColor="rgba(155,185,129)"):(this.color=e.color||_u,this.headerColor="rgb(190,190,190)"),this.isVisible=void 0===e.isVisible||e.isVisible}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}async getAllFeatures(){return"function"==typeof this.featureSource.getAllFeatures?await this.featureSource.getAllFeatures():{}}addFeature(e){this.featureSource.addFeature(e)}removeFeature(e){this.featureSource.removeFeature(e)}toJSON(){if(this.url)return{name:this.name,color:this.color,url:this.url,isUserDefined:this.isUserDefined,isVisible:this.isVisible};{const e=this.featureSource.getAllFeatures(),t=[];for(let i of Object.keys(e))for(let n of e[i])t.push(n);return{name:this.name,color:this.color,features:t,isUserDefined:this.isUserDefined,isVisible:this.isVisible}}}dispose(){for(let e of Object.keys(this))this[e]=void 0}}function Iu(e,t,i,n){let r=Math.round((e-i)/n);let s=Math.round((t-i)/n)-r;return s<3&&(s=3,r-=1),{x:r,width:s}}class Su{constructor(e,t){this.featureMap={},this.genome=t;for(let i of e){const e=t?t.getChromosomeName(i.chr):i.chr;let n=this.featureMap[e];n||(n=[],this.featureMap[e]=n),n.push(i)}for(let e of Object.keys(this.featureMap))this.featureMap[e].sort(((e,t)=>e.start-t.start))}async getFeatures({chr:e,start:t,end:i}){if("all"===e.toLowerCase())return Ll(this.featureMap,this.genome);{const n=this.featureMap[e];return n?n.filter((e=>e.end>t&&e.start<i)):[]}}getAllFeatures(){return this.featureMap}supportsWholeGenome(){return!0}addFeature(e){let t=this.featureMap[e.chr];t||(t=[],this.featureMap[e.chr]=t),t.push(e),t.sort(((e,t)=>e.start-t.start))}removeFeature({chr:e,start:t,end:i}){if(this.featureMap[e]){const n=`${e}-${t}-${i}`;this.featureMap[e]=this.featureMap[e].filter((e=>n!==`${e.chr}-${e.start}-${e.end}`)),0===this.featureMap[e].length&&delete this.featureMap[e]}}}class Eu{constructor(t,i,n,r){this.rulerViewport=t,this.rulerSweeper=e({class:"igv-ruler-sweeper"}),i.appendChild(this.rulerSweeper),this.browser=n,this.referenceFrame=r,this.isMouseHandlers=void 0,this.addBrowserObserver()}addBrowserObserver(){this.boundObserverHandler=(()=>{this.referenceFrame&&(mu.isWholeGenomeView(this.referenceFrame.chr)?this.removeMouseHandlers():this.addMouseHandlers())}).bind(this),this.browser.on("locuschange",this.boundObserverHandler)}removeBrowserObserver(){this.browser.off("locuschange",this.boundObserverHandler)}addMouseHandlers(){if(!0===this.isMouseHandlers)return;let e,t,i,n,r,s;this.boundContentMouseDownHandler=function(s){e=!0,t=!0;const{x:o}=a(s,this.rulerViewport.contentDiv);n=i=o,r=1,this.rulerSweeper.style.display="block",this.rulerSweeper.style.backgroundColor=!0===s.shiftKey?xu:"rgba(68, 134, 247, 0.25)",this.rulerSweeper.style.left=`${n}px`,this.rulerSweeper.style.width=`${r}px`}.bind(this),this.rulerViewport.contentDiv.addEventListener("mousedown",this.boundContentMouseDownHandler),this.boundDocumentMouseMoveHandler=function(o){let c;if(e&&t){const{x:e}=a(o,this.rulerViewport.contentDiv);c=Math.max(Math.min(e,this.rulerViewport.contentDiv.clientWidth),0),s=c-i,r=Math.abs(s),this.rulerSweeper.style.width=`${r}px`,s<0&&(n=i+s,this.rulerSweeper.style.left=`${n}px`)}}.bind(this),document.addEventListener("mousemove",this.boundDocumentMouseMoveHandler),this.boundDocumentMouseUpHandler=function(i){let s;if(!0===e&&!0===t&&(e=t=void 0,this.rulerSweeper.style.display="none",r>1)){s={start:Math.floor(this.referenceFrame.calculateEnd(n)),end:Math.floor(this.referenceFrame.calculateEnd(n+r))};!0===i.shiftKey?this.browser.roiManager.updateUserDefinedROISet(Object.assign({chr:this.referenceFrame.chr},s)):(Va(this.browser.genome.getChromosome(this.referenceFrame.chr).bpLength,s,this.browser.minimumBases()),function(e,t,i){e.start=Math.round(t.start),e.end=Math.round(t.end),e.bpPerPixel=(e.end-e.start)/i}(this.referenceFrame,s,this.rulerViewport.contentDiv.clientWidth),this.browser.updateViews(this.referenceFrame))}}.bind(this),document.addEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!0}removeMouseHandlers(){this.rulerViewport.contentDiv.removeEventListener("mousedown",this.boundContentMouseDownHandler),document.removeEventListener("mousemove",this.boundDocumentMouseMoveHandler),document.removeEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!1}dispose(){this.removeBrowserObserver(),this.removeMouseHandlers(),this.rulerSweeper.remove()}}function Nu(e){if(Bu[e])return Bu[e];if(Bu["chr"+e]){const t=Bu["chr"+e];return Bu[e]=t,t}{const t=_s.randomRGB(0,255);return Bu[e]=t,t}}const Bu={chrX:"rgb(204, 153, 0)",chrY:"rgb(153, 204, 0)",chrUn:"rgb(50, 50, 50)",chr1:"rgb(80, 80, 255)",chrI:"rgb(139, 155, 187)",chr2:"rgb(206, 61, 50)",chrII:"rgb(206, 61, 50)",chr2a:"rgb(216, 71, 60)",chr2b:"rgb(226, 81, 70)",chr3:"rgb(116, 155, 88)",chrIII:"rgb(116, 155, 88)",chr4:"rgb(240, 230, 133)",chrIV:"rgb(240, 230, 133)",chr5:"rgb(70, 105, 131)",chr6:"rgb(186, 99, 56)",chr7:"rgb(93, 177, 221)",chr8:"rgb(128, 34, 104)",chr9:"rgb(107, 215, 107)",chr10:"rgb(213, 149, 167)",chr11:"rgb(146, 72, 34)",chr12:"rgb(131, 123, 141)",chr13:"rgb(199, 81, 39)",chr14:"rgb(213, 143, 92)",chr15:"rgb(122, 101, 165)",chr16:"rgb(228, 175, 105)",chr17:"rgb(59, 27, 83)",chr18:"rgb(205, 222, 183)",chr19:"rgb(97, 42, 121)",chr20:"rgb(174, 31, 99)",chr21:"rgb(231, 199, 111)",chr22:"rgb(90, 101, 94)",chr23:"rgb(204, 153, 0)",chr24:"rgb(153, 204, 0)",chr25:"rgb(51, 204, 0)",chr26:"rgb(0, 204, 51)",chr27:"rgb(0, 204, 153)",chr28:"rgb(0, 153, 204)",chr29:"rgb(10, 71, 255)",chr30:"rgb(71, 117, 255)",chr31:"rgb(255, 194, 10)",chr32:"rgb(255, 209, 71)",chr33:"rgb(153, 0, 51)",chr34:"rgb(153, 26, 0)",chr35:"rgb(153, 102, 0)",chr36:"rgb(128, 153, 0)",chr37:"rgb(51, 153, 0)",chr38:"rgb(0, 153, 26)",chr39:"rgb(0, 153, 102)",chr40:"rgb(0, 128, 153)",chr41:"rgb(0, 51, 153)",chr42:"rgb(26, 0, 153)",chr43:"rgb(102, 0, 153)",chr44:"rgb(153, 0, 128)",chr45:"rgb(214, 0, 71)",chr46:"rgb(255, 20, 99)",chr47:"rgb(0, 214, 143)",chr48:"rgb(20, 255, 177)"};let Mu,Ru;class Du extends Au{constructor(e,t,i,n){super(e,t,i,n)}get contentDiv(){return this.$viewport.get(0)}initializationHelper(){let e;this.$multiLocusCloseButton=Bt("<div>",{class:"igv-multi-locus-close-button"}),this.$viewport.append(this.$multiLocusCloseButton),this.$multiLocusCloseButton.get(0).appendChild(l("times-circle")),this.$multiLocusCloseButton.click((()=>{this.browser.removeMultiLocusPanel(this.referenceFrame)})),this.$rulerLabel=Bt("<div>",{class:"igv-multi-locus-ruler-label"}),this.$viewport.append(this.$rulerLabel),e=document.createElement("div"),this.$rulerLabel.append(Bt(e)),this.$rulerLabel.get(0).addEventListener("click",(async e=>{e.stopPropagation(),await this.browser.gotoMultilocusPanel(this.referenceFrame)})),this.$tooltip=Bt("<div>",{class:"igv-ruler-tooltip"}),this.$tooltip.height(this.$viewport.height()),this.$viewport.append(this.$tooltip),this.$tooltipContent=Bt("<div>"),this.$tooltip.append(this.$tooltipContent),this.rulerSweeper=new Eu(this,this.$viewport.get(0).parentElement,this.browser,this.referenceFrame),this.attachMouseHandlers(mu.isWholeGenomeView(this.referenceFrame.chr)),this.$tooltip.hide(),this.dismissLocusLabel()}presentLocusLabel(e){this.$multiLocusCloseButton.show(),this.$rulerLabel.show(),this.$rulerLabel.get(0).style.backgroundColor=Nu(this.referenceFrame.chr);const t=this.$rulerLabel.get(0).querySelector("div"),{width:i}=this.$rulerLabel.get(0).getBoundingClientRect();t.innerHTML=`${this.referenceFrame.getMultiLocusLabel(e)}`;const{width:n}=t.getBoundingClientRect();n/i>.5&&(t.innerHTML=`${this.referenceFrame.getMultiLocusLabelBPLengthOnly(e)}`)}dismissLocusLabel(){this.$rulerLabel.hide(),this.$multiLocusCloseButton.hide()}attachMouseHandlers(e){if(this.namespace=`.ruler_track_viewport_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}`,this.$viewport.off(this.namespace),!0===e){const e=this.browser.referenceFrameList.indexOf(this.referenceFrame),t=`click${this.namespace}`;this.$viewport.on(t,(t=>{const{x:i}=a(t,this.$viewport.get(0)),n=Math.round(this.referenceFrame.start+this.referenceFrame.toBP(i));let r;const{chr:s}=this.browser.genome.getChromosomeCoordinate(n);if(1===this.browser.referenceFrameList.length)r=s;else{let t=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));t[e]=s,r=t.join(" ")}this.browser.search(r)})),this.$viewport.get(0).style.cursor="pointer"}else this.$viewport.get(0).style.cursor="default"}mouseMove(e){if(!0===this.browser.doShowCursorGuide){void 0===Ru?(Ru=this,this.$tooltip.show()):Ru.guid!==this.guid?(Ru.$tooltip&&Ru.$tooltip.hide(),this.$tooltip.show(),Ru=this):this.$tooltip.show();if(this.browser.isMultiLocusWholeGenomeView()||mu.isWholeGenomeView(this.referenceFrame.chr))return void this.$tooltip.hide();const{x:t}=a(e,this.$viewport.get(0)),{start:i,end:n,bpPerPixel:r}=this.referenceFrame,s=Math.round(.5+i+Math.max(0,t)*r);this.$tooltipContent.text(Rt(s));const{width:o}=this.$tooltipContent.get(0).getBoundingClientRect(),{width:c}=this.$viewport.get(0).getBoundingClientRect();return this.$tooltip.css({left:`${ys.clamp(t,0,c-o)}px`}),clearTimeout(Mu),Mu=setTimeout((()=>{this.$tooltip&&this.$tooltip.hide()}),1e4),{start:i,bp:s,end:n}}}startSpinner(){}stopSpinner(){}dispose(){this.rulerSweeper.dispose(),super.dispose()}}class Tu extends Au{featureCache=new Lu;constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.canvas=document.createElement("canvas"),this.canvas.className="igv-ideogram-canvas",this.$viewport.append(Bt(this.canvas)),this.ideogram_ctx=this.canvas.getContext("2d"),this.addMouseHandlers()}async getFeatures(e,t,i,n){return this.featureCache.containsRange(e)?this.featureCache.get(e):this.loadFeatures()}async loadFeatures(){const e=this.referenceFrame.chr,t=await this.referenceFrame.genome.getCytobands(e);return this.featureCache.set(e,t),t}repaint(){if(void 0===this.featureCache)return;const{width:e,height:t}=this.$viewport[0].getBoundingClientRect();xo.configureHighDPICanvas(this.ideogram_ctx,e,t);const i=this.referenceFrame.chr,n=this.featureCache.get(i),r={context:this.ideogram_ctx,pixelWidth:e,pixelHeight:t,referenceFrame:this.referenceFrame,features:n};this.trackView.track.draw(r)}addMouseHandlers(){this.addViewportClickHandler(this.$viewport.get(0))}addViewportClickHandler(e){this.boundClickHandler=function(e){const{xNormalized:t,width:i}=a(e,this.ideogram_ctx.canvas),{bpLength:n}=this.browser.genome.getChromosome(this.referenceFrame.chr),r=this.referenceFrame.bpPerPixel*i/n;let s=t;s-r/2<0&&(s=r/2);s+r/2>1&&(s=1-r/2);const o=Math.round((s-r/2)*n),c=Math.round((s+r/2)*n);this.referenceFrame.start=o,this.referenceFrame.end=c,this.referenceFrame.bpPerPixel=(c-o)/i,this.browser.updateViews(this.referenceFrame,this.browser.trackViews,!0)}.bind(this),e.addEventListener("click",this.boundClickHandler)}setWidth(e){this.$viewport.width(e)}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){const{width:r,height:o}=this.$viewport.get(0).getBoundingClientRect(),a=`ideogram_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${s()}`,c=t,l=i+this.contentTop,h=-this.contentTop;e.saveWithTranslationAndClipRect(a,c,l,r,o,h),this.trackView.track.draw({context:e,pixelWidth:r,pixelHeight:o,referenceFrame:this.referenceFrame,features:this.featureCache.get(this.referenceFrame.chr)}),e.restore()}startSpinner(){}stopSpinner(){}}class Lu{features=new Map;containsRange(e){return this.features.has(e)}set(e,t){this.features.set(e,t)}get(e){return this.features.get(e)}}function zu(e,t,i,n){if("ruler"===e.track.type)return new Du(e,t,i,n);if("ideogram"===e.track.id)return new Tu(e,t,i,n);{const r=new Au(e,t,i,n);return i.viewport=r,r}}const Hu=["rgb(255, 0, 0)","rgb(0, 255, 0)","rgb(0, 0, 255)","rgb(255, 0, 255)","rgb(0, 255, 255)","rgb(128, 0, 128)","rgb(255, 165, 0)","rgb(255, 105, 180)","rgb(255, 127, 80)","rgb(220, 20, 60)","rgb(255, 99, 71)","rgb(173, 216, 230)","rgb(144, 238, 144)","rgb(224, 255, 255)","rgb(250, 250, 210)","rgb(152, 251, 152)","rgb(70, 130, 180)","rgb(102, 205, 170)"].map((e=>{const[t,i,n]=e.split(","),[r,s]=t.split("("),[o,a]=n.split(")");return[s,i,o]})),Pu=ro("magnesium"),Ou=["#sampleTable","#sampleMapping","#colors"];class Uu{static emptySpaceReplacement="|";sampleDictionary={};attributeNames=[];sampleMappingDictionary={};colorDictionary={};attributeRangeLUT={};constructor(e){e.tracks.some((e=>"function"==typeof e.getSamples)).length>0&&e.sampleInfoControl.setButtonVisibility(!0),this.initialize()}initialize(){this.sampleInfoFiles=[],this.attributeNames=[],this.sampleDictionary={},this.sampleMappingDictionary={},this.colorDictionary={},this.attributeRangeLUT={},this.initialized=!1}get attributeCount(){return this.attributeNames?this.attributeNames.length:0}isInitialized(){return this.initialized}hasAttributes(){return this.attributeCount>0}getAttributes(e){const t=0===Object.keys(this.sampleMappingDictionary)?e:this.sampleMappingDictionary[e]||e;return this.sampleDictionary[t]}async loadSampleInfoFile(e){try{const t=await Qs.loadString(e);this.#g(t),this.sampleInfoFiles.push(e)}catch(e){console.error(e.message)}}#g(e){const t=function(e){const t={},i=e.split(/\r?\n|\r/).map((e=>e.trim())).filter((e=>""!==e));let n;Ou.includes(i[0])||(n="#sampleTable",t[n]=[]);for(const e of i)Ou.includes(e)?(n=e,t[n]=[]):n&&!1===e.startsWith("#")&&t[n].push(e);return t}(e);for(const[e,i]of Object.entries(t))switch(e){case"#sampleTable":this.#m(i);break;case"#sampleMapping":this.#w(i);break;case"#colors":this.#b(i)}this.initialized=!0}getAttributeColor(e,t){let i;if("-"===t)i=ro("snow");else if("string"==typeof t&&this.colorDictionary[t])i=this.colorDictionary[t]();else if(this.colorDictionary[e])i=this.colorDictionary[e](t);else if("string"==typeof t)i="NA"===t?Pu:function(e){let t=0;for(let i=0;i<e.length;i++)t=e.charCodeAt(i)+((t<<5)-t);let i=[];for(let e=0;e<3;e++){const n=t>>8*e&255;i.push(n)}return`rgb(${i.join(", ")})`}(t);else{const[n,r]=this.attributeRangeLUT[e],s=.2,o=Math.max((t-n)/(r-n),s),[a,c,l]=Hu[Object.keys(this.attributeRangeLUT).indexOf(e)];i=`rgba(${a},${c},${l},${o})`}return i}getSortedSampleKeysByAttribute(e,t,i){i=i||1;const n=e.filter((e=>"number"==typeof this.getAttributes(e)[t])),r=e.filter((e=>"string"==typeof this.getAttributes(e)[t])),s=(e,n)=>{const r=this.getAttributes(e)[t],s=this.getAttributes(n)[t];return"string"==typeof r&&"string"==typeof s?i*r.localeCompare(s):"number"==typeof r&&"number"==typeof s?i*(r-s):void 0};return n.sort(s),r.sort(s),-1===i?[...n,...r]:[...r,...n]}toJSON(){const e=[];for(const t of this.sampleInfoFiles){const i={url:t},n=Hl.localFileInspection(i);e.push(n)}return e}#m(e){const t=e.shift().split("\t").filter((e=>e.length>0));t.shift();const i=t.map((e=>e.split(" ").join(Uu.emptySpaceReplacement))),n=e.filter((e=>e.length>0));let r;for(const e of n){const t=e.split("\t"),n=t.shift();void 0===r&&(r={}),r[n]={};for(let e=0;e<t.length;e++){const s={};""===t[e]?s[i[e]]="-":s[i[e]]=t[e],Object.assign(r[n],s)}}for(const[e,t]of Object.entries(r))r[e]=Qu(t);const s=function(e,t){const i={};for(const n of Object.values(t))for(const t of e){let e=n[t];void 0===i[t]&&(i[t]=[]),i[t].push(e)}const n=e=>"number"==typeof e,r=e=>"string"==typeof e;for(const e of Object.keys(i)){const t=i[e],s=new Set(t),o=Array.from(s);if(!0===o.some(r)&&!0===o.some(n)?i[e]=o.filter((e=>!r(e))):i[e]=o,!i[e].some(r)){const t=i[e].slice();i[e]=[Math.min(...t),Math.max(...t)]}}return i}(i,r);qu(this.attributeRangeLUT,s);const o=new Set(this.attributeNames);for(const e of i)o.has(e)||this.attributeNames.push(e);qu(this.sampleDictionary,r)}#w(e){for(const t of e){const[e,i]=t.split("\t");this.sampleMappingDictionary[e]=i}}#b(e){const t=(e,t,i)=>{let n;switch(t){case 0:n=e.split(" ").join(Uu.emptySpaceReplacement);break;case 1:n=e.includes(":")?e.split(":").map((e=>parseFloat(e))):e;break;case 2:case 3:n=`rgb(${e})`}return n},i=e.map((e=>e.split("\t").map(t))),n=i.filter((e=>3===e.length&&!e.includes("*"))).filter((([e,t,i])=>!Array.isArray(t))),r={};for(const e of n){const[t,i,n]=e;void 0===r[t]&&(r[t]={}),r[t][i.toUpperCase()]=n}for(const[e,t]of Object.entries(r)){const i=Object.assign({},t);this.colorDictionary[e]=e=>{const t=e.toUpperCase();return i[t]||ro("snow")}}const s=i.filter((e=>Array.isArray(e[1])));for(const e of s){const[t,i]=e[1],n=e[0];if(3===e.length){const[r,s,o]=uo(e[2]);this.colorDictionary[n]=e=>{e=ys.clamp(e,t,i);return lo(r,s,o,(e-t)/(i-t))}}else if(4===e.length){const[t,i]=e[1],[n,r,s,o]=e;this.colorDictionary[n]=e=>{e=ys.clamp(e,t,i);return fo(s,o,(e-t)/(i-t))}}}const o=i.filter((e=>3===e.length&&e.includes("*")));for(const e of o)if("*"===e[1]){const[t,i,n]=e;this.colorDictionary[t]=e=>{if("NA"===e)return Pu;{const[i,r]=this.attributeRangeLUT[t],s=(e-i)/(r-i),[o,a,c]=uo(n);return lo(o,a,c,s)}}}else if("*"===e[0]){const[t,i,n]=e;this.colorDictionary[i]=()=>n}}}function qu(e,t){for(const[i,n]of Object.entries(t))i in e&&e[i]===n||(e[i]=n)}function Qu(e){const t=Object.assign({},e);for(const[e,i]of Object.entries(t))"string"!=typeof i||isNaN(i)||(t[e]=Number(i));return t}const Vu=16,ju=Rt;class Wu{constructor(e){this.browser=e,this.height=40,this.name="",this.id="ruler",this.disableButtons=!0,this.ignoreTrackMenu=!0,this.order=.01*Number.MIN_SAFE_INTEGER,this.removable=!1,this.type="ruler"}async getFeatures(e,t,i){return[]}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpPerPixel:r,bpStart:s}){mu.isWholeGenomeView(t.chr)?this.drawWholeGenome({context:e,pixelWidth:i,pixelHeight:n,bpPerPixel:r}):this.doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:s})}drawWholeGenome({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n}){e.save(),xo.fillRect(e,0,0,t,i,{fillStyle:"white"});for(let t of this.browser.genome.wgChromosomeNames){let r=this.browser.genome.getCumulativeOffset(t),s=this.browser.genome.getChromosome(t).bpLength,o=Math.round(r/n),a=Math.round(s/n);this.renderChromosomeRect(e,o,0,a,i,t)}e.restore()}doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:r}){e.clearRect(0,0,i,n);const s=function(e,t){if(e<10)return new Gu(1,"bp",1);const i=Math.floor(Math.log10(e));let n="bp",r=1;i>9?(n="gb",r=1e9):i>6?(n="mb",r=1e6):i>3&&(n="kb",r=1e3);const s=Math.pow(10,i-1),o=e/s,a=75,c=Math.pow(10,i-1),l=Math.pow(10,i)/2;return new Gu(o<a&&!0!==t?c:l,n,r)}(Math.floor(t.toBP(i)),e.isSVG);let o=Math.floor(r/s.majorTick)-1;const{tickDelta:a,labelLength:c}=function(e,t,i,n,r){const s=l(t,c(1+n,r),i)-l(t,c(n,r),i),o=`${Rt(Math.floor(c(n,r)/r.unitMultiplier))} ${r.majorUnit}`,a=Math.floor(e.measureText(o).width);return{tickDelta:s,labelLength:a};function c(e,t){return Math.floor(e*t.majorTick)}function l(e,t,i){return Math.round(e.toPixels(t-1-i+.5))}}(e,t,r,o,s);let l,h;this.browser.referenceFrameList.indexOf(t);let d=a;const u=.25*c;do{h=Math.floor(o*s.majorTick);const i=`${Rt(Math.floor(h/s.unitMultiplier))} ${s.majorUnit}`;l=Math.round(t.toPixels(h-1-r+.5));const n=Math.round(l-e.measureText(i).width/2);n>0&&u+c<=d&&(xo.fillText(e,i,n,this.height-8),d=0),l>0&&xo.strokeLine(e,l,this.height-6,l,this.height-2),h=Math.floor((1+o)*s.majorTick);let f=l+(Math.round(t.toPixels(h-1-r+.5))-l)/2;f>0&&xo.strokeLine(e,f,this.height-6,f,this.height-2),++o,d+=a}while(l<i);xo.strokeLine(e,0,this.height-2,i,this.height-2)}renderChromosomeRect(e,t,i,n,r,s){e.textAlign="center",e.textBaseline="middle",e.font="12px sans-serif",xo.strokeLine(e,t+n,i,t+n,i+r,{strokeStyle:_s.greyScale(191)});const o=(s=this.browser.genome.getChromosomeDisplayName(s)).startsWith("chr")?s.substring(3):s;n>e.measureText(o).width&&xo.fillText(e,o,t+n/2,i+r/2,{fillStyle:_s.greyScale(68)})}get supportsWholeGenome(){return!0}dispose(){}}class Gu{constructor(e,t,i){this.majorTick=e,this.minorTick=e/10,this.majorUnit=t,this.unitMultiplier=i}description(e){console.log((e||"")+" tick "+ju(this.majorTick)+" label width "+ju(this.labelWidthBP)+" multiplier "+this.unitMultiplier)}}class $u{constructor(t,i,n){this.guid=s(),this.trackView=t,this.browser=t.browser,this.viewport=e({class:"igv-viewport"}),i.appendChild(this.viewport),this.viewport.style.height=`${t.track.height}px`,null===this.viewport.previousElementSibling&&(this.viewport.style.zIndex=16,this.viewport.style.overflow="visible"),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.ctx.font="10px verdana",this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(n),this.addMouseHandlers()}resizeCanvas(){const e=window.devicePixelRatio,t=this.browser.getSampleInfoViewportWidth();let i;if(this.browser.trackViews.length>1&&null===this.viewport.previousElementSibling){const[e,t]=[this.browser.ideogramTrackView.track,this.browser.rulerTrackView.track];i=e.height+t.height}else i=this.viewport.clientHeight;if(this.canvas.width!==t*e||this.canvas.height!==i*e){const n=this.canvas;n.width=t*e,n.height=i*e,n.style.width=`${t}px`,n.style.height=`${i}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(e,e),null===this.viewport.previousElementSibling&&xo.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:ro("snow")})}}setTop(e){"function"==typeof this.trackView.track.getSamples&&(this.contentTop=e,this.repaint())}setWidth(e){this.viewport.innerWidth=e,this.resizeCanvas()}setHeight(e){const t=this.browser.getSampleInfoViewportWidth();this.viewport.style.width=`${t}px`,this.viewport.style.height=`${e}px`;const i=window.devicePixelRatio;this.canvas.width=t*i,this.canvas.height=e*i,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(i,i),null===this.viewport.previousElementSibling&&xo.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:ro("snow")})}async repaint(){if(this.resizeCanvas(),"function"==typeof this.trackView.track.getSamples){const e=this.trackView.track.getSamples();e.names&&e.names.length>0&&this.draw({context:this.ctx,samples:e})}else null===this.viewport.previousElementSibling&&(this.browser.rulerTrackView&&this.browser.rulerTrackView.setTrackHeight(!0===this.browser.sampleInfoControl.showSampleInfo?this.calculateSampleInfoColumnHeight():40,!0),this.renderSampleInfoColumns(this.ctx))}calculateSampleInfoColumnHeight(){const e=this.browser.sampleInfo.attributeNames.map((e=>this.ctx.measureText(e).width));return 4+Math.min(Math.max(...e),128)}draw({context:e,samples:t}){if(e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillStyle=ro("snow"),e.fillRect(0,0,e.canvas.width,e.canvas.height),t&&t.names.length>0){const i=this.browser.sampleInfo.attributeNames,n=this.viewport.getBoundingClientRect().height;let r=1;const s=t.height;r=s-2*r<=1?0:1;let o=this.contentTop+t.yOffset;this.hitList={};for(const a of t.names){if(o>n)break;if(o+s>0){const t=this.browser.sampleInfo.getAttributes(a);if(t){const n=Object.entries(t);for(const t of n){const[n,a]=t;e.fillStyle=this.browser.sampleInfo.getAttributeColor(n,a);const c=8+i.indexOf(n)*Vu,l=o+r,h=s-2*r;e.fillRect(c,l,15,h);const d=`${Math.floor(c)}#${Math.floor(l)}#16#${Math.ceil(h)}`;this.hitList[d]=`${n}#${a}`}}}o+=s}}}renderSampleInfoColumns(e){const t=(e,t,i,n,r,s)=>{e.save(),e.font="10px verdana",e.translate(i+r/2,n+s),e.rotate(-Math.PI/2),e.textAlign="left",e.fillStyle=ro("lead"),e.fillText(t,2,2),e.restore()},i=this.browser.sampleInfo.attributeNames;this.hitList={};for(let n=0;n<i.length;n++){const r=8+n*Vu,s=15,o=Math.round(e.canvas.height/window.devicePixelRatio);xo.fillRect(e,r,0,s,o,{fillStyle:ro("snow")}),t(e,i[n],r,0,s,o);const a=`${Math.floor(r)}#0#${s}#${Math.ceil(o)}`;this.hitList[a]=`${i[n]}`}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:o,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${s()}`;e.saveWithTranslationAndClipRect(c,t,i+r,o,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.addMouseMoveHandler()}addMouseMoveHandler(){this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList);if(null===this.viewport.previousElementSibling){const i=(t,i)=>{const{marginTop:n}=window.getComputedStyle(i),{x:r,y:s}=a(e,this.browser.columnContainer.querySelector(".igv-sample-info-column"));return{x:Math.floor(r),y:Math.floor(s-parseInt(n,10))}},n=this.browser.columnContainer.querySelector(".igv-sample-info-column"),{x:r,y:s}=i(n,this.viewport);n.setAttribute("title","");for(const[e,i]of t){const[t,o,a,c]=e.split("#").map((e=>parseInt(e,10)));if(!(r<t||r>t+a||s<o||s>o+c)){n.setAttribute("title",`${i}`);break}}}else{const{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){const[e,t]=r.split("#");this.viewport.setAttribute("title",`${e.split(Uu.emptySpaceReplacement).join(" ")}: ${"-"===t?"":t}`);break}}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}show(){this.viewport.style.display="block"}hide(){this.viewport.style.display="none"}}class Ku{constructor(t,i,n,r){this.guid=s(),this.trackView=t,this.browser=t.browser,this.viewport=e({class:"igv-viewport"}),i.appendChild(this.viewport),t.track.height&&(this.viewport.style.height=`${t.track.height}px`),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.trackScrollDelta=0,this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(r),this.addMouseHandlers()}checkCanvas(){const e=this.browser.sampleNameViewportWidth||0;this.ctx.canvas.width=e*window.devicePixelRatio,this.ctx.canvas.style.width=`${e}px`,this.ctx.canvas.height=this.viewport.clientHeight*window.devicePixelRatio,this.ctx.canvas.style.height=`${this.viewport.clientHeight}px`,this.ctx.scale(window.devicePixelRatio,window.devicePixelRatio)}setTop(e){if("function"==typeof this.trackView.track.getSamples){this.contentTop=e;const t=this.trackView.track.getSamples();this.repaint(t)}}setWidth(e){this.viewport.innerWidth=e,this.checkCanvas()}async repaint(e){if(e.names.length>0&&!0===this.browser.showSampleNames&&(this.checkCanvas(),this.draw({context:this.ctx,samples:e}),void 0===this.browser.sampleNameViewportWidth)){const t=e.names.map((e=>this.ctx.measureText(e).width));this.browser.sampleNameViewportWidth=Math.min(200,4+Math.ceil(Math.max(...t))),this.browser.layoutChange()}}draw({context:e,samples:t}){if(xo.fillRect(e,0,0,e.canvas.width,t.height,{fillStyle:ro("snow")}),t&&t.names.length>0){const i=this.viewport.getBoundingClientRect().height,n=t.height,r=n-2<=1?0:1;let s=this.contentTop+t.yOffset;this.hitList={};for(const o of t.names){if(s>i)break;if(s+n>0){const t=n-2*r;Yu(e,o,0+2,s+r,e.canvas.width,t)}s+=n}}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:o,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${s()}`;e.saveWithTranslationAndClipRect(c,t,i+r,o,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.boundClickHandler=function(e){e.preventDefault();const t={label:"Name Panel Width",value:this.browser.sampleNameViewportWidth,callback:e=>{this.browser.sampleNameViewportWidth=parseInt(e),this.browser.layoutChange()}};this.browser.inputDialog.present(t,e)}.bind(this),this.viewport.addEventListener("contextmenu",this.boundClickHandler),this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList),{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){this.viewport.setAttribute("title",`${r}`);break}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("contextmenu",this.boundClickHandler),this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}}function Yu(e,t,i,n,r,s){const o=Math.min(s,10);e.font=`${o}px sans-serif`,e.textAlign="start",e.fillStyle=ro("lead");const a=i,c=e.measureText(t),l=n+s/2+(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent)/2;e.fillText(t,a,l)}class Xu{constructor(t){this.popover=e({class:"igv-menu-popup"}),t.appendChild(this.popover),this.parent=t;const i=e({class:"igv-menu-popup-header"});this.popover.appendChild(i),u(i,(()=>this.popover.style.display="none")),this.popoverContent=e(),this.popover.appendChild(this.popoverContent),p(this.popover,i),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()})),this.popover.style.display="none"}presentMenuList(e,t){if(Zu(this.parent),t.length>0){this.popoverContent.innerHTML="";const i=this.parseMenuList(e,t);for(let e of i){e.init&&e.init();let t=e.object;0===i.indexOf(e)&&t.removeClass("igv-track-menu-border-top"),t.hasClass("igv-track-menu-border-top")||t.hasClass("igv-menu-popup-check-container")||t.is("div")&&t.addClass("igv-menu-popup-shim"),this.popoverContent.appendChild(t.get(0))}this.popover.style.display="flex";const{width:n}=this.popover.getBoundingClientRect();this.popover.style.left=-n+"px",this.popover.style.top="0px"}}parseMenuList(e,t){return t.map(((t,i)=>{let n;if(t.name?(n=Bt("<div>"),n.text(t.name)):t.object?n=t.object:"string"==typeof t.label?(n=Bt("<div>"),n.html(t.label)):"string"==typeof t&&(n=t.startsWith("<")?Bt(t):Bt("<div>"+t+"</div>")),0===i&&n.addClass("igv-track-menu-border-top"),t.click||t.dialog){const i=i=>{if(i.preventDefault(),i.stopPropagation(),t.click)if(e.track.selected){const n=e.browser.getSelectedTrackViews();if(!0===t.doAllMultiSelectedTracks)t.click.call(e.track,i);else if("removeTrack"===t.menuItemType){const r=()=>{e.browser.overlayTrackButton.setVisibility(!1);for(const{track:e}of n)t.click.call(e,i)},s={html:`Are you sure you want to delete ${n.length} tracks?`,callback:r};e.browser.menuUtils.dialog.present(s,i)}else for(const{track:e}of n)t.click.call(e,i)}else t.click.call(e.track,i);else t.dialog&&t.dialog.call(e.track,i);this.popover.style.display="none"};n.on("click",i),n.on("touchend",(e=>i(e))),n.on("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}return{object:n,init:t.init||void 0}}))}presentTrackContextMenu(t,n){this.popoverContent.innerHTML="";const r=function(t,n){return t.map((t=>{let r;if("string"==typeof t&&"<hr/>"===t)r=document.createElement("hr");else if("string"==typeof t)r=e({class:"context-menu"}),r.innerHTML=t;else if("Node"==typeof t)r=t;else{if("function"==typeof t.init&&t.init(),"checkbox"===t.type)r=Dl("Show all bases",t.value);else if("color"===t.type){const s=new Da(n.parentElement);s.configure({color:"grey"}),r=e({class:"context-menu"}),"string"==typeof t.label&&(r.innerHTML=t.label);const o=e=>{s.show(),i(n),e.preventDefault(),e.stopPropagation()};r.addEventListener("click",o),r.addEventListener("touchend",o),r.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}else r=e({class:"context-menu"}),"string"==typeof t.label&&(r.innerHTML=t.label);if(t.click&&"color"!==t.type){function a(e){t.click(),i(n),e.preventDefault(),e.stopPropagation()}r.addEventListener("click",a),r.addEventListener("touchend",a),r.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}}return{el:r,init:t.init}}))}(n,this.popover);for(let{el:e}of r)this.popoverContent.appendChild(e);!function(e,t){t.style.display="flex";const{x:i,y:n}=a(e,t.parentNode),{width:r}=t.getBoundingClientRect(),s=i+r,{width:o}=t.parentNode.getBoundingClientRect();t.style.left=`${s>o?i-(s-o):i}px`,t.style.top=`${n}px`}(t,this.popover)}hide(){this.popover.style.display="none"}dispose(){this.popoverContent.innerHTML="",this.popover.innerHTML="",Object.keys(this).forEach((function(e){this[e]=void 0}))}}const Zu=e=>{const t=e.querySelectorAll(".igv-menu-popup");for(const e of t)e.style.display="none"};class Ju{constructor(t,i,n,r,s,o,a){this.browser=t,this.button=e({class:"igv-navbar-text-button"}),i.appendChild(this.button),Array.isArray(n)?(this.textContent=n[0],this.title=n[1]):this.textContent=this.title=n,this.buttonLabel=r,this.imageDictionary={image:`url("data:image/svg+xml,${encodeURIComponent(s)}")`,imageHover:`url("data:image/svg+xml,${encodeURIComponent(o)}")`},this.responsiveKey="text",this.configureButton(this.textContent,this.title),this.setState(a),t.on("navbar-resize",(e=>{this.navbarResizeHandler(e)}))}navbarResizeHandler(e){const t="igv-navbar-icon-button"===e?"image":"text";t!==this.responsiveKey&&(this.responsiveKey=t,this.configureButton(this.textContent,this.title),this.setState(void 0))}configureButton(e,t){this.groupElement=void 0,this.button.title=t,this.button.innerHTML="",this.button.style.backgroundImage="none",this.button.classList.remove("igv-navbar-icon-button"),this.button.classList.remove("igv-navbar-text-button"),"text"===this.responsiveKey?this.configureTextButton(e):this.configureIconButton()}configureTextButton(e){this.button.classList.add("igv-navbar-text-button");const t=document.createElement("div");t.innerHTML=this.buttonLabel;const i=t.firstChild;this.button.appendChild(i),this.groupElement=i.querySelector("#igv-navbar-button-group");i.querySelector("#igv-navbar-button-label").textContent=e}configureIconButton(){this.button.classList.add("igv-navbar-icon-button")}setState(e){void 0!==e&&(this.doHover=e),"text"===this.responsiveKey?this.setTextButtonState(this.doHover):this.setIconButtonState(this.doHover)}setTextButtonState(e){this.groupElement.classList.remove(...this.groupElement.classList);const t=!0===e?"igv-navbar-text-button-svg-hover":"igv-navbar-text-button-svg-inactive";this.groupElement.classList.add(t)}setIconButtonState(e){this.button.style.backgroundImage=!0===e?this.imageDictionary.imageHover:this.imageDictionary.image}show(){this.button.style.display="flex"}hide(){this.button.style.display="none"}setVisibility(e){!0===e?this.show():this.hide()}static currentNavbarButtonClass(e){return e.$navigation.get(0).querySelector(".igv-navbar-text-button")?"igv-navbar-text-button":"igv-navbar-icon-button"}}const ef='<svg width="80px" height="18px" viewBox="0 0 80 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="79" height="17" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>';class tf extends Hl{static defaults={autoscale:void 0,alpha:.5,height:50};constructor(e,t,i){super(e,t),this.type="merged",this.paintAxis=cd,this.graphType=e.graphType,this.tracks=i||[]}async postInit(){if(this.config.tracks){for(let e of this.config.tracks){const t=await this.browser.createTrack(e);t?this.tracks.push(t):console.warn("Could not create track "+e),"function"==typeof t.postInit&&await t.postInit()}this.config.tracks.every((e=>void 0!==e.autoscale||void 0!==e.max))||(this.config.autoscale=void 0===this.config.max)}for(let e of this.tracks)e.isMergedTrack=!0;if(this.config.autoscale?this.autoscale=this.config.autoscale:void 0!==this.config.max&&this.setDataRange({min:this.config.min||0,max:this.config.max}),void 0!==this.config.flipAxis)for(let e of this.tracks)e.flipAxis=this.config.flipAxis;if(void 0!==this.config.logScale)for(let e of this.tracks)e.logScale=this.config.logScale;this.resolutionAware=this.tracks.some((e=>e.resolutionAware))}set flipAxis(e){this.config.flipAxis=e;for(let t of rf(this.tracks))t.flipAxis=e}get flipAxis(){return rf(this.tracks).every((e=>e.flipAxis))}set logScale(e){this.config.logScale=e;for(let t of rf(this.tracks))t.logScale=e}get logScale(){return rf(this.tracks).every((e=>e.logScale))}get height(){return this._height}set height(e){if(this.config.height=e,this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}set autoscale(e){if(this._autoscale=e,!1===e&&this.tracks)for(let e of this.tracks)e.autoscale=!1}get autoscale(){return this._autoscale}setDataRange({min:e,max:t}){this.autoscale=!1;for(const i of rf(this.tracks))i.dataRange={min:e,max:t},i.autoscale=!1,i.autoscaleGroup=!1}set dataRange({min:e,max:t}){for(const i of rf(this.tracks))i.dataRange={min:e,max:t}}get dataRange(){if(this.tracks){const e=rf(this.tracks);if(e.length>0){const t=e[0].dataRange;if(e.every((e=>e.dataRange&&e.dataRange.min===t.min&&e.dataRange.max===t.max)))return t}}}menuItemList(){const e=[];return rf(this.tracks).length>0&&(void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e.push(...this.numericDataMenuItems())),e.push("<hr/>"),e.push(this.overlayTrackAlphaAdjustmentMenuItem()),e.push(this.trackSeparationMenuItem()),e}async getFeatures(e,t,i,n){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n))),s=await Promise.all(r);if(s.every((e=>0===e.length)))return new nf([],[]);{const e=this.tracks.map((e=>e.name));return new nf(s,e)}}draw(e){const t=e.features;for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t.featureArrays[i],n.alpha=this.alpha,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}}popupData(e){const t=this.clickedFeatures(e);if(t&&t.length===this.tracks.length){const i=[];let n=!0;for(let r=0;r<t.length;r++)if(r>0&&i.push("<hr/>"),i.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${t[r].trackName}</div>`),t[r].features.length>0){n=!1;const s=this.tracks[r].popupData(e,t[r].features);i.push(...s)}else i.push("Missing or 0 value(s)");return!0===n?[]:i}}clickedFeatures(e){const t=e.viewport.cachedFeatures;if(!t||!t.featureArrays||!Array.isArray(t.featureArrays)||0===t.featureArrays.length)return[];const i=e.genomicLocation,n=[],r=e.referenceFrame.bpPerPixel>.2?3*e.referenceFrame.bpPerPixel:.2,s=i-r,o=i+r;for(let e=0;e<t.featureArrays.length;e++){const i=to(t.featureArrays[e],s,o);n.push({trackName:t.trackNames[e],features:i})}return n}get supportsWholeGenome(){return this.tracks.every((e=>e.supportsWholeGenome))}getState(){const e=super.getState(),t=[];for(let e of this.tracks)t.push(e.getState());return e.tracks=t,e}updateScales(e){let t;if(this.autoscale){t=!0;let i=[];for(let t of e){if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,r=n+e.toBP(t.getWidth()),s=t.featureCache.features;this.autoscale&&(i.push({value:s.getMax(n,r)}),i.push({value:s.getMin(n,r)}))}const e=Qa(i);for(const t of rf(this.tracks))t.dataRange=e}}else{let i=-1;for(let n of this.tracks)if(++i,n.autoscale){t=!0;let r=[];for(let t of e)if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,s=n+e.toBP(t.getWidth()),o=t.featureCache.features.featureArrays[i];if(o)for(let e of o)if(!(e.end<n)){if(e.start>s)break;r.push(e)}}n.dataRange=Qa(r)}}return t}overlayTrackAlphaAdjustmentMenuItem(){const t=e();return t.innerText="Set transparency",{object:Bt(t),dialog:function(e){const t={label:"Transparency",value:this.alpha,min:0,max:1,scaleFactor:1e3,callback:e=>{this.alpha=Math.max(.001,e),this.repaintViews()}};this.browser.sliderDialog.present(t,e)}}}trackSeparationMenuItem(){const e=Bt("<div>");return e.text("Separate tracks"),{object:e,click:function(e){const t=this.autoscale,i=this.name,n=this.tracks,r=this.browser,s=this.order;r.removeTrack(this);for(let e of n)e.order=s,t&&(e.autoscaleGroup=i),e.isMergedTrack=!1,r.addTrack(e.config,e);r.updateViews()}}}}class nf{constructor(e,t){this.featureArrays=e,this.trackNames=t}getMax(e,t){let i=-Number.MAX_VALUE;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(!(void 0===r.value||Number.isNaN(r.value)||r.end<e)){if(r.start>t)break;i=Math.max(i,r.value)}return i!==-Number.MAX_VALUE?i:100}getMin(e,t){let i=0;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(void 0!==r.value&&!Number.isNaN(r.value)){if(r.end<e)continue;if(r.start>t)break;i=Math.min(i,r.value)}return i}}const rf=e=>e?e.filter((e=>void 0!==e.dataRange||void 0!==e.autoscale||void 0!==e.autoscaleGroup)):[];class sf extends Ju{constructor(e,t){super(e,t,"Overlay Tracks",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks">\n <rect id="backdrop" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#737373" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#737373" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#737373" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks Hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks-Hover">\n <rect id="backdrop-copy" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#FFFFFF" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#FFFFFF" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#FFFFFF" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border-copy" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>this.setState(!1)));this.boundMouseClickHandler=(()=>{this.setVisibility(!1),of.call(this)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(!0)}}function of(e){if(!0===af(this.browser)){const e=this.browser.getSelectedTrackViews().map((({track:e})=>e));for(const t of e)t.selected=!1;const t=[];for(let i of e)"merged"===i.type?t.push(...i.tracks):t.push(i);const i={name:"Overlay",type:"merged",autoscale:!1,alpha:.5,height:Math.max(...e.map((({height:e})=>e))),order:Math.min(...e.map((({order:e})=>e)))},n=new tf(i,this.browser,t);for(const t of e)this.browser.removeTrack(t);this.browser.addTrack(i,n)}}function af(e){const t=e.getSelectedTrackViews();if(t&&t.length>1){const e=new Set(["wig","merged"]);return t.filter((({track:t})=>e.has(t.type))).length>1}return!1}const cf=new Set(["sequence","ruler","ideogram"]),lf=new Set(["ruler","sequence","ideogram"]);class hf{constructor(e,t,i){this.namespace=`trackview-${s()}`,this.browser=e,this.track=i,i.trackView=this,this.addDOMToColumnContainer(e,t,e.referenceFrameList)}startSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].startSpinner()}stopSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].stopSpinner()}addDOMToColumnContainer(e,t,i){this.axis=this.createAxis(e,this.track),this.createViewports(e,t,i),this.sampleInfoViewport=new $u(this,e.columnContainer.querySelector(".igv-sample-info-column"),e.getSampleInfoViewportWidth()),this.sampleNameViewport=new Ku(this,e.columnContainer.querySelector(".igv-sample-name-column"),void 0,e.getSampleNameViewportWidth()),this.createTrackScrollbar(e),this.createTrackDragHandle(e),this.createTrackGearPopup(e)}createViewports(e,t,i){this.viewports=[];const n=e.calculateViewportWidth(i.length),r=t.querySelectorAll(".igv-column");for(let e=0;e<r.length;e++){const t=zu(this,r[e],i[e],n);this.viewports.push(t)}}createAxis(t,i){const n=e();if(t.columnContainer.querySelector(".igv-axis-column").appendChild(n),n.dataset.tracktype=i.type,n.style.height=`${i.height}px`,"function"==typeof i.paintAxis){const{width:e,height:t}=n.getBoundingClientRect();this.axisCanvas=document.createElement("canvas"),this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`,n.appendChild(this.axisCanvas)}if(!1===mo.has(this.track.type)){const t=e();n.appendChild(t);const i='<input type="checkbox" name="track-select">',r=document.createRange().createContextualFragment(i).firstChild;t.appendChild(r),r.checked=this.track.selected||!1,r.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation(),this.track.selected=e.target.checked,this.setDragHandleSelectionState(e.target.checked),this.browser.overlayTrackButton.setVisibility(af(this.browser))})),this.setTrackSelectionState(n,!1)}return n}resizeAxisCanvas(e,t){this.axis.style.width=`${e}px`,this.axis.style.height=`${t}px`,"function"==typeof this.track.paintAxis&&(this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`)}renderSVGContext(e,{deltaX:t,deltaY:i}){!function(e,t,i,n,r){if("function"==typeof t.paintAxis){const{y:o,width:a,height:c}=i.getBoundingClientRect(),l=`${(t.name||t.id).replace(/\W/g,"")}_axis_guid_${s()}`;e.saveWithTranslationAndClipRect(l,n,o+r,a,c,0),t.paintAxis(e,a,c),e.restore()}}(e,this.track,this.axisCanvas,t,i);const{width:n}=this.axis.getBoundingClientRect(),{y:r}=this.viewports[0].$viewport.get(0).getBoundingClientRect();let o={deltaX:n+t,deltaY:r+i};for(let t of this.viewports){t.renderSVGContext(e,o);const{width:i}=t.$viewport.get(0).getBoundingClientRect();o.deltaX+=i}if(!0===this.browser.sampleInfo.isInitialized()&&!0===this.browser.sampleInfoControl.showSampleInfo){this.sampleInfoViewport.renderSVGContext(e,o);const{width:t}=this.sampleInfoViewport.viewport.getBoundingClientRect();o.deltaX+=t}!0===this.browser.showSampleNames&&this.sampleNameViewport.renderSVGContext(e,o)}presentColorPicker(e){if(!1===lf.has(this.track.type)){const t=[],i=this.track.color||this.track.defaultColor;Mt(i)&&t.push(i),this.track.altColor&&Mt(this.track.altColor)&&t.push(this.track.altColor);let n=t.map((e=>e.startsWith("#")?e:e.startsWith("rgb(")?_s.rgbToHex(e):_s.colorNameToHex(e))),r={color:e=>{this.track.color=io(e),this.repaintViews()},altColor:e=>{this.track.altColor=io(e),this.repaintViews()}};const s=this.browser.getSelectedTrackViews();s.length>0&&new Set(s).has(this)?(r={color:e=>{for(let t of s)t.track.color=e,t.repaintViews()}},this.browser.genericColorPicker.configure(n,r)):this.browser.genericColorPicker.configure(n,r),this.browser.genericColorPicker.setActiveColorHandler(e),this.browser.genericColorPicker.show()}}setTrackHeight(e,t){t||(this.track.minHeight&&(e=Math.max(this.track.minHeight,e)),this.track.maxHeight&&(e=Math.min(this.track.maxHeight,e))),this.track.height=e,this.resizeAxisCanvas(this.axis.clientWidth,this.track.height),"function"==typeof this.track.paintAxis&&this.paintAxis();for(let{$viewport:t}of this.viewports)t.height(e);if(this.sampleInfoViewport.setHeight(e),this.sampleNameViewport.viewport.style.height=`${e}px`,"function"!=typeof this.track.computePixelHeight)for(let t of this.viewports)t.setContentHeight(e);this.repaintViews(),this.updateScrollbar(),this.dragHandle.style.height=`${e}px`,this.gearContainer.style.height=`${e}px`}updateScrollbar(){const e=this.viewports[0].$viewport.height();if(this.outerScroll.style.height=`${e}px`,!1===cf.has(this.track.type)){const t=this.maxViewportContentHeight(),i=Math.round(e/t*e);t>e?(this.innerScroll.style.display="block",this.innerScroll.style.height=`${i}px`):this.innerScroll.style.display="none"}}moveScroller(e){const t=Bt(this.innerScroll).position().top+e,i=Math.min(Math.max(0,t),this.outerScroll.clientHeight-this.innerScroll.clientHeight);Bt(this.innerScroll).css("top",`${i}px`);const n=this.maxViewportContentHeight(),r=-Math.round(i*(n/this.viewports[0].$viewport.height()));for(let e of this.viewports)e.setTop(r);this.sampleInfoViewport.setTop(r),this.sampleNameViewport.trackScrollDelta=e,this.sampleNameViewport.setTop(r)}isLoading(){for(let e of this.viewports)if(e.isLoading())return!0}repaintViews(){for(let e of this.viewports)e.isVisible()&&e.repaint();"function"==typeof this.track.paintAxis&&this.paintAxis(),this.repaintSampleInfo(),this.repaintSamples()}repaintSampleInfo(){this.sampleInfoViewport.repaint()}repaintSamples(){if("function"==typeof this.track.getSamples){const e=this.track.getSamples();e.names&&e.names.length>0&&this.sampleNameViewport.repaint(e)}}setTrackLabelName(e){this.viewports.forEach((t=>t.setTrackLabel(e)))}resize(e){for(let t of this.viewports)t.setWidth(e)}async updateViews(){if(!this.browser||!this.browser.referenceFrameList)return;const e=this.viewports.filter((e=>e.isVisible()));if(e.forEach((e=>e.shift())),this.browser.dragObject)return;const t=e.filter((e=>e.needsRepaint())).filter((e=>e.checkZoomIn())),i=e.filter((e=>e.checkZoomIn())).filter((e=>e.needsReload()));for(let e of i)await e.loadFeatures();if(this.disposed)return;if(this.track&&"function"==typeof this.track.variantRowCount&&i.length>0){let e=0;for(let t of this.viewports)t.featureCache&&t.featureCache.features&&(e=Math.max(e,t.featureCache.features.reduce(((e,t)=>Math.max(e,t.row||0)),0)));if(this.track.nVariantRows!==e+1){this.track.variantRowCount(e+1);for(let e of this.viewports)e.checkContentHeight()}}let n;if("merged"===this.track.type)n=this.track.updateScales(e);else if(this.track.autoscale){let t=[];for(let i of e){const e=i.referenceFrame,n=e.start,r=n+e.toBP(i.getWidth());if(i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const e=i.featureCache.features.getMax(n,r);if(t.push({value:e}),"function"==typeof i.featureCache.features.getMin){const e=i.featureCache.features.getMin(n,r);t.push({value:e})}}else{const e=to(i.featureCache.features,n,r);for(let i of e)t.push(i)}}"function"==typeof this.track.doAutoscale?this.track.dataRange=this.track.doAutoscale(t):this.track.dataRange=Qa(t)}const r=this.track.autoscale||this.track.autoscaleGroup||"ruler"===this.track.type||n||this.track.groupBy;for(let i of e)t.includes(i)?i.repaint():r&&i.refresh();this.adjustTrackHeight(),this.repaintSampleInfo(),this.repaintSamples(),this.updateRulerViewportLabels()}clearCachedFeatures(){for(let e of this.viewports)e.clearCache()}updateRulerViewportLabels(){const e=this.browser.calculateViewportWidth(this.viewports.length);for(let t of this.viewports)"ruler"===this.track.type&&(this.viewports.length>1?t.presentLocusLabel(e):t.dismissLocusLabel())}async getInViewFeatures(){if(!this.browser||!this.browser.referenceFrameList)return[];let e=[];const t=this.viewports.filter((e=>e.isVisible()));for(let i of t){const t=i.referenceFrame,{chr:n,start:r,bpPerPixel:s}=i.referenceFrame,o=r+t.toBP(i.getWidth());if((!i.featureCache||!i.featureCache.containsRange(n,r,o,s))&&await i.loadFeatures(),i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const t=i.featureCache.features.getMax(r,o);e.push({value:t})}else{const t="function"==typeof i.featureCache.queryFeatures?i.featureCache.queryFeatures(n,r,o):to(i.featureCache.features,r,o);e=e.concat(t)}}return e}checkContentHeight(){for(let e of this.viewports)e.checkContentHeight();this.adjustTrackHeight()}adjustTrackHeight(){var e=this.maxViewportContentHeight();if(this.track.autoHeight?this.setTrackHeight(e,!1):this.track.paintAxis&&this.paintAxis(),!1===cf.has(this.track.type)){const t=this.viewports[0].getContentTop(),i=this.viewports[0].$viewport.height(),n=Math.min(0,i-e);if(t<n)for(let e of this.viewports)e.setTop(n);this.updateScrollbar()}}viewportsToReload(e){return this.viewports.filter((t=>{if(!t.isVisible())return!1;if(t.checkZoomIn()){const i=t.referenceFrame,n=t.referenceFrame.chr,r=i.start,s=r+i.toBP(Bt(t.contentDiv).width()),o=i.bpPerPixel;return e||!t.tile||t.tile.invalidate||!t.tile.containsRange(n,r,s,o)}return!1}))}createTrackScrollbar(t){const i=e();if(t.columnContainer.querySelector(".igv-scrollbar-column").appendChild(i),i.style.height=`${this.track.height}px`,this.outerScroll=i,!1===cf.has(this.track.type)){const n=e();i.appendChild(n),this.innerScroll=n,this.addTrackScrollMouseHandlers(t)}}createTrackDragHandle(t){"sequence"!==this.track.type&&!0===mo.has(this.track.type)?this.dragHandle=e({class:"igv-track-drag-shim"}):(this.dragHandle=e({class:"igv-track-drag-handle"}),this.dragHandle.classList.add("igv-track-drag-handle-color")),t.columnContainer.querySelector(".igv-track-drag-column").appendChild(this.dragHandle),this.dragHandle.style.height=`${this.track.height}px`,this.addTrackDragMouseHandlers(t)}createTrackGearPopup(t){if(this.gearContainer=e(),t.columnContainer.querySelector(".igv-gear-menu-column").appendChild(this.gearContainer),this.gearContainer.style.height=`${this.track.height}px`,!0===this.track.ignoreTrackMenu);else{function i(e){if(e.preventDefault(),e.stopPropagation(),"none"===this.trackGearPopup.popover.style.display){for(const e of t.trackViews.filter((e=>e!==this&&void 0!==e.trackGearPopup)))e.trackGearPopup.popover.style.display="none";this.trackGearPopup.presentMenuList(this,t.menuUtils.trackMenuItemList(this))}else this.trackGearPopup.popover.style.display="none"}this.gear=e(),this.gearContainer.appendChild(this.gear),this.gear.appendChild(l("cog")),this.trackGearPopup=new Xu(this.gear),this.boundTrackGearClickHandler=i.bind(this),this.gear.addEventListener("click",this.boundTrackGearClickHandler)}}addTrackScrollMouseHandlers(e){this.boundTrackScrollMouseDownHandler=function(t){t.stopPropagation();const{y:i}=r(t);Bt(this.innerScroll).data("yDown",i.toString()),this.boundColumnContainerMouseMoveHandler=function(e){e.stopPropagation();const{y:t}=r(e);this.moveScroller(t-parseInt(Bt(this.innerScroll).data("yDown"))),Bt(this.innerScroll).data("yDown",t.toString())}.bind(this),e.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),this.innerScroll.addEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.boundColumnContainerMouseUpHandler=function(t){e.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),e.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),e.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseUpHandler)}removeTrackScrollMouseHandlers(){!1===cf.has(this.track.type)&&(this.innerScroll.removeEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.browser.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.browser.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.browser.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseMoveHandler))}addTrackDragMouseHandlers(e){if("sequence"===this.track.type||!1===mo.has(this.track.type)){let t;function i(i){i.preventDefault(),t=i.target,!1===this.track.selected&&(t.classList.remove("igv-track-drag-handle-color"),t.classList.add("igv-track-drag-handle-hover-color")),e.startTrackDrag(this)}function n(i){e.endTrackDrag(),t&&i.target!==t&&!1===this.track.selected&&(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-color")),t=void 0}function r(i){i.preventDefault(),void 0===t&&!1===this.track.selected&&(i.target.classList.remove("igv-track-drag-handle-color"),i.target.classList.add("igv-track-drag-handle-hover-color")),e.updateTrackDrag(this)}function s(e){e.preventDefault(),void 0===t&&!1===this.track.selected&&(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color"))}this.boundTrackDragMouseDownHandler=i.bind(this),this.dragHandle.addEventListener("mousedown",this.boundTrackDragMouseDownHandler),this.boundDocumentTrackDragMouseUpHandler=n.bind(this),document.addEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.boundTrackDragMouseEnterHandler=r.bind(this),this.dragHandle.addEventListener("mouseenter",this.boundTrackDragMouseEnterHandler),this.dragHandle.addEventListener("mouseout",(e=>{e.preventDefault(),void 0===t&&!1===this.track.selected&&(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color"))})),this.boundTrackDragMouseOutHandler=s.bind(this),this.dragHandle.addEventListener("mouseout",this.boundTrackDragMouseOutHandler)}}removeTrackDragMouseHandlers(){"ideogram"===this.track.type||"ruler"===this.track.type||(this.dragHandle.removeEventListener("mousedown",this.boundTrackDragMouseDownHandler),document.removeEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.dragHandle.removeEventListener("mouseup",this.boundTrackDragMouseEnterHandler),this.dragHandle.removeEventListener("mouseout",this.boundTrackDragMouseOutHandler))}removeTrackGearMouseHandlers(){!0===this.track.ignoreTrackMenu||this.gear.removeEventListener("click",this.boundTrackGearClickHandler)}removeDOMFromColumnContainer(){this.axis.remove(),this.removeViewportsFromColumnContainer(),this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove()}removeViewportsFromColumnContainer(){for(let e of this.viewports)e.$viewport.remove()}dispose(){this.axis.remove();for(let e of this.viewports)e.dispose();this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove(),"function"==typeof this.track.dispose&&this.track.dispose();for(let e of Object.keys(this))this[e]=void 0;this.alert&&this.alert.container.remove(),this.disposed=!0}paintAxis(){if("function"==typeof this.track.paintAxis){const{width:e,height:t}=this.axisCanvas.getBoundingClientRect(),i=window.devicePixelRatio||1;this.axisCanvas.height=i*t,this.axisCanvas.width=i*e;const n=this.axisCanvas.getContext("2d");if(n.scale(i,i),this.track.autoscaleGroup){if(void 0===wo[this.track.autoscaleGroup]){const e=so.Dark2,t=Math.floor(Math.random()*so.Dark2.length);wo[this.track.autoscaleGroup]=e[t]}const i=_s.addAlpha(wo[this.track.autoscaleGroup],.75);this.track.paintAxis(n,e,t,i)}else this.track.paintAxis(n,e,t,void 0)}}maxViewportContentHeight(){return Math.max(...this.viewports.map((e=>e.getContentHeight())))}setTrackSelectionState(e,t){const i=e.querySelector("div");if(!1!==t)i.style.display="grid";else{i.querySelector("[name=track-select]").checked=this.track.selected,this.dragHandle&&this.setDragHandleSelectionState(!1),i.style.display="none"}}setDragHandleSelectionState(e){const t=this.dragHandle;e?(t.classList.remove("igv-track-drag-handle-color"),t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-selected-color")):(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.remove("igv-track-drag-handle-selected-color"),t.classList.add("igv-track-drag-handle-color"))}}function df(e){this.thresholds=e.thresholds,this.colors=e.colors}function uf(e){this.scale=e,this.lowColor="rgb("+e.lowR+","+e.lowG+","+e.lowB+")",this.highColor="rgb("+e.highR+","+e.highG+","+e.highB+")",this.diff=e.high-e.low}df.prototype.getColor=function(e){for(let t of this.thresholds)if(e<t)return this.colors[this.thresholds.indexOf(t)];return this.colors[this.colors.length-1]},uf.prototype.getColor=function(e){var t,i=this.scale;return e<=i.low?this.lowColor:e>=i.high?this.highColor:(t=(e-i.low)/this.diff,"rgb("+Math.floor(i.lowR+t*(i.highR-i.lowR))+","+Math.floor(i.lowG+t*(i.highG-i.lowG))+","+Math.floor(i.lowB+t*(i.highB-i.lowB))+")")};class ff{constructor(e){this.color=e}getColor(){return this.color}}const pf={threshold:2e3,r:0,g:0,b:255};class gf{constructor(e){e=e||pf,this.threshold=e.threshold,this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[],this.nbins=2e3,this.binsize=this.threshold/this.nbins}setThreshold(e){this.threshold=e,this.cache=[],this.binsize=this.threshold/this.nbins}getThreshold(){return this.threshold}setColorComponents(e){this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[]}getColorComponents(){return{r:this.r,g:this.g,b:this.b}}equals(e){return JSON.stringify(this)===JSON.stringify(e)}getColor(e){const t=Math.floor(Math.min(this.threshold,e)/this.binsize);if(void 0===this.cache[t]){const i=(ys.clamp(e,0,this.threshold)-0)/(this.threshold-0);this.cache[t]=`rgba(${this.r},${this.g},${this.b}, ${i})`}return this.cache[t]}stringify(){return this.threshold+","+this.r+","+this.g+","+this.b}static parse(e){var t,i;return e.startsWith("R:")?(t=e.substring(2).split(":"),(i=new RatioColorScale(Number.parseFloat(t[0]))).positiveScale=n(t[1]),i.negativeScale=n(t[2]),i):n(e);function n(e){var t,i;return t={threshold:(i=e.split(","))[0],r:i[1],g:i[2],b:i[3]},new gf(t)}}}class mf{constructor(e){this.config=e,this.url=e.path||e.url}async read(e,t){const i={start:e,size:t};return Qs.loadArrayBuffer(this.url,{range:i})}}class wf{constructor(e){this.file=e}async read(e,t){const i=this.file;return void 0!==e?i.slice(e,e+t).arrayBuffer():i.arrayBuffer()}}class bf{constructor(e,t){this.file=e,this.rateLimiter=t}async read(e,t){const i=this.file,n=this.rateLimiter;return new Promise((function(r,s){n.limiter((async function(i){try{const n=await i.read(e,t);r(n)}catch(e){s(e)}}))(i)}))}}class Ff{constructor(e){this.file=e.file,this.size=e.size||64e3,this.position=0,this.bufferStart=0,this.bufferLength=0,this.buffer=void 0}async read(e,t){const i=e,n=e+t,r=this.bufferStart,s=this.bufferStart+this.bufferLength;if(t>this.size)return this.buffer=void 0,this.bufferStart=0,this.bufferLength=0,this.file.read(e,t);if(i>=r&&n<=s){const e=i-r,n=e+t;return this.buffer.slice(e,n)}if(i<r&&n>r){const n=r-i,s=await this.file.read(e,n),o=t-n;if(o>0){const e=this.buffer.slice(0,o);return vf(s,e)}return s}if(!(i<s&&n>s))return this.buffer=await this.file.read(e,this.size),this.bufferStart=e,this.bufferLength=this.buffer.byteLength,this.buffer.slice(0,t);{const e=s-i,n=this.bufferLength-e,r=this.buffer.slice(n,this.bufferLength),o=t-e;if(!(o>0))return r;try{this.buffer=await this.file.read(s,this.size),this.bufferStart=s,this.bufferLength=this.buffer.byteLength;const e=this.buffer.slice(0,o);return vf(r,e)}catch(e){if(e.code&&416===e.code)return r;throw e}}}}var vf=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer};const yf=function(e,t){this.littleEndian=void 0===t||t,this.position=0,this.view=e,this.length=e.byteLength};function Af(e,t){this.block=e,this.offset=t}yf.prototype.available=function(){return this.length-this.position},yf.prototype.remLength=function(){return this.length-this.position},yf.prototype.hasNext=function(){return this.position<this.length-1},yf.prototype.getByte=function(){var e=this.view.getUint8(this.position,this.littleEndian);return this.position++,e},yf.prototype.getShort=function(){var e=this.view.getInt16(this.position,this.littleEndian);return this.position+=2,e},yf.prototype.getUShort=function(){var e=this.view.getUint16(this.position,this.littleEndian);return this.position+=2,e},yf.prototype.getInt=function(){var e=this.view.getInt32(this.position,this.littleEndian);return this.position+=4,e},yf.prototype.getUInt=function(){var e=this.view.getUint32(this.position,this.littleEndian);return this.position+=4,e},yf.prototype.getLong=function(){var e=[];e[0]=this.view.getUint8(this.position),e[1]=this.view.getUint8(this.position+1),e[2]=this.view.getUint8(this.position+2),e[3]=this.view.getUint8(this.position+3),e[4]=this.view.getUint8(this.position+4),e[5]=this.view.getUint8(this.position+5),e[6]=this.view.getUint8(this.position+6),e[7]=this.view.getUint8(this.position+7);var t=0;if(this.littleEndian)for(var i=e.length-1;i>=0;i--)t=256*t+e[i];else for(i=0;i<e.length;i++)t=256*t+e[i];return this.position+=8,t},yf.prototype.getString=function(e){for(var t,i="";0!=(t=this.view.getUint8(this.position++))&&(i+=String.fromCharCode(t),!e||i.length!=e););return i},yf.prototype.getFixedLengthString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>0&&(n+=String.fromCharCode(i));return n},yf.prototype.getFixedLengthTrimmedString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>32&&(n+=String.fromCharCode(i));return n},yf.prototype.getFloat=function(){var e=this.view.getFloat32(this.position,this.littleEndian);return this.position+=4,e},yf.prototype.getDouble=function(){var e=this.view.getFloat64(this.position,this.littleEndian);return this.position+=8,e},yf.prototype.skip=function(e){return this.position+=e,this.position},yf.prototype.getVPointer=function(){var e=this.position,t=this.view.getUint8(e+1)<<8|this.view.getUint8(e),i=4294967296*(255&this.view.getUint8(e+6))+16777216*(255&this.view.getUint8(e+5))+65536*(255&this.view.getUint8(e+4))+256*(255&this.view.getUint8(e+3))+(255&this.view.getUint8(e+2));return this.position+=8,new Af(i,t)},Af.prototype.isLessThan=function(e){return this.block<e.block||this.block===e.block&&this.offset<e.offset},Af.prototype.isGreaterThan=function(e){return this.block>e.block||this.block===e.block&&this.offset>e.offset},Af.prototype.print=function(){return this.block+":"+this.offset};class Cf{constructor(e,t){this.chr1=e,this.chr2=t}getKey(){return this.chr1.name+"_"+this.chr2.name+"_"+this.zoom.unit+"_"+this.zoom.binSize}getBlockNumbers(e,t,i){if(e.chr==this.chr2&&t.chr===this.chr1){const i=e;e=t,t=i}const n=this.chr1===this.chr2,r=this.zoom.binSize,s=this.blockBinCount,o=this.blockColumnCount;return i<9||!n?function(){const i=e.start/r,a=e.end/r,c=t.start/r,l=t.end/r,h=Math.floor(i/s),d=Math.floor((a-1)/s),u=Math.floor(c/s),f=Math.floor((l-1)/s),p=[];for(let e=u;e<=f;e++)for(let t=h;t<=d;t++){let i;i=n&&e<t?t*o+e:e*o+t,p.includes(i)||p.push(i)}return p}():function(){const i=e.start/r,n=e.end/r,a=t.start/r,c=t.end/r,l=Math.floor((i+a)/2/s),h=Math.floor((n+c)/2/s),d=Math.floor(Math.log2(1+Math.abs(i-c)/Math.sqrt(2)/s)),u=Math.floor(Math.log2(1+Math.abs(n-a)/Math.sqrt(2)/s)),f=(n-a)*(i-c)<0?0:Math.min(d,u),p=Math.max(d,u),g=[];for(let e=f;e<=p;e++)for(let t=l;t<=h;t++){const i=e*o+t;g.push(i)}return g}()}static parseMatrixZoomData(e,t,i){const n=new Cf(e,t),r=i.getString(),s=i.getInt(),o=i.getFloat(),a=i.getFloat(),c=i.getFloat(),l=i.getFloat(),h=i.getInt();n.blockBinCount=i.getInt(),n.blockColumnCount=i.getInt();const d=i.getInt();n.zoom={index:s,unit:r,binSize:h},n.blockIndex=new _f(d,i);const u=o/(e.size/h)/(t.size/h);return n.averageCount=u,n.sumCounts=o,n.stdDev=c,n.occupiedCellCount=a,n.percent95=l,n}}class _f{constructor(e,t){for(this.blockIndex={};e-- >0;){const e=t.getInt(),i=t.getLong(),n=t.getInt();this.blockIndex[e]={filePosition:i,size:n}}}getBlockIndexEntry(e){return this.blockIndex[e]}}class xf{constructor(e,t,i){this.chr1=e,this.chr2=t,this.bpZoomData=[],this.fragZoomData=[];for(let e of i)"BP"===e.zoom.unit?this.bpZoomData.push(e):this.fragZoomData.push(e)}findZoomForResolution(e,t){const i="FRAG"===t?this.fragZoomData:this.bpZoomData;for(let t=1;t<i.length;t++){if(i[t].zoom.binSize<e)return t-1}return i.length-1}getZoomData(e,t){const i="BP"===(t=t||"BP")?this.bpZoomData:this.fragZoomData;for(let t=0;t<i.length;t++){var n=i[t];if(e===n.zoom.binSize)return n}}getZoomDataByIndex(e,t){return("FRAG"===t?this.fragZoomData:this.bpZoomData)[e]}static getKey(e,t){if(e>t){const i=e;e=t,t=i}return`${e}_${t}`}static parseMatrix(e,t){const i=new yf(new DataView(e)),n=i.getInt(),r=i.getInt(),s=t[n],o=t[r];let a=i.getInt();const c=[];for(;a-- >0;){const e=Cf.parseMatrixZoomData(s,o,i);c.push(e)}return new xf(n,r,c)}}class kf{constructor(e,t,i){this.bin1=e,this.bin2=t,this.counts=i}getKey(){return this.bin1+"_"+this.bin2}}class If{constructor(e=10){this.max=e,this.map=new Map}get(e){let t=this.map.get(e);return t&&(this.map.delete(e),this.map.set(e,t)),t}set(e,t){this.map.has(e)?this.map.delete(e):this.map.size===this.max&&this.map.delete(this.first()),this.map.set(e,t)}has(e){return this.map.has(e)}clear(){this.map.clear()}first(){return this.map.keys().next().value}}class Sf{constructor(e,t,i,n){this.file=e,this.filePosition=t,this.nValues=i,this.dataType=n,this.cache=void 0}async getValues(e,t){if(!this.cache||e<this.cache.start||t>this.cache.end){const i=Math.max(0,e-1e3),n=Math.min(this.nValues,t+1e3),r=this.filePosition+i*this.dataType,s=n-i,o=s*this.dataType,a=await this.file.read(r,o);if(!a)return;const c=new yf(new DataView(a)),l=[];for(let e=0;e<s;e++)l[e]=8===this.dataType?c.getDouble():c.getFloat();this.cache={start:i,end:n,values:l}}const i=e-this.cache.start,n=i+(t-e);return this.cache.values.slice(i,n)}getKey(){return Sf.getKey(this.type,this.chrIdx,this.unit,this.resolution)}static getNormalizationVectorKey(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}}var Ef={"hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined.hic":"54386046426,55860","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fprimary.hic":"33860030033,37504","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Freplicate.hic":"30849652794,55832","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fmaternal.hic":"1380542661,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fpaternal.hic":"1389001777,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2Fcombined.hic":"13433880319,35723","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC001.hic":"3409347253,35975","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC002.hic":"4529947083,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC003.hic":"6894962500,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC004.hic":"3395593338,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC005.hic":"5204128636,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC006.hic":"3278363811,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC007.hic":"3585547340,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC008.hic":"4134197273,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC009.hic":"2851728310,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC010.hic":"1754216102,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC011.hic":"1716829574,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC012.hic":"4367980375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC013.hic":"2309654671,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC014.hic":"5324950266,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC015.hic":"3132333594,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC016.hic":"3159154704,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC017.hic":"3262554627,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC018.hic":"3014216364,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC019.hic":"5025753246,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC020.hic":"5861584507,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC021.hic":"3542263275,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC022.hic":"5061949378,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC023.hic":"4816423919,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC024.hic":"2683781104,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC025.hic":"6522701781,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC026.hic":"6748846520,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC027.hic":"5642693007,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC028.hic":"2098921691,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC029.hic":"3886454027,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC030.hic":"2288984204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC031.hic":"2115342419,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fpellet%2FHIC032.hic":"2063314324,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fsupernatant%2FHIC033.hic":"1933908457,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC034.hic":"13555514595,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC035.hic":"6129650900,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC036.hic":"4307445019,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC037.hic":"9375139867,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2Fcombined.hic":"11664249584,33929","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_DpnII.hic":"7003537290,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC038.hic":"2099825544,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC039.hic":"2096900138,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC040.hic":"2593642141,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC041.hic":"2263919098,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC042.hic":"2684774693,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_noXlink.hic":"5574807456,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC043.hic":"2986114347,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC044.hic":"1916378621,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC045.hic":"746463126,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC046.hic":"2338476164,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC047.hic":"1167496250,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC048.hic":"2231690794,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC049.hic":"2782308678,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC050.hic":"3633531346,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC051.hic":"4063486444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC052.hic":"929756278,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC053.hic":"2489657204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC054.hic":"4036419444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC055.hic":"4284185549,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC056.hic":"4410546240,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fdilution%2FHIC057.hic":"1491998259,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2Fcombined.hic":"7266425111,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC058.hic":"6532635593,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC059.hic":"400684530,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC060.hic":"645352187,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC061.hic":"736291871,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC062.hic":"762731037,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC063.hic":"682917431,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fdilution%2FHIC064.hic":"4550171307,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2Fcombined.hic":"11897184911,35789","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC065.hic":"5425943567,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC066.hic":"5942869818,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC067.hic":"5191049261,35647","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fdilution%2FHIC068.hic":"2713318801,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2Fcombined.hic":"12641555389,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC069.hic":"5630177461,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC070.hic":"5926611269,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC071.hic":"2486191351,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC072.hic":"2281343366,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC073.hic":"2173074239,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC074.hic":"2463700999,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2Fcombined.hic":"14661922519,35639","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC075.hic":"3685310515,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC076.hic":"5833658487,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC077.hic":"2406346486,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC078.hic":"5241454987,35919","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC079.hic":"6297234263,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2Fcombined.hic":"9193858096,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC080.hic":"5171405536,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC081.hic":"3489767688,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC082.hic":"4243339375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fdilution%2FHIC083.hic":"1497495406,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2Fcombined.hic":"7923332224,35593","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC084.hic":"867699123,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC085.hic":"3669518514,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC086.hic":"5306474712,35595","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC087.hic":"1490963755,36397","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2Fcombined.hic":"8956382853,50248","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC088.hic":"1874185366,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC089.hic":"1301165236,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC090.hic":"1105246282,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC091.hic":"1338325770,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC092.hic":"1307918730,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC093.hic":"755136918,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC094.hic":"1606583694,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC095.hic":"2039711245,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC096.hic":"1909573053,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC097.hic":"1826710712,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC098.hic":"1998793575,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC099.hic":"1007740962,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC100.hic":"736464120,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC101.hic":"980505082,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC102.hic":"1116083646,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC103.hic":"1096994310,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC104.hic":"841063882,32102","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC105.hic":"107742864,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC106.hic":"134295912,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC107.hic":"110228014,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC108.hic":"102761401,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC109.hic":"100461491,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC110.hic":"88828472,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC111.hic":"81471064,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC112.hic":"92297035,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC113.hic":"65503916,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC114.hic":"49181188,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC115.hic":"46471102,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC116.hic":"64284432,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC117.hic":"60434076,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC118.hic":"45248563,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC119.hic":"60288782,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC120.hic":"136888414,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC121.hic":"125009003,33681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC122.hic":"154011688,34127","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC123.hic":"177663372,35293","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC124.hic":"382186226,35245","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC125.hic":"158160717,35271","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC127.hic":"110261177,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC128.hic":"246131875,35509","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC129.hic":"260160119,35667","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC130.hic":"117479562,34681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC131.hic":"81508929,34673","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC132.hic":"105959102,34895","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC133.hic":"91504812,33451","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC134.hic":"52222546,33737","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC135.hic":"57763085,34159","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC136.hic":"50618489,33731","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC137.hic":"193163606,33363","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC138.hic":"229876152,33777","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC139.hic":"201783666,33571","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC140.hic":"281163862,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC141.hic":"275969727,33935","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC142.hic":"275020431,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC144.hic":"223834810,34177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC145.hic":"296632653,33937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC146.hic":"290945216,33961","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC147.hic":"234459964,34231","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC148.hic":"295457850,34039","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC149.hic":"113569632,35695","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC150.hic":"304381897,33963","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC151.hic":"289314545,33805","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC152.hic":"284320182,33803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC153.hic":"401393947,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC154.hic":"188065488,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC155.hic":"299157119,33967","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC156.hic":"279289244,33787","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC157.hic":"254852119,33917","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC158.hic":"195969660,33477","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC159.hic":"185720388,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC160.hic":"227709279,33599","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC161.hic":"157225076,33209","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC162.hic":"105703444,32033","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC163.hic":"122665658,32121","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC164.hic":"228048231,33761","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC165.hic":"114440819,32011","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC166.hic":"285147558,33891","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC167.hic":"363116754,33943","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC168.hic":"119592158,31937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC169.hic":"236853872,33785","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC170.hic":"195187639,33395","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC171.hic":"208044058,33309","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC172.hic":"144645916,32877","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC173.hic":"119115941,32203","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC175.hic":"178030481,33525","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC176.hic":"117220136,32169","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC177.hic":"128586196,32659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC178.hic":"191419141,33629","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC179.hic":"141556748,32959","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC180.hic":"199825102,33185","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC181.hic":"301022688,33783","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC182.hic":"185384453,33205","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC183.hic":"202189264,36367","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC184.hic":"37464475,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC185.hic":"161938278,36099","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC186.hic":"133853166,36179","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC188.hic":"128068030,36237","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC189.hic":"148053886,36177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC190.hic":"198946958,35803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC191.hic":"226584564,36063","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC192.hic":"194412797,36341","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC193.hic":"176408194,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC194.hic":"207215649,36055","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC195.hic":"175185530,36315","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC196.hic":"168969337,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC197.hic":"121231252,36339","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC198.hic":"92713752,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC199.hic":"105130500,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC200.hic":"114526350,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC201.hic":"122689717,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhap1%2Fin-situ%2Fcombined.hic":"9614983328,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fctbp_8_4_17%2Fall_intra_megabase_michrom.hic":"154205644,10960","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xa-combined.hic":"8843305329,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXa-chrX-diploid.hic":"11173520,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-combined.hic":"13365182403,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-chrX-diploid.hic":"17343459,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC002.hic":"4279298739,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC003.hic":"3027365532,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC004.hic":"2896130835,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC005.hic":"4717830071,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC006.hic":"5066210154,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC007.hic":"3069516128,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xi-combined.hic":"14551096423,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXi-chrX-diploid.hic":"17362477,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC008.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC009.hic":"2935931663,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC010.hic":"2019085070,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC011.hic":"6087610814,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC012.hic":"2809618194,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC013.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fcombined.hic":"6950423609,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fpaternal.hic":"220592749,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fmaternal.hic":"323233095,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC014.hic":"3183235800,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC015.hic":"1739539801,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC016.hic":"1105912758,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC017.hic":"1060773319,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC018.hic":"1203679874,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC019.hic":"3321955269,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Frhesus%2FDarrowHuntley-2015%2FHIC020.hic":"7108980626,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fcola%2FDarrowHuntley-2015%2FHIC021.hic":"3906448676,34955","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Faedes%2Fcombined.hic":"390780490,2245","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Fhs2-hic.hic":"1960284186,33561","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2FCpipJ3.hic":"766279097,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2Fupdated_O%2FSnyder_O.hic":"8046980555,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2FA_inter.hic":"10986005145,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2Fcombined.hic":"30439217680,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2Fcombined.hic":"33255540403,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F20min_withdraw_combined.hic":"11078436933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F40min_withdraw_combined.hic":"11031830038,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F60min_withdraw_combined.hic":"10312725340,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F180min_withdraw_combined.hic":"10038610214,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC001.hic":"8004335785,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC002.hic":"8453215933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC003.hic":"9118406189,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC004.hic":"5973342894,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC005.hic":"6846576837,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC006.hic":"6075148017,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC007.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC008.hic":"6844159653,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC009.hic":"7282063059,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC010.hic":"10410578833,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC011.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC012.hic":"7223422850,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC013.hic":"7435986997,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC014.hic":"9120113605,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2Fcombined.hic":"4170577904,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC015.hic":"1504084990,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC016.hic":"1686244500,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC017.hic":"1804802410,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC018.hic":"1533942067,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2Fcombined.hic":"4572390198,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC019.hic":"1543609666,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC020.hic":"1814133288,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC021.hic":"1942698243,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC022.hic":"1873587413,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC049.hic":"405127557,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC060.hic":"326681741,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC061.hic":"300908673,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC050.hic":"481758242,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC051.hic":"417577401,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC052.hic":"419353227,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC053.hic":"411554953,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC054.hic":"386655891,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC055.hic":"402170701,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_240min%2FRao-2017-HIC057.hic":"735906308,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC058.hic":"443789827,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC059.hic":"491422615,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC062.hic":"320261375,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC063.hic":"306590499,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC032S.hic":"367051742,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC033S.hic":"344555339,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC036S.hic":"349392947,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC037S.hic":"317714554,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC040S.hic":"266786397,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC041S.hic":"279445530,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC044S.hic":"898418269,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC045S.hic":"961006347,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC064.hic":"833576408,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC065.hic":"840881418,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC066.hic":"980958864,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC067.hic":"882023129,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC068.hic":"1110292630,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC069.hic":"1001747023,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FCP190_HiChIP.hic":"144107588,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27ac_HiChIP_combined.hic":"43171370,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27me3_HiChIP_combined.hic":"42906472,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2_ChIAPET.hic":"41992430,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2S2_HiChIP.hic":"145842743,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FArabidopsis_Wang2015_Liu2016.hic":"1134391078,4984","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FElegans_Crane2015.hic":"387127568,8758","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FNcrassa_Galazka2016.hic":"26555511,27725","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPfalciparum_trophozoite_Ay2014.hic":"15640893,13948","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-A.hic":"6897251,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-B.hic":"4959088,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-A.hic":"5232286,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-B.hic":"5105292,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-A.hic":"6900072,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-B.hic":"8653258,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-A.hic":"7999058,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-B.hic":"8774657,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc.hic":"23671753603,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep1.hic":"23671754721,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep2.hic":"22269909910,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fhffc6_rep1.hic":"19016661622,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_NcoI.hic":"480725203,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2F302NH.hic":"99948617,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FK562.hic":"470263605,36151","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_HindIII.hic":"293706559,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_rep_HindIII.hic":"309673862,36087","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep1.hic":"1531151371,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep2.hic":"2851437676,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmouse-rep1.hic":"582052544,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep1.hic":"698509182,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep2.hic":"461410393,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep1.hic":"691045338,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep2.hic":"668888336,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Fsexton%2Fcombined.hic":"50650087,4486","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-hindiii.hic":"1071142023,16500","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-mboi.hic":"1508851093,16448","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Fnon-tcc-hindiii.hic":"395179229,36093","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-combined.hic":"1050423847,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-hindiii%2Fsplit-read-run.hic":"9599984876,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fhesc-hindiii.hic":"1952555632,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fimr90-hindiii.hic":"9691260435,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-cortex.hic":"3712072953,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr18.hic":"2083350075,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr2.hic":"3362049644,16360","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr7.hic":"1658399854,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr15.hic":"866691249,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr2.hic":"3304782795,16386","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-1.hic":"23673506,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-2.hic":"26873280,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-3.hic":"31066362,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-4.hic":"16807724,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-5.hic":"28665065,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-6.hic":"13124158,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-7.hic":"15118945,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-8.hic":"68316814,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-9.hic":"18965101,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-10.hic":"17020666,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Fcombined.hic":"6526601242,36427","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep1.hic":"1861562891,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep2.hic":"3061013635,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep3.hic":"1564588211,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep4.hic":"1255543175,36153","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep5.hic":"974683253,36179","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep6.hic":"1040805629,36053","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Fcombined.hic":"8424080116,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep1.hic":"2697976702,36295","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep3.hic":"1718610467,36159","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep4.hic":"2029519405,36101","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep5.hic":"985310855,36069","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep6.hic":"1418750480,35967","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fmhh-call-4-cell-line.hic":"538380253,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fprimary-b-all.hic":"773764191,35793","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fnormal-b-cell-line.hic":"336271459,35005","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Frl-cell-line.hic":"484807998,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-biorep.hic":"135932435,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep1.hic":"160355961,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep2.hic":"188809887,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fpre-prob-egs.hic":"2237792858,15483","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-egs.hic":"5744720377,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-fa.hic":"2174866215,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhct116-rnapii-pilot.hic":"396366166,35999","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhela-rnapii-pilot.hic":"882516759,35107","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-pilot.hic":"1131576189,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-saturated.hic":"571583828,36291","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fmcf7-rnapii-saturated.hic":"1282547841,36035","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fnb4-rnapii-pilot.hic":"761614686,34861","hicfiles.s3.amazonaws.com%2Fexternal%2Fjung%2Fmouse_sperm.hic":"1730231642,29184","hicfiles.s3.amazonaws.com%2Fexternal%2Ftang%2Fgm12878.hic":"1953518212,20505","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791299.hic":"5723484,11956","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791297.hic":"16534743,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv.hic":"5094525579,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep1.hic":"2574358912,36373","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep2.hic":"3417099433,36243","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev.hic":"4785157552,36323","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep1.hic":"2648268465,36321","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep2.hic":"2994727980,36107","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf.hic":"5391791815,36063","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep1.hic":"3325842095,36269","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep2.hic":"3096215920,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl.hic":"3830902383,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl-rep1.hic":"1346712252,36079","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl_rep2.hic":"3098067367,36271","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-0h-hiseq.hic":"38174042,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq.hic":"26506099,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq-non-crosslinked_control.hic":"3545496,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-36h-hiseq.hic":"70754194,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fg1mid-r1.hic":"200863476,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r1.hic":"249021190,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r2.hic":"212341157,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-0-25fa.hic":"583572265,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-1fa.hic":"354502306,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-0-25fa.hic":"149308791,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-98percent.hic":"778175225,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-1fa.hic":"158091047,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-ns-r1.hic":"801670039,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-m-r1.hic":"875922086,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r1.hic":"130959943,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r2.hic":"237861106,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT.hic":"496104039,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT-adv-cre.hic":"438608517,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep1.hic":"446205712,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep2.hic":"386354767,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep1.hic":"621998722,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep2.hic":"583840829,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep1.hic":"801290988,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep2.hic":"819406658,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep1.hic":"792825269,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep2.hic":"746189884,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT.hic":"309353372,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT-OHT.hic":"274229679,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R1.hic":"1490362251,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R3.hic":"2403664421,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R1.hic":"1377124538,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R3.hic":"2646201369,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2Fcrh6-mutant.hic":"105261071,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2FWT.hic":"127506388,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2FCol.hic":"153638500,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn1.hic":"211213220,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn4.hic":"134236837,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fxie%2Fprimary.hic":"92936173,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt337.hic":"318737891,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt67.hic":"348123956,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt337.hic":"251107279,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt67.hic":"351840994,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2FCol0.hic":"345969497,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fclf28-swn7.hic":"299585025,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fcmt3-11.hic":"253427706,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fddm1-2.hic":"303626924,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fmet1-3.hic":"347697973,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fsuvh4-suvh5-suvh6.hic":"263122019,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNase-HiC-WG-K562.hic":"892955840,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNaseHiC-WG-H1.hic":"696922695,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-K562-rep1.hic":"341917716,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargeredDNaseHiC-lincRNA-K562-rep2.hic":"214841185,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep1.hic":"616326137,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep2.hic":"579654013,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-H1-rep1.hic":"519810544,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-K562-rep1.hic":"199553123,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII.hic":"1319373594,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_HinfI.hic":"1465493873,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII_HinfI_combo.hic":"753062558,5814","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-10A.hic":"2784956115,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-7.hic":"2700457411,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbatullin%2Fsperm.hic":"501052169,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep1.hic":"1450697530,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep2.hic":"1189371558,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Fcombined.hic":"2262007875,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Finactive.hic":"4444564,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Factive.hic":"3993495,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep1.hic":"1650838357,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep2.hic":"1258038606,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski.hic":"499827296,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_dnase.hic":"4298088401,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_in_situ_dnase.hic":"609321852,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain.hic":"1028196506,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep1.hic":"1283306,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep2.hic":"1263227,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FNcoI_rep1.hic":"4380906,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined.hic":"1829549643,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined_randomized.hic":"1859742654,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_GM_cohesin.hic":"1231264781,17932","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_cohesin_all.hic":"1152008628,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_Oct4.hic":"912828146,16438","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FSCC4KO.hic":"1767906138,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FDKO.hic":"1487228787,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_1.14.hic":"1189751862,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_3.3.hic":"1155057696,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWT.hic":"1522401568,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2Fmega_Liverpool%2Fmega.hic":"2612171975,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2836_Liverpool1%2FLiverpool1.hic":"191729195,2245","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2861_Liverpool2%2FLiverpool2.hic":"1637096030,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2862_Liverpool3%2FLiverpool3.hic":"1160045602,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC.hic":"11857786247,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC_CanyonDel.hic":"8139168836,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Ftcell.hic":"9871547081,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Fep.hic":"17479335373,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2FTh1_ensemble.hic":"1690592868,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FES_mapq30.hic":"32930498831,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FNPC_mapq30.hic":"55053730986,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FCN_mapq30.hic":"53138031154,32386","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_72_hours_WT.hic":"16492991184,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_WT.hic":"23057795398,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_MYC_KO.hic":"21245554876,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_TSA.hic":"13933346059,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_oligomycin.hic":"21902506832,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-mES_WT.hic":"9451969795,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_WT.hic":"3600188564,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_WT.hic":"1309503359,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_HU_treated.hic":"1477252396,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_flavopiridol.hic":"15711773490,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FPGP1F_mega_090118%2FPGP1F_mega_090118_30.hic":"24786676166,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7145%2FHIC7145_30.hic":"4554644616,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7146%2FHIC7146_30.hic":"4174848944,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7147%2FHIC7147_30.hic":"5062229182,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7862%2FHIC7862_30.hic":"4520990620,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7863%2FHIC7863_30.hic":"4330354773,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7864%2FHIC7864_30.hic":"5880640268,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7865%2FHIC7865_30.hic":"4431632469,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7866%2FHIC7866_30.hic":"4686000222,36479","encode-public.s3.amazonaws.com%2F2018%2F10%2F19%2Fb122542b-306c-4631-bdc3-2e155e89af55%2FENCFF718AWL.hic":"39544267907,58932","encode-public.s3.amazonaws.com%2F2019%2F02%2F15%2F8e787cd8-e388-4bc2-a236-7a5e6f39e0c0%2FENCFF999YXX.hic":"9255069996,56883","encode-public.s3.amazonaws.com%2F2019%2F02%2F08%2Ffc1d9d5d-8fa0-4e29-9080-3da674d9490d%2FENCFF543USQ.hic":"5005263062,36479","s3.us-east-1.wasabisys.com%2Fhicfiles%2Finternal%2FLCL_mega_42B_500bp_30.hic":"106482584851,22829","www.encodeproject.org%2Ffiles%2FENCFF925QIF%2F%40%40download%2FENCFF925QIF.hic":"51712684396,54779","www.encodeproject.org%2Ffiles%2FENCFF259YUS%2F%40%40download%2FENCFF259YUS.hic":"24640030444,54779","www.encodeproject.org%2Ffiles%2FENCFF783KQI%2F%40%40download%2FENCFF783KQI.hic":"27209249856,54779","www.encodeproject.org%2Ffiles%2FENCFF318JAP%2F%40%40download%2FENCFF318JAP.hic":"28636979242,54779","www.encodeproject.org%2Ffiles%2FENCFF512PQA%2F%40%40download%2FENCFF512PQA.hic":"28124104361,54779","www.encodeproject.org%2Ffiles%2FENCFF591MHA%2F%40%40download%2FENCFF591MHA.hic":"37373387202,54779","www.encodeproject.org%2Ffiles%2FENCFF197OWW%2F%40%40download%2FENCFF197OWW.hic":"41826180893,54779","www.encodeproject.org%2Ffiles%2FENCFF317OIA%2F%40%40download%2FENCFF317OIA.hic":"34741636038,54779","www.encodeproject.org%2Ffiles%2FENCFF522YLZ%2F%40%40download%2FENCFF522YLZ.hic":"24064692329,54779","www.encodeproject.org%2Ffiles%2FENCFF420JTA%2F%40%40download%2FENCFF420JTA.hic":"21202405177,54779","www.encodeproject.org%2Ffiles%2FENCFF871ZDJ%2F%40%40download%2FENCFF871ZDJ.hic":"10124815680,18679","www.encodeproject.org%2Ffiles%2FENCFF349RZY%2F%40%40download%2FENCFF349RZY.hic":"4446702705,36479","www.encodeproject.org%2Ffiles%2FENCFF738YON%2F%40%40download%2FENCFF738YON.hic":"3338049584,35947","www.encodeproject.org%2Ffiles%2FENCFF406KJN%2F%40%40download%2FENCFF406KJN.hic":"4132875306,36479","www.encodeproject.org%2Ffiles%2FENCFF081NPN%2F%40%40download%2FENCFF081NPN.hic":"34495587443,54779","www.encodeproject.org%2Ffiles%2FENCFF946RZW%2F%40%40download%2FENCFF946RZW.hic":"34571955193,54779","www.encodeproject.org%2Ffiles%2FENCFF602CHT%2F%40%40download%2FENCFF602CHT.hic":"30674798032,54779","www.encodeproject.org%2Ffiles%2FENCFF150DKS%2F%40%40download%2FENCFF150DKS.hic":"12618769864,36479","www.encodeproject.org%2Ffiles%2FENCFF614IPZ%2F%40%40download%2FENCFF614IPZ.hic":"42450060331,54779","www.encodeproject.org%2Ffiles%2FENCFF571ZQR%2F%40%40download%2FENCFF571ZQR.hic":"15230068871,47429","www.encodeproject.org%2Ffiles%2FENCFF705MKK%2F%40%40download%2FENCFF705MKK.hic":"38686554702,54779","www.encodeproject.org%2Ffiles%2FENCFF658KTB%2F%40%40download%2FENCFF658KTB.hic":"13195884405,47429","www.encodeproject.org%2Ffiles%2FENCFF435JYN%2F%40%40download%2FENCFF435JYN.hic":"17192139674,54779","www.encodeproject.org%2Ffiles%2FENCFF016JKX%2F%40%40download%2FENCFF016JKX.hic":"37266736642,54779","www.encodeproject.org%2Ffiles%2FENCFF294GFP%2F%40%40download%2FENCFF294GFP.hic":"36389843399,54779","www.encodeproject.org%2Ffiles%2FENCFF700CYI%2F%40%40download%2FENCFF700CYI.hic":"60482012152,54779","www.encodeproject.org%2Ffiles%2FENCFF962EDB%2F%40%40download%2FENCFF962EDB.hic":"39394328182,54779","www.encodeproject.org%2Ffiles%2FENCFF467OGP%2F%40%40download%2FENCFF467OGP.hic":"35572788855,54779","www.encodeproject.org%2Ffiles%2FENCFF556RLR%2F%40%40download%2FENCFF556RLR.hic":"34826921187,54779","www.encodeproject.org%2Ffiles%2FENCFF309UNV%2F%40%40download%2FENCFF309UNV.hic":"48510618174,54779","www.encodeproject.org%2Ffiles%2FENCFF653HCO%2F%40%40download%2FENCFF653HCO.hic":"41079007620,54779","www.encodeproject.org%2Ffiles%2FENCFF120DSV%2F%40%40download%2FENCFF120DSV.hic":"12790195576,47429","www.encodeproject.org%2Ffiles%2FENCFF284OEA%2F%40%40download%2FENCFF284OEA.hic":"46007570339,54779","www.encodeproject.org%2Ffiles%2FENCFF035BLF%2F%40%40download%2FENCFF035BLF.hic":"63868871985,54779","www.encodeproject.org%2Ffiles%2FENCFF094KKX%2F%40%40download%2FENCFF094KKX.hic":"42151419971,54779","www.encodeproject.org%2Ffiles%2FENCFF965BPU%2F%40%40download%2FENCFF965BPU.hic":"42717376107,54779","www.encodeproject.org%2Ffiles%2FENCFF842DUO%2F%40%40download%2FENCFF842DUO.hic":"39553892515,54779","www.encodeproject.org%2Ffiles%2FENCFF417GBZ%2F%40%40download%2FENCFF417GBZ.hic":"45544785452,54779","www.encodeproject.org%2Ffiles%2FENCFF499BVX%2F%40%40download%2FENCFF499BVX.hic":"40900674170,54779","www.encodeproject.org%2Ffiles%2FENCFF136XCV%2F%40%40download%2FENCFF136XCV.hic":"47700392974,54779","www.encodeproject.org%2Ffiles%2FENCFF224HKR%2F%40%40download%2FENCFF224HKR.hic":"40426005932,54779","www.encodeproject.org%2Ffiles%2FENCFF711XSR%2F%40%40download%2FENCFF711XSR.hic":"41434581949,54779","www.encodeproject.org%2Ffiles%2FENCFF660JWA%2F%40%40download%2FENCFF660JWA.hic":"54201632697,54779","www.encodeproject.org%2Ffiles%2FENCFF081PMO%2F%40%40download%2FENCFF081PMO.hic":"53428285130,54779","www.encodeproject.org%2Ffiles%2FENCFF799QGA%2F%40%40download%2FENCFF799QGA.hic":"1228682189,36479","www.encodeproject.org%2Ffiles%2FENCFF473CAA%2F%40%40download%2FENCFF473CAA.hic":"1077514950,36479","www.encodeproject.org%2Ffiles%2FENCFF663FRL%2F%40%40download%2FENCFF663FRL.hic":"39843938245,54779","www.encodeproject.org%2Ffiles%2FENCFF341WOY%2F%40%40download%2FENCFF341WOY.hic":"34792598619,54779","www.encodeproject.org%2Ffiles%2FENCFF515ZBF%2F%40%40download%2FENCFF515ZBF.hic":"41779230923,54779","www.encodeproject.org%2Ffiles%2FENCFF545GBW%2F%40%40download%2FENCFF545GBW.hic":"38351980358,54779","www.encodeproject.org%2Ffiles%2FENCFF252ANV%2F%40%40download%2FENCFF252ANV.hic":"37668839771,54779","www.encodeproject.org%2Ffiles%2FENCFF912NDK%2F%40%40download%2FENCFF912NDK.hic":"21196851956,54779","www.encodeproject.org%2Ffiles%2FENCFF683PLM%2F%40%40download%2FENCFF683PLM.hic":"21849338763,54779","www.encodeproject.org%2Ffiles%2FENCFF355NFJ%2F%40%40download%2FENCFF355NFJ.hic":"47880627268,54779","www.encodeproject.org%2Ffiles%2FENCFF507WEW%2F%40%40download%2FENCFF507WEW.hic":"35777782924,54779","www.encodeproject.org%2Ffiles%2FENCFF241MSL%2F%40%40download%2FENCFF241MSL.hic":"22507408288,54779","www.encodeproject.org%2Ffiles%2FENCFF135MUT%2F%40%40download%2FENCFF135MUT.hic":"24168734040,54779","www.encodeproject.org%2Ffiles%2FENCFF459FRB%2F%40%40download%2FENCFF459FRB.hic":"37166770103,54779","www.encodeproject.org%2Ffiles%2FENCFF705YZH%2F%40%40download%2FENCFF705YZH.hic":"44679182442,54779","www.encodeproject.org%2Ffiles%2FENCFF395INO%2F%40%40download%2FENCFF395INO.hic":"56727346538,54779","www.encodeproject.org%2Ffiles%2FENCFF736ITL%2F%40%40download%2FENCFF736ITL.hic":"49036286185,54779","www.encodeproject.org%2Ffiles%2FENCFF546TZN%2F%40%40download%2FENCFF546TZN.hic":"33195126348,54779","www.encodeproject.org%2Ffiles%2FENCFF706SFK%2F%40%40download%2FENCFF706SFK.hic":"3271831702,36479","www.encodeproject.org%2Ffiles%2FENCFF922ERE%2F%40%40download%2FENCFF922ERE.hic":"12476647122,36479","www.encodeproject.org%2Ffiles%2FENCFF876OWE%2F%40%40download%2FENCFF876OWE.hic":"1538692704,47429","www.encodeproject.org%2Ffiles%2FENCFF227XJZ%2F%40%40download%2FENCFF227XJZ.hic":"1925617685,36479","www.encodeproject.org%2Ffiles%2FENCFF053BXY%2F%40%40download%2FENCFF053BXY.hic":"1032237652,36479","www.encodeproject.org%2Ffiles%2FENCFF014VMM%2F%40%40download%2FENCFF014VMM.hic":"1564021703,36479","www.encodeproject.org%2Ffiles%2FENCFF563XES%2F%40%40download%2FENCFF563XES.hic":"1489180508,36479","www.encodeproject.org%2Ffiles%2FENCFF482LGO%2F%40%40download%2FENCFF482LGO.hic":"1208778887,36479","www.encodeproject.org%2Ffiles%2FENCFF216QQM%2F%40%40download%2FENCFF216QQM.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF256UOW%2F%40%40download%2FENCFF256UOW.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF791UZC%2F%40%40download%2FENCFF791UZC.hic":"37029615181,54779","www.encodeproject.org%2Ffiles%2FENCFF911AHQ%2F%40%40download%2FENCFF911AHQ.hic":"34246649165,54779","www.encodeproject.org%2Ffiles%2FENCFF491AOR%2F%40%40download%2FENCFF491AOR.hic":"558663570,36479","www.encodeproject.org%2Ffiles%2FENCFF307PDL%2F%40%40download%2FENCFF307PDL.hic":"525321519,36479","www.encodeproject.org%2Ffiles%2FENCFF773ITV%2F%40%40download%2FENCFF773ITV.hic":"295464771,36479","www.encodeproject.org%2Ffiles%2FENCFF198SSL%2F%40%40download%2FENCFF198SSL.hic":"500142476,36479","www.encodeproject.org%2Ffiles%2FENCFF251UEF%2F%40%40download%2FENCFF251UEF.hic":"567443575,36479","www.encodeproject.org%2Ffiles%2FENCFF942LTN%2F%40%40download%2FENCFF942LTN.hic":"4430960222,36479","www.encodeproject.org%2Ffiles%2FENCFF543USQ%2F%40%40download%2FENCFF543USQ.hic":"5005263062,36479","www.encodeproject.org%2Ffiles%2FENCFF434XQU%2F%40%40download%2FENCFF434XQU.hic":"25506511674,54779","www.encodeproject.org%2Ffiles%2FENCFF318GOM%2F%40%40download%2FENCFF318GOM.hic":"44750824314,54779","www.encodeproject.org%2Ffiles%2FENCFF004TKY%2F%40%40download%2FENCFF004TKY.hic":"20705661833,54779","www.encodeproject.org%2Ffiles%2FENCFF493YNC%2F%40%40download%2FENCFF493YNC.hic":"53407154984,54779","www.encodeproject.org%2Ffiles%2FENCFF334XXU%2F%40%40download%2FENCFF334XXU.hic":"14341194962,47429","www.encodeproject.org%2Ffiles%2FENCFF569RJM%2F%40%40download%2FENCFF569RJM.hic":"1922066634,36479","www.encodeproject.org%2Ffiles%2FENCFF076LWH%2F%40%40download%2FENCFF076LWH.hic":"39406255845,54779","www.encodeproject.org%2Ffiles%2FENCFF977XWK%2F%40%40download%2FENCFF977XWK.hic":"20563512962,54779","www.encodeproject.org%2Ffiles%2FENCFF127TPS%2F%40%40download%2FENCFF127TPS.hic":"21032070512,54779","www.encodeproject.org%2Ffiles%2FENCFF480KLP%2F%40%40download%2FENCFF480KLP.hic":"33115569647,54779","www.encodeproject.org%2Ffiles%2FENCFF281ILS%2F%40%40download%2FENCFF281ILS.hic":"28236353584,54779","www.encodeproject.org%2Ffiles%2FENCFF129LMU%2F%40%40download%2FENCFF129LMU.hic":"35247096013,54779","www.encodeproject.org%2Ffiles%2FENCFF759YCW%2F%40%40download%2FENCFF759YCW.hic":"16058537743,32102","www.encodeproject.org%2Ffiles%2FENCFF045YOM%2F%40%40download%2FENCFF045YOM.hic":"19775445828,32102","www.encodeproject.org%2Ffiles%2FENCFF013TGD%2F%40%40download%2FENCFF013TGD.hic":"4208420532,36479","www.encodeproject.org%2Ffiles%2FENCFF929RPW%2F%40%40download%2FENCFF929RPW.hic":"1974260276,36479","www.encodeproject.org%2Ffiles%2FENCFF996XEO%2F%40%40download%2FENCFF996XEO.hic":"2072918865,36479","www.encodeproject.org%2Ffiles%2FENCFF097SKJ%2F%40%40download%2FENCFF097SKJ.hic":"1983524001,36479","www.encodeproject.org%2Ffiles%2FENCFF464KRA%2F%40%40download%2FENCFF464KRA.hic":"1957300131,36479","www.encodeproject.org%2Ffiles%2FENCFF406HHC%2F%40%40download%2FENCFF406HHC.hic":"3854527235,36479","www.encodeproject.org%2Ffiles%2FENCFF080DPJ%2F%40%40download%2FENCFF080DPJ.hic":"19953768024,47429","www.encodeproject.org%2Ffiles%2FENCFF621AIY%2F%40%40download%2FENCFF621AIY.hic":"26781700010,54779","www.encodeproject.org%2Ffiles%2FENCFF366ERB%2F%40%40download%2FENCFF366ERB.hic":"1049184239,36479","www.encodeproject.org%2Ffiles%2FENCFF997RGL%2F%40%40download%2FENCFF997RGL.hic":"2521167549,36479","www.encodeproject.org%2Ffiles%2FENCFF029MPB%2F%40%40download%2FENCFF029MPB.hic":"1854711185,36479","www.encodeproject.org%2Ffiles%2FENCFF043EEE%2F%40%40download%2FENCFF043EEE.hic":"2924133032,36479","www.encodeproject.org%2Ffiles%2FENCFF920CJR%2F%40%40download%2FENCFF920CJR.hic":"3011577886,36479","www.encodeproject.org%2Ffiles%2FENCFF928NJV%2F%40%40download%2FENCFF928NJV.hic":"2778936244,36479","www.encodeproject.org%2Ffiles%2FENCFF894GLR%2F%40%40download%2FENCFF894GLR.hic":"2831733099,36479","www.encodeproject.org%2Ffiles%2FENCFF303PCK%2F%40%40download%2FENCFF303PCK.hic":"688704435,36479","www.encodeproject.org%2Ffiles%2FENCFF999YXX%2F%40%40download%2FENCFF999YXX.hic":"9255069996,56883","www.encodeproject.org%2Ffiles%2FENCFF685BLG%2F%40%40download%2FENCFF685BLG.hic":"16797022992,47429","www.encodeproject.org%2Ffiles%2FENCFF188SSH%2F%40%40download%2FENCFF188SSH.hic":"16797023050,47429","www.encodeproject.org%2Ffiles%2FENCFF465ESX%2F%40%40download%2FENCFF465ESX.hic":"13489465953,32102","www.encodeproject.org%2Ffiles%2FENCFF493SFI%2F%40%40download%2FENCFF493SFI.hic":"30033046818,54779","www.encodeproject.org%2Ffiles%2FENCFF235LCO%2F%40%40download%2FENCFF235LCO.hic":"38572174589,54779","www.encodeproject.org%2Ffiles%2FENCFF625VNK%2F%40%40download%2FENCFF625VNK.hic":"45202258438,54779","www.encodeproject.org%2Ffiles%2FENCFF304HMS%2F%40%40download%2FENCFF304HMS.hic":"36994445315,54779","www.encodeproject.org%2Ffiles%2FENCFF605CEN%2F%40%40download%2FENCFF605CEN.hic":"40358346301,54779","www.encodeproject.org%2Ffiles%2FENCFF086ORS%2F%40%40download%2FENCFF086ORS.hic":"22650781304,54779","www.encodeproject.org%2Ffiles%2FENCFF237UKR%2F%40%40download%2FENCFF237UKR.hic":"41516707246,54779","www.encodeproject.org%2Ffiles%2FENCFF004YZQ%2F%40%40download%2FENCFF004YZQ.hic":"71900665326,54779","www.encodeproject.org%2Ffiles%2FENCFF104THR%2F%40%40download%2FENCFF104THR.hic":"15172410632,54779","www.encodeproject.org%2Ffiles%2FENCFF807IRK%2F%40%40download%2FENCFF807IRK.hic":"17346637451,54779","www.encodeproject.org%2Ffiles%2FENCFF193CQL%2F%40%40download%2FENCFF193CQL.hic":"55726903245,54779","www.encodeproject.org%2Ffiles%2FENCFF700DEX%2F%40%40download%2FENCFF700DEX.hic":"20231399798,54779","www.encodeproject.org%2Ffiles%2FENCFF234MDO%2F%40%40download%2FENCFF234MDO.hic":"24635312640,54779","www.encodeproject.org%2Ffiles%2FENCFF181ROW%2F%40%40download%2FENCFF181ROW.hic":"26883606497,54779","www.encodeproject.org%2Ffiles%2FENCFF896OFN%2F%40%40download%2FENCFF896OFN.hic":"36952196833,54779","www.encodeproject.org%2Ffiles%2FENCFF573OPJ%2F%40%40download%2FENCFF573OPJ.hic":"36685546919,54779","www.encodeproject.org%2Ffiles%2FENCFF028RXH%2F%40%40download%2FENCFF028RXH.hic":"31053919206,54779","www.encodeproject.org%2Ffiles%2FENCFF156GGD%2F%40%40download%2FENCFF156GGD.hic":"35284134289,54779","www.encodeproject.org%2Ffiles%2FENCFF496GEU%2F%40%40download%2FENCFF496GEU.hic":"44659660933,54779","www.encodeproject.org%2Ffiles%2FENCFF945TUH%2F%40%40download%2FENCFF945TUH.hic":"3898570191,35639","www.encodeproject.org%2Ffiles%2FENCFF698KFV%2F%40%40download%2FENCFF698KFV.hic":"4427896684,35751","www.encodeproject.org%2Ffiles%2FENCFF239BHZ%2F%40%40download%2FENCFF239BHZ.hic":"1718552021,36479","www.encodeproject.org%2Ffiles%2FENCFF277LAN%2F%40%40download%2FENCFF277LAN.hic":"4542391336,36479","www.encodeproject.org%2Ffiles%2FENCFF397CMD%2F%40%40download%2FENCFF397CMD.hic":"2832016430,36479","www.encodeproject.org%2Ffiles%2FENCFF778OYA%2F%40%40download%2FENCFF778OYA.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF775VSU%2F%40%40download%2FENCFF775VSU.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF812THZ%2F%40%40download%2FENCFF812THZ.hic":"9667720429,36479","www.encodeproject.org%2Ffiles%2FENCFF777KBU%2F%40%40download%2FENCFF777KBU.hic":"5058284320,36479","www.encodeproject.org%2Ffiles%2FENCFF688KOY%2F%40%40download%2FENCFF688KOY.hic":"4198695833,36479","www.encodeproject.org%2Ffiles%2FENCFF223UBX%2F%40%40download%2FENCFF223UBX.hic":"1206064037,36479","www.encodeproject.org%2Ffiles%2FENCFF273XBU%2F%40%40download%2FENCFF273XBU.hic":"44085607579,54779","www.encodeproject.org%2Ffiles%2FENCFF952JZV%2F%40%40download%2FENCFF952JZV.hic":"44728845246,54779","www.encodeproject.org%2Ffiles%2FENCFF643NDM%2F%40%40download%2FENCFF643NDM.hic":"35877886780,54779","www.encodeproject.org%2Ffiles%2FENCFF586MQY%2F%40%40download%2FENCFF586MQY.hic":"71158037547,54779","www.encodeproject.org%2Ffiles%2FENCFF251VFA%2F%40%40download%2FENCFF251VFA.hic":"40089479399,54779","www.encodeproject.org%2Ffiles%2FENCFF033WGK%2F%40%40download%2FENCFF033WGK.hic":"30802023728,54779","www.encodeproject.org%2Ffiles%2FENCFF649OHR%2F%40%40download%2FENCFF649OHR.hic":"28203184265,54779","www.encodeproject.org%2Ffiles%2FENCFF782WVZ%2F%40%40download%2FENCFF782WVZ.hic":"37248221674,54779","www.encodeproject.org%2Ffiles%2FENCFF579CAR%2F%40%40download%2FENCFF579CAR.hic":"39662025395,54779","www.encodeproject.org%2Ffiles%2FENCFF514XWQ%2F%40%40download%2FENCFF514XWQ.hic":"1319613701,36479","www.encodeproject.org%2Ffiles%2FENCFF666USK%2F%40%40download%2FENCFF666USK.hic":"15051670107,32102","www.encodeproject.org%2Ffiles%2FENCFF047SDP%2F%40%40download%2FENCFF047SDP.hic":"1357076705,16438","www.encodeproject.org%2Ffiles%2FENCFF584LEP%2F%40%40download%2FENCFF584LEP.hic":"9314176858,36479","www.encodeproject.org%2Ffiles%2FENCFF671SOE%2F%40%40download%2FENCFF671SOE.hic":"3273732256,16438","www.encodeproject.org%2Ffiles%2FENCFF702LAP%2F%40%40download%2FENCFF702LAP.hic":"1800427500,31682","www.encodeproject.org%2Ffiles%2FENCFF339PON%2F%40%40download%2FENCFF339PON.hic":"5394351199,31514","www.encodeproject.org%2Ffiles%2FENCFF741QPR%2F%40%40download%2FENCFF741QPR.hic":"4271510019,30139","www.encodeproject.org%2Ffiles%2FENCFF103ANX%2F%40%40download%2FENCFF103ANX.hic":"4439745804,30083","www.encodeproject.org%2Ffiles%2FENCFF395SBC%2F%40%40download%2FENCFF395SBC.hic":"1596732351,31850","www.encodeproject.org%2Ffiles%2FENCFF289WNN%2F%40%40download%2FENCFF289WNN.hic":"8632980535,32102","www.encodeproject.org%2Ffiles%2FENCFF381EAU%2F%40%40download%2FENCFF381EAU.hic":"1702476311,36479","www.encodeproject.org%2Ffiles%2FENCFF976FEY%2F%40%40download%2FENCFF976FEY.hic":"1448279040,36479","www.encodeproject.org%2Ffiles%2FENCFF485LVS%2F%40%40download%2FENCFF485LVS.hic":"1593610856,36479","www.encodeproject.org%2Ffiles%2FENCFF143VJV%2F%40%40download%2FENCFF143VJV.hic":"1422312076,36479","www.encodeproject.org%2Ffiles%2FENCFF588NHX%2F%40%40download%2FENCFF588NHX.hic":"3943637009,36479","www.encodeproject.org%2Ffiles%2FENCFF768UBD%2F%40%40download%2FENCFF768UBD.hic":"24786676166,36479","www.encodeproject.org%2Ffiles%2FENCFF965PEE%2F%40%40download%2FENCFF965PEE.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF702IFC%2F%40%40download%2FENCFF702IFC.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF288DNV%2F%40%40download%2FENCFF288DNV.hic":"10313429504,36479","www.encodeproject.org%2Ffiles%2FENCFF698HWZ%2F%40%40download%2FENCFF698HWZ.hic":"10962849269,47429","www.encodeproject.org%2Ffiles%2FENCFF355OWW%2F%40%40download%2FENCFF355OWW.hic":"3219571601,36479","www.encodeproject.org%2Ffiles%2FENCFF177TYX%2F%40%40download%2FENCFF177TYX.hic":"10325679706,36479","www.encodeproject.org%2Ffiles%2FENCFF542BHD%2F%40%40download%2FENCFF542BHD.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF684IFW%2F%40%40download%2FENCFF684IFW.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF592UHE%2F%40%40download%2FENCFF592UHE.hic":"21363948089,32102","www.encodeproject.org%2Ffiles%2FENCFF779XIS%2F%40%40download%2FENCFF779XIS.hic":"9517383271,36479","www.encodeproject.org%2Ffiles%2FENCFF518PSL%2F%40%40download%2FENCFF518PSL.hic":"7500581463,36479","www.encodeproject.org%2Ffiles%2FENCFF275GBB%2F%40%40download%2FENCFF275GBB.hic":"7889407162,36479","www.encodeproject.org%2Ffiles%2FENCFF634KXI%2F%40%40download%2FENCFF634KXI.hic":"6430702966,36479","www.encodeproject.org%2Ffiles%2FENCFF337QPM%2F%40%40download%2FENCFF337QPM.hic":"8529733887,36479","www.encodeproject.org%2Ffiles%2FENCFF162KMP%2F%40%40download%2FENCFF162KMP.hic":"5615896908,36479","www.encodeproject.org%2Ffiles%2FENCFF992VTE%2F%40%40download%2FENCFF992VTE.hic":"7328975027,36479","www.encodeproject.org%2Ffiles%2FENCFF464WXY%2F%40%40download%2FENCFF464WXY.hic":"5715339664,36479","www.encodeproject.org%2Ffiles%2FENCFF752EGH%2F%40%40download%2FENCFF752EGH.hic":"1733758743,36479","www.encodeproject.org%2Ffiles%2FENCFF474UJM%2F%40%40download%2FENCFF474UJM.hic":"222309548,18679","www.encodeproject.org%2Ffiles%2FENCFF531UPZ%2F%40%40download%2FENCFF531UPZ.hic":"1827756846,36479","www.encodeproject.org%2Ffiles%2FENCFF022VHA%2F%40%40download%2FENCFF022VHA.hic":"244983451,18679","www.encodeproject.org%2Ffiles%2FENCFF732NGR%2F%40%40download%2FENCFF732NGR.hic":"1679484567,36479","www.encodeproject.org%2Ffiles%2FENCFF513VSF%2F%40%40download%2FENCFF513VSF.hic":"28397932940,36479","www.encodeproject.org%2Ffiles%2FENCFF750AOC%2F%40%40download%2FENCFF750AOC.hic":"36471430712,47429","www.encodeproject.org%2Ffiles%2FENCFF219YOB%2F%40%40download%2FENCFF219YOB.hic":"2859767211,26979","www.encodeproject.org%2Ffiles%2FENCFF604YDD%2F%40%40download%2FENCFF604YDD.hic":"3549694085,26979","www.encodeproject.org%2Ffiles%2FENCFF746AMV%2F%40%40download%2FENCFF746AMV.hic":"2954867135,26979","www.encodeproject.org%2Ffiles%2FENCFF845ZEB%2F%40%40download%2FENCFF845ZEB.hic":"2763039282,26979","www.encodeproject.org%2Ffiles%2FENCFF570LWS%2F%40%40download%2FENCFF570LWS.hic":"2861588289,26979","www.encodeproject.org%2Ffiles%2FENCFF883YVR%2F%40%40download%2FENCFF883YVR.hic":"2433679887,26979","www.encodeproject.org%2Ffiles%2FENCFF056VLK%2F%40%40download%2FENCFF056VLK.hic":"2502986910,26979","www.encodeproject.org%2Ffiles%2FENCFF532DUQ%2F%40%40download%2FENCFF532DUQ.hic":"3172615899,26979","www.encodeproject.org%2Ffiles%2FENCFF723PYJ%2F%40%40download%2FENCFF723PYJ.hic":"10292839095,36479","www.encodeproject.org%2Ffiles%2FENCFF991SGJ%2F%40%40download%2FENCFF991SGJ.hic":"13072407683,32102","www.encodeproject.org%2Ffiles%2FENCFF885UZI%2F%40%40download%2FENCFF885UZI.hic":"1201881201,16438","www.encodeproject.org%2Ffiles%2FENCFF287KXA%2F%40%40download%2FENCFF287KXA.hic":"14705801988,32102","www.encodeproject.org%2Ffiles%2FENCFF335HYI%2F%40%40download%2FENCFF335HYI.hic":"20366756545,32102","www.encodeproject.org%2Ffiles%2FENCFF121YPY%2F%40%40download%2FENCFF121YPY.hic":"2760104016,26979","www.encodeproject.org%2Ffiles%2FENCFF675SJE%2F%40%40download%2FENCFF675SJE.hic":"3751779995,26979","www.encodeproject.org%2Ffiles%2FENCFF876LAW%2F%40%40download%2FENCFF876LAW.hic":"4032376256,26979","www.encodeproject.org%2Ffiles%2FENCFF740KVX%2F%40%40download%2FENCFF740KVX.hic":"3202490322,26979","www.encodeproject.org%2Ffiles%2FENCFF977OQV%2F%40%40download%2FENCFF977OQV.hic":"2919735477,26979","www.encodeproject.org%2Ffiles%2FENCFF525EFN%2F%40%40download%2FENCFF525EFN.hic":"2394748073,26979","www.encodeproject.org%2Ffiles%2FENCFF690QRC%2F%40%40download%2FENCFF690QRC.hic":"3183023394,26979","www.encodeproject.org%2Ffiles%2FENCFF452FWS%2F%40%40download%2FENCFF452FWS.hic":"2951805127,26979","www.encodeproject.org%2Ffiles%2FENCFF089KBG%2F%40%40download%2FENCFF089KBG.hic":"2531936700,26979","www.encodeproject.org%2Ffiles%2FENCFF939ARM%2F%40%40download%2FENCFF939ARM.hic":"3066385212,26979","www.encodeproject.org%2Ffiles%2FENCFF401ZAN%2F%40%40download%2FENCFF401ZAN.hic":"3008677144,26979","www.encodeproject.org%2Ffiles%2FENCFF378RZT%2F%40%40download%2FENCFF378RZT.hic":"2830232168,26979","www.encodeproject.org%2Ffiles%2FENCFF304AVD%2F%40%40download%2FENCFF304AVD.hic":"6164439305,50358","www.encodeproject.org%2Ffiles%2FENCFF453DBX%2F%40%40download%2FENCFF453DBX.hic":"6775246670,36479","www.encodeproject.org%2Ffiles%2FENCFF590VOM%2F%40%40download%2FENCFF590VOM.hic":"6443478922,36479","www.encodeproject.org%2Ffiles%2FENCFF246DOF%2F%40%40download%2FENCFF246DOF.hic":"6837914659,36479","www.encodeproject.org%2Ffiles%2FENCFF125FXX%2F%40%40download%2FENCFF125FXX.hic":"9736232550,36479","www.encodeproject.org%2Ffiles%2FENCFF241RAY%2F%40%40download%2FENCFF241RAY.hic":"7686758397,36479","www.encodeproject.org%2Ffiles%2FENCFF415XWQ%2F%40%40download%2FENCFF415XWQ.hic":"6973092068,36479","www.encodeproject.org%2Ffiles%2FENCFF374EBH%2F%40%40download%2FENCFF374EBH.hic":"8557459058,36479","www.encodeproject.org%2Ffiles%2FENCFF263YWR%2F%40%40download%2FENCFF263YWR.hic":"331586820,18679","www.encodeproject.org%2Ffiles%2FENCFF280CGS%2F%40%40download%2FENCFF280CGS.hic":"1743569614,36479","www.encodeproject.org%2Ffiles%2FENCFF553ZNS%2F%40%40download%2FENCFF553ZNS.hic":"1717253636,36479","www.encodeproject.org%2Ffiles%2FENCFF451VOI%2F%40%40download%2FENCFF451VOI.hic":"1626927468,36479","www.encodeproject.org%2Ffiles%2FENCFF420MQO%2F%40%40download%2FENCFF420MQO.hic":"31055961677,36479","www.encodeproject.org%2Ffiles%2FENCFF301BWY%2F%40%40download%2FENCFF301BWY.hic":"38902429246,47429","www.encodeproject.org%2Ffiles%2FENCFF606XNW%2F%40%40download%2FENCFF606XNW.hic":"1009699327,36479","www.encodeproject.org%2Ffiles%2FENCFF439ZOU%2F%40%40download%2FENCFF439ZOU.hic":"12381714313,36479","www.encodeproject.org%2Ffiles%2FENCFF499SYK%2F%40%40download%2FENCFF499SYK.hic":"13182654663,47429","www.encodeproject.org%2Ffiles%2FENCFF532LFI%2F%40%40download%2FENCFF532LFI.hic":"8286030286,36479","www.encodeproject.org%2Ffiles%2FENCFF020DPP%2F%40%40download%2FENCFF020DPP.hic":"23521952420,47429","www.encodeproject.org%2Ffiles%2FENCFF306VTV%2F%40%40download%2FENCFF306VTV.hic":"23521952480,47429","www.encodeproject.org%2Ffiles%2FENCFF399IHE%2F%40%40download%2FENCFF399IHE.hic":"10216571232,36479","www.encodeproject.org%2Ffiles%2FENCFF944AII%2F%40%40download%2FENCFF944AII.hic":"12567308552,47429","www.encodeproject.org%2Ffiles%2FENCFF230HVV%2F%40%40download%2FENCFF230HVV.hic":"8629849711,36479","www.encodeproject.org%2Ffiles%2FENCFF174LAF%2F%40%40download%2FENCFF174LAF.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF898HRO%2F%40%40download%2FENCFF898HRO.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF429MOR%2F%40%40download%2FENCFF429MOR.hic":"1455757398,36479","www.encodeproject.org%2Ffiles%2FENCFF061NXV%2F%40%40download%2FENCFF061NXV.hic":"1710915891,36479","www.encodeproject.org%2Ffiles%2FENCFF434PYS%2F%40%40download%2FENCFF434PYS.hic":"1832274903,36479","www.encodeproject.org%2Ffiles%2FENCFF704HHX%2F%40%40download%2FENCFF704HHX.hic":"1768142834,36479","www.encodeproject.org%2Ffiles%2FENCFF349DPM%2F%40%40download%2FENCFF349DPM.hic":"4316041260,36479","www.encodeproject.org%2Ffiles%2FENCFF718AWL%2F%40%40download%2FENCFF718AWL.hic":"39544267907,58932","www.encodeproject.org%2Ffiles%2FENCFF065LSP%2F%40%40download%2FENCFF065LSP.hic":"24929805283,55874","www.encodeproject.org%2Ffiles%2FENCFF632MFV%2F%40%40download%2FENCFF632MFV.hic":"22333105467,55798","www.encodeproject.org%2Ffiles%2FENCFF179HVU%2F%40%40download%2FENCFF179HVU.hic":"2659219603,36479","www.encodeproject.org%2Ffiles%2FENCFF791SPZ%2F%40%40download%2FENCFF791SPZ.hic":"2537491657,36479","www.encodeproject.org%2Ffiles%2FENCFF211ZWF%2F%40%40download%2FENCFF211ZWF.hic":"3512141227,36479","www.encodeproject.org%2Ffiles%2FENCFF614BNU%2F%40%40download%2FENCFF614BNU.hic":"5252155462,36479","www.encodeproject.org%2Ffiles%2FENCFF891DLM%2F%40%40download%2FENCFF891DLM.hic":"2549095612,36479","www.encodeproject.org%2Ffiles%2FENCFF056EXT%2F%40%40download%2FENCFF056EXT.hic":"2219014704,36479","www.encodeproject.org%2Ffiles%2FENCFF776DSS%2F%40%40download%2FENCFF776DSS.hic":"3920308353,36479","www.encodeproject.org%2Ffiles%2FENCFF814LQF%2F%40%40download%2FENCFF814LQF.hic":"1349480197,36479","www.encodeproject.org%2Ffiles%2FENCFF513ZNA%2F%40%40download%2FENCFF513ZNA.hic":"2638868195,36479","www.encodeproject.org%2Ffiles%2FENCFF692IOL%2F%40%40download%2FENCFF692IOL.hic":"3106768498,36479","www.encodeproject.org%2Ffiles%2FENCFF294WZY%2F%40%40download%2FENCFF294WZY.hic":"2211089761,36479","www.encodeproject.org%2Ffiles%2FENCFF339UWS%2F%40%40download%2FENCFF339UWS.hic":"2142759055,36479","www.encodeproject.org%2Ffiles%2FENCFF835FSK%2F%40%40download%2FENCFF835FSK.hic":"3919821739,36479","www.encodeproject.org%2Ffiles%2FENCFF328BMB%2F%40%40download%2FENCFF328BMB.hic":"2550686152,36479","www.encodeproject.org%2Ffiles%2FENCFF897RTY%2F%40%40download%2FENCFF897RTY.hic":"1323294397,36479","www.encodeproject.org%2Ffiles%2FENCFF306MWH%2F%40%40download%2FENCFF306MWH.hic":"1665386199,36479","www.encodeproject.org%2Ffiles%2FENCFF039YUJ%2F%40%40download%2FENCFF039YUJ.hic":"2335679939,36479","www.encodeproject.org%2Ffiles%2FENCFF468QIN%2F%40%40download%2FENCFF468QIN.hic":"3352516594,36479","www.encodeproject.org%2Ffiles%2FENCFF364WXU%2F%40%40download%2FENCFF364WXU.hic":"3959043175,36479","www.encodeproject.org%2Ffiles%2FENCFF373MSH%2F%40%40download%2FENCFF373MSH.hic":"4429550624,36479","www.encodeproject.org%2Ffiles%2FENCFF959EGQ%2F%40%40download%2FENCFF959EGQ.hic":"2475218228,36479","www.encodeproject.org%2Ffiles%2FENCFF624XMK%2F%40%40download%2FENCFF624XMK.hic":"3527855681,36479","www.encodeproject.org%2Ffiles%2FENCFF445OKS%2F%40%40download%2FENCFF445OKS.hic":"3369125589,36479","www.encodeproject.org%2Ffiles%2FENCFF239QDV%2F%40%40download%2FENCFF239QDV.hic":"1960069888,36479","www.encodeproject.org%2Ffiles%2FENCFF645AVM%2F%40%40download%2FENCFF645AVM.hic":"4969006589,36479","www.encodeproject.org%2Ffiles%2FENCFF494IPI%2F%40%40download%2FENCFF494IPI.hic":"1565483792,36479","www.encodeproject.org%2Ffiles%2FENCFF753IXE%2F%40%40download%2FENCFF753IXE.hic":"2892400648,36479","www.encodeproject.org%2Ffiles%2FENCFF731GXX%2F%40%40download%2FENCFF731GXX.hic":"5131381303,36479","www.encodeproject.org%2Ffiles%2FENCFF369CAQ%2F%40%40download%2FENCFF369CAQ.hic":"4236629448,36479","www.encodeproject.org%2Ffiles%2FENCFF053VBX%2F%40%40download%2FENCFF053VBX.hic":"54305946375,47429","www.encodeproject.org%2Ffiles%2FENCFF555ISR%2F%40%40download%2FENCFF555ISR.hic":"54305946434,47429","www.encodeproject.org%2Ffiles%2FENCFF964RSP%2F%40%40download%2FENCFF964RSP.hic":"12065485229,36479","www.encodeproject.org%2Ffiles%2FENCFF234MZQ%2F%40%40download%2FENCFF234MZQ.hic":"17507142760,47429","www.encodeproject.org%2Ffiles%2FENCFF994CEG%2F%40%40download%2FENCFF994CEG.hic":"17507142760,47429","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb068e787-bbdd-49e2-9f6d-7a0e9f065d6e%2F4DNFIHSUIRFY.hic":"2701182442,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3768b89a-e124-40eb-8acd-94a4fdd35807%2F4DNFIXTAS6EE.hic":"3283740601,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9c513602-5abb-4088-8415-c827c381ab0d%2F4DNFIC3JD6O2.hic":"4896075767,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde954dad-1849-4c23-beb4-bf893b7d76c9%2F4DNFIGY85S4W.hic":"3364151996,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe1befa6e-8067-4296-8db2-67d2a2458985%2F4DNFI2LTNXME.hic":"3699291418,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbb3307fd-7162-477a-87c5-52f12d03befc%2F4DNFID162B9J.hic":"3576428773,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8597cdae-8319-42d9-9175-3f77aaee34e1%2F4DNFIQWS3632.hic":"4022561190,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F327f091d-6a63-47c4-9752-2dff303a13d9%2F4DNFI6GFHB6G.hic":"4239331168,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd70dc3b8-48a7-42c2-bd23-80bc44fc2266%2F4DNFIS5F6EBL.hic":"4404671861,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77df7bf8-6a3d-407a-8968-4ca1e78d2269%2F4DNFIF2D3TL9.hic":"4793989394,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8f7cc35-d2ef-4717-9009-c02154050fbf%2F4DNFI6EIFUZI.hic":"3370273763,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F98449d79-30d1-4e32-801d-07435819a42f%2F4DNFIRKGMZRQ.hic":"4669813207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd4fe1844-2493-4722-8b98-34a93a4bb7d8%2F4DNFIQWD8ZYD.hic":"5379889057,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1ee40499-1de4-47ff-b540-d9a65943c6b8%2F4DNFIX7H3CE2.hic":"4857679239,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac016170-23a7-4111-8773-353d6c150f34%2F4DNFIO21YDCV.hic":"4695989644,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1faea4e7-9a32-466e-a826-0bfdab6cd915%2F4DNFIUE5RAS6.hic":"4788044799,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcbd396ed-11bb-404f-aed9-ef10abc258e6%2F4DNFIFI6NIKJ.hic":"2069414927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3f78db-ae92-4215-bcae-76d30c617e5d%2F4DNFIL5K3MA1.hic":"2585598247,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66fc2893-224e-48b4-bdb0-25e022dedd03%2F4DNFIPV5KFMK.hic":"2060965679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2b39781d-aadc-434f-abe3-562d61308fdd%2F4DNFIW8TIFI5.hic":"1694424195,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6d28f7b-27d3-486f-b5ac-32567416560d%2F4DNFIA6NSSBJ.hic":"2219532611,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F08785616-722e-46bb-ade2-2fdd21324e11%2F4DNFIBKZK63V.hic":"2429136232,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F904b13d3-1203-42a4-812c-963e80c159b1%2F4DNFI3CFMRID.hic":"1233390166,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0ed4afe-5ecf-451d-bb1f-444697e3f558%2F4DNFIYIAUEPW.hic":"1753567534,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4bb9a9b3-12a8-4d2f-8071-4722294c88ea%2F4DNFIC3HAU11.hic":"2271375254,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5abf9c36-c1d1-44dc-8197-74d860d896c0%2F4DNFIM2BMJ33.hic":"1770471113,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa68475db-7816-4cec-b2da-d4ce4a0c7a0e%2F4DNFIBY3UHJB.hic":"2095528423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07c40943-0d0b-4b3e-94a0-8583b0e00b47%2F4DNFIWZEN3FF.hic":"1558559508,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8a39553-2718-4866-9b2a-45d8e9c5ac6f%2F4DNFIE5TEYK7.hic":"1323063102,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294b61ef-5565-4f04-ade9-f921a6686cce%2F4DNFI7H4II2V.hic":"1436947982,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a70ad7-7d34-4302-9c03-eb824bd4e633%2F4DNFIAS8LV1C.hic":"1263105698,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9db804c6-5a91-4cf5-8ae9-e054223afb77%2F4DNFIBXWIH8J.hic":"1587059951,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd1e55906-ec8f-444b-8ce1-2de22a431a76%2F4DNFIO2HBDAI.hic":"1666436393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a4b9b37-8e38-470c-8190-fd4d513c0bbb%2F4DNFIXWCLD4M.hic":"1513511880,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7615b2-5310-4bbf-a605-98761d3a3079%2F4DNFINASC4NQ.hic":"1420358914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F20454014-49cd-4e2d-93da-f40ad52776d5%2F4DNFIZF1KI43.hic":"1377041630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5df04e86-ee2a-45f2-b878-bf1648e2cca5%2F4DNFIQBHR9XC.hic":"1179502734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1cc910-bb3f-4106-802a-73184c58d5ba%2F4DNFIQVMVRP6.hic":"1811976991,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe431986b-0732-460f-92ff-0abd1694d2d0%2F4DNFIJ7OAIFQ.hic":"1685503856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56d0c575-4962-4ea3-92c3-55bd0e17c096%2F4DNFIE8E4ANZ.hic":"1598369564,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb1502fb-a989-4ef9-b800-7eaa7be172ae%2F4DNFIOUSETUP.hic":"1493294709,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Facc2f1c3-8c96-4d21-814a-3a8ba81e7741%2F4DNFIVJ3IIQL.hic":"1472376655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F037fb4c3-8641-4953-a977-cc71f2137582%2F4DNFIHN2QSMX.hic":"1179632606,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16d2c3c0-6d29-4815-b074-b142af90b615%2F4DNFIILDWK8M.hic":"2280059989,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31789849-e4db-45d8-9730-66a048c02d8a%2F4DNFI6XD6JAQ.hic":"2253961696,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fff04947e-e6e8-4d62-8374-ef2ee4104809%2F4DNFIALNLR78.hic":"1914687914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F53e6c1e7-9410-4158-84e6-57c2e683b095%2F4DNFIBT4EAKN.hic":"2296378356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0127900a-258f-4815-97d2-6fd2b043d853%2F4DNFIDJ2JZ7Q.hic":"2558945393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F89f95693-3d28-44eb-9d45-14932f8e258c%2F4DNFI8JFOAJT.hic":"1726440253,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd803d818-b0d4-4796-8d61-a9f3943f3b10%2F4DNFIRZA6EV6.hic":"1805017504,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff9165fb1-0782-4757-a740-5b929e0252bb%2F4DNFIB7QTIMH.hic":"2541020707,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8d916b2-b58e-4cdf-894c-ffcb3bf6ebd9%2F4DNFIJ5DQZVK.hic":"2445734043,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14066a5b-e01a-43c2-a468-b18826174df3%2F4DNFISTWNV9C.hic":"2499319890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd0692151-7f9a-4475-b059-f8802616dded%2F4DNFIBN9K4V9.hic":"1591570769,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70a7ef36-a514-4e45-918f-47c4e9e30ef4%2F4DNFIR8OU6QJ.hic":"1689882108,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F180306cd-8593-413a-ae83-24f19209c5d2%2F4DNFIDSWKFF5.hic":"1596696630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e7b9be7-f465-4434-8e9c-68d1e44a76af%2F4DNFIV239W4L.hic":"2345867406,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F55df948c-941d-4930-854c-6a07557a0c1d%2F4DNFIREVU1Z5.hic":"2254683002,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f590cb7-df3a-498f-81c3-d5ed4179b8ad%2F4DNFIFHU75I5.hic":"2497670883,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8f064770-6008-4f74-bfca-268d4a22d745%2F4DNFIMROE6N4.hic":"9850583704,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa93d0588-76b7-4ccf-933c-4325876b0a53%2F4DNFI5SUHCGZ.hic":"10364705187,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f5f0d6b-0b22-4936-93c9-0944d49c037b%2F4DNFII84FBKM.hic":"8836986129,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12e90fc5-0b76-4e42-b346-58d267f9ad6e%2F4DNFI2J1ODWB.hic":"13410858286,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2702a45-3e8b-4980-bcd5-6bb0e291614f%2F4DNFIJWBWE41.hic":"20515676755,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa0859349-5f06-4ad3-b56f-b1166b34a9eb%2F4DNFIIMZB6Y9.hic":"15350325963,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12685c57-d54a-46fa-9efb-acf34ed77574%2F4DNFICJECID5.hic":"1525002266,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd101a58e-89aa-44fd-96c5-6bf1e2476272%2F4DNFIR6UW2QA.hic":"1264999913,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8c73bf-1335-4af4-b124-e3622d48c5f6%2F4DNFIGOEKBUZ.hic":"1905947578,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcd2477cf-6ed0-4d7b-b4e9-88fb38b0df48%2F4DNFIMDNAEW4.hic":"996444147,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0f03953e-29da-4f2e-8c05-572d0edf4525%2F4DNFI5OSZ3JC.hic":"369361754,22829","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F29d95dbb-005a-4ae1-8b9c-0fec9ec0bbd0%2F4DNFI7KOUGFM.hic":"1227434049,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa441ab7b-afbe-437d-bf98-b6b916558642%2F4DNFIGKX4A32.hic":"883933242,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F941b2f94-2fff-4d3c-aceb-fee4a5ae41a9%2F4DNFI1ORHOTA.hic":"1140970677,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8720ede9-093f-4c00-912f-373283260a16%2F4DNFIWSVLZED.hic":"458091151,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9e17155-2b62-4a68-afb2-31dfa674e169%2F4DNFI6H926RO.hic":"3552863515,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F22f22778-987a-4dc0-97bc-f26eae0156d9%2F4DNFIKTYSPOF.hic":"2939475400,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40f40192-0acb-44cb-8778-8d21afe593fb%2F4DNFIZ4S52BV.hic":"3067438113,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8767374-7018-4e11-9226-bf5612d39ebb%2F4DNFI3APMXHF.hic":"3258874744,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c5140ec-a65a-4186-8c59-2927233eecaa%2F4DNFIQLIKDSD.hic":"2746398416,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8cdedda6-d7d8-4231-a85b-d56fcd962366%2F4DNFIKYXMF1E.hic":"14442148774,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa4d4497-7c6c-4dad-8040-be13ba07ea32%2F4DNFI9815EEJ.hic":"17960817603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9b7b95f-190b-49fe-8047-ef4a8fc59746%2F4DNFIQ2687RT.hic":"15954277087,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F59863d3a-8d7c-49c7-9a41-7f2a58ad24d1%2F4DNFIYDBBSE3.hic":"16499534862,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e80ca41-b3e0-4f4f-a05e-8f95fe96d938%2F4DNFIMOCN1YS.hic":"863725312,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F96f97a01-0020-4f09-93e8-fc8a9fd07218%2F4DNFI6558CM8.hic":"1597967345,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fce9e9334-ee0b-4549-a845-110470ba5986%2F4DNFIQZRKS7Y.hic":"907626411,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaac8209-1015-48da-9e31-2e252dfd8fe0%2F4DNFIX4DLXSE.hic":"1369766288,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F268b7d52-9655-474c-9467-8ba31bb2195c%2F4DNFII3JV8I1.hic":"856656441,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9681f9b5-335a-4f56-afa1-15b58bbb41e8%2F4DNFI5IAH9H1.hic":"1495185175,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e082eab-95aa-4677-88ed-9d7adcc1effb%2F4DNFIK5HY1GP.hic":"2135337789,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31af1ead-4520-4669-957e-424b4b197c33%2F4DNFIFA89L5B.hic":"1975593640,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcc2b78fd-52d4-4e0c-ac93-b84ee82daf7e%2F4DNFICXCFGEI.hic":"2628202920,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff54efece-280f-46ca-95e3-1f8a3cd18820%2F4DNFIK4CECUH.hic":"1901129375,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1181c0c4-afb7-4b6a-9fdc-d868fb2253fc%2F4DNFI1EYIGOC.hic":"1947135384,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1d3e2905-b9b9-4b91-bcb4-8d34746e78f6%2F4DNFI7TLEWUI.hic":"1185758726,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faba3d42f-39cd-4a85-9d3f-835aefb5c803%2F4DNFIVCJKHMN.hic":"687240974,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F27f54fcb-54fe-41a4-b25a-2f8944c89044%2F4DNFIN8F14CS.hic":"1304082029,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb75fedb5-88f4-4bc0-8e38-298df7847a7f%2F4DNFI5LCW273.hic":"12497258313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f22b2a0-3712-496e-92d2-63775ec0e421%2F4DNFIVSCH2CH.hic":"12594733778,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07e47261-5863-44f5-9198-76e263081bea%2F4DNFIZ268JGC.hic":"1499059135,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F682b1ae1-3ac3-40e4-a330-c49f63946952%2F4DNFIJ1P4HBI.hic":"1190211725,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F197e7c89-ea73-41de-8cb2-8c0b1e3bb945%2F4DNFITEGKBIW.hic":"2061501971,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F191f6928-c9a8-44b2-8516-ee4d6005f24b%2F4DNFIE1P6RVH.hic":"1711447310,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F94435086-3701-4b28-a6d0-4a59b24d7615%2F4DNFICJ6I4DO.hic":"1557899940,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa9ac173-d233-41c7-8985-ca91949664e4%2F4DNFIKUG8MEW.hic":"1339072088,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fba6d8ab6-ee18-4ba2-8da9-d631888dd50a%2F4DNFICFZGFAV.hic":"1261083478,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a3ab04-7094-4673-81e4-ac8c9add8eb5%2F4DNFIQXCZVVA.hic":"1084913802,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc1ff488-82af-4579-9424-959184edb139%2F4DNFIB6PJFJ3.hic":"1114571343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f7026ee-987a-41e7-8a61-45510ee3f86b%2F4DNFIX97731O.hic":"1246860402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6186787c-2e72-4925-9729-02121e2e4597%2F4DNFIYQYZOTO.hic":"1212210849,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b98a946-0109-4efa-a13e-cc7a36772125%2F4DNFIPXU7V25.hic":"1696288217,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fea17d041-c6ed-43a1-8047-535f3d19ad44%2F4DNFIL39PR76.hic":"1719284710,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72774afe-f166-42ac-9849-4070b0dadf6d%2F4DNFIYLJ3R3B.hic":"1106419640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a45e733-55f8-4a8e-be24-2ef34c976e25%2F4DNFIL51WBN6.hic":"1327651164,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F086c62b0-a26f-41ae-a5ff-88b8be2bd2aa%2F4DNFI6SFPUDA.hic":"1336964405,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4d9b79c7-af62-4070-84a9-b953903f2732%2F4DNFI2KM22QR.hic":"953067310,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c9889d1-f49e-4639-8e15-2d99d6cd22e7%2F4DNFIVF8Q45U.hic":"984193565,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa080dd7b-b7bb-4eae-a275-572a8b45b2d0%2F4DNFI2RN3WFP.hic":"1046525527,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb81860ca-c227-4b68-a298-1907fd32300a%2F4DNFI4TJTL7A.hic":"1160373401,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F74ab47dc-7b52-421c-845e-6feb33457adf%2F4DNFIYJ4TWB8.hic":"1268416204,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc6582128-a930-4bcc-941e-5c0733bdd4d5%2F4DNFIM6RGKPV.hic":"863347067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11a75514-4450-4295-9eda-18e3678a575a%2F4DNFIL2VWWL5.hic":"860731581,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5eb52a8c-bf14-4225-bf34-14a0aa47c369%2F4DNFIX6ZXCA8.hic":"893462267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66aaa4c0-1f62-4040-8ecc-4e95da23cd18%2F4DNFIEVR81FS.hic":"879736207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F821c6e7f-96f7-47de-b7d9-4970562b3c8e%2F4DNFIAUI6BBI.hic":"996313881,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9252c362-31ab-413d-a47a-cc97bdbf243a%2F4DNFIAFEE9G2.hic":"1103265750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc1a0bf52-2e65-4deb-871f-ede736babd41%2F4DNFIPZBEXCP.hic":"1081257762,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F729f5ce3-d7e0-466d-b781-d18049e63bfa%2F4DNFIWPKRZGU.hic":"973779283,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80b769ee-a717-4825-9db0-dca86f913173%2F4DNFIMD9QNDX.hic":"1158688208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F266290c0-2767-4158-85ab-7274368905b9%2F4DNFIATA1HD5.hic":"1073361089,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc46f18a8-eb24-4d35-b112-36db72bde2f5%2F4DNFIH9U4I7I.hic":"1111124316,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fec91a79e-7de7-49f7-9b3d-d28313aeddc8%2F4DNFIZ95S6TR.hic":"1242494051,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e9390b9-da20-43bb-a8f4-9830f354ddf9%2F4DNFI5ERM9J7.hic":"1271051397,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee8ea82e-b9e4-41ad-bced-5f4fbdaa4fec%2F4DNFI15FPSQL.hic":"1216714120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbed7eb86-8990-42f2-b3ee-5992d6361f7c%2F4DNFIJ3DZPGM.hic":"1035089437,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaa8a324-3bf8-424c-8a86-b8ad325cc20d%2F4DNFINW9P6XF.hic":"1215712740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70631758-6bf8-47a0-92b6-132574886faa%2F4DNFITS16HW8.hic":"1105283847,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe473304b-7bc8-49b8-bba1-ecb9f06914ee%2F4DNFIS3DIH4V.hic":"1036056660,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F10f9224a-111c-402a-ac25-e221ad0af9ef%2F4DNFIY3KDHP6.hic":"1071761024,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17519b96-2bdd-4294-98f0-1535f1aef28e%2F4DNFIO8HVKOL.hic":"953793750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb18f896-4730-4909-86a3-867fc8e76cd6%2F4DNFIMF6CFOM.hic":"708717889,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcfee4d87-0873-40b0-b79f-35dcc8669c1c%2F4DNFIZZ77KD2.hic":"732668723,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8b5d909-8a1b-41bb-bcdd-d108a0bde762%2F4DNFIOLO226X.hic":"951271932,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ce81f6e-b9cf-4ec9-8bd3-517539e4b662%2F4DNFIJMS2ODT.hic":"932509067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F506aa952-5d41-49ff-b658-916bcf88a395%2F4DNFI49F3LJ4.hic":"1208494817,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4dc392d-ca36-4bdf-a27d-173cae34f520%2F4DNFI65MQOIJ.hic":"854630155,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F149ef8d7-e0b4-4e4f-b7e5-7226e2603746%2F4DNFIM4KEPRD.hic":"882790622,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa436f0a8-4f9a-4524-90ac-795c5b8491cf%2F4DNFIIXBIZFC.hic":"848244425,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc8a05dc-7449-4b01-8330-a55db37ca8e6%2F4DNFIWDOOBVE.hic":"1116239020,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faef8b881-28fe-4694-9a95-1d31940e6726%2F4DNFIDT9EB5M.hic":"888289053,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff66f3162-a53d-46f2-8800-3752935d5400%2F4DNFIX2VUNV8.hic":"1226661451,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F36c782e6-2c48-4298-aa43-bd6624da003d%2F4DNFIEQHTV1R.hic":"804665819,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff15d571e-605d-4bcc-a359-0350b57a6815%2F4DNFIFW7GA64.hic":"901568712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2aa2e8b-ac7f-4acb-b4b5-ac5f845840fe%2F4DNFIXGXD67I.hic":"970995551,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F71b6fd7d-b249-4d65-a597-b80b95845399%2F4DNFIA7GB1NB.hic":"956785837,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cbb1418-34db-427f-9273-5174eac81529%2F4DNFIVOJGWNP.hic":"890415052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc69c2ee7-b6c3-4a62-8d4f-913491c9dab8%2F4DNFIW22BNB5.hic":"1075499540,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa268f28f-c6d9-4324-8989-75d2d317af1b%2F4DNFIIFBC8WN.hic":"1045459440,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7361d4-60a6-440b-b5be-072cada98663%2F4DNFI9ZBEBJH.hic":"759395398,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcceaad1a-e01e-4430-8bd6-24ffa6891802%2F4DNFID4SLU53.hic":"921288444,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9eee5854-b33e-4d5a-9ba8-ceffd47e7488%2F4DNFIODI1NUJ.hic":"733159777,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5e1089b0-42e8-441c-99bb-4be99bcec28b%2F4DNFIJL26LFN.hic":"723567970,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F298a429e-ea29-49d3-bfed-fa851e1e7c4c%2F4DNFI5KTF553.hic":"2213661745,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F965d29f0-e4a3-477c-8ae4-faf4a654e69a%2F4DNFIYSPGFGV.hic":"2274989349,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd88acbc1-37b9-4266-9f97-d8fed576d0f3%2F4DNFILOR6D2D.hic":"2595459358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7b6ddbce-0ed1-4272-b8ae-32793e4ea4e4%2F4DNFI1WMMPJQ.hic":"2262433890,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fedc0c8c4-97d8-4372-9a4f-5e0cdf09d7d0%2F4DNFI47P5978.hic":"2146314403,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0edcc389-43a4-44d7-b946-fe3496f93d56%2F4DNFI7XGW6IH.hic":"2302805723,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0a802926-e235-4c80-b521-83a1774dfb46%2F4DNFIK1EJG8I.hic":"2374943035,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c36aedb-6a58-4aa2-9b11-bb440ec174f1%2F4DNFIDQ3THN9.hic":"2341188249,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F846123cd-8828-4e51-8b8a-27deaf293858%2F4DNFI3WPNFWT.hic":"775145629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd06e3ad-0e37-48a3-8367-c7d5912cab03%2F4DNFI9DCUOQ1.hic":"870487824,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2eaf9bf-9584-4cec-8685-bd74038a6c01%2F4DNFIU8AF5ZY.hic":"1276224366,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F219497b5-3f35-473b-9d4e-e1cf21c69561%2F4DNFIHW8NTQX.hic":"28864787856,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4be13558-114a-4f2d-abca-7598e2ff4757%2F4DNFI4OUMWZ8.hic":"17061013588,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49aed637-87a1-4d4d-ae68-e5da82aec05b%2F4DNFIEYQ5ZIR.hic":"13555272651,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa2f48779-4eff-44a6-8a9d-96435aca1ddc%2F4DNFIDZT7PR8.hic":"13425047093,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6ec6b71-27b8-4891-b10a-ab06a5270468%2F4DNFIEJEFCAM.hic":"15394960208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F68b9a7b5-8413-44fc-8c2d-59a67b1c4166%2F4DNFIJ8JKKWJ.hic":"17012681779,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294d45a4-8b5e-456f-a9cb-1cbbbad3a7d2%2F4DNFINEQY95T.hic":"13966775978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd7f3a48-b822-41e2-bd9c-f52b3aff7b6a%2F4DNFII6AN691.hic":"12367300362,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7da44594-0dc8-4e74-8e10-a957aeaea51a%2F4DNFIDBIEXI7.hic":"2015474981,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F085a0453-3784-4eba-80b2-3556e53e2f52%2F4DNFIDKJFK2S.hic":"1983111659,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc370c78c-0a99-4c3f-a29b-2dfafc6a3e86%2F4DNFIPAF4PYT.hic":"3041434294,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F907ce45f-baa5-416d-92de-e86db4bacff1%2F4DNFIWIYYNQ5.hic":"7082321112,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff13afc6b-cf69-4c9d-881f-eed4dd3c28ee%2F4DNFIHMCILEN.hic":"1739157603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7575d891-0e3d-4a77-896a-3e1b3a8d330b%2F4DNFIJBJ6QVH.hic":"5213499748,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0daa830-60d5-4c7c-a2e1-a4ee70b3fee7%2F4DNFIH2A7IKF.hic":"4099503507,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4970a25-91d8-49a7-9a4a-fe0f12cb2b0f%2F4DNFIOL8KGQ2.hic":"2256042055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879f1850-d175-4a86-8a97-12658482e3d1%2F4DNFIWILLD6C.hic":"5476286356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F787f538e-d619-4c8f-985b-78753fb7e57c%2F4DNFIZBXXJAF.hic":"5946467856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8ee785f-1016-4989-9e64-78352621d32f%2F4DNFI8PZOJHN.hic":"8307204961,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8997fa-528c-4531-b25b-a412de6bd472%2F4DNFIGXAMSJY.hic":"6577588285,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87aede55-7610-4283-af0e-c6840429a31e%2F4DNFIWNNO89O.hic":"2871061417,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93b8e020-b337-4685-81dc-40cc8a12b5e9%2F4DNFIXU2KPNQ.hic":"3401717686,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb5cf1bd-59d6-46fe-857d-b86d9756029d%2F4DNFIHBGD6N6.hic":"840028421,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2d1bc088-d838-49b8-85fc-fea78a7353c4%2F4DNFI7J8NI4A.hic":"675705256,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a27b63-fd67-401b-9aa2-2798e6588d21%2F4DNFISFM9VFK.hic":"800145922,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F656c0a9d-7058-4c4b-a3ce-701d929561c1%2F4DNFIJU5XBK7.hic":"966593603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2efacfbd-9c81-4e62-8df7-847d1ab774d5%2F4DNFIPKY8ED1.hic":"3401629450,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa50b6a26-56b5-43f2-b525-fa219fd716f1%2F4DNFIQRTP7NM.hic":"5358852759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5dc7a59-b998-4490-8a76-afbf3b258a49%2F4DNFIBCIA62Q.hic":"5779049277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62b2b237-cb02-45f7-89d9-616cf9ffb678%2F4DNFIV56OFE3.hic":"5818844506,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ac79b4f-cfbf-4b2a-9fc2-898ed6c3e5e1%2F4DNFILIM6FDL.hic":"19637469163,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cff8afa-5a13-4ad4-bcad-91fc3ced759c%2F4DNFIP71EWXC.hic":"17934647326,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F000789fe-9a22-4280-a71c-7ad228fd4cac%2F4DNFIM7ZVQOQ.hic":"700134697,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8d78457f-0c2b-4358-b08c-4d4ef4d9f59d%2F4DNFIS6EYHCX.hic":"628314484,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ca3b4a0-2478-49c9-b4a2-a28430417a32%2F4DNFIKKCMS1Q.hic":"584050634,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5041473-18ec-439d-92b1-8ad98c9b25c0%2F4DNFIBIV8OUN.hic":"522632731,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcf474ec6-abd4-431e-a21c-252fcf5ee6b3%2F4DNFIAUMRM2S.hic":"313395531,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bb1c73e-fb0f-41c4-8620-a938cc8d24a0%2F4DNFI9ZUXG61.hic":"332217525,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F26dfa41e-7e4f-457a-a3ac-72daf8059f3c%2F4DNFIDBFENL7.hic":"359604894,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ed2e68b-189e-4988-bb6d-94e63240a231%2F4DNFI7XAZNNQ.hic":"5312422266,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6f2b1ce0-5205-4680-981e-d91b694dc3e4%2F4DNFISNGDB53.hic":"2008546759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F73c8147f-bc7d-4d33-8a10-a9e7b413ecc6%2F4DNFI1CIGHYC.hic":"2221847625,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F526ae3e3-32cc-4670-970f-1faa9cfafd4d%2F4DNFIQD2DP2F.hic":"5295591503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e803530-47f8-4c56-bb19-fbdcd578d2f0%2F4DNFINHT8P7C.hic":"3159499486,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe705f38-903f-47b7-9b38-f80ebd18a479%2F4DNFIGF8EM7M.hic":"3490552542,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa197328-d6da-4299-a0fd-409ac9892668%2F4DNFIUPG2ZBJ.hic":"5382003751,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe5d52c4-2be7-4812-bca0-cd4bb3025e6b%2F4DNFIH3OTR14.hic":"3224693110,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21935f61-daa8-4df2-aa69-fcd27953b405%2F4DNFIUATRW3Z.hic":"3835865655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72147527-e3e8-4967-bc45-8251249d76c9%2F4DNFI6V7ZQAE.hic":"4382708138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F589f0919-f54d-49ff-a482-e2f453ef7f34%2F4DNFICKMT1CY.hic":"4479068191,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F861946ca-bad8-4a87-96e1-b2eb20b9ef10%2F4DNFIF9BDCNI.hic":"3698151402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff76346ac-97ec-4893-8984-2b75ce1cdc51%2F4DNFIG5O1OQS.hic":"5704288175,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe8b43826-f049-4c3f-b83a-e75fa7aacc85%2F4DNFIHS2SVBQ.hic":"990025510,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46316260-f555-4dd4-9e40-8ae06ca52822%2F4DNFIU95B69H.hic":"1275878544,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff62ef491-a3ae-4f66-ab33-c5673c9e0b65%2F4DNFIYRROFCR.hic":"1522530503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cd617e1-fad4-4fdc-8b4e-cb277650123c%2F4DNFIF7JN3IU.hic":"1463443128,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb20fe2a-0078-4d4a-8a52-d76043d06f40%2F4DNFIB2RYULQ.hic":"1269529700,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d386fcf-1d22-47de-a0d6-0c3a641ca174%2F4DNFIMVDK3SI.hic":"1185489599,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F00e470bd-c533-41b1-923a-4b471824da12%2F4DNFIRLOTXSC.hic":"978217499,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8774fb3-d0c5-43cc-a6c9-eb0ca39841fb%2F4DNFIZAPX6J8.hic":"1100356082,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fab3b826e-614c-448b-860f-a3ebef68a82f%2F4DNFIQD5VCSD.hic":"1322319877,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66c78d2b-993a-4937-95ed-9e2d302ceb3e%2F4DNFIIF6VAGN.hic":"868885799,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5d106fe1-2d80-466e-87aa-46b38ba142c5%2F4DNFI86IEZXH.hic":"751443267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc99490b6-faf9-413f-9c38-3f53018089d6%2F4DNFIP881SR2.hic":"754427927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F39c7e387-e710-4b1d-b757-357dec03f6ad%2F4DNFI42NNCW8.hic":"1166392978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4742a211-43b1-4325-af6f-82490aeb766b%2F4DNFIEV4PKP6.hic":"1102227476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaa73842-1c86-4ad9-8a9e-c189c0b4c01d%2F4DNFIF1DUQHE.hic":"1206699207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd25f24df-0298-4079-bb6f-1c8e1e32392b%2F4DNFIGW55EAY.hic":"1033358104,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc57a7ab5-2778-4fe2-9d64-9a4e95135f12%2F4DNFISZRU6I4.hic":"1539570262,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd89f494a-27ca-46b6-89be-7583f3f6d18c%2F4DNFIBKKDTAP.hic":"350372180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F06725280-cb24-4f22-a267-18b434bfa79e%2F4DNFIJSRQW24.hic":"314361467,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8fe5c3c5-006f-425b-ac6d-ea475e29be78%2F4DNFI3REN89E.hic":"299665258,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8b6ac5c-13b4-427e-9158-cec0b890b6d8%2F4DNFIF5XLHKM.hic":"235668364,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F01ff33fc-fc23-48aa-a6c6-b720d6fe0768%2F4DNFIB6Q538N.hic":"316494853,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F552978c8-abbc-424a-9187-3e34cf802a97%2F4DNFI3ST3F7Y.hic":"296298411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72e66520-5170-4f2e-844a-fbfd0e23b480%2F4DNFIQT4M6UI.hic":"307691265,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb3eb3953-ffe8-4d5a-970c-a16f3b7b9ec3%2F4DNFIFNCC7M2.hic":"364160436,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F37d413fb-afab-41ff-99aa-1678830f7dde%2F4DNFITM9MDJL.hic":"252412426,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf5db92c-aaf1-4086-a0d2-79b28648f172%2F4DNFI3NTD7B3.hic":"227586640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6892f7b-1f8a-4d7d-9605-c67932cd5654%2F4DNFIBED48O1.hic":"328344868,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd64afb07-5ab1-4c4f-8438-2fee37afa86a%2F4DNFISATK9PF.hic":"379669025,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fad11bb63-8692-461c-b698-89c601451321%2F4DNFISRP84FE.hic":"298491537,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F63710ec5-35d2-47dd-bf9a-08d3daa83d67%2F4DNFI2LY7B73.hic":"303150299,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76077d9e-ca75-4301-ab79-88aa49bda495%2F4DNFIXEB4UZO.hic":"711757090,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F34dd4c0e-3487-4fb4-b95f-c4bb66e0fa31%2F4DNFIQWWATGK.hic":"221304476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F48a8cf86-3248-4a8e-8e85-472ec219d49c%2F4DNFI44JLUSL.hic":"284772724,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee399fbf-2a9e-46e2-8364-457713bff508%2F4DNFIM7Q2FQQ.hic":"330729464,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F124d191a-c5c7-49b6-b84b-0d1bad8bef2b%2F4DNFIZK7W8GZ.hic":"293166018,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe351f7cc-7a2c-4515-ae0b-3bb2f91c986a%2F4DNFIMIMLMD3.hic":"240094740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffd1ae249-57b1-41d6-81a6-16b21dcd8f12%2F4DNFI7QUSU5J.hic":"681762505,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46c92c5c-9ad8-4d49-beba-f35c5cd99208%2F4DNFINXUOI5H.hic":"375594313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7350d40-4e9e-4131-9151-bb539d39b431%2F4DNFIIJR2296.hic":"331322302,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfacf37b-1665-45f3-a046-e29e1544e9b0%2F4DNFIJMZUTXR.hic":"361313244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F234e18fb-9990-43bf-9a48-f72722cfa232%2F4DNFIZQPT9EL.hic":"540421873,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b35ab09-2e79-4876-b2bc-d3a8faa26257%2F4DNFIZIXSZ9J.hic":"545066813,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae5118e-807a-46e0-8e92-143d4b282b3d%2F4DNFIDD9IF9T.hic":"237409149,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb34d7f6f-73f7-4b6b-80c7-c8af0f991549%2F4DNFIVC8OQPG.hic":"355121712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ab169fd-cbdd-4f60-8553-a4c6912ad89e%2F4DNFITUPI4HA.hic":"313085022,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4e53712b-d0d9-40c5-afe1-ffa0fad71e59%2F4DNFI5IZNXIO.hic":"341863906,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a91477f-45eb-4a16-affb-fc131f9326b8%2F4DNFII16KXA7.hic":"248904495,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F153729de-0eca-43cc-9b61-61aa8d775b38%2F4DNFIAAH19VM.hic":"668047244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879fd78a-7165-43d9-a0de-ca158b53df30%2F4DNFIVKIY3KV.hic":"247571318,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f901a4-040b-4b04-9fff-94a1780423cd%2F4DNFIVVCWL6C.hic":"198355985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd5b30c5a-654a-463c-9474-39bdc3ce4500%2F4DNFIJRF2273.hic":"343971277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7070280a-8f03-40d0-9fef-e9d9f4d3dae7%2F4DNFI6FCC9ZA.hic":"312013061,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F47049719-9407-4d76-9048-26231045f642%2F4DNFI1CPQ4O3.hic":"352923267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F862c2b5f-44c2-4bd7-9264-b3ca032d3d8d%2F4DNFISXFEDE9.hic":"271745977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feffbe052-39ff-4217-9871-44199ed90818%2F4DNFIF9L6QEQ.hic":"668409334,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa7791854-1b35-4258-90fb-603c55f24642%2F4DNFIPKASX1Q.hic":"312727920,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79cccad6-a78e-4de9-9fe7-08f7e8df663d%2F4DNFIWXZ4JQZ.hic":"151808553,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7e86e0cc-d6f1-4ce0-aba4-c36c6ebb3c4c%2F4DNFIEMQ1O8V.hic":"700533280,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a1b58d3-9ae6-43e4-91cf-49f1fcbbab33%2F4DNFIYWONU7A.hic":"729050356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67bff264-0b0c-4c5c-9d4d-ff5abef2bbe4%2F4DNFISNIE5FH.hic":"7987657997,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3a6a943f-2cc0-4433-a27d-c89f3fdd3309%2F4DNFIV8MLWJB.hic":"6646216171,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e235711-ba90-404d-b4ac-b15990ea8e33%2F4DNFIXSTDPHL.hic":"3146468238,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c89f4bc-e9fc-4ecf-b868-26108dbb7bb2%2F4DNFIQJNOH8U.hic":"2919703928,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1856ff9e-de7a-4fa1-ae0b-3e04b837b5e1%2F4DNFI57XB4A8.hic":"13417594377,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F099bb5b9-6315-4650-8f78-d603f5a046b3%2F4DNFIQ7UKVZV.hic":"9016468637,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3c7a30-0fc4-410d-8d41-247da3eb105d%2F4DNFIWJY8GHD.hic":"7921314766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda99f429-20ab-4d91-bbfe-f8bdea8ed7b1%2F4DNFIN8NKRNF.hic":"4247121358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0ca0f4e3-30ca-4332-b735-e32dce08e1a4%2F4DNFIZYGEHNZ.hic":"4910404663,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F243f48b0-6b59-4f37-ad39-a12e0986f530%2F4DNFIRPYGAV8.hic":"4220073636,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49f1a890-d458-42a6-9c78-99c38b6c7a8f%2F4DNFI6MZTDM1.hic":"375035361,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76bd4768-9343-44ba-a99d-5500e184e39d%2F4DNFIG3BCGPL.hic":"2422923206,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1ed866-eaf6-4906-aa8c-9e39616dde38%2F4DNFIS9YPJ3L.hic":"1593271574,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1e7a5636-bdb6-45fb-85d8-87a7e908de43%2F4DNFIOWGA9AX.hic":"1632314387,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ecc552a-0a6b-49a9-9aa5-9f3fd9b535fd%2F4DNFINKEDSBF.hic":"1458761024,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c03f1d2-bb25-4c94-b5f5-d5cdd01c14b6%2F4DNFIVIXVUK7.hic":"1504818271,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1a4616ff-6d04-4a6a-9773-b80e81da2471%2F4DNFIANHFY16.hic":"1850724180,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd2231870-a78d-4c8b-9cfd-084f2468acb1%2F4DNFIJ67ZFBI.hic":"1473864703,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F859c2dd3-df8a-42b7-86ea-bf6524f75e80%2F4DNFIG3YQQ4V.hic":"1539822829,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8bad667e-6003-4828-9a20-07585fa9c811%2F4DNFIOLKEOME.hic":"3036353747,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F92ea551b-5779-4d31-a0f5-621e4bd0eb21%2F4DNFIVLN8WJE.hic":"2710426318,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61ee79fa-0617-4083-b121-f92ef3a8905c%2F4DNFI2111XQA.hic":"2589549183,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F83ebb98d-e5db-403d-aa23-875293156c0e%2F4DNFI88HXX7D.hic":"2462367030,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6d63671a-8f1d-4159-82c0-931b43464772%2F4DNFIUBM6QK8.hic":"2486020469,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcccb9014-ce15-4032-81ac-222b3d621cb4%2F4DNFIVILEERC.hic":"2052537210,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a07867-4007-4ca5-b066-25d3168208dc%2F4DNFIF7Q43N4.hic":"2091773428,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff738de0f-358b-44bf-97dd-644c8d9b1b1c%2F4DNFID56VJGW.hic":"878913568,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda97c1d4-bb92-4a77-92a7-f7960f88b9dc%2F4DNFIYUR29KO.hic":"983915575,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F54ea363a-99e7-4f55-861e-1644acab7939%2F4DNFIUDPGHO8.hic":"905253594,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcd66a07-55ee-48d9-a157-419cf4ee3eef%2F4DNFISWC2N8T.hic":"1233576358,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40363837-7466-4a1d-b20d-a66d1670b700%2F4DNFICMPHDMI.hic":"516590777,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0b3fa4e6-caeb-40b4-8942-e9c0b03dfe4f%2F4DNFIKMKN736.hic":"634310295,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6a34050-d52b-4880-91cf-d3fe4b0ce982%2F4DNFIN5NLS49.hic":"650451131,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8e63a47b-9fd4-4772-8b0c-10ee589ffb16%2F4DNFI4P8UBRL.hic":"705655033,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d92b666-30cc-4838-9d46-c1f11cee3d3c%2F4DNFISNC3LAI.hic":"176146197,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17f7dc63-a1bc-4970-b389-87d9ee93b753%2F4DNFIVBWPFD7.hic":"749678512,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8897333-4791-4a83-9444-a653e24aee13%2F4DNFITMQRXB7.hic":"254477361,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8712bf31-33d0-4562-ab0b-a1e9cf4fd30c%2F4DNFIUYD3HBY.hic":"995625724,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfaf6383-9cc6-4b5c-9b20-d3bf2e8c3495%2F4DNFIRRSC7P9.hic":"1149985362,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0b70598-5d17-4e0a-8831-6cbe697e69e2%2F4DNFIWKR8FP6.hic":"1151628407,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fccc094a8-23ce-4fd8-9c4a-41f07c045c8f%2F4DNFIQ74RSUY.hic":"931695969,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8eda16f3-af5e-4f1f-b46d-c74df44b76aa%2F4DNFI9IIO5PW.hic":"1077740364,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff283637b-cf2c-4412-ba00-0e3d7e279fad%2F4DNFI8WGJG19.hic":"812086456,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ad8438f-d3d9-42d8-88bf-42845a0dc2d0%2F4DNFIQ5CCESJ.hic":"652559720,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70e3bdcc-caf4-4822-b9c5-85234873db7a%2F4DNFIWTZHB4H.hic":"760694196,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56ed767d-cd8a-4d38-8047-ed1e8bc8cd19%2F4DNFIENYQCDP.hic":"1159428005,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa912fff9-5f90-42b1-a3a6-cbb9eb2cf861%2F4DNFIFATZWPD.hic":"1033325746,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21338ea5-fdee-4ad8-b61c-608fc6cec4bc%2F4DNFI7YRXKEO.hic":"388142539,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0f88647-5631-437b-b48a-4603915e3714%2F4DNFIUY3J7EW.hic":"407344788,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16926af8-ac3b-4f32-97d5-6c0dc6f1596a%2F4DNFIRKUYKP4.hic":"893352368,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93e39aec-6cde-4c5b-bcdf-283faa3163a2%2F4DNFIAQDBJZP.hic":"489922022,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0dc0b1ba-5509-4464-9814-dfe103ff09a0%2F4DNFIC1CLPK7.hic":"565748333,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb50964c7-b025-49d9-b1ed-289bedb59678%2F4DNFI3A3VYWU.hic":"4597459343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4390cea-b330-4022-88c1-9ff8c0a786f7%2F4DNFI6JJQKFJ.hic":"3678393678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c0f730-5da1-4863-9b7a-6cdd31066cff%2F4DNFIK61ILGM.hic":"3324300994,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14b14ac4-ab59-4754-9c43-eacd9d0638e2%2F4DNFIYD8LO9Z.hic":"3227227120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7386f953-8da9-47b0-acb2-931cba810544%2F4DNFIOTPSS3L.hic":"253942497,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6b5d8bd-27dc-4415-a320-53405a16db85%2F4DNFI525PKU5.hic":"305089653,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f922dbc-637b-4c43-b816-f604f0e79ad1%2F4DNFI8Y9SRP2.hic":"1438589609,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6a36d686-716c-4ba8-a9c3-fa8311791d3c%2F4DNFIP25GZGA.hic":"1419100109,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0e535542-2cf2-46e4-ba10-7a0b946a7fb2%2F4DNFITPO1WTY.hic":"3885296184,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c17d228-5052-4c83-880e-af05118e6929%2F4DNFIG4X5Z5F.hic":"2159245890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc3977c00-525b-4556-9a27-061707f8cb76%2F4DNFIXLYR32S.hic":"587852728,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f856506-cbc5-4211-a29d-48a7530c622e%2F4DNFIWI3V5LI.hic":"2318237793,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F38f77979-5eb7-4b6f-9a60-c2451185db98%2F4DNFI2DGL7LH.hic":"2068150664,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe0992a75-7727-405e-95ac-aa97141b51c1%2F4DNFI1VSO8JP.hic":"1807949651,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe925f1aa-2e7b-44e7-bfa8-2084a613ab13%2F4DNFIV5O2ZYO.hic":"2242134377,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F803a6d3c-3972-4939-8ff2-d195c5192090%2F4DNFIEWEWQ8D.hic":"2981341325,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F25104375-a588-46e6-a382-663cee6c332f%2F4DNFICSTCJQZ.hic":"14592996888,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F927aa8a5-24a5-43b7-807a-1e99ac321459%2F4DNFICEGAHRC.hic":"15431307603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c380474-12cd-41f4-b86f-2a29faf12eec%2F4DNFIY3XPKPO.hic":"2550999291,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77da562e-d0ec-45a8-8764-14fa16d995a1%2F4DNFIK9PS9GM.hic":"3401011629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11b26222-d480-40a7-8d53-3ad8500396cb%2F4DNFIF4Y74JR.hic":"2127593378,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93df02c6-1047-43f6-afae-d3598b61eeea%2F4DNFIBBKG9KD.hic":"5724446278,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cd4378a-8f51-4e65-99eb-15f5c80abf8d%2F4DNFIT4I5C6Z.hic":"5419655766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F067881e5-563d-40de-a9e3-caccad887fbc%2F4DNFI2U38HCE.hic":"14749043471,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcb3da9ad-7afe-4d0c-9c2d-261181e7a95c%2F4DNFIETP228R.hic":"9401474797,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F185b7bcc-7bb7-41b7-9ebe-92d4fe159431%2F4DNFIXKC48TK.hic":"11624295594,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F18459b84-dd43-4af6-a05f-bcb773096322%2F4DNFIFPGOWJ6.hic":"2843730862,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffde1e48c-4a0d-4bb1-b84a-e0e45f9a0aa3%2F4DNFIIRMBE8Y.hic":"5820677927,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbabed539-1f0f-4e87-8815-fde596e6024c%2F4DNFIVUGNDD7.hic":"5170782436,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d00531a-e616-469b-af52-5b028270e2ce%2F4DNFIFLJLIS5.hic":"18917549985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a9dad53-b8af-4cb6-9ce3-5c38e4a855c7%2F4DNFIOX3BGNE.hic":"5482775936,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F82fd7b7e-5f47-48d5-bf0d-daaa48a4674d%2F4DNFISPUVQHA.hic":"2177864938,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4c6680f3-9cf6-452f-9dc5-ecebf376775d%2F4DNFI8649RQJ.hic":"3288850368,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2395f001-19d9-4000-9f00-dae3dea708d6%2F4DNFIE8T8JZ8.hic":"1383191843,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24464fa8-bf96-483c-8e9a-c2f626ad6e19%2F4DNFIBM714BP.hic":"1765204569,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F918fc048-fa27-41d2-a63a-d50c511fbb9a%2F4DNFI6CWNUFL.hic":"2431120602,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ff5a0d1-8e54-4cf0-9fe7-339f147c78da%2F4DNFIZ4F74QR.hic":"3211825957,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F355f0412-cb17-452a-b15c-aba16c5a742c%2F4DNFIOUVOX3R.hic":"5547401083,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cac91c5-160a-4b91-a91e-edc309318dd5%2F4DNFIVTDXW6X.hic":"4797344498,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9ac9ec5-6221-4f39-951a-1c5054fc9f1c%2F4DNFICA8Y9TN.hic":"4277557869,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46f62222-b50a-428b-938b-5444951600eb%2F4DNFIDWM3HN5.hic":"4374808431,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F50e4f2a1-9cb6-4192-8199-64d354bfdf96%2F4DNFIBK5TB3N.hic":"3757387253,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4cdd5a8-1a45-4c6a-906b-a9603260d4c8%2F4DNFI3JYF9VS.hic":"5260534916,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8164e99-5778-427d-be26-f0e1b62400f0%2F4DNFIP1GNKUO.hic":"7589365689,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0d72e78a-fc87-4716-8b8e-6dc5650ff2ef%2F4DNFIQYQWPF5.hic":"22022259901,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac58fc15-48c2-4eec-a689-23b677b4b6e7%2F4DNFIW6H9U3S.hic":"6810897169,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31811e40-e3ca-4456-8ba6-2ee66d6c7104%2F4DNFI7J8BQ4P.hic":"7188744676,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62d81a52-d2cb-4bbd-8510-0fe120e786e0%2F4DNFIA3AKFSU.hic":"1763730692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae0b7513-d1a0-4f27-a9d3-348837f42cb6%2F4DNFID68JQY9.hic":"2422880133,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae6a1a7e-1d2d-4fd2-a89f-1799abac8a9c%2F4DNFIL1FQDXE.hic":"1543814834,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80d343c9-bd60-468a-803d-c3e351a958bc%2F4DNFITSIPCSK.hic":"2344682115,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2d61195-a3a6-4d50-b928-546ca67546cb%2F4DNFIJ88LYHR.hic":"3362742962,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31052aba-773a-4500-961b-e0a518245b0c%2F4DNFIJIPWD63.hic":"2529548812,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc93d0710-3fbf-40cc-b0eb-878e2aa659e4%2F4DNFIZUP2BBI.hic":"491996147,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8660baeb-5be1-4ba5-93e4-66499e9a4587%2F4DNFIEBC4AF3.hic":"2993048734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6d08fbc-b836-4776-82ad-8b1b277ae837%2F4DNFI5VO3E1W.hic":"1949322679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3af004a2-a6fa-46dc-8be8-898b847a77be%2F4DNFIFDGVWLU.hic":"2456400803,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd613b4b-2422-492c-8d8f-8afba9c8a182%2F4DNFITVGFNYZ.hic":"1411204423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc340694f-14f3-4638-b09b-98220c20039a%2F4DNFIOW9TTC1.hic":"2611370588,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3effa71b-6aa3-4265-87ba-f8d709d778d7%2F4DNFIOAA3ZEQ.hic":"3123195980,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde75cf8b-9ce1-44fc-8b7b-ca0adea6bae9%2F4DNFIA5ID1S6.hic":"3496246968,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F714f775d-a5a4-4314-83f8-016b9d73200b%2F4DNFIZYU7V81.hic":"4245592042,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ca518af-6e1e-4777-b67b-0fe7f039ce58%2F4DNFIRV6PVUX.hic":"3981520466,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc29b57d5-c263-4372-b396-ab4f55682f5d%2F4DNFIMEANFBY.hic":"3999623376,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4196d3ef-161a-4c18-a57e-005165c6b32a%2F4DNFIGLGQXLC.hic":"4105683321,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe10828b5-9519-4ceb-81e7-7228bfd890de%2F4DNFILS2HLXC.hic":"3804942111,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaac88c7-9bdc-4b1e-aa9f-e675520dfffa%2F4DNFIQS8853L.hic":"5287726781,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faab371b1-bc8d-4e83-998e-5bb977c443ca%2F4DNFIVBYCYGS.hic":"4657988157,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb116add-af8c-4a3b-b106-9f704ba0a175%2F4DNFIE4WWHMF.hic":"5116727268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F033366e2-05a2-4381-9d48-90122892a9e0%2F4DNFIKDUUC3C.hic":"45638237,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7284a446-442d-4a46-aae5-84987e75a7af%2F4DNFIJ5HIRA2.hic":"62201052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F876649a3-6dd3-463a-8b17-5752a98a89c5%2F4DNFIXDFC7EM.hic":"69878143,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cb4ce4d-d474-459f-8b8a-2159d8df8068%2F4DNFIO35EOVR.hic":"70153114,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5c5612fa-18c2-47fb-8074-693b1054e254%2F4DNFI57QGL6U.hic":"54605055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c1472d-cf3a-41d7-8682-cd03b7cc978d%2F4DNFI2AGEBE5.hic":"67930121,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bf4cce8-6e03-422b-a190-e51d4a07d501%2F4DNFI1E6NJQJ.hic":"4893181511,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0eb3aa56-8a23-435d-a07b-8bb545e8d708%2F4DNFI2DNFM1A.hic":"60466977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1201682a-a223-482d-913d-3c3972b8eb65%2F4DNFIIRIHBR2.hic":"48961678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6aee7913-6356-43cf-affa-f2b60dd478f6%2F4DNFIKXNMT46.hic":"39095246,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F357139a3-c9a5-4343-b0a4-b41c45fd03fd%2F4DNFIRV7IRJP.hic":"70916718,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76be3061-6259-42be-a917-19dcba41517b%2F4DNFIFX1XYKZ.hic":"229197441,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff60c348a-a62c-43c3-ac85-f6c28b5f823f%2F4DNFI64CJUZ5.hic":"112428610,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd0b0a14-9703-49af-bb36-2359f96d4d0e%2F4DNFIBPL2HL1.hic":"73972428,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79ac278d-83f7-4c1f-91b2-05c8018c1426%2F4DNFIBRSIPE4.hic":"415430378,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c3b8141-8e67-4211-80dd-3bae88f9e537%2F4DNFIDLDVY14.hic":"112747303,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae703d2-d85c-4ac4-9ce1-14d653927675%2F4DNFI4R1II4P.hic":"210565448,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76e641af-90be-49f8-b126-12c20f856159%2F4DNFINMLRY95.hic":"1590865292,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b416382-ae5d-469f-9e9a-85a3e2ce9793%2F4DNFI8KBXYNL.hic":"4626496956,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa27589a6-86b2-43a2-8218-1f2232d551e6%2F4DNFI53R5IKA.hic":"1536016455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdd3999f5-b36e-4154-a6b9-446656959a3a%2F4DNFIAWVDQ8C.hic":"2210273411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc377953b-0e61-426b-a905-abab2d5a3002%2F4DNFI9VXTBE2.hic":"3384365692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2dbe0377-1db2-4aae-af2b-d87dff728035%2F4DNFIT96Z365.hic":"7692311974,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcfcb009-f006-4ab8-a4c7-af72be58c12c%2F4DNFITUOMFUQ.hic":"6592120312,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f9073d-b2c5-474e-b3d5-7d72cde555cd%2F4DNFIHLQKDN8.hic":"2647703964,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76968cc8-fb9f-485b-85b2-c9289067194b%2F4DNFIL9M97T2.hic":"6186798917,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87d9330b-8d2c-4e9d-85bb-02e572de7a68%2F4DNFIDWGZLHX.hic":"4379708168,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffc01b381-3665-4225-88ee-2e5e9ecb7324%2F4DNFIMEG1QIC.hic":"3587146533,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3144a03c-15c3-4bf9-95f8-ffad2640a1bf%2F4DNFIWSB66VX.hic":"1529739069,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7d3aac0-ba66-494b-ba0c-147631084b98%2F4DNFIH7TH4MF.hic":"6896300679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b13bd19-fbd1-4c68-8855-4f0158d1ce47%2F4DNFIHKWIZ9T.hic":"1954878455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d04e286-30d4-4add-a806-7a929d36419e%2F4DNFIZBBX795.hic":"1350142414,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa26f261-a88a-4cac-9118-ff8e90ab6f61%2F4DNFI9ZWZ5BS.hic":"3410552807,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24e516ce-0b49-4476-b818-cc96471d8765%2F4DNFIPAI8XB5.hic":"4168518737,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac3b06b5-46d4-4c1e-97e9-9a4f353473a7%2F4DNFI1OUWFSC.hic":"10766406904,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76c6aa27-895f-4e82-8ed8-7a85aca84490%2F4DNFIX4PJKXZ.hic":"1463157350,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe6fbe03a-997b-4d72-a3cc-f1ed7bd88a92%2F4DNFIZGCA8AH.hic":"1597664180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61d99a87-4ec6-4116-be99-b483999641c4%2F4DNFI5CGQ46V.hic":"2870576870,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F271ea8cd-53b9-44c9-9fff-1bb5c444b54c%2F4DNFIOCW5AEM.hic":"2463600138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa98ca64a-861a-4a8c-92e9-586af457b1fb%2F4DNFI1UEG1HD.hic":"22480709268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5809b32e-0aea-4cf5-a174-cf162d591a35%2F4DNFI9YAVTI1.hic":"3141182061,25900"};const Nf="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,Bf=new class{constructor(e){this.wait=void 0===e?100:e,this.isCalled=!1,this.calls=[]}limiter(e){const t=this;let i=function(){t.calls.length&&!t.isCalled&&(t.isCalled=!0,t.calls.shift().call(),setTimeout((function(){t.isCalled=!1,i()}),t.wait))};return function(){t.calls.push(e.bind(this,...arguments)),i()}}}(100);class Mf{constructor(e){if(e.alert&&(this.alert=e.alert),this.config=e,this.loadFragData=e.loadFragData,this.fragmentSitesCache={},this.normVectorCache=new If(10),this.normalizationTypes=["NONE"],this.matrixCache=new If(10),this.blockCache=new Tf,e.file)this.file=e.file;else if(e.blob)this.file=new wf(e.blob);else{if(!(e.url||e.path&&!Nf))throw e.path?Error("path property is deprecated, use NodeLocalFile"):Error("Arguments must include file, blob, url, or path");{this.url=e.url||this.path,this.remote=!0;const i=new mf(e);(t=this.url).indexOf("drive.google.com")>=0||t.indexOf("www.googleapis.com/drive")>0?this.file=new bf(i,Bf):this.file=i}}var t}async init(){this.initialized||(await this.readHeaderAndFooter(),this.initialized=!0)}async getVersion(){if(void 0===this.version){const e=await this.file.read(0,128);if(!e)return;const t=new yf(new DataView(e));return this.magic=t.getString(),this.version=t.getInt(),this.version}return this.version}async getMetaData(){return await this.init(),this.meta}async readHeaderAndFooter(){let e=await this.file.read(0,16);if(!e||0===e.byteLength)throw Error("File content is empty");let t=new yf(new DataView(e));if(this.magic=t.getString(),this.version=t.getInt(),this.version<5)throw Error("Unsupported hic version: "+this.version);this.footerPosition=t.getLong(),await this.readFooter();const i=Object.values(this.masterIndex).reduce(((e,t)=>Math.min(e,t.start)),Number.MAX_VALUE)-16;e=await this.file.read(16,i),t=new yf(new DataView(e)),this.genomeId=t.getString(),this.version>=9&&(this.normVectorIndexPosition=t.getLong(),this.normVectorIndexSize=t.getLong()),this.attributes={};let n=t.getInt();for(;n-- >0;)this.attributes[t.getString()]=t.getString();this.chromosomes=[],this.chromosomeIndexMap={};let r=t.getInt(),s=0;for(;r-- >0;){const e={index:s,name:t.getString(),size:this.version<9?t.getInt():t.getLong()};"all"===e.name.toLowerCase()&&(this.wholeGenomeChromosome=e,this.wholeGenomeResolution=Math.round(2*e.size)),this.chromosomes.push(e),this.chromosomeIndexMap[e.name]=e.index,s++}this.bpResolutions=[];let o=t.getInt();for(;o-- >0;)this.bpResolutions.push(t.getInt());if(this.loadFragData){this.fragResolutions=[];let e=t.getInt();if(e>0)for(;e-- >0;)this.fragResolutions.push(t.getInt())}this.chrAliasTable={};for(let e of Object.keys(this.chromosomeIndexMap))e.startsWith("chr")?this.chrAliasTable[e.substr(3)]=e:"MT"===e?this.chrAliasTable.chrM=e:this.chrAliasTable["chr"+e]=e;this.meta={version:this.version,genome:this.genomeId,chromosomes:this.chromosomes,resolutions:this.bpResolutions}}async readFooter(){const e=this.version<9?8:12;let t=await this.file.read(this.footerPosition,e);if(!t)return null;let i=new yf(new DataView(t));const n=this.version<9?i.getInt():i.getLong();let r=i.getInt();const s=196*r;for(t=await this.file.read(this.footerPosition+e,Math.min(s,n)),i=new yf(new DataView(t)),this.masterIndex={};r-- >0;){const e=i.getString(),t=i.getLong(),n=i.getInt();this.masterIndex[e]={start:t,size:n}}if(this.expectedValueVectors={},this.version>5){const e=this.version<9?4:8;this.normExpectedValueVectorsPosition=this.footerPosition+e+n}return this}async printIndexStats(){let e,t=0,i=0;await await this.init();for(let n of Object.keys(this.masterIndex)){const r=this.masterIndex[n];t+=r.size,r.size>i&&(i=r.size,e=n)}console.log(`${i} ${e} ${this.config.url}`)}async getMatrix(e,t){const i=xf.getKey(e,t);if(this.matrixCache.has(i))return this.matrixCache.get(i);{const n=await this.readMatrix(e,t);return this.matrixCache.set(i,n),n}}async readMatrix(e,t){if(await this.init(),e>t){const i=e;e=t,t=i}const i=xf.getKey(e,t),n=this.masterIndex[i];if(!n)return;const r=await this.file.read(n.start,n.size);return r?xf.parseMatrix(r,this.chromosomes):void 0}async getContactRecords(e,t,i,n,r,s=!1){await this.init();const o=this.chromosomeIndexMap[this.getFileChrName(t.chr)],a=this.chromosomeIndexMap[this.getFileChrName(i.chr)];if(o>a||o===a&&t.start>=i.end){const e=t;t=i,i=e}const c=await this.getBlocks(t,i,n,r);if(!c||0===c.length)return[];const l=[],h=t.start/r,d=t.end/r,u=i.start/r,f=i.end/r,p=Math.floor(h),g=Math.ceil(d),m=Math.floor(u),w=Math.ceil(f);for(let o of c)if(o){let a,c,b=e&&"NONE"!==e;const F=this.getFileChrName(t.chr),v=this.getFileChrName(i.chr);if(b){const t=await this.getNormalizationVector(e,F,n,r),i=F===v?t:await this.getNormalizationVector(e,v,n,r);t&&i?(a=await t.getValues(p,g),c=await i.getValues(m,w)):b=!1}for(let e of o.records)if(s||e.bin1>=h&&e.bin1<d&&e.bin2>=u&&e.bin2<f)if(b){const t=e.bin1,i=e.bin2,n=a[t-p]*c[i-m];if(0!==n&&!isNaN(n)){const r=e.counts/n;l.push(new kf(t,i,r))}}else l.push(e);void 0===this.percentile95&&o.records.length>10&&(this.percentile95=Lf(o.records,95))}return l}async getBlocks(e,t,i,n){const r=(e,t)=>`${t.getKey()}_${e}`;await this.init();const s=this.getFileChrName(e.chr),o=this.getFileChrName(t.chr),a=this.chromosomeIndexMap[s],c=this.chromosomeIndexMap[o];if(void 0===a)return console.log("No chromosome named: "+e.chr),[];if(void 0===c)return console.log("No chromosome named: "+t.chr),[];const l=await this.getMatrix(a,c);if(!l)return console.log("No matrix for "+e.chr+"-"+t.chr),[];const h=l.getZoomData(n,i);if(!h){let i=`No data avalailble for resolution: ${n} for map ${e.chr}-${t.chr}`;throw new Error(i)}const d=h.getBlockNumbers(e,t,this.version),u=[],f=[];for(let e of d){const t=r(e,h);this.blockCache.has(n,t)?u.push(this.blockCache.get(n,t)):f.push(e)}const p=f.map((e=>this.readBlock(e,h))),g=await Promise.all(p);for(let e of g)e&&this.blockCache.set(n,r(e.blockNumber,h),e);return u.concat(g)}async readBlock(e,t){const i=await t.blockIndex.getBlockIndexEntry(e);if(i){let n=await this.file.read(i.filePosition,i.size);if(!n)return;n=new ls(new Uint8Array(n)).buffer;const r=new yf(new DataView(n)),s=r.getInt(),o=[];if(this.version<7)for(let e=0;e<s;e++){const e=r.getInt(),t=r.getInt(),i=r.getFloat();o.push(new kf(e,t,i))}else{const e=r.getInt(),t=r.getInt(),i=1===r.getByte(),n=!(this.version<9)&&1==r.getByte(),s=!(this.version<9)&&1==r.getByte(),a=r.getByte();if(1===a){const a=s?r.getInt():r.getShort();for(let c=0;c<a;c++){const a=t+(s?r.getInt():r.getShort()),c=n?r.getInt():r.getShort();for(let t=0;t<c;t++){const t=e+(n?r.getInt():r.getShort()),s=i?r.getFloat():r.getShort();o.push(new kf(t,a,s))}}}else{if(2!=a)throw new Error("Unknown block type: "+a);{const n=r.getInt(),s=r.getShort();for(let a=0;a<n;a++){const n=Math.floor(a/s),c=e+(a-n*s),l=t+n;if(i){const e=r.getFloat();isNaN(e)||o.push(new kf(c,l,e))}else{const e=r.getShort();-32768!=e&&o.push(new kf(c,l,e))}}}}}return new Df(e,t,o,i)}}async hasNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Rf(e,r,i.toString(),n),o=await this.getNormVectorIndex();return o&&o[s]}async isNormalizationValueAvailableAtResolution(e,t,i,n){let r;if(Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}return void 0!==(await this.getNormVectorIndex())[Rf(e,r,i.toString(),n)]}async getNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Rf(e,r,i.toString(),n);if(this.normVectorCache.has(s))return this.normVectorCache.get(s);const o=await this.getNormVectorIndex();if(!o)return void console.log("Normalization vectors not present in this file");if(!1===await this.isNormalizationValueAvailableAtResolution(e,t,i,n)){const t=`Normalization option ${e} not available at resolution ${n}. Will use NONE.`;return console.log(t),void(this.alert&&this.alert(t))}const a=o[s],c=await this.file.read(a.filePosition,8);if(!c)return;const l=new yf(new DataView(c)),h=this.version<9?l.getInt():l.getLong(),d=this.version<9?8:4,u=this.version<9?a.filePosition+4:a.filePosition+8,f=new Sf(this.file,u,h,d);return this.normVectorCache.set(s,f),f}async getNormVectorIndex(){if(!(this.version<6)){if(!this.normVectorIndex){if(!this.config.nvi&&this.remote&&this.url){const e=new URL(this.url),t=encodeURIComponent(e.hostname+e.pathname);Ef.hasOwnProperty(t)&&(this.config.nvi=Ef[t])}if(this.config.nvi){const e=decodeURIComponent(this.config.nvi).split(","),t={start:parseInt(e[0]),size:parseInt(e[1])};return this.readNormVectorIndex(t)}try{return await this.readNormExpectedValuesAndNormVectorIndex(),this.normVectorIndex}catch(e){"416"===e.code||416===e.code?this.normExpectedValueVectorsPosition=void 0:console.error(e)}}return this.normVectorIndex}}async getNormalizationOptions(){return await this.getNormVectorIndex(),this.normalizationTypes}async readNormVectorIndex(e){await this.init(),this.normalizationVectorIndexRange=e;const t=await this.file.read(e.start,e.size),i=new yf(new DataView(t));this.normVectorIndex={};let n=i.getInt();for(;n-- >0;)this.parseNormVectorEntry(i);return this.normVectorIndex}async readNormExpectedValuesAndNormVectorIndex(){if(await this.init(),void 0===this.normExpectedValueVectorsPosition)return;const e=await this.skipExpectedValues(this.normExpectedValueVectorsPosition);let t=4,i=await this.file.read(e,4);if(0===i.byteLength)return;const n=new yf(new DataView(i)).getInt(),r={start:e+t,size:30*n};i=await this.file.read(r.start,r.size),this.normalizedExpectedValueVectors={},this.normVectorIndex={},await async function i(n,r){const s=new yf(new DataView(r));for(;n-- >0;){if(s.available()<100){n++,t+=s.position;const r=Math.max(1e3,30*n),o={start:e+t,size:r},a=await this.file.read(o.start,o.size);return i.call(this,n,a)}this.parseNormVectorEntry(s)}t+=s.position}.call(this,n,i),this.config.nvi=e.toString()+","+t}async skipExpectedValues(e){const t=this.version,i=new Ff({file:this.file,size:256e3}),n={start:e,size:4},r=await i.read(n.start,n.size),s=new yf(new DataView(r)).getInt();return 0===s?e+4:async function e(n,r){let s={start:n,size:500},o=0,a=n,c=await i.read(s.start,s.size),l=new yf(new DataView(c));l.getString(),l.getString(),l.getInt();const h=t<9?l.getInt():l.getLong();o+=l.position+h*(t<9?8:4),s={start:n+o,size:4},c=await i.read(s.start,s.size),l=new yf(new DataView(c));const d=l.getInt();return o+=4+d*(4+(t<9?8:4)),r--,0===r?a+o:e(a+o,r)}(e+4,s)}getZoomIndexForBinSize(e,t){let i;if("BP"===(t=t||"BP"))i=this.bpResolutions;else{if("FRAG"!==t)throw new Error("Invalid unit: "+t);i=this.fragResolutions}for(let t=0;t<i.length;t++)if(i[t]===e)return t;return-1}parseNormVectorEntry(e){const t=e.getString(),i=e.getInt(),n=e.getString(),r=e.getInt(),s=e.getLong(),o=this.version<9?e.getInt():e.getLong(),a=t+"_"+i+"_"+n+"_"+r;this.normalizationTypes.includes(t)||this.normalizationTypes.push(t),this.normVectorIndex[a]={filePosition:s,size:o}}getFileChrName(e){return this.chrAliasTable.hasOwnProperty(e)?this.chrAliasTable[e]:e}}function Rf(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}class Df{constructor(e,t,i,n){this.blockNumber=e,this.zoomData=t,this.records=i,this.idx=n}}class Tf{constructor(){this.resolution=void 0,this.map=new If(6)}set(e,t,i){this.resolution!==e&&this.map.clear(),this.resolution=e,this.map.set(t,i)}get(e,t){return this.resolution===e?this.map.get(t):void 0}has(e,t){return this.resolution===e&&this.map.has(t)}}function Lf(e,t){const i=e.map((e=>e.counts));i.sort((function(e,t){return e-t}));return i[Math.floor(t/100*e.length)]}class zf{constructor(e,t){this.config=e,this.genome=t,this.hicFile=e._hicFile?e._hicFile:new Mf(e),e._hicFile=void 0}async getHeader(){return await this.hicFile.init(),this.hicFile}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){this.hicFile.initialized||await this.hicFile.init();const s=this.hicFile.bpResolutions,o=s[s.length-1];return(await this.hicFile.getContactRecords(void 0,{chr:e,start:t,end:i},{chr:"celltype",start:0,end:1e8},"BP",o)).map((t=>{const i=t.bin1*o;return{chr:e,start:i,end:i+o,value:t.counts,sample:t.bin2.toString()}}))}supportsWholeGenome(){return!1}}function Hf(e,t){const i=new Set(e.attributeNames),n=t[0];if(void 0===e.getAttributes(n))return!1;{const t=Object.keys(e.getAttributes(n));for(const e of t)if(!1===i.has(e))return!1}return!0}class Pf extends Hl{#F=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),this.type=e.type||"seg","maf"===this.type&&(this.type="mut"),this.isLog=e.isLog,this.displayMode=e.displayMode||"EXPANDED",this.height=e.height||300,this.maxHeight=e.maxHeight||500,this.squishedRowHeight=e.sampleSquishHeight||e.squishedRowHeight||2,this.expandedRowHeight=e.sampleExpandHeight||e.expandedRowHeight||13,this.sampleHeight=this.squishedRowHeight,this.sampleKeys=[],e.samples){for(let t of e.samples)this.sampleKeys.push(t);this.explicitSamples=!0}if(e.color)this.color=e.color;else if(e.colorTable)this.colorTable=new ao(e.colorTable);else switch(this.type){case"mut":this.colorTable=new ao(qf);break;case"shoebox":e.colorScale&&(this.sbColorScale=gf.parse(e.colorScale));break;default:this.posColorScale=new uf(e.posColorScale||Of),this.negColorScale=new uf(e.negColorScale||Uf)}const t=Object.assign({},this.config);t.maxWGCount=t.maxWGCount||Number.MAX_SAFE_INTEGER,"shoebox"===this.type?(this.featureSource=new zf(t,this.browser.genome),this.height=e.height||500,this.maxHeight=e.maxHeight||800,this.isLog=!1,this.squishedRowHeight=e.squishedRowHeight||1,this.displayMode=e.displayMode||"SQUISHED",this.visibilityWindow=void 0===e.visibilityWindow?1e6:e.visibilityWindow):this.featureSource=Ad(t,this.browser.genome),this.initialSort=e.sort}async postInit(){"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader(),this.disposed)||this.header&&this.setTrackProperties(this.header)}menuItemList(){const e=[];if(!0===Hf(this.browser.sampleInfo,this.sampleKeys)){e.push("<hr/>"),e.push("Sort by attribute:");for(const n of this.browser.sampleInfo.attributeNames){if(this.sampleKeys.some((e=>{const t=this.browser.sampleInfo.getAttributes(e);return t&&t[n]}))){const r=Bt("<div>");function s(){const e=this.#F.get(n)||1;this.sortByAttribute(n,e),this.#F.set(n,-1*e),this.config.sort={option:"ATTRIBUTE",attribute:n,direction:1===e?"ASC":"DESC"}}r.html(`&nbsp;&nbsp;${n.split(Uu.emptySpaceReplacement).join(" ")}`),e.push({object:r,click:s})}}}const t={SQUISHED:"Squish",EXPANDED:"Expand",FILL:"Fill"};if("shoebox"===this.type&&this.sbColorScale){function o(e){this.browser.inputDialog.present({label:"Color Scale Threshold",value:this.sbColorScale.threshold,callback:()=>{const e=Number(this.browser.inputDialog.value,10);e&&(this.sbColorScale.setThreshold(e),this.trackView.repaintViews())}},e)}e.push("<hr/>"),e.push({object:Bt("<div>Set color scale threshold</div>"),dialog:o})}e.push("<hr/>"),e.push("DisplayMode:");const i="seg"===this.type||"shoebox"===this.type?["SQUISHED","EXPANDED","FILL"]:["SQUISHED","EXPANDED"];for(let a of i){const c=Dl(t[a],a===this.displayMode);e.push({object:Bt(c),click:function(){this.displayMode=a,this.config.displayMode=a,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.trackView.moveScroller(this.trackView.sampleNameViewport.trackScrollDelta)}})}return e}hasSamples(){return!0}getSamples(){return{names:this.sampleKeys,height:this.sampleHeight,yOffset:0}}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:t,end:i});if(this.updateSampleKeys(n),this.initialSort){const e=this.initialSort;if(void 0===e.option||"VALUE"===e.option.toUpperCase())this.sortByValue(e,n);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="DESC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return n}draw({context:e,pixelTop:t,pixelWidth:i,pixelHeight:n,features:r,bpPerPixel:s,bpStart:o}){if(xo.fillRect(e,0,t,i,n,{fillStyle:"rgb(255, 255, 255)"}),r&&r.length>0){if(this.checkForLog(r),"shoebox"===this.type&&!this.sbColorScale){const e=this.featureSource.hicFile.percentile95||2e3;this.sbColorScale=new gf({threshold:e,r:0,g:0,b:255})}const a={};let c;switch(this.sampleKeys.forEach((function(e,t){a[e]=t})),this.displayMode){case"FILL":this.sampleHeight=n/this.sampleKeys.length,c=0;break;case"SQUISHED":this.sampleHeight=this.squishedRowHeight,c=0;break;default:this.sampleHeight=this.expandedRowHeight,c=1}const l=this.sampleHeight;for(let e of r)e.pixelRect=void 0;const h=t+n,d=o+i*s+1,u=s;this.sampleYStart=void 0;for(let i of r){if(i.end<o||i.start>d)continue;const n=i.sampleKey||i.sample;i.row=a[n];const r=i.row*l+c;void 0===this.sampleYStart&&(this.sampleYStart=r);if(r+l<t||r>h)continue;const s=Math.max(i.start,o);let f=Math.round((s-o)/u);const p=Math.min(i.end,d),g=Math.round((p-o)/u);let m,w,b=Math.max(1,g-f);if(this.color?m="function"==typeof this.color?this.color(i):this.color:this.colorTable&&(m=this.colorTable.getColor(i.value.toLowerCase())),"mut"===this.type)w=l-2*c,b<3&&(b=3,f-=1);else if("shoebox"===this.type){m=this.sbColorScale.getColor(i.value);let e=l;if(l<.25){const t=.1+2*Math.abs(t.value);e=Math.min(1,t*l)}w=e-2*c}else{let e=i.value;this.isLog||(e=ys.log2(e/2)),m=e<-.1?this.negColorScale.getColor(e):e>.1?this.posColorScale.getColor(e):"white";let t=l;if(l<.25){const i=.1+2*Math.abs(e);t=Math.min(1,i*l)}w=t-2*c}i.pixelRect={x:f,y:r,w:b,h:w},e.fillStyle=m,e.fillRect(f,r,b,w)}}}checkForLog(e){if(void 0===this.isLog){this.isLog=!1;for(let t of e)if(t.value<0)return void(this.isLog=!0)}}computePixelHeight(e){if(!e)return 0;const t="SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight;return this.updateSampleKeys(e),this.sampleKeys.length*t}async sortByValue(e,t){const i=e.chr;let n,r;if(e.position?(n=e.position-1,r=n+1):(n=e.start,r=e.end),t||(t=await this.featureSource.getFeatures({chr:i,start:n,end:r})),!t)return;this.updateSampleKeys(t);const s={},o="ASC"===e.direction?1:-1,a=()=>{const e=r-n+1;for(let i of t){if(i.end<n)continue;if(i.start>r)break;const t=Math.max(n,i.start),o=(Math.min(r,i.end)-t)/e,a=i.sampleKey||i.sample,c=s[a]||0;s[a]=c+o*i.value}this.sampleKeys.sort((function(e,t){let i=s[e],n=s[t];return i||(i=o*Number.MAX_VALUE),n||(n=o*Number.MAX_VALUE),i===n?0:i>n?o:-1*o}))},c=()=>{for(let e of t){if(e.end<n)continue;if(e.start>r)break;const t=e.sampleKey||e.sample;(!s.hasOwnProperty(t)||e.value.localeCompare(s[t])>0)&&(s[t]=e.value)}this.sampleKeys.sort((function(e,t){let i=s[e]||"",n=s[t]||"";return o*i.localeCompare(n)}))};"mut"===this.type?c():a(),this.trackView.repaintViews()}sortByAttribute(e,t){this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}clickedFeatures(e){const t=super.clickedFeatures(e),i=e.y;return t.filter((function(e){const t=e.pixelRect;return t&&i>=t.y&&i<=t.y+t.h}))}hoverText(e){const t=this.clickedFeatures(e);if(t&&t.length>0)return`${t[0].sample}: ${t[0].value}`}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){i.length>0&&(i.push("<hr/>"),i.push("<hr/>"));const t=e._f||e,n="function"==typeof t.popupData?t.popupData(this.type,this.browser.genome.id):this.extractPopupData(t);Array.prototype.push.apply(i,n)}return i}contextMenuItemList(e){const t=e.genomicLocation,i=t=>{const i=e.viewport.cachedFeatures;this.sortByValue(t,i)},n=e.referenceFrame.toBP(2.5);return["DESC","ASC"].map((r=>{const s="DESC"===r?"descending":"ascending";return{label:"seg"===this.type||"shoebox"===this.type?`Sort by value (${s})`:`Sort by type (${s})`,click:()=>{const s={option:"VALUE",direction:r,chr:e.referenceFrame.chr,start:Math.floor(t-n),end:Math.floor(t+n)};i(s),this.config.sort=s}}}))}get supportsWholeGenome(){return(!1===this.config.indexed||!this.config.indexURL)&&!1!==this.config.supportsWholeGenome}updateSampleKeys(e){if(this.explicitSamples)return;const t=new Set(this.sampleKeys);for(let i of e){const e=i.sampleKey||i.sample;t.has(e)||(this.sampleKeys.push(e),t.add(e))}}}const Of={low:.1,lowR:255,lowG:255,lowB:255,high:1.5,highR:255,highG:0,highB:0},Uf={low:-1.5,lowR:0,lowG:0,lowB:255,high:-.1,highR:255,highG:255,highB:255},qf={indel:"rgb(0,200,0)","targeted region":"rgb(236,155,43)",truncating:"rgb(\t150,0,0)","non-coding transcript":"rgb(0,0,150)",synonymous:"rgb(109,165,95)",silent:"rgb(109,135,80)",missense_mutation:"rgb(72,130,187)",missense:"rgb(72,130,187)","splice site":"rgb(143,83,155)",splice_region:"rgb(143,83,155)",nonsense:"rgb(216, 57,81)",nonsense_mutation:"rgb(216, 57,81)",frame_shift_del:"rgb(226,135,65)",frame_shift_ins:"rgb(226,135,65)",in_frame_del:"rgb(247,235,94)",in_frame_ins:"rgb(247,235,94)","*other*":"rgb(159,91,50)"};class Qf{constructor(e){this.paired=!0,this.firstAlignment=e,this.chr=e.chr,this.readName=e.readName,e.start<e.mate.position?(this.start=e.start,this.scStart=e.scStart,this.connectingStart=e.start+e.lengthOnRef,this.connectingEnd=e.mate.position):(this.start=e.mate.position,this.scStart=this.start,this.connectingStart=e.mate.position,this.connectingEnd=e.start),this.end=Math.max(e.mate.position,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start;let t=Math.max(this.end,e.scStart+e.scLengthOnRef);this.scLengthOnRef=t-this.scStart}setSecondAlignment(e){this.secondAlignment=e;const t=this.firstAlignment;e.start>t.start?this.connectingEnd=e.start:this.connectingStart=e.start+e.lengthOnRef,this.start=Math.min(t.start,e.start),this.end=Math.max(t.start+t.lengthOnRef,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start,this.scStart=Math.min(t.scStart,e.scStart);const i=Math.max(t.scStart+t.scLengthOnRef,e.scStart+e.scLengthOnRef);this.scLengthOnRef=i-this.scStart}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}alignmentContaining(e,t){return this.firstAlignment.containsLocation(e,t)?this.firstAlignment:this.secondAlignment&&this.secondAlignment.containsLocation(e,t)?this.secondAlignment:void 0}popupData(e){let t=this.firstAlignment.popupData(e);return this.secondAlignment&&(t.push("-------------------------------"),t=t.concat(this.secondAlignment.popupData(e))),t}isPaired(){return!0}isMateMapped(){return!0}isProperPair(){return this.firstAlignment.isProperPair()}get fragmentLength(){return Math.abs(this.firstAlignment.fragmentLength)}get firstOfPairStrand(){return this.firstAlignment.firstOfPairStrand}get pairOrientation(){return this.firstAlignment.pairOrientation}hasTag(e){return this.firstAlignment.hasTag(e)||this.secondAlignment&&this.secondAlignment.hasTag(e)}getGroupValue({option:e,tag:t}){switch(e){case"strand":return this.isNegativeStrand()?"-":"+";case"FIRST_IN_PAIR_STRAND":return this.isPaired()?this.isFirstOfPair()?this.isNegativeStrand()?"-":"+":this.isSecondOfPair()?this.isNegativeStrand()?"+":"-":void 0:void 0;case"START":return this.start;case"INSERT_SIZE":return this.fragmentLength;case"MATE_CHR":return this.mate?this.mate.chr:void 0;case"MQ":return this.mq;case"ALIGNED_READ_LENGTH":return this.lengthOnRef;case"TAG":return this.tags()[t];case"PHASE":return this.tags().HP;case"READ_ORDER":return this.isPaired()&&this.isFirstOfPair()?"FIRST":this.isPaired()&&this.isSecondOfPair()?"SECOND":"";default:return}}}class Vf{static instances=new Map;static getKey(e,t,i){const n=""+e+t+i;return Vf.instances.has(n)||Vf.instances.set(n,new Vf(e,t,i)),Vf.instances.get(n)}constructor(e,t,i){this.base=e,this.strand=t,this.modification=i,this.canonicalBase="+"===this.strand?this.base:ac(this.base)}getCanonicalBase(){}toString(){return""+this.base+this.strand+this.modification}static compare(e,t){const i=e.modification,n=t.modification;return i===n?e.strand.charAt(0)-t.strand.charAt(0):jf.has(i)&jf.has(n)?jf.get(i)-jf.get(n):jf.has(i)?1:jf.has(n)?-1:i>n?1:-1}}const jf=new Map(["NONE_C","NONE_T","NONE_G","NONE_A","m","h","f","c","C","g","e","b","T","U","a","A","o","G","n","N"].map(((e,t)=>[e,t])));class Wf{constructor(e,t,i,n){this.base=e,this.modification=i,this.strand=t,this.likelihoods=n,this.canonicalBase="+"==this.strand?this.base:ac(this.base),this.key=Vf.getKey(e,t,i)}containsPosition(e){return this.likelihoods.has(e)}is5mC(){return this.modification.equals("m")&&("C"===this.base&&"+"===this.strand||"G"===this.base&&"-"===this.strand)}fullName(){return Gf.get(this.modification)||this.modification}}const Gf=new Map;Gf.set("m","5mC"),Gf.set("h","5hmC"),Gf.set("f","5fC"),Gf.set("c","5caC"),Gf.set("g","5hmU"),Gf.set("e","5fU"),Gf.set("b","5caU"),Gf.set("a","6mA"),Gf.set("o","8xoG"),Gf.set("n","Xao"),Gf.set("C","Unknown C"),Gf.set("T","Unknown T"),Gf.set("A","Unknown A"),Gf.set("G","Unknown G"),Gf.set("N","Unknown");const $f=new Map([["m","5mC"],["h","5hmC"],["f","5fC"],["c","5caC"],["g","5hmU"],["e","5fU"],["b","5caU"],["a","6mA"],["o","8xoG"],["n","Xao"],["C","Unknown C"],["T","Unknown T"],["A","Unknown A"],["G","Unknown G"],["N","Unknown"]]);function Kf(e){return $f.has(e)?$f.get(e):"Uknown"}function Yf(e){if(!e)return!1;const t=e.length;if(0==t)return!1;for(let i=0;i<t;i++){const t=e.charAt(i);if(t<"0"||t>"9")return!1}return!0}function Xf(e){return e<0?e+256:e}class Zf{allModifications=new Set;simplexModifications=new Set;maxLikelihoods=new Map;nomodLikelihoods=new Map;lastThreshold;incrementCounts(e){if(!e.blocks)return;const t=e.getBaseModificationSets();if(t)for(let i of e.blocks)if("S"!==i.type)for(let e=0;e<i.len;e++){let n,r=e+i.seqOffset,s=0,o=-1,a=255;for(let e of t){const t=Vf.getKey(e.base,e.strand,e.modification);this.allModifications.add(t);const i=e.likelihoods;if(e.containsPosition(r)){const c=Xf(i.get(r));a-=c,c>o&&(s=e.canonicalBase,o=c,n=t)}}if(0!=s){const t=i.start+e,r=Vf.getKey(s,"+","NONE_"+s);this.allModifications.add(r);const c=(e,t,i,n)=>{let r=n.get(i);r||(r=new Map,n.set(i,r));let s=r.get(e);s||(s=[],r.set(e,s)),s.push(t)};c(t,o,n,this.maxLikelihoods),a>o?c(t,a,r,this.nomodLikelihoods):c(t,o,n,this.nomodLikelihoods)}}}getCount(e,t,i,n){this.lastThreshold=i;const r=255*i,s=n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t);if(!s)return 0;const o=s.get(e);if(o){let e=0;for(let t of o){Xf(t)>=r&&e++}return e}return 0}getLikelihoodSum(e,t,i,n){this.lastThreshold=i;const r=255*i,s=(n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t)).get(e);if(s){let e=0;for(let t of s){const i=Xf(t);i>=r&&(e+=i)}return e}return 0}popupData(e,t){const i=[];i.push("<b>Modifications with likelihood > "+100*this.lastThreshold+"%</b>");for(let n of this.maxLikelihoods.keys()){if(this.maxLikelihoods.get(n).has(e)){let r="basemod2"===t;const s=this.getCount(e,n,this.lastThreshold,r);if(s>0){const t=this.getLikelihoodSum(e,n,this.lastThreshold,r)/s*.3921568,o=Kf(n.modification);i.push(o+" ("+n.base+n.strand+"): "+s+" @ average likelihood "+Math.round(t)+"%")}}}return i}computeSimplex(){const e=new Set(Array.from(this.allModifications).filter((e=>"-"===e.strand)).map((e=>e.modification)));for(let t of this.allModifications)"+"!==t.strand||e.has(t.modification)||(this.simplexModifications.add(t.modification),this.simplexModifications.add("NONE_"+t.getCanonicalBase()))}}class Jf{constructor(){this.alignments=[],this.score=void 0}findAlignment(e,t=!1){const i=(e,i)=>i>=e.start&&i<e.start+(t?e.fragmentLength:e.lengthOnRef);let n;for(let r=0;r<this.alignments.length;r++){const s=this.alignments[r];if(e>=s.start&&e<s.start+(t?s.fragmentLength:s.lengthOnRef)){s.paired?s.firstAlignment&&i(s.firstAlignment,e)?n=s.firstAlignment:s.secondAlignment&&i(s.secondAlignment,e)&&(n=s.secondAlignment):n=s;break}}return n}getSortValue({position:e,option:t,tag:i,sortAsPairs:n},r){t||(t="BASE");const s=this.findAlignment(e,n);if(void 0===s)return Number.MAX_VALUE;switch(t){case"NUCLEOTIDE":case"BASE":return function(e,t,i){let n;const r=Math.floor(i)-t.start;r<t.sequence.length&&(n=t.sequence.charAt(r));if(!n)return 0;const s=e.readBaseAt(i),o=e.readBaseQualityAt(i),a=t.coverageMap,c=Math.floor(i-a.bpStart),l=a.coverage[c];let h=0;if(e.insertions)for(let t of e.insertions)t.start===i&&(h=-l.ins);if(s)if(n=n.toUpperCase(),"N"===s&&0===h)h=2;else if(n!==s&&"="!==s||0!==h){if("X"===s||n!==s){h-=l["pos"+s]+l["neg"+s]+o/1e3}}else h=4-o/1e3;else{const e=l.del;e>0?h-=e:0===h&&(h=1)}return h}(s,r,e);case"strand":return s.strand?1:-1;case"START":return s.start;case"TAG":return s.tags()[i];case"READ_NAME":return s.readName;case"INSERT_SIZE":return-Math.abs(s.fragmentLength);case"GAP_SIZE":return-s.gapSizeAt(e);case"MATE_CHR":return s.mate?s.mate.chr:Number.MAX_VALUE;case"MQ":return void 0===s.mq?Number.MAX_VALUE:-s.mq;case"ALIGNED_READ_LENGTH":return-s.lengthOnRef;default:return Number.MAX_VALUE}}}var ep={fr:{F1R2:"LR",F2R1:"LR",F1F2:"LL",F2F1:"LL",R1R2:"RR",R2R1:"RR",R1F2:"RL",R2F1:"RL"},rf:{R1F2:"LR",R2F1:"LR",R1R2:"LL",R2R1:"LL",F1F2:"RR",F2F1:"RR",F1R2:"RL",F2R1:"RL"},ff:{F2F1:"LR",R1R2:"LR",F2R1:"LL",R1F2:"LL",R2F1:"RR",F1R2:"RR",R2R1:"RL",F1F2:"RL"}};class tp{#v=[];baseModificationKeys=new Set;constructor(e,t,i,{samplingWindowSize:n,samplingDepth:r,alleleFreqThreshold:s,colorBy:o}){this.alleleFreqThreshold=void 0===s?.2:s,this.samplingWindowSize=n||100,this.samplingDepth=r||1e3,this.chr=e,this.start=Math.floor(t),this.end=Math.ceil(i),this.length=i-t,this.coverageMap=new np(e,t,i,this.alleleFreqThreshold),this.downsampledIntervals=[],o&&o.startsWith("basemod")&&(this.baseModCounts=new Zf),this.alignments=[],this.pairsCache=new Map,this.downsampledReads=new Set,this.currentBucket=new ip(this.start,this.start+this.samplingWindowSize,this),this.hasPairs=!1}pack({viewAsPairs:e,showSoftClips:t,expectedPairOrientation:i,groupBy:n,displayMode:r}){let s=this.allAlignments();s=e?function(e){const t=new Map,i=e.map((e=>{if(ap(e)){let i=t.get(e.readName);return i?(i.setSecondAlignment(e),t.delete(e.readName),i):(i=new Qf(e),t.set(e.readName,i),i)}return e}));return i}(s):function(e){return e.flatMap((e=>e instanceof Qf?[e.firstAlignment,e.secondAlignment].filter(Boolean):[e]))}(s),this.packAlignmentRows(s,t,i,n,r),this.alignments&&delete this.alignments}packAlignmentRows(e,t,i,n,r){this.#v=[];const s=(e,i)=>{e.sort((function(e,i){return t?e.scStart-i.scStart:e.start-i.start}));const n=new op(i);let r,s=0,o=0;const a=new Set,c=()=>{r=new Jf,n.push(r),s=0,o=0,a.clear()};for(c();e.length>0;)if(o>=0&&o<e.length){const i=e[o];a.add(i),r.alignments.push(i),s=t?i.scStart+i.scLengthOnRef+2:i.start+i.lengthOnRef+2,o=cp(e,(e=>(t?e.scStart:e.start)>s),o)}else e=e.filter((e=>!a.has(e))),c();return n},o=(e,t)=>{e.sort((function(e,t){return e.start-t.start}));const i=new op(t),{start:n,end:r}=this.viewport.genomicRange();for(let t of e)if(t.end<n||t.start>r)this.#v.push(t);else{const e=new Jf;e.alignments.push(t),i.push(e)}return i};if(!e||0===e.length)return new Map;{const t=new Map;if(n)for(let r of e){const e=lp(r,n,i)||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}else t.set("",e);const a=new Map,c=Array.from(t.keys()).sort(function(e){switch(e){case"pairOrientation":return function(){const e=["LL","RR","RL","LR",""];return(t,i)=>e.indexOf(t)-e.indexOf(i)}();case"strand":case"firstOfPairStrand":return up;default:return e&&e.startsWith("base:")?dp:fp}}(n));for(let e of c){const i=t.get(e),n="FULL"===r?o(i,e):s(i,e);a.set(e,n)}this.packedGroups=a}}push(e){this.hasPairs=this.hasPairs||e.isPaired(),this.coverageMap.incCounts(e);const t=e.getBaseModificationSets();if(t)for(let e of t)this.baseModificationKeys.add(e.key);this.baseModCounts&&this.baseModCounts.incrementCounts(e),this.downsampledReads.has(e.readName)?this.currentBucket.downsampledCount++:(e.start>=this.currentBucket.end&&(this.finishBucket(),this.currentBucket=new ip(e.start,e.start+this.samplingWindowSize,this)),this.currentBucket.addAlignment(e))}finish(){void 0!==this.currentBucket&&this.finishBucket(),this.hasAlignments=this.alignments.length>0,this.alignments.sort((function(e,t){return e.start-t.start})),this.baseModCounts&&this.baseModCounts.computeSimplex(),delete this.currentBucket,delete this.pairsCache,delete this.downsampledReads}contains(e,t,i){return this.chr===e&&this.start<=t&&this.end>=i}hasDownsampledIntervals(){return this.downsampledIntervals&&this.downsampledIntervals.length>0}finishBucket(){this.alignments=this.alignments.concat(this.currentBucket.alignments),this.currentBucket.downsampledCount>0&&this.downsampledIntervals.push(new sp(this.currentBucket.start,this.currentBucket.end,this.currentBucket.downsampledCount))}allAlignments(){if(this.alignments)return this.alignments;if(this.packedGroups){const e=Array.from(this.packedGroups.values()).flatMap((e=>e.rows.flatMap((e=>e.alignments))));if(this.#v&&this.#v.length>0)for(let t of this.#v)e.push(t);return e}return[]}getMax(e,t){return this.coverageMap.getMax(e,t)}sortRows(e){if(this.packedGroups)for(let t of this.packedGroups.values())t.sortRows(e,this)}}class ip{constructor(e,t,{samplingDepth:i,downsampledReads:n,pairsCache:r}){this.start=e,this.end=t,this.alignments=[],this.downsampledCount=0,this.samplingDepth=i,this.downsampledReads=n,this.pairsCache=r,this.hasPairs=!1}addAlignment(e){this.hasPairs=this.hasPairs||e.isPaired();const t=this.hasPairs?Math.ceil(this.samplingDepth/2):this.samplingDepth;if(ap(e)){const t=this.pairsCache.get(e.readName);if(t)return t.setSecondAlignment(e),void this.pairsCache.delete(e.readName)}if(this.alignments.length<t)if(ap(e)){const t=new Qf(e);this.pairsCache.set(e.readName,t),this.alignments.push(t)}else this.alignments.push(e);else{const i=Math.floor(Math.random()*(t+this.downsampledCount-1));if(i<t){const t=this.alignments[i];if(this.pairsCache.has(t.readName)&&this.pairsCache.delete(t.readName),ap(e)){const t=new Qf(e);this.pairsCache.set(e.readName,t),this.alignments[i]=t}else this.alignments[i]=e;this.downsampledReads.add(t.readName)}else this.downsampledReads.add(e.readName);this.downsampledCount++}}}class np{constructor(e,t,i,n){this.chr=e,this.bpStart=t,this.length=i-t,this.coverage=new Array(this.length),this.maximum=0,this.threshold=n,this.qualityWeight=!0}getMax(e,t){let i=0;const n=this.coverage.length;for(let r=0;r<n;r++){const n=this.bpStart+r;if(n>t)break;const s=this.coverage[r];n>=e&&s&&(i=Math.max(i,s.total))}return i}incCounts(e){var t=this;if(void 0===e.blocks?i(e):e.blocks.forEach((function(e){i(e)})),e.gaps)for(let i of e.gaps)if("D"===i.type){const e=i.start-t.bpStart;for(let n=e;n<e+i.len;n++)n<0||(this.coverage[n]||(this.coverage[n]=new rp(t.threshold)),this.coverage[n].del++)}if(e.insertions)for(let i of e.insertions){const e=i.start-this.bpStart;e<0||(this.coverage[e]||(this.coverage[e]=new rp(t.threshold)),this.coverage[e].ins++)}function i(i){if("S"===i.type)return;const n=e.seq,r=e.qual,s=i.seqOffset;for(let o=i.start-t.bpStart,a=0;a<i.len;o++,a++){t.coverage[o]||(t.coverage[o]=new rp(t.threshold));const i=null==n?"N":n.charAt(s+a),c=e.strand?"pos"+i:"neg"+i,l=r&&s+a<r.length?r[s+a]:30;t.coverage[o][c]+=1,t.coverage[o]["qual"+i]+=l,t.coverage[o].total+=1,t.coverage[o].qual+=l,t.maximum=Math.max(t.coverage[o].total,t.maximum)}}}getPosCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.posA;case"C":case"c":return n.posC;case"T":case"t":return n.posT;case"G":case"g":return n.posG;case"N":case"n":return n.posN;default:return 0}}getNegCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.negA;case"C":case"c":return n.negC;case"T":case"t":return n.negT;case"G":case"g":return n.negG;case"N":case"n":return n.negN;default:return 0}}getCount(e,t){return this.getPosCount(e,t)+this.getNegCount(e,t)}getTotalCount(e){const t=e-this.bpStart;return t>=0&&t<this.coverage.length?this.coverage[t].total:0}}class rp{constructor(e){this.qualityWeight=!0,this.posA=0,this.negA=0,this.posT=0,this.negT=0,this.posC=0,this.negC=0,this.posG=0,this.negG=0,this.posN=0,this.negN=0,this.pos=0,this.neg=0,this.qualA=0,this.qualT=0,this.qualC=0,this.qualG=0,this.qualN=0,this.qual=0,this.total=0,this.del=0,this.ins=0,this.threshold=e}hoverText(){const e=this.posA+this.posT+this.posC+this.posG+this.posN,t=this.negA+this.negT+this.negC+this.negG+this.negN;return`${this.total} (${e}+, ${t}-)`}isMismatch(e){const t=this.threshold*(this.qualityWeight&&this.qual?this.qual:this.total);let i=0;for(let t of["A","T","C","G"])t!==e&&(i+=this.qualityWeight&&this.qual?this["qual"+t]:this["pos"+t]+this["neg"+t]);return i>=t}}class sp{constructor(e,t,i){this.start=e,this.end=t,this.counts=i}popupData(e){return[{name:"start",value:Math.floor(this.start+1)},{name:"end",value:this.end},{name:"# downsampled:",value:this.counts}]}}class op{pixelTop=0;pixelBottom=0;rows=[];constructor(e){this.name=this.name}push(e){this.rows.push(e)}get length(){return this.rows.length}sortRows(e,t){const i=[],n=[];for(let t of this.rows){void 0!==t.findAlignment(e.position,e.sortAsPairs)?i.push(t):n.push(t)}i.sort(((i,n)=>{const r=e.direction,s=i.getSortValue(e,t),o=n.getSortValue(e,t);if(void 0===o&&void 0!==o)return 1;if(void 0!==s&&void 0===o)return-1;const a=s>o?1:s<o?-1:0;return!0===r?a:-a}));for(let e of n)i.push(e);this.rows=i}}function ap(e){return e.isPaired()&&e.mate&&e.isMateMapped()&&e.chr===e.mate.chr&&(e.isFirstOfPair()||e.isSecondOfPair())&&!(e.isSecondary()||e.isSupplementary())}function cp(e,t,i){let n=i-1,r=e.length;for(;1+n<r;){const i=n+(r-n>>1);t(e[i])?r=i:n=i}return r}function lp(e,t,i){let n,r,s;if(t.startsWith("tag:"))n=t.substring(4),t="tag";else if(t.startsWith("base:")){const e=t.split(":");3===e.length&&(t="base",r=e[1],s=Number.parseInt(e[2].replaceAll(",",""))-1)}switch(t){case"strand":return e.strand?"+":"-";case"firstOfPairStrand":const t=e.firstOfPairStrand;return void 0===t?"":t?"+":"-";case"mateChr":return e.mate&&e.isMateMapped()?e.mate.chr:"";case"pairOrientation":return ep[i][e.pairOrientation]||"";case"chimeric":return e.tags().SA?"chimeric":"";case"supplementary":return e.isSupplementary?"supplementary":"";case"readOrder":return e.isPaired()&&e.isFirstOfPair()?"first":e.isPaired()&&e.isSecondOfPair()?"second":"";case"phase":return e.tags().HP||"";case"tag":return e.tags()[n]||"";case"base":if(e.chr===r&&e.start<=s&&e.end>s){const t=e.readBaseAt(s);return t||"GAP"}return"";default:return}}const hp=new Map([["A",1],["T",2],["C",3],["G",4],["N",5],["GAP",5],["",7]]);function dp(e,t){return hp.has(e)&&hp.has(t)?hp.get(e)-hp.get(t):e.localeCompare(t,void 0,{sensitivity:"base"})}function up(e,t){return e===t?0:e&&t?-e.localeCompare(t):e?1:-1}function fp(e,t){if(e||t){if(e){if(t){if(e===t)return 0;if(ja(e)&&(ja(t),1))return Number.parseFloat(e)-Number.parseFloat(t);{let i=e.toString(),n=t.toString();return i.localeCompare(n,void 0,{sensitivity:"base"})}}return-1}return 1}return 0}class pp{constructor(e){const t=e.split(",");this.chr=t[0],this.start=parseInt(t[1]),this.strand=t[2].charAt(0),this.mapQ=parseInt(t[4]),this.numMismatches=parseInt(t[5]),this.lenOnRef=function(e){let t=0,i="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(r>47&&r<58)i+=e.charAt(n);else{switch(r){case 78:case 68:case 77:case 61:case 88:t+=parseInt(i.toString())}i=""}}return t}(t[3])}printString(){return this.chr+":"+Rt(this.start)+"-"+Rt(this.start+this.lenOnRef)+" ("+this.strand+") = "+Rt(this.lenOnRef)+"bp @MAPQ: "+this.mapQ+" NM: "+this.numMismatches}}function gp(e){return e.split(";").filter((e=>e.length>0)).map((e=>new pp(e)))}const mp={c:1,C:1,s:2,S:2,i:4,I:4,f:4};class wp{constructor(){this.hidden=!1}isMapped(){return!(4&this.flags)}isPaired(){return!!(1&this.flags)}isProperPair(){return!!(2&this.flags)}isFirstOfPair(){return!!(64&this.flags)}isSecondOfPair(){return!!(128&this.flags)}isSecondary(){return!!(256&this.flags)}isSupplementary(){return!!(2048&this.flags)}isFailsVendorQualityCheck(){return!!(512&this.flags)}isDuplicate(){return!!(1024&this.flags)}isMateMapped(){return!(8&this.flags)}isNegativeStrand(){return!!(16&this.flags)}isMateNegativeStrand(){return!!(32&this.flags)}hasTag(e){return(this.tagDict||vp(this.tagBA)).hasOwnProperty(e)}tags(){return this.tagDict||(this.tagBA?(this.tagDict=vp(this.tagBA),this.tagBA=void 0):this.tagDict={}),this.tagDict}getTag(e){return this.tags()[e]}get firstOfPairStrand(){if(this.isPaired()){if(this.isFirstOfPair())return this.strand;if(this.isMateMapped())return this.mate.strand}}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}popupData(e){const t=[];if(e=Math.floor(e),this.insertions){const n=this.seq;for(let r of this.insertions){var i=r.start;if(e===i||e===i-1)return t.push({name:"Insertion",value:n.substr(r.seqOffset,r.len)}),t.push({name:"Location",value:i}),t}}t.push({name:"Read Name",value:this.readName}),t.push("<hr/>"),t.push({name:"Alignment Start",value:Rt(1+this.start),borderTop:!0}),t.push({name:"Read Strand",value:!0===this.strand?"(+)":"(-)",borderTop:!0});let n=this.cigar;if(n&&n.length>50){const e=25;n=`${n.substring(0,e-2)} ... ${n.substring(n.length-e+2)}`}t.push({name:"Cigar",value:n}),t.push({name:"Mapping Quality",value:this.mq}),t.push({name:"Secondary",value:a(this.isSecondary())}),t.push({name:"Supplementary",value:a(this.isSupplementary())}),t.push({name:"Duplicate",value:a(this.isDuplicate())}),t.push({name:"Failed QC",value:a(this.isFailsVendorQualityCheck())}),this.isPaired()&&(t.push("<hr/>"),t.push({name:"First in Pair",value:!this.isSecondOfPair(),borderTop:!0}),t.push({name:"Mate is Mapped",value:a(this.isMateMapped())}),this.pairOrientation&&t.push({name:"Pair Orientation",value:this.pairOrientation}),this.isMateMapped()&&(t.push({name:"Mate Chromosome",value:this.mate.chr}),t.push({name:"Mate Start",value:this.mate.position+1}),t.push({name:"Mate Strand",value:!0===this.mate.strand?"(+)":"(-)"}),t.push({name:"Insert Size",value:this.fragmentLength})));const r=this.tags();if(r.hasOwnProperty("SA")){t.push("<hr/>"),t.push({name:"Supplementary Alignments",value:""});const e=gp(r.SA);if(e){t.push("<ul>");for(let i of e)t.push(`<li>${i.printString()}</li>`);t.push("</ul>")}}const s=new Set(["SA","MD"]);t.push("<hr/>");for(let e in r)s.has(e)||t.push({name:e,value:r[e]});t.push({name:"Hidden Tags",value:"SA, MD"}),t.push("<hr/>"),t.push({name:"Genomic Location: ",value:Rt(1+e)}),t.push({name:"Read Base:",value:this.readBaseAt(e)}),t.push({name:"Base Quality:",value:this.readBaseQualityAt(e)});const o=this.getBaseModificationSets();if(o){const i=this.positionToReadIndex(e);if(void 0!==i){let e=!1;for(let n of o)if(n.containsPosition(i)){e||(t.push("<hr/>"),t.push("<b>Base modifications:</b>"),e=!0);const r=Math.round(100/255*Xf(n.likelihoods.get(i)));t.push(`${n.fullName()} @ likelihood = ${r}%`)}}}return t;function a(e){return e?"Yes":"No"}}readBaseAt(e){const t=Fp(this.blocks,e);if(t){if("*"===this.seq)return"*";{const i=t.seqIndexAt(e);return this.seq[i]}}}readBaseQualityAt(e){const t=Fp(this.blocks,e);if(t){if("*"===this.qual)return 30;{const i=t.seqIndexAt(e);return i>=0&&this.qual&&i<this.qual.length?this.qual[i]:30}}}gapSizeAt(e){if(this.gaps)for(let t of this.gaps)if(e>=t.start&&e<t.start+t.len)return t.len;return 0}softClippedBlocks(){let e,t,i;for(let n of this.blocks)"S"===n.type?i?t=n:e=n:"H"!==n.type&&(i=!0);return{left:e,right:t}}getBaseModificationSets(){if(this.tags(),!this.baseModificationSets&&(this.tagDict.MM||this.tagDict.Mm)){const e=this.tagDict.MM||this.tagDict.Mm,t=this.tagDict.ML||this.tagDict.Ml;!Mt(e)||t&&!Array.isArray(t)||(0===e.length?this.baseModificationSets=bp:this.baseModificationSets=function(e,t,i,n){n&&(i=lc(i));const r=[],s=e.split(";");let o=0;for(let e of s){const s=e.split(","),a=s[0].charAt(0),c=s[0].charAt(1),l=s[0].endsWith(".");if(1==s.length);else{const e=s[0].endsWith(".")||s[0].endsWith("?")?s[0].substring(2,s[0].length-1):s[0].substring(2);let h=[];if(e.length>1)if(Yf(e))h.push(e);else for(let t=0;t<e.length;t++)h.push(e.substring(t,t+1));else h.push(e);const d=new Map;for(let e of h)d.set(e,new Map);let u=1,f=Number.parseInt(s[u++]),p=0,g=0;for(;p<i.length;){if("N"===a||i[p]===a){const e=n?i.length-1-p:p;if(g===f){for(let i of h){const n=t?t[o++]:255;d.get(i).set(e,n)}if(u<s.length)f=Number.parseInt(s[u++]),g=0;else{if(!l)break;f=-1}}else{if(l)for(let t of h)d.get(t).set(e,0);g++}}p++}for(let e of h)r.push(new Wf(a,c,e,d.get(e)))}}return r}(e,t,this.seq,this.isNegativeStrand()))}return this.baseModificationSets}getGroupValue(e,t,i){const n=this;switch(e){case"strand":return n.strand?"+":"-";case"firstOfPairStrand":const e=n.firstOfPairStrand;return void 0===e?"":e?"+":"-";case"mateChr":return n.mate&&n.isMateMapped()?n.mate.chr:"";case"pairOrientation":return ep[i][n.pairOrientation]||"";case"chimeric":return n.tags().SA?"chimeric":"";case"supplementary":return n.isSupplementary?"supplementary":"";case"readOrder":return n.isPaired()&&n.isFirstOfPair()?"first":n.isPaired()&&n.isSecondOfPair()?"second":"";case"phase":return n.tags().HP||"";case"tag":return n.tags()[t]||"";default:return}}positionToReadIndex(e){const t=Fp(this.blocks,e);return t?e-t.start+t.seqOffset:void 0}}const bp=new Set;function Fp(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(t>=n.start&&t<n.start+n.len)return n}}function vp(e){let t=0;const i=e.length,n={};for(;t<i;){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const s=String.fromCharCode(e[t++]);let o;if("A"===s)o=String.fromCharCode(e[t]),t++;else if("i"===s||"I"===s)o=yp(e,t),t+=4;else if("c"===s)o=_p(e,t),t++;else if("C"===s)o=xp(e,t),t++;else if("s"===s||"S"===s)o=Ap(e,t),t+=2;else if("f"===s)o=Cp(e,t),t+=4;else if("Z"===s)for(o="";;){var r=e[t++];if(0===r)break;o+=String.fromCharCode(r)}else{if("B"!==s){o="Error unknown type: "+s,n[i]=o;break}{const r=String.fromCharCode(e[t++]);let s=mp[r];if(void 0===s){n[i]=`Error: unknown element type '${r}'`;break}const a=yp(e,t);t+=4;const c=t+a*s;o=[];const l=new DataView(e.buffer);for(;t<c;){switch(r){case"c":o.push(l.getInt8(t));break;case"C":o.push(l.getUint8(t));break;case"s":o.push(l.getInt16(t));break;case"S":o.push(l.getUint16(t));break;case"i":o.push(l.getInt32(t));break;case"I":o.push(l.getUint32(t));break;case"f":o.push(l.getFloat32(t))}t+=s}}}n[i]=o}return n}function yp(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Ap(e,t){return e[t+1]<<8|e[t]}function Cp(e,t){return new DataView(e.buffer).getFloat32(t)}function _p(e,t){return new DataView(e.buffer).getInt8(t)}function xp(e,t){return new DataView(e.buffer).getUint8(t)}class kp{constructor(e){e&&Object.assign(this,e)}seqIndexAt(e){return Math.floor(e)-this.start+this.seqOffset}}class Ip{constructor(e){e||(e={}),this.vendorFailed=e.vendorFailed=!1!==e.vendorFailed,this.duplicate=e.duplicate=!1!==e.duplicate,this.secondary=e.secondary||!1,this.supplementary=e.supplementary||!1,this.mq=e.mq||0,e.readgroups&&(this.readgroups=new Set(e.readgroups))}pass(e){if(!e.isMapped())return!1;if(this.vendorFailed&&e.isFailsVendorQualityCheck())return!1;if(this.duplicate&&e.isDuplicate())return!1;if(this.secondary&&e.isSecondary())return!1;if(this.supplementary&&e.isSupplementary())return!1;if(e.mq<this.mq)return!1;if(this.readgroups){const t=e.tags().RG;return this.readgroups.has(t)}return!0}}const Sp=["=","A","C","M","G","R","S","V","T","W","Y","H","K","D","B","N"],Ep=["M","I","D","N","S","H","P","=","X","?","?","?","?","?","?","?"],Np=Dp(new Uint8Array([66,65,77,1]),0),Bp=1e4,Mp={readHeader:async function(e,t,i){const n=gs(await Qs.loadArrayBuffer(e,t));return Mp.decodeBamHeader(n,i)},decodeBamHeader:function(e){const t=Dp(e,0);if(t!==Np)throw new Error("BAM header errror: bad magic number. This could be caused by either a corrupt or missing file.");const i=Dp(e,4);let n="";for(var r=0;r<i;++r)n+=String.fromCharCode(e[r+8]);const s=Dp(e,i+8);let o=i+12;const a={},c=[];for(r=0;r<s;++r){const t=Dp(e,o);let i="";for(var l=0;l<t-1;++l)i+=String.fromCharCode(e[o+4+l]);a[i]=r,c[r]=i,o=o+8+t}return{magicNumber:t,size:o,chrNames:c,chrToIndex:a}},bam_tag2cigar:function(e,t,i,n,r,s){function o(e){return"C"===e||"c"===e||"A"===e?1:"S"===e||"s"===e?2:"I"===e||"i"===e||"f"===e?4:0}if(1!==s.length||r.start<0)return!1;for(var a=i+(n+1>>1)+n;a+4<t;){if("CG"===String.fromCharCode(e[a])+String.fromCharCode(e[a+1]))break;var c=String.fromCharCode(e[a+2]);if("B"===c)a+=8+o(c=String.fromCharCode(e[a+3]))*Dp(e,a+4);else if("Z"===c||"H"===c)for(a+=3;0!==e[a++];);else a+=3+o(c)}if(a>=t)return!1;if("B"!==String.fromCharCode(e[a+2])||"I"!==String.fromCharCode(e[a+3]))return!1;var l=Dp(e,a+4),h=a+8;if(h+4*l>t)return!1;var d="",u=0;s.length=0,a=h;for(var f=0;f<l;++f,a+=4){var p=Dp(e,a),g=p>>4,m=Ep[15&p];"M"!==m&&"EQ"!==m&&"X"!==m&&"D"!==m&&"N"!==m&&"="!==m||(u+=g),d=d+g+m,s.push({len:g,ltr:m})}return r.cigar=d,r.lengthOnRef=u,!0},decodeBamRecords:function(e,t,i,n,r,s,o,a){for(;t<e.length;){const u=t+Dp(e,t)+4,f=new wp,p=Dp(e,t+4),g=Dp(e,t+8);if(u>e.length)return;if(p<0){t=u;continue}if(void 0!==r&&(p>r||g>o))return!0;if(void 0!==r&&p<r){t=u;continue}const m=Dp(e,t+12),w=(65280&m)>>8,b=255&m,F=Dp(e,t+16),v=(4294901760&F)>>16,y=65535&F,A=Dp(e,t+20),C=Dp(e,t+24),_=Dp(e,t+28),x=Dp(e,t+32);let k=[];for(let i=0;i<b-1;++i)k.push(String.fromCharCode(e[t+36+i]));k=k.join("");let I=0,S="",E=t+36+b;const N=[];let B;for(let t=0;t<y;++t){var c=Dp(e,E),l=c>>4,h=Ep[15&c];"M"!==h&&"EQ"!==h&&"X"!==h&&"D"!==h&&"N"!==h&&"="!==h||(I+=l),S=S+l+h,E+=4,B={len:l,ltr:h},N.push(B)}if(f.chr=n[p],f.start=g,f.flags=v,f.strand=!(16&v),f.readName=k,f.cigar=S,f.lengthOnRef=I,f.fragmentLength=x,f.mq=w,Mp.bam_tag2cigar(e,u,E,A,f,N),f.end=f.start+f.lengthOnRef,f.end<s){t=u;continue}let M=[];const R=A+1>>1;for(let t=0;t<R;++t){var d=e[E+t];M.push(Sp[(240&d)>>4]),M.push(Sp[15&d])}M=M.slice(0,A).join(""),E+=R;const D=[];for(let t=0;t<A;++t)D.push(e[E+t]);E+=A,C>=0&&(f.mate={chr:n[C],position:_,strand:!(32&v)}),f.seq=M,f.qual=D,f.tagBA=new Uint8Array(e.buffer.slice(E,u)),this.setPairOrientation(f),(void 0===a||a.pass(f))&&(Rp(f,N),i.push(f)),t=u}},decodeSamRecords:function(e,t,i,n,r,s){var o,a,c,l,h,d,u,f,p,g;for(l=(o=Dt(e)).length,a=0;a<l;a++)if(h=o[a].split("\t"),(p=new wp).chr=h[2],p.start=Number.parseInt(h[3])-1,p.flags=Number.parseInt(h[1]),p.readName=h[0],p.strand=!(16&p.flags),p.mq=Number.parseInt(h[4]),p.cigar=h[5],p.fragmentLength=Number.parseInt(h[8]),p.seq=h[9],"*"!==p.chr&&p.isMapped()&&p.chr===i){if(p.start>r)break;if(f=0,(g=Tp(p.cigar)).forEach((function(e){var t=e.len,i=e.ltr;"M"!==i&&"EQ"!==i&&"X"!==i&&"D"!==i&&"N"!==i&&"="!==i||(f+=t)})),p.lengthOnRef=f,!(p.start+f<n)){for(d=h[10],p.qual=[],c=0;c<d.length;c++)p.qual[c]=d.charCodeAt(c)-33;p.tagDict=h.length<11?{}:Lp(h.slice(11)),p.isMateMapped()&&(u=h[6],p.mate={chr:"="===u?p.chr:u,position:Number.parseInt(h[7]),strand:!(32&p.flags)}),this.setPairOrientation(p),(void 0===s||s.pass(p))&&(Rp(p,g),t.push(p))}}},setReaderDefaults:function(e,t){e.filter="function"==typeof t.filter?{pass:t.filter}:new Ip(t.filter),t.readgroup&&(e.filter.readgroups=new Set([t.readgroup])),e.alleleFreqThreshold=void 0===t.alleleFreqThreshold?.2:t.alleleFreqThreshold,e.samplingWindowSize=void 0===t.samplingWindowSize?100:t.samplingWindowSize,e.samplingDepth=void 0===t.samplingDepth?500:t.samplingDepth,e.samplingDepth>Bp&&(console.log("Warning: attempt to set sampling depth > maximum value of "+Bp),e.samplingDepth=Bp)},setPairOrientation:function(e){if(e.isMapped()&&e.mate&&e.isMateMapped()&&e.mate.chr===e.chr){var t=e.strand?"F":"R",i=e.mate,n=i.strand?"F":"R",r=" ",s=" ";e.isFirstOfPair()?(r="1",s="2"):e.isSecondOfPair()&&(r="2",s="1");var o=[],a=e.fragmentLength,c=e.end-e.start;if(0===a)a=(e.start<i.position?i.position+c:i.position-c)-e.start;a>0?(o[0]=t,o[1]=r,o[2]=n,o[3]=s):(o[2]=t,o[3]=r,o[0]=n,o[1]=s),e.pairOrientation=o.join("")}}};function Rp(e,t){const i=[];let n,r,s=0,o=e.start;e.scStart=e.start,e.scLengthOnRef=e.lengthOnRef;for(let a of t){let t;switch(a.ltr){case"H":case"P":break;case"S":t=o,e.scLengthOnRef+=a.len,0===i.length&&(e.scStart-=a.len,t-=a.len),i.push(new kp({start:t,seqOffset:s,len:a.len,type:"S"})),s+=a.len;break;case"N":case"D":void 0===r&&(r=[]),r.push({start:o,len:a.len,type:a.ltr}),o+=a.len;break;case"I":void 0===n&&(n=[]),n.push(new kp({start:o,len:a.len,seqOffset:s,type:"I"})),s+=a.len;break;case"M":case"EQ":case"=":case"X":i.push(new kp({start:o,seqOffset:s,len:a.len,type:"M"})),s+=a.len,o+=a.len;break;default:console.log("Error processing cigar element: "+a.len+a.ltr)}}e.blocks=i,e.insertions=n,e.gaps=r}function Dp(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Tp(e){var t,i,n,r,s,o,a,c,l;for(t=[],i=[],s=null,r=e.length,n=0;n<r;n++)o=e.charAt(n),l=void 0,(l=o.charCodeAt(0))>=48&&l<=57?i.push(o):(a=o,c=Number.parseInt(i.join("")),i=[],null!==s&&s.ltr===a?s.len+=c:(s={len:c,ltr:a},t.push(s)));return t}function Lp(e){var t={};return e.forEach((function(e){var i=e.split(":");t[i[0]]=i[2]})),t}class zp{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.isDataUri=$a(e.url),Mp.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.alignmentCache){let e;if(this.isDataUri){const t=function(e){const t=e.split(","),i=t[0].split(":")[1];let n=t[1];n=i.indexOf("base64")>=0?atob(n):decodeURI(n);const r=new Uint8Array(n.length);for(var s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}(this.bamPath);e=gs(t.buffer)}else{e=gs(await Qs.loadArrayBuffer(this.bamPath,qa(this.config)))}this.alignmentCache=this.#y(e)}const n=await this.#A(e),r=this.alignmentCache.queryFeatures(n,t,i),s=new tp(e,t,i,this.config);for(let e of r)s.push(e);return s.finish(),s}#y(e){const t=[];return this.header=Mp.decodeBamHeader(e),Mp.decodeBamRecords(e,this.header.size,t,this.header.chrNames,void 0,0,Number.MAX_SAFE_INTEGER,this.filter),new Zs(t,this.genome)}async#A(e){const t=new Set(this.header.chrNames);if(t.has(e))return e;if(this.chrAliasTable.has(e))return this.chrAliasTable.get(e);if(this.genome){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>t.has(e)));e.length>0&&(n=e[0])}return this.chrAliasTable.set(e,n),n}return e}}class Hp{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.baiPath=e.indexURL,Mp.setReaderDefaults(this,e),this._blockLoader=new yh(e)}async readAlignments(e,t,i){const n=await this.#C(e),r=new tp(e,t,i,this.config);if(void 0===n)return r;{const e=(await this.getIndex()).chunksForRange(n,t,i);if(!e||0===e.length)return r;for(let s of e){const e=await this._blockLoader.getData(s.minv,s.maxv);if(Mp.decodeBamRecords(e,s.minv.offset,r,this.header.chrNames,n,t,i,this.filter))break}return r.finish(),r}}async#C(e){if(await this.getHeader(),this.chrAliasTable.has(e)&&void 0===(e=this.chrAliasTable.get(e)))return;let t=this.header.chrToIndex[e];if(void 0===t){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>void 0!==this.header.chrToIndex[e]));e.length>0&&(n=e[0],t=this.header.chrToIndex[e[0]])}this.chrAliasTable.set(e,n)}return t}async getHeader(){if(!this.header){const e=this.genome,t=await this.getIndex();let i;if(t.firstBlockPosition){const e=qa(this.config,{range:{start:t.firstBlockPosition,size:26}}),n=ms(await Qs.loadArrayBuffer(this.bamPath,e));i=t.firstBlockPosition+n}else i=64e3;const n=qa(this.config,{range:{start:0,size:i}});this.header=await Mp.readHeader(this.bamPath,n,e)}return this.header}async getIndex(){return this.index||(this.index=await gh(this.baiPath,this.config)),this.index}async getChrIndex(){if(this.chrToIndex)return this.chrToIndex;{const e=await this.getHeader();return this.chrToIndex=e.chrToIndex,this.indexToChr=e.chrNames,this.chrNames=new Set(e.chrNames),this.chrToIndex}}}class Pp{constructor(e,t){this.config=e,this.genome=t;const i={};e.sources.sequences.forEach((function(n){const r=t?t.getChromosomeName(n):n;i[r]=function(e,t,i){const n={url:e.sources.url.replace("$CHR",i)};e.sources.indexURL&&(n.indexURL=e.sources.indexURL.replace("$CHR",i));const r=Object.assign(e,n);return new Hp(r,t)}(e,t,n)})),this.bamReaders=i,Mp.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(this.bamReaders.hasOwnProperty(e)){let n=this.bamReaders[e];return await n.readAlignments(e,t,i)}return new tp(e,t,i,this.config)}}const Op=function(e,t){this.config=e,this.genome=t,Mp.setReaderDefaults(this,e)};function Up(){const e=this,t=this.genome;if(this.header)return Promise.resolve(this.header);{const i=this.config.url+"?file="+this.config.alignmentFile+"&options=-b,-H",n=qa(this.config);return Mp.readHeader(i,n,t).then((function(t){return e.header=t,t}))}}Op.prototype.readAlignments=function(e,t,i){var n=this;return Up.call(n).then((function(r){var s,o;return s=r.chrAliasTable.hasOwnProperty(e)?r.chrAliasTable[e]:e,o=n.config.url+"?reference="+n.config.referenceFile+"&file="+n.config.alignmentFile+"&region="+s+":"+t+"-"+i,Qs.loadString(o,qa(n.config)).then((function(o){var a;return r.chrToIndex[s],a=new tp(e,t,i,n.config),Mp.decodeSamRecords(o,a,s,t,i,n.filter),a}))}))};class qp extends Rh{constructor(e,t){super(e,t),Mp.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.header){const e=gs((await this.readHeaderData()).buffer);this.header=Mp.decodeBamHeader(e,this.genome),this.chrAliasTable=new Map;for(let e of this.header.chrNames)this.chrAliasTable.set(e,this.genome.getChromosomeName(e))}let n=this.chrAliasTable.has(e)?this.chrAliasTable.get(e):e;const r=gs((await this.readData(n,t,i)).buffer);this.header=Mp.decodeBamHeader(r,this.genome);const s=this.header.chrToIndex[e],o=new tp(e,t,i,this.config);return Mp.decodeBamRecords(r,this.header.size,o,this.header.chrNames,s,t,i,this.filter),o.finish(),o}}
43
43
  /*! For license information please see cram-bundle.js.LICENSE.txt */for(var Qp=(()=>{var e={4923:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(i(7430)),o=r(i(7392)),a=i(8712),c=i(5931),l=i(9747);function h(e,t){const[i,n,r,s,o,a]=t;e[i]||(e[i]=[]),e[i].push({start:n,span:r,containerStart:s,sliceStart:o,sliceBytes:a})}t.default=class{constructor(e){this.filehandle=(0,c.open)(e.url,e.path,e.filehandle),this._parseCache=new s.default({cache:new o.default({maxSize:1}),fill:(e,t)=>this.parseIndex()})}parseIndex(){const e={};return this.filehandle.readFile().then((e=>31===e[0]&&139===e[1]?(0,a.unzip)(e):e)).then((t=>{if(t.length>4&&21578050===t.readUInt32LE(0))throw new l.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");let i=[],n="";for(const r of t)if(r>=48&&r<=57||!n&&45===r)n+=String.fromCharCode(r);else if(9===r)i.push(Number.parseInt(n,10)),n="";else if(10===r)i.push(Number.parseInt(n,10)),n="",h(e,i),i=[];else if(13!==r&&32!==r)throw new l.CramMalformedError("invalid .crai index file");return n&&i.push(Number.parseInt(n,10)),6===i.length&&h(e,i),Object.entries(e).forEach((([t,i])=>{e[t]=i.sort(((e,t)=>e.start-t.start||e.span-t.span))})),e}))}getIndex(e={}){return this._parseCache.get("index",null,e.signal)}hasDataForReferenceSequence(e){return n(this,void 0,void 0,(function*(){return!!(yield this.getIndex())[e]}))}getEntriesForRange(e,t,i){return n(this,void 0,void 0,(function*(){const n=(yield this.getIndex())[e];if(!n)return[];const r=e=>{const n=e.start,r=e.start+e.span;return n>i?-1:r<=t?1:0},s=[];for(const e of n)0===r(e)&&s.push(e);return s}))}}},9508:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t){this.parameters=e,this.dataType=t}}},368:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=n(i(9508)),o=i(612);class a extends s.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new r.CramUnimplementedError(`${this.dataType} decoding not yet implemented by BETA codec`)}decode(e,t,i,n){return(0,o.getBits)(t.content,n.coreBlock,this.parameters.length)-this.parameters.offset}}t.default=a},8635:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(400);class o extends r.default{constructor(e,t,i){if(super(e,t),this.instantiateCodec=i,"byteArray"!==t)throw new TypeError(`byteArrayLength does not support data type ${t}`)}decode(e,t,i,n){const r=this._getLengthCodec().decode(e,t,i,n),s=this._getDataCodec(),o=new Uint8Array(r);for(let a=0;a<r;a+=1)o[a]=s.decode(e,t,i,n);return o}_getLengthCodec(){const e=this.parameters.lengthsEncoding;return this.instantiateCodec(e,"int")}_getDataCodec(){const e=this.parameters.valuesEncoding;return this.instantiateCodec(e,"byte")}}t.default=o,"_getLengthCodec _getDataCodec".split(" ").forEach((e=>(0,s.tinyMemoize)(o,e)))},4839:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=n(i(9508)),o=i(612);class a extends s.default{constructor(e,t){if(super(e,t),"byteArray"!==t)throw new TypeError(`byteArrayStop codec does not support data type ${t}`)}decode(e,t,i,n){const{blockContentId:s}=this.parameters,o=i[s];if(!o)throw new r.CramMalformedError(`no block found with content ID ${s}`);const a=n.externalBlocks.getCursor(s);return this._decodeByteArray(o,a)}_decodeByteArray(e,t){const i=e.content,{stopByte:n}=this.parameters,r=t.bytePosition;let s=t.bytePosition;for(;i[s]!==n&&s<i.length;){if(s===i.length)throw new o.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");s+=1}return t.bytePosition=s+1,i.subarray(r,s)}}t.default=a},8153:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=n(i(9508)),o=i(400),a=i(612);class c extends s.default{constructor(e,t){if(super(e,t),"int"===this.dataType)this._decodeData=this._decodeInt;else{if("byte"!==this.dataType)throw new r.CramUnimplementedError(`${this.dataType} decoding not yet implemented by EXTERNAL codec`);this._decodeData=this._decodeByte}}decode(e,t,i,n){const{blockContentId:s}=this.parameters,o=i[s];if(!o)throw new r.CramMalformedError(`no block found with content ID ${s}}`);const a=n.externalBlocks.getCursor(s);return this._decodeData(o,a)}_decodeInt(e,t){const[i,n]=(0,o.parseItf8)(e.content,t.bytePosition);return t.bytePosition=t.bytePosition+n,i}_decodeByte(e,t){if(t.bytePosition>=e.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");return e.content[t.bytePosition++]}}t.default=c},8185:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=n(i(9508)),o=i(612);class a extends s.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new r.CramUnimplementedError(`${this.dataType} decoding not yet implemented by GAMMA codec`)}decode(e,t,i,n){let r=1;for(;0===(0,o.getBits)(t.content,n.coreBlock,1);)r+=1;return((0,o.getBits)(t.content,n.coreBlock,r-1)|1<<r-1)-this.parameters.offset}}t.default=a},612:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CramBufferOverrunError=void 0,t.getBits=function(e,t,n){let r=0;if(t.bytePosition+(7-t.bitPosition+n)/8>e.length)throw new i("read error during decoding. the file seems to be truncated.");for(let i=n;i;i--)r<<=1,r|=e[t.bytePosition]>>t.bitPosition&1,t.bitPosition-=1,t.bitPosition<0&&(t.bytePosition+=1),t.bitPosition&=7;return r};class i extends Error{}t.CramBufferOverrunError=i},4341:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=n(i(9508)),o=i(612);class a extends s.default{constructor(e,t){if(super(e,t),this.codes={},this.codeBook={},this.sortedCodes=[],this.sortedValuesByBitCode=[],this.sortedBitCodes=[],this.sortedBitLengthsByBitCode=[],this.bitCodeToValue=[],!["byte","int"].includes(this.dataType))throw new TypeError(`${this.dataType} decoding not yet implemented by HUFFMAN_INT codec`);this.buildCodeBook(),this.buildCodes(),this.buildCaches(),0===this.sortedCodes[0].bitLength&&(this._decode=this._decodeZeroLengthCode)}buildCodeBook(){let e=new Array(this.parameters.numCodes);for(let t=0;t<this.parameters.numCodes;t+=1)e[t]={symbol:this.parameters.symbols[t],bitLength:this.parameters.bitLengths[t]};e=e.sort(((e,t)=>e.bitLength-t.bitLength||e.symbol-t.symbol)),this.codeBook={},e.forEach((e=>{this.codeBook[e.bitLength]||(this.codeBook[e.bitLength]=[]),this.codeBook[e.bitLength].push(e.symbol)}))}buildCodes(){this.codes={};let e=0,t=-1;Object.entries(this.codeBook).forEach((([i,n])=>{const s=parseInt(i,10);n.forEach((i=>{const n={bitLength:s,value:i,bitCode:0};t+=1;const o=s-e;if(t<<=o,n.bitCode=t,e+=o,function(e){let t=e-(e>>1)&1431655765;return t=(858993459&t)+(t>>2&858993459),16843009*(t+(t>>4)&252645135)>>24}(t)>s)throw new r.CramMalformedError("Symbol out of range");this.codes[i]=n}))}))}buildCaches(){this.sortedCodes=Object.values(this.codes).sort(((e,t)=>e.bitLength-t.bitLength||e.bitCode-t.bitCode)),this.sortedValuesByBitCode=this.sortedCodes.map((e=>e.value)),this.sortedBitCodes=this.sortedCodes.map((e=>e.bitCode)),this.sortedBitLengthsByBitCode=this.sortedCodes.map((e=>e.bitLength));const e=Math.max(...this.sortedBitCodes);this.bitCodeToValue=new Array(e+1).fill(-1);for(let e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e}decode(e,t,i,n){return this._decode(e,t,n.coreBlock)}_decodeZeroLengthCode(){return this.sortedCodes[0].value}_decode(e,t,i){const n=t.content;let s=0,a=0;for(let e=0;e<this.sortedCodes.length;e+=1){const t=this.sortedCodes[e].bitLength;a<<=t-s,a|=(0,o.getBits)(n,i,t-s),s=t;{const i=this.bitCodeToValue[a];if(i>-1&&this.sortedBitLengthsByBitCode[i]===t)return this.sortedValuesByBitCode[i];for(let i=e;this.sortedCodes[i+1].bitLength===t&&i<this.sortedCodes.length;i+=1)e+=1}}throw new r.CramMalformedError("Huffman symbol not found.")}}t.default=a},6524:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.instantiateCodec=function e(t,i){const n=(s="ignore"===i?0:t.codecId,u[s]);var s;if(!n)throw new r.CramUnimplementedError(`no codec implemented for codec ID ${t.codecId}`);return new n(t.parameters,i,e)};const r=i(9747),s=n(i(4341)),o=n(i(8153)),a=n(i(4839)),c=n(i(8635)),l=n(i(368)),h=n(i(8185)),d=n(i(99)),u={1:o.default,3:s.default,4:c.default,5:a.default,6:l.default,7:d.default,9:h.default}},99:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=n(i(9508)),o=i(612);class a extends s.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new r.CramUnimplementedError(`${this.dataType} decoding not yet implemented by SUBEXP codec`)}decode(e,t,i,n){let r,s,a=0;for(;(0,o.getBits)(t.content,n.coreBlock,1);)a+=1;return 0===a?(r=this.parameters.K,s=(0,o.getBits)(t.content,n.coreBlock,r)):(r=a+this.parameters.K-1,s=1<<r|(0,o.getBits)(t.content,n.coreBlock,r)),s-this.parameters.offset}}t.default=a},7295:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},7219:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(6524),r=i(9747),s={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int"};t.default=class{constructor(e){this.dataSeriesCodecCache={},this.tagCodecCache={},this.tagEncoding={},this.readNamesIncluded=e.preservation.RN,this.APdelta=e.preservation.AP,this.referenceRequired=!!e.preservation.RR,this.tagIdsDictionary=e.preservation.TD,this.substitutionMatrix=function(e){const t=new Array(5);for(let e=0;e<5;e+=1)t[e]=new Array(4);return t[0][e[0]>>6&3]="C",t[0][e[0]>>4&3]="G",t[0][e[0]>>2&3]="T",t[0][3&e[0]]="N",t[1][e[1]>>6&3]="A",t[1][e[1]>>4&3]="G",t[1][e[1]>>2&3]="T",t[1][3&e[1]]="N",t[2][e[2]>>6&3]="A",t[2][e[2]>>4&3]="C",t[2][e[2]>>2&3]="T",t[2][3&e[2]]="N",t[3][e[3]>>6&3]="A",t[3][e[3]>>4&3]="C",t[3][e[3]>>2&3]="G",t[3][3&e[3]]="N",t[4][e[4]>>6&3]="A",t[4][e[4]>>4&3]="C",t[4][e[4]>>2&3]="G",t[4][3&e[4]]="T",t}(e.preservation.SM),this.dataSeriesEncoding=e.dataSeriesEncoding,this.tagEncoding=e.tagEncoding}getCodecForTag(e){if(!this.tagCodecCache[e]){const t=this.tagEncoding[e];t&&(this.tagCodecCache[e]=(0,n.instantiateCodec)(t,"byteArray"))}return this.tagCodecCache[e]}getTagNames(e){return this.tagIdsDictionary[e]}getCodecForDataSeries(e){let t=this.dataSeriesCodecCache[e];if(void 0===t){const i=this.dataSeriesEncoding[e];if(i){const o=s[e];if(!o)throw new r.CramMalformedError(`data series name ${e} not defined in file compression header`);t=(0,n.instantiateCodec)(i,o),this.dataSeriesCodecCache[e]=t}}return t}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.endsWith("Cache")||(e[t]=this[t])})),e}}},78:function(e,t,i){var n=i(8287).Buffer,r=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(9747),a=i(400),c=s(i(6771)),l=s(i(7219)),h=i(3165);class d{constructor(e,t){this.file=e,this.filePosition=t}getHeader(){return this._readContainerHeader(this.filePosition)}getCompressionHeaderBlock(){return r(this,void 0,void 0,(function*(){const e=yield this.getHeader();if(!(null==e?void 0:e.numRecords))return null;const{majorVersion:t}=yield this.file.getDefinition(),i=(0,h.getSectionParsers)(t),n=yield this.getFirstBlock();if(void 0===n)return;if("COMPRESSION_HEADER"!==n.contentType)throw new o.CramMalformedError(`invalid content type ${n.contentType} in what is supposed to be the compression header block`);const r=(0,a.parseItem)(n.content,i.cramCompressionHeader.parser,0,n.contentPosition);return Object.assign(Object.assign({},n),{parsedContent:r})}))}getFirstBlock(){return r(this,void 0,void 0,(function*(){const e=yield this.getHeader();if(e)return this.file.readBlock(e._endPosition)}))}getCompressionScheme(){return r(this,void 0,void 0,(function*(){const e=yield this.getCompressionHeaderBlock();if(e)return new l.default(e.parsedContent)}))}getSlice(e,t){return new c.default(this,e,t)}_readContainerHeader(e){return r(this,void 0,void 0,(function*(){const{majorVersion:t}=yield this.file.getDefinition(),i=(0,h.getSectionParsers)(t),{cramContainerHeader1:r,cramContainerHeader2:s}=i,{size:o}=yield this.file.stat();if(e>=o)return void console.warn(`position:${e}>=fileSize:${o} in cram container`);const c=n.allocUnsafe(r.maxLength);yield this.file.read(c,0,r.maxLength,e);const l=(0,a.parseItem)(c,r.parser),d=(0,a.itf8Size)(l.numLandmarks);if(e+l.length>=o)return void console.warn(`container header at ${e} indicates that the container has length ${l.length}, which extends beyond the length of the file. Skipping this container.`);const u=n.allocUnsafe(s.maxLength(l.numLandmarks));yield this.file.read(u,0,s.maxLength(l.numLandmarks),e+l._size-d);const f=(0,a.parseItem)(u,s.parser);return this.file.validateChecksums&&void 0!==f.crc32&&(yield this.file.checkCrc32(e,l._size+f._size-d-4,f.crc32,`container header beginning at position ${e}`)),Object.assign(l,f,{_size:l._size+f._size-d,_endPosition:l._size+f._size-d+e})}))}}t.default=d,"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((e=>(0,a.tinyMemoize)(d,e)))},6794:function(e,t,i){var n=i(8287).Buffer,r=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(8712),a=s(i(4132)),c=s(i(7392)),l=s(i(6960)),h=s(i(235)),d=i(1307),u=i(9747),f=s(i(9989)),p=i(3165),g=s(i(78)),m=i(5931),w=i(400),b=i(5417);class F{constructor(e){var t;if(this.file=(0,m.open)(e.url,e.path,e.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=e.seqFetch,this.options={checkSequenceMD5:e.checkSequenceMD5,cacheSize:null!==(t=e.cacheSize)&&void 0!==t?t:2e4},this.featureCache=new c.default({maxSize:this.options.cacheSize}),function(){const e=new Uint32Array([287454020]),t=new Uint8Array(e.buffer);return 68===t[0]?0:17===t[0]?1:2}()>0)throw new Error("Detected big-endian machine, may be unable to run")}read(e,t,i,n){return this.file.read(e,t,i,n)}stat(){return this.file.stat()}getDefinition(){return r(this,void 0,void 0,(function*(){const{maxLength:e,parser:t}=(0,p.cramFileDefinition)(),i=n.allocUnsafe(e);yield this.file.read(i,0,e,0);const r=t(i).value;if(2!==r.majorVersion&&3!==r.majorVersion)throw new u.CramUnimplementedError(`CRAM version ${r.majorVersion} not supported`);return r}))}getSamHeader(){return r(this,void 0,void 0,(function*(){const e=yield this.getContainerById(0);if(!e)throw new u.CramMalformedError("file contains no containers");const t=yield e.getFirstBlock();if(void 0===t)return(0,b.parseHeaderText)("");const i=t.content,n=i.readInt32LE(0),r=i.toString("utf8",4,4+n);return this.header=r,(0,b.parseHeaderText)(r)}))}getHeaderText(){return r(this,void 0,void 0,(function*(){return yield this.getSamHeader(),this.header}))}getContainerById(e){return r(this,void 0,void 0,(function*(){const{majorVersion:t}=yield this.getDefinition(),i=(0,p.getSectionParsers)(t);let n=i.cramFileDefinition.maxLength;const{size:r}=yield this.file.stat(),{cramContainerHeader1:s}=i;let o;for(let t=0;t<=e;t++){if(n+s.maxLength+8>=r)return;o=this.getContainerAtPosition(n);const i=yield o.getHeader();if(!i)throw new u.CramMalformedError(`container ${e} not found in file`);if(0===t){n=i._endPosition;for(let e=0;e<i.numBlocks;e++){const e=yield this.readBlock(n);if(void 0===e)return;n=e._endPosition}}else n+=i._size+i.length}return o}))}checkCrc32(e,t,i,s){return r(this,void 0,void 0,(function*(){const r=n.allocUnsafe(t);yield this.file.read(r,0,t,e);const o=a.default.unsigned(r);if(o!==i)throw new u.CramMalformedError(`crc mismatch in ${s}: recorded CRC32 = ${i}, but calculated CRC32 = ${o}`)}))}containerCount(){return r(this,void 0,void 0,(function*(){const{majorVersion:e}=yield this.getDefinition(),t=(0,p.getSectionParsers)(e),{size:i}=yield this.file.stat(),{cramContainerHeader1:n}=t;let r=0,s=t.cramFileDefinition.maxLength;for(;s+n.maxLength+8<i;){const e=yield this.getContainerAtPosition(s).getHeader();if(!e)break;if(0===r){s=e._endPosition;for(let t=0;t<e.numBlocks;t++){const e=yield this.readBlock(s);if(void 0===e)return;s=e._endPosition}}else s+=e._size+e.length;r+=1}return r}))}getContainerAtPosition(e){return new g.default(this,e)}readBlockHeader(e){return r(this,void 0,void 0,(function*(){const{majorVersion:t}=yield this.getDefinition(),i=(0,p.getSectionParsers)(t),{cramBlockHeader:r}=i,{size:s}=yield this.file.stat();if(e+r.maxLength>=s)return;const o=n.allocUnsafe(r.maxLength);return yield this.file.read(o,0,r.maxLength,e),(0,w.parseItem)(o,r.parser,0,e)}))}_parseSection(e,t){return r(this,arguments,void 0,(function*(e,t,i=e.maxLength,r=void 0){let s;if(r)s=r;else{const{size:e}=yield this.file.stat();if(t+i>=e)return;s=n.allocUnsafe(i),yield this.file.read(s,0,i,t)}const o=(0,w.parseItem)(s,e.parser,0,t);if(o._size!==i)throw new u.CramMalformedError(`section read error: requested size ${i} does not equal parsed size ${o._size}`);return o}))}_uncompress(e,t,i){return r(this,void 0,void 0,(function*(){if("gzip"===e)(0,o.unzip)(t).copy(i);else if("bzip2"===e){const e=h.default.array(t);let r,s=h.default.header(e),o=0;do{r=h.default.decompress(e,s),-1!=r&&(n.from(r).copy(i,o),o+=r.length,s-=r.length)}while(-1!=r)}else if("lzma"===e){const e=new Response(new d.XzReadableStream((r=t,new ReadableStream({start(e){e.enqueue(r),e.close()}}))));n.from(yield e.arrayBuffer()).copy(i)}else if("rans"===e)(0,f.default)(t,i);else if("rans4x16"===e)l.default.r4x16_uncompress(t,i);else if("arith"===e)l.default.arith_uncompress(t,i);else if("fqzcomp"===e)l.default.fqzcomp_uncompress(t,i);else{if("tok3"!==e)throw new u.CramUnimplementedError(`${e} decompression not yet implemented`);l.default.tok3_uncompress(t,i)}var r}))}readBlock(e){return r(this,void 0,void 0,(function*(){const{majorVersion:t}=yield this.getDefinition(),i=(0,p.getSectionParsers)(t),r=yield this.readBlockHeader(e);if(void 0===r)return;const s=r._endPosition,o=n.allocUnsafe(r.uncompressedSize),a=Object.assign(Object.assign({},r),{_endPosition:s,contentPosition:s,content:o});if("raw"!==r.compressionMethod){const e=n.allocUnsafe(r.compressedSize);yield this.read(e,0,r.compressedSize,s),yield this._uncompress(r.compressionMethod,e,o)}else yield this.read(o,0,r.uncompressedSize,s);if(t>=3){const t=yield this._parseSection(i.cramBlockCrc32,s+r.compressedSize);if(void 0===t)return;a.crc32=t.crc32,this.validateChecksums&&(yield this.checkCrc32(e,r._size+r.compressedSize,t.crc32,"block data")),a._endPosition=t._endPosition,a._size=a.compressedSize+i.cramBlockCrc32.maxLength}else a._endPosition=s+a.compressedSize,a._size=a.compressedSize;return a}))}}t.default=F,"getDefinition getSectionParsers getSamHeader".split(" ").forEach((e=>(0,w.tinyMemoize)(F,e)))},7390:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CramRecord=void 0;var r=i(8401);Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return n(r).default}});var s=i(6794);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(s).default}})},8401:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MateFlagsDecoder=t.CramFlagsDecoder=t.BamFlagsDecoder=t.MateFlags=t.CramFlags=t.BamFlags=void 0;const r=n(i(7295)),s={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};function o(e){const t={};for(const[i,n]of e)t["is"+n]=e=>!!(e&i),t["set"+n]=e=>e|i;return t}t.BamFlags=[[1,"Paired"],[2,"ProperlyPaired"],[4,"SegmentUnmapped"],[8,"MateUnmapped"],[16,"ReverseComplemented"],[32,"MateReverseComplemented"],[64,"Read1"],[128,"Read2"],[256,"Secondary"],[512,"FailedQc"],[1024,"Duplicate"],[2048,"Supplementary"]],t.CramFlags=[[1,"PreservingQualityScores"],[2,"Detached"],[4,"WithMateDownstream"],[8,"DecodeSequenceAsStar"]],t.MateFlags=[[1,"OnNegativeStrand"],[2,"Unmapped"]],t.BamFlagsDecoder=o(t.BamFlags),t.CramFlagsDecoder=o(t.CramFlags),t.MateFlagsDecoder=o(t.MateFlags),t.default=class{constructor({flags:e,cramFlags:t,readLength:i,mappingQuality:n,lengthOnRef:r,qualityScores:s,mateRecordNumber:o,readBases:a,readFeatures:c,mateToUse:l,readGroupId:h,readName:d,sequenceId:u,uniqueId:f,templateSize:p,alignmentStart:g,tags:m}){this.flags=e,this.cramFlags=t,this.readLength=i,this.mappingQuality=n,this.lengthOnRef=r,this.qualityScores=s,a&&(this.readBases=a),this.readGroupId=h,this.readName=d,this.sequenceId=u,this.uniqueId=f,this.templateSize=p,this.alignmentStart=g,this.tags=m,c&&(this.readFeatures=c),l&&(this.mate={flags:l.mateFlags,readName:l.mateReadName,sequenceId:l.mateSequenceId,alignmentStart:l.mateAlignmentStart}),o&&(this.mateRecordNumber=o)}isPaired(){return!!(this.flags&r.default.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&r.default.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&r.default.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&r.default.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&r.default.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&r.default.BAM_FMREVERSE)}isRead1(){return!!(this.flags&r.default.BAM_FREAD1)}isRead2(){return!!(this.flags&r.default.BAM_FREAD2)}isSecondary(){return!!(this.flags&r.default.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&r.default.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&r.default.BAM_FDUP)}isSupplementary(){return!!(this.flags&r.default.BAM_FSUPPLEMENTARY)}isDetached(){return!!(this.cramFlags&r.default.CRAM_FLAG_DETACHED)}hasMateDownStream(){return!!(this.cramFlags&r.default.CRAM_FLAG_MATE_DOWNSTREAM)}isPreservingQualityScores(){return!!(this.cramFlags&r.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)}isUnknownBases(){return!!(this.cramFlags&r.default.CRAM_FLAG_NO_SEQ)}getReadBases(){if(!this.readBases&&this._refRegion){const e=function(e,t){if(!e.lengthOnRef&&!e.readLength)return null;if(e.isUnknownBases())return null;const i=e.alignmentStart-t.start;if(!e.readFeatures)return t.seq.slice(i,i+(e.lengthOnRef||0)).toUpperCase();let n="",r=i,s=0;for(;n.length<e.readLength;)if(s<e.readFeatures.length){const i=e.readFeatures[s];if("Q"===i.code||"q"===i.code)s+=1;else if(i.pos===n.length+1)if(s+=1,"b"===i.code){const e=i.data;n+=e,r+=e.length}else"B"===i.code?(n+=i.data[0],r+=1):"X"===i.code?(n+=i.sub,r+=1):"I"===i.code?n+=i.data:"D"===i.code?r+=i.data:"i"===i.code?n+=i.data:"N"===i.code?r+=i.data:"S"===i.code?n+=i.data:"P"===i.code||i.code;else if(s<e.readFeatures.length){const i=t.seq.slice(r,r+e.readFeatures[s].pos-n.length-1);n+=i,r+=i.length}}else{const i=t.seq.slice(r,r+e.readLength-n.length);n+=i,r+=i.length}return n.toUpperCase()}(this,this._refRegion);e&&(this.readBases=e)}return this.readBases}getPairOrientation(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){const e=this.isReverseComplemented()?"R":"F",t=this.isMateReverseComplemented()?"R":"F";let i=" ",n=" ";this.isRead1()?(i="1",n="2"):this.isRead2()&&(i="2",n="1");const r=[];let s=this.templateLength||this.templateSize;if(void 0===s)throw new Error("One of templateSize and templateLength must be set");return this.alignmentStart>this.mate.alignmentStart&&s>0&&(s=-s),s>0?(r[0]=e,r[1]=i,r[2]=t,r[3]=n):(r[2]=e,r[3]=i,r[0]=t,r[1]=n),r.join("")}return null}addReferenceSequence(e,t){this.readFeatures&&this.readFeatures.forEach((i=>{"X"===i.code&&function(e,t,i,n){if(!t)return;const r=n.refPos-t.start,o=t.seq.charAt(r);o&&(n.ref=o);let a=s[o];void 0===a&&(a=4);const c=i.substitutionMatrix[a][n.data];c&&(n.sub=c)}(0,e,t,i)})),!this.readBases&&e.start<=this.alignmentStart&&e.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=e)}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.startsWith("_")||(e[t]=this[t])})),e.readBases=this.getReadBases(),e}}},3165:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.cramFileDefinition=r,t.cramBlockHeader=s,t.cramBlockCrc32=o,t.cramTagDictionary=c,t.cramPreservationMap=l,t.isMappedSliceHeader=function(e){return"number"==typeof e.refSeqId},t.getSectionParsers=function(e){return{cramFileDefinition:r(),cramBlockHeader:s(),cramBlockCrc32:o(),cramDataSeriesEncodingMap:p(),cramTagEncodingMap:g(),cramCompressionHeader:{parser:(e,t)=>{const{value:i,offset:n}=l().parser(e,t);t=n;const{value:r,offset:s}=p().parser(e,t);t=s;const{value:o,offset:a}=g().parser(e,t);return t=a,{value:{dataSeriesEncoding:h(r),preservation:h(i),tagEncoding:h(o)},offset:t}}},cramEncoding:{parser:(e,t)=>f(e,t)},cramUnmappedSliceHeader:d(e),cramMappedSliceHeader:u(e),cramContainerHeader1:m(e),cramContainerHeader2:w(e)}};const n=i(400);function r(){return{parser:(e,t=0)=>{const i=e,n=new DataView(i.buffer,i.byteOffset,i.length);let r=0;const s=e.subarray(r,r+4).toString();r+=4;const o=n.getUint8(r);r+=1;const a=n.getUint8(r);r+=1;const c=i.subarray(r,r+20).toString().replaceAll("\0","");return r+=20,{value:{magic:s,majorVersion:o,minorVersion:a,fileId:c},offset:r}},maxLength:26}}function s(){return{parser:(e,t=0)=>{const i=e,r=new DataView(i.buffer,i.byteOffset,i.length);let s=0;const o=r.getUint8(s),a=["raw","gzip","bzip2","lzma","rans","rans4x16","arith","fqzcomp","tok3"][o];if(!a)throw new Error(`compression method number ${o} not implemented`);s+=1;const c=r.getUint8(s),l=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][c];if(!l)throw new Error(`invalid block content type id ${c}`);s+=1;const[h,d]=(0,n.parseItf8)(e,s);s+=d;const[u,f]=(0,n.parseItf8)(e,s);s+=f;const[p,g]=(0,n.parseItf8)(e,s);return s+=g,{offset:s,value:{uncompressedSize:p,compressedSize:u,contentId:h,contentType:l,compressionMethod:a}}},maxLength:17}}function o(){return{parser:(e,t)=>{const i=e,n=new DataView(i.buffer,i.byteOffset,i.length).getUint32(t,!0);return{offset:t+=4,value:{crc32:n}}},maxLength:4}}function a(e,t,i){const n=e.toString("utf8",t,i),r=[];for(let e=0;e<n.length;e+=3)r.push(n.slice(e,e+3));return r}function c(){return{parser:(e,t)=>{const[i,r]=(0,n.parseItf8)(e,t);t+=r;const s=e.subarray(t,t+i);t+=i;const o=[];let c=0,l=0;for(;l<s.length;l++)s[l]||(o.push(a(s,c,l)),c=l+1);return l>c&&o.push(a(s,c,l)),{value:{size:i,ents:o},offset:t}}}}function l(){return{parser:(e,t)=>{const i=e,r=new DataView(i.buffer,i.byteOffset,i.length),[s,o]=(0,n.parseItf8)(e,t);t+=o;const[a,l]=(0,n.parseItf8)(e,t);t+=l;const h=[];for(let i=0;i<a;i++){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);if(t+=2,"MI"===i||"UI"===i||"PI"===i||"RN"===i||"AP"===i||"RR"===i)h.push({key:i,value:!!r.getUint8(t)}),t+=1;else if("SM"===i)h.push({key:i,value:[r.getUint8(t),r.getUint8(t+1),r.getUint8(t+2),r.getUint8(t+3),r.getUint8(t+4)]}),t+=5;else{if("TD"!==i)throw new Error(`unknown key ${i}`);{const{offset:n,value:r}=c().parser(e,t);h.push({key:i,value:r.ents}),t=n}}}return{value:{mapSize:s,mapCount:a,ents:h},offset:t}}}}function h(e){const t={};for(const{key:i,value:n}of e.ents)t[i]&&console.warn(`duplicate key ${i} in map`),t[i]=n;return t}function d(e){return{parser:(t,i)=>{const[r,s]=(0,n.parseItf8)(t,i);i+=s;let o=0;if(e>=3){const[e,r]=(0,n.parseLtf8)(t,i);i+=r,o=e}else if(2===e){const[e,r]=(0,n.parseItf8)(t,i);i+=r,o=e}else console.warn("recordCounter=0");const[a,c]=(0,n.parseItf8)(t,i);i+=c;const[l,h]=(0,n.parseItf8)(t,i);i+=h;const d=[];for(let e=0;e<l;e++){const[e,r]=(0,n.parseItf8)(t,i);i+=r,d.push(e)}let u;return e>=2&&(u=[...t.subarray(i,i+16)],i+=16),{value:{recordCounter:o,md5:u,contentIds:d,numContentIds:l,numBlocks:a,numRecords:r},offset:i}},maxLength:e=>40+5*e}}function u(e){return{parser:(t,i)=>{const[r,s]=(0,n.parseItf8)(t,i);i+=s;const[o,a]=(0,n.parseItf8)(t,i);i+=a;const[c,l]=(0,n.parseItf8)(t,i);i+=l;const[h,d]=(0,n.parseItf8)(t,i);i+=d;let u=0;if(e>=3){const[e,r]=(0,n.parseLtf8)(t,i);i+=r,u=e}else if(2===e){const[e,r]=(0,n.parseItf8)(t,i);i+=r,u=e}else console.warn("majorVersion is <2, recordCounter set to 0");const[f,p]=(0,n.parseItf8)(t,i);i+=p;const[g,m]=(0,n.parseItf8)(t,i);i+=m;const w=[];for(let e=0;e<g;e++){const[e,r]=(0,n.parseItf8)(t,i);i+=r,w.push(e)}const[b,F]=(0,n.parseItf8)(t,i);let v;return i+=F,e>=2&&(v=[...t.subarray(i,i+16)],i+=16),{value:{md5:v,numBlocks:f,numRecords:h,numContentIds:g,refSeqSpan:c,refSeqId:r,refSeqStart:o,recordCounter:u,refBaseBlockId:b,contentIds:w},offset:i}},maxLength:e=>60+5*e}}function f(e,t){const i=e,r=new DataView(i.buffer,i.byteOffset,i.length),[s,o]=(0,n.parseItf8)(e,t);t+=o;const[a,c]=(0,n.parseItf8)(e,t);t+=c;const l={};if(0===s);else if(1===s){const[i,r]=(0,n.parseItf8)(e,t);l.blockContentId=i,t+=r}else if(2===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.M=s,t+=o}else if(3===s){const i=(0,n.parseItf8)(e,t),r=i[0];t+=i[1];const s=[];for(let i=0;i<r;i++){const i=(0,n.parseItf8)(e,t);s.push(i[0]),t+=i[1]}l.symbols=s;const o=(0,n.parseItf8)(e,t),a=i[0];l.numLengths=a,l.numCodes=r,l.numLengths=a,t+=o[1];const c=[];for(let i=0;i<a;i++){const i=(0,n.parseItf8)(e,t);t+=i[1],c.push(i[0])}l.bitLengths=c}else if(4===s){const{value:i,offset:n}=f(e,t);l.lengthsEncoding=i,t=n;const{value:r,offset:s}=f(e,t);l.valuesEncoding=r,t=s}else if(5===s){l.stopByte=r.getUint8(t),t+=1;const[i,s]=(0,n.parseItf8)(e,t);l.blockContentId=i,t+=s}else if(6===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.length=s,t+=o}else if(7===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.K=s,t+=o}else if(8===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.log2m=s,t+=o}else{if(9!==s)throw new Error(`unknown codecId ${s}`);{const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r}}return{value:{codecId:s,parametersBytes:a,parameters:l},offset:t}}function p(){return{parser:(e,t)=>{const[i,r]=(0,n.parseItf8)(e,t);t+=r;const[s,o]=(0,n.parseItf8)(e,t);t+=o;const a=[];for(let i=0;i<s;i++){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const{value:n,offset:r}=f(e,t);t=r,a.push({key:i,value:n})}return{value:{mapSize:i,ents:a,mapCount:s},offset:t}}}}function g(){return{parser:(e,t)=>{const[i,r]=(0,n.parseItf8)(e,t);t+=r;const[s,o]=(0,n.parseItf8)(e,t);t+=o;const a=[];for(let i=0;i<s;i++){const[i,r]=(0,n.parseItf8)(e,t);t+=r;const s=String.fromCharCode(i>>16&255)+String.fromCharCode(i>>8&255)+String.fromCharCode(255&i),{value:o,offset:c}=f(e,t);t=c,a.push({key:s,value:o})}return{value:{mapSize:i,ents:a,mapCount:s},offset:t}}}}function m(e){return{maxLength:52,parser:(t,i)=>{const r=t,s=new DataView(r.buffer,r.byteOffset,r.length).getInt32(i,!0);i+=4;const[o,a]=(0,n.parseItf8)(t,i);i+=a;const[c,l]=(0,n.parseItf8)(t,i);i+=l;const[h,d]=(0,n.parseItf8)(t,i);i+=d;const[u,f]=(0,n.parseItf8)(t,i);i+=f;let p,g=0;if(e>=3){const[e,r]=(0,n.parseLtf8)(t,i);g=e,i+=r}else if(2===e){const[e,r]=(0,n.parseItf8)(t,i);g=e,i+=r}else console.warn("setting recordCounter=0");if(e>1){const[e,r]=(0,n.parseLtf8)(t,i);p=e,i+=r}const[m,w]=(0,n.parseItf8)(t,i);i+=w;const[b,F]=(0,n.parseItf8)(t,i);return{value:{length:s,refSeqId:o,refSeqStart:c,alignmentSpan:h,numBlocks:m,numLandmarks:b,numBases:p,recordCounter:g,numRecords:u},offset:i+=F}}}}function w(e){return{parser:(t,i)=>{const r=t,s=new DataView(r.buffer,r.byteOffset,r.length),[o,a]=(0,n.parseItf8)(t,i);i+=a;const c=[];for(let e=0;e<o;e++){const[e,r]=(0,n.parseItf8)(t,i);i+=r,c.push(e)}let l;return e>=3&&(l=s.getUint32(i,!0),i+=4),{value:Object.assign(Object.assign({},void 0===l?{}:{crc32:l}),{numLandmarks:o,landmarks:c}),offset:i}},maxLength:e=>5+5*e+4}}},6484:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,n,r,h,d,u,f){let p=t("BF");const g=t("CF");if(!(0,a.isMappedSliceHeader)(n.parsedContent))throw new Error("slice header not mapped");const m=u>1&&-2===n.parsedContent.refSeqId?t("RI"):n.parsedContent.refSeqId,w=t("RL");let b=t("AP");i.APdelta&&(b+=d.lastAlignmentStart),d.lastAlignmentStart=b;const F=t("RG");let v,y,A,C;if(i.readNamesIncluded&&(v=c(t("RN"))),o.CramFlagsDecoder.isDetached(g)){const e=t("MF");let n;i.readNamesIncluded||(n=c(t("RN")),v=n);const r=t("NS"),s=t("NP");(e||r>-1)&&(y={mateFlags:e,mateSequenceId:r,mateAlignmentStart:s,mateReadName:n}),A=t("TS"),o.MateFlagsDecoder.isUnmapped(e)&&(p=o.BamFlagsDecoder.setMateUnmapped(p)),o.MateFlagsDecoder.isOnNegativeStrand(e)&&(p=o.BamFlagsDecoder.setMateReverseComplemented(p))}else o.CramFlagsDecoder.isWithMateDownstream(g)&&(C=t("NF")+f+1);const _=t("TL");if(_<0)throw new s.CramMalformedError("invalid TL index");const x={},k=i.getTagNames(_),I=k.length;for(let t=0;t<I;t+=1){const n=k[t],o=n.slice(0,2),a=n.slice(2,3),c=i.getCodecForTag(n);if(!c)throw new s.CramMalformedError(`no codec defined for auxiliary tag ${n}`);const u=c.decode(e,r,h,d);x[o]=l(a,u)}let S,E,N,B,M;if(o.BamFlagsDecoder.isSegmentUnmapped(p))if(o.CramFlagsDecoder.isDecodeSequenceAsStar(g))M=null,B=null;else{const e=new Array(w);for(let i=0;i<e.length;i+=1)e[i]=t("BA");if(M=String.fromCharCode(...e),o.CramFlagsDecoder.isPreservingQualityScores(g)){B=new Array(w);for(let i=0;i<e.length;i+=1)B[i]=t("QS")}}else{const e=t("FN");if(e&&(S=function(e,t,i,n,r){let o=0,a=e-1;const c=new Array(t);function l([e,t]){const n=i(t);if("character"===e)return String.fromCharCode(n);if("string"===e){let e="";for(let t=0;t<n.byteLength;t++)e+=String.fromCharCode(n[t]);return e}return"numArray"===e?n.toArray():n}for(let e=0;e<t;e+=1){const t=String.fromCharCode(i("FC")),n=i("FP"),h={B:["character","BA"],S:["string",r>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[t];if(!h)throw new s.CramMalformedError(`invalid read feature code "${t}"`);let d=l(h);const u={B:["number","QS"]}[t];u&&(d=[d,l(u)]),o+=n;const f=o;a+=n;const p=a;"D"===t||"N"===t?a+=d:"I"===t||"S"===t?a-=d.length:"i"===t&&(a-=1),c[e]={code:t,pos:f,refPos:p,data:d}}return c}(b,e,t,0,u)),E=w,S)for(const{code:e,data:t}of S)"D"===e||"N"===e?E+=t:"I"===e||"S"===e?E-=t.length:"i"===e&&(E-=1);if(Number.isNaN(E)&&(console.warn(`${v||`${m}:${b}`} record has invalid read features`),E=w),N=t("MQ"),o.CramFlagsDecoder.isPreservingQualityScores(g)){B=new Array(w);for(let e=0;e<B.length;e++)B[e]=t("QS")}}return{readLength:w,sequenceId:m,cramFlags:g,flags:p,alignmentStart:b,readGroupId:F,readName:v,mateToUse:y,templateSize:A,mateRecordNumber:C,readFeatures:S,lengthOnRef:E,mappingQuality:N,qualityScores:B,readBases:M,tags:x}};const r=n(i(8570)),s=i(9747),o=i(8401),a=i(3165);function c(e){let t="";for(let i=0;i<e.length&&0!==e[i];i++)t+=String.fromCharCode(e[i]);return t}function l(e,t){if("Z"===e)return c(t);if("A"===e)return String.fromCharCode(t[0]);if("I"===e)return r.default.fromBytesLE(t).toNumber();if("i"===e)return new Int32Array(t.buffer)[0];if("s"===e)return new Int16Array(t.buffer)[0];if("S"===e)return new Uint16Array(t.buffer)[0];if("c"===e)return new Int8Array(t.buffer)[0];if("C"===e)return t[0];if("f"===e)return new Float32Array(t.buffer)[0];if("H"===e)return Number.parseInt(c(t).replace(/^0x/,""),16);if("B"===e)return function(e){const t=String.fromCharCode(e[0]),i=Int32Array.from(e.slice(1))[0],n=new Array(i);if(e=e.slice(5),"c"===t){const t=new Int8Array(e.buffer);for(let e=0;e<i;e+=1)n[e]=t[e]}else if("C"===t){const t=new Uint8Array(e.buffer);for(let e=0;e<i;e+=1)n[e]=t[e]}else if("s"===t){const t=new Int16Array(e.buffer);for(let e=0;e<i;e+=1)n[e]=t[e]}else if("S"===t){const t=new Uint16Array(e.buffer);for(let e=0;e<i;e+=1)n[e]=t[e]}else if("i"===t){const t=new Int32Array(e.buffer);for(let e=0;e<i;e+=1)n[e]=t[e]}else if("I"===t){const t=new Uint32Array(e.buffer);for(let e=0;e<i;e+=1)n[e]=t[e]}else{if("f"!==t)throw new Error("unknown type: "+t);{const t=new Float32Array(e.buffer);for(let e=0;e<i;e+=1)n[e]=t[e]}}return n}(t);throw new s.CramMalformedError(`Unrecognized tag type ${e}`)}},6771:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(9747),o=i(400),a=r(i(7295)),c=r(i(6484)),l=r(i(8401)),h=i(3165),d=i(612);function u(e,t,i,n){if(!n)throw new s.CramMalformedError("could not resolve intra-slice mate pairs, file seems truncated or malformed");const r=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==t);i.readName||(i.readName=String(i.uniqueId),n.readName=i.readName),i.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(i.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:i.sequenceId,alignmentStart:i.alignmentStart,uniqueId:i.uniqueId},i.readName&&(n.mate.readName=i.readName)),i.flags|=a.default.BAM_FPAIRED,n.flags&a.default.BAM_FUNMAP&&(i.flags|=a.default.BAM_FMUNMAP),i.flags&a.default.BAM_FUNMAP&&(n.flags|=a.default.BAM_FMUNMAP),n.flags&a.default.BAM_FREVERSE&&(i.flags|=a.default.BAM_FMREVERSE),i.flags&a.default.BAM_FREVERSE&&(n.flags|=a.default.BAM_FMREVERSE),void 0===i.templateLength&&(r?function(e,t,i){const n=function t(i){const n=[i];if(void 0!==i.mateRecordNumber&&i.mateRecordNumber>=0){const r=e[i.mateRecordNumber];if(!r)throw new s.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push(...t(r))}return n}(i),r=n.map((e=>e.alignmentStart)),o=n.map((e=>e.alignmentStart+e.readLength-1)),a=Math.max(...o)-Math.min(...r)+1;a>=0&&n.forEach((e=>{if(void 0!==e.templateLength)throw new s.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");e.templateLength=a}))}(e,0,i):function(e,t){const i=Math.min(e.alignmentStart,t.alignmentStart),n=Math.max(e.alignmentStart+e.readLength-1,t.alignmentStart+t.readLength-1)-i+1;e.templateLength=n,t.templateLength=n}(i,n)),delete i.mateRecordNumber}class f{constructor(e,t,i){this.container=e,this.containerPosition=t,this.file=e.file}getHeader(){return n(this,void 0,void 0,(function*(){const{majorVersion:e}=yield this.file.getDefinition(),t=(0,h.getSectionParsers)(e),i=yield this.container.getHeader();if(!i)throw new Error("wow");const n=yield this.file.readBlock(i._endPosition+this.containerPosition);if(void 0===n)throw new Error("block header undefined");if("MAPPED_SLICE_HEADER"===n.contentType){const e=(0,o.parseItem)(n.content,t.cramMappedSliceHeader.parser,0,i._endPosition);return Object.assign(Object.assign({},n),{parsedContent:e})}if("UNMAPPED_SLICE_HEADER"===n.contentType){const e=(0,o.parseItem)(n.content,t.cramUnmappedSliceHeader.parser,0,i._endPosition);return Object.assign(Object.assign({},n),{parsedContent:e})}throw new s.CramMalformedError(`error reading slice header block, invalid content type ${n.contentType}`)}))}getBlocks(){return n(this,void 0,void 0,(function*(){const e=yield this.getHeader();let t=e._endPosition;const i=new Array(e.parsedContent.numBlocks);for(let e=0;e<i.length;e++){const n=yield this.file.readBlock(t);if(void 0===n)throw new Error("block undefined");i[e]=n,t=i[e]._endPosition}return i}))}getCoreDataBlock(){return n(this,void 0,void 0,(function*(){return(yield this.getBlocks())[0]}))}_getBlocksContentIdIndex(){return n(this,void 0,void 0,(function*(){const e=yield this.getBlocks(),t={};return e.forEach((e=>{"EXTERNAL_DATA"===e.contentType&&(t[e.contentId]=e)})),t}))}getBlockByContentId(e){return n(this,void 0,void 0,(function*(){return(yield this._getBlocksContentIdIndex())[e]}))}getReferenceRegion(){return n(this,void 0,void 0,(function*(){const e=(yield this.getHeader()).parsedContent;if(!(0,h.isMappedSliceHeader)(e))throw new Error("slice header not mapped");if(e.refSeqId<0)return;const t=yield this.container.getCompressionScheme();if(void 0===t)throw new Error("compression scheme undefined");if(e.refBaseBlockId>=0){const t=yield this.getBlockByContentId(e.refBaseBlockId);if(!t)throw new s.CramMalformedError("embedded reference specified, but reference block does not exist");return{seq:t.data.toString("utf8"),start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}}if(t.referenceRequired||this.file.fetchReferenceSequenceCallback){if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");const t=yield this.file.fetchReferenceSequenceCallback(e.refSeqId,e.refSeqStart,e.refSeqStart+e.refSeqSpan-1);if(t.length!==e.refSeqSpan)throw new s.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return{seq:t,start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}}}))}getAllRecords(){return this.getRecords((()=>!0))}_fetchRecords(){return n(this,void 0,void 0,(function*(){var e,t;const{majorVersion:i}=yield this.file.getDefinition(),n=yield this.container.getCompressionScheme();if(void 0===n)throw new Error("compression scheme undefined");const r=yield this.getHeader();if(void 0===r)throw new Error("slice header undefined");const a=yield this._getBlocksContentIdIndex();if(i>1&&this.file.options.checkSequenceMD5&&(0,h.isMappedSliceHeader)(r.parsedContent)&&r.parsedContent.refSeqId>=0&&"0000000000000000"!==(null===(e=r.parsedContent.md5)||void 0===e?void 0:e.join(""))){const e=yield this.getReferenceRegion();if(e){const{seq:i,start:n,end:a}=e,c=(0,o.sequenceMD5)(i),l=null===(t=r.parsedContent.md5)||void 0===t?void 0:t.map((e=>(e<16?"0":"")+e.toString(16))).join("");if(c!==l)throw new s.CramMalformedError(`MD5 checksum reference mismatch for ref ${r.parsedContent.refSeqId} pos ${n}..${a}. recorded MD5: ${l}, calculated MD5: ${c}`)}}const f=yield this.getCoreDataBlock(),p={lastAlignmentStart:(0,h.isMappedSliceHeader)(r.parsedContent)?r.parsedContent.refSeqStart:0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{map:new Map,getCursor(e){let t=this.map.get(e);return void 0===t&&(t={bitPosition:7,bytePosition:0},this.map.set(e,t)),t}}},g=e=>{const t=n.getCodecForDataSeries(e);if(!t)throw new s.CramMalformedError(`no codec defined for ${e} data series`);return t.decode(this,f,a,p)};let m=new Array(r.parsedContent.numRecords);for(let t=0;t<m.length;t+=1)try{const e=(0,c.default)(this,g,n,r,f,a,p,i,t);m[t]=new l.default(Object.assign(Object.assign({},e),{uniqueId:r.contentPosition+r.parsedContent.recordCounter+t+1}))}catch(e){if(e instanceof d.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated."),m=m.filter((e=>!!e));break}throw e}for(let e=0;e<m.length;e+=1){const{mateRecordNumber:t}=m[e];void 0!==t&&t>=0&&u(m,e,m[e],m[t])}return m}))}getRecords(e){return n(this,void 0,void 0,(function*(){const t=this.container.filePosition+this.containerPosition;let i=this.file.featureCache.get(t.toString());i||(i=this._fetchRecords(),this.file.featureCache.set(t.toString(),i));const r=(yield i).filter(e);if(r.length&&this.file.fetchReferenceSequenceCallback){const e=yield this.getHeader();if((0,h.isMappedSliceHeader)(e.parsedContent)&&(e.parsedContent.refSeqId>=0||-2===e.parsedContent.refSeqId)){const t=e.parsedContent.refSeqId>=0?e.parsedContent.refSeqId:void 0,i=yield this.container.getCompressionScheme();if(void 0===i)throw new Error("compression scheme undefined");const s={};for(const e of r){const i=void 0!==t?t:e.sequenceId;let n=s[i];n||(n={id:i,start:e.alignmentStart,end:-1/0,seq:null},s[i]=n);const r=e.alignmentStart+(e.lengthOnRef||e.readLength)-1;r>n.end&&(n.end=r),e.alignmentStart<n.start&&(n.start=e.alignmentStart)}yield Promise.all(Object.values(s).map((e=>n(this,void 0,void 0,(function*(){-1!==e.id&&e.start<=e.end&&this.file.fetchReferenceSequenceCallback&&(e.seq=yield this.file.fetchReferenceSequenceCallback(e.id,e.start,e.end))})))));for(const e of r){const n=s[void 0!==t?t:e.sequenceId];if(null==n?void 0:n.seq){const t=n.seq;e.addReferenceSequence(Object.assign(Object.assign({},n),{seq:t}),i)}}}}return r}))}}t.default=f,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((e=>(0,o.tinyMemoize)(f,e)))},400:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.itf8Size=function(e){return-128&e?-16384&e?-2097152&e?-268435456&e?5:4:3:2:1},t.parseItf8=function(e,t){let i=t;const n=e[i];let r;if(n<128?(r=n,i+=1):n<192?(r=16383&(n<<8|e[i+1]),i+=2):n<224?(r=2097151&(n<<16|e[i+1]<<8|e[i+2]),i+=3):n<240?(r=268435455&(n<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),i+=4):(r=(15&n)<<28|e[i+1]<<20|e[i+2]<<12|e[i+3]<<4|15&e[i+4],i+=5),i>e.length)throw new o.CramBufferOverrunError("Attempted to read beyond end of buffer; this file seems truncated.");return[r,i-t]},t.parseLtf8=function(e,t){let i=t;const n=e[i];let r;if(n<128)r=n,i+=1;else if(n<192)r=16383&(e[i]<<8|e[i+1]),i+=2;else if(n<224)r=2097151&(e[i]<<16|e[i+1]<<8|e[i+2]),r=(63&n)<<16|e.readUInt16LE(i+1),i+=3;else if(n<240)r=268435455&(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),i+=4;else if(n<248)r=(15&e[i])*Math.pow(2,32)+(e[i+1]<<24)|e[i+2]<<16|e[i+3]<<8|e[i+4],i+=5;else if(n<252)r=((7&e[i])<<8|e[i+1])*Math.pow(2,32)+(e[i+2]<<24)|e[i+3]<<16|e[i+4]<<8|e[i+5],i+=6;else if(n<254)r=((3&e[i])<<16|e[i+1]<<8|e[i+2])*Math.pow(2,32)+(e[i+3]<<24)|e[i+4]<<16|e[i+5]<<8|e[i+6],i+=7;else if(n<255){if(r=s.default.fromBytesBE(e.slice(i+1,i+8)),r.greaterThan(Number.MAX_SAFE_INTEGER)||r.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");r=r.toNumber(),i+=8}else{if(r=s.default.fromBytesBE(e.slice(i+1,i+9)),r.greaterThan(Number.MAX_SAFE_INTEGER)||r.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");r=r.toNumber(),i+=9}return[r,i-t]},t.parseItem=function(e,t,i=0,n=0){const{offset:r,value:s}=t(e,i);return Object.assign(Object.assign({},s),{_endPosition:r+n,_size:r-i})},t.tinyMemoize=function(e,t){const i=e.prototype[t],n=`_memo_${t}`;e.prototype[t]=function(){if(!(n in this)){const e=i.call(this);this[n]=e,Promise.resolve(e).catch((()=>{delete this[n]}))}return this[n]}},t.sequenceMD5=function(e){return(0,r.default)(e.toUpperCase().replaceAll(/[^\u0021-\u007e]/g,""))};const r=n(i(3503)),s=n(i(8570)),o=i(612)},9747:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CramArgumentError=t.CramSizeLimitError=t.CramMalformedError=t.CramUnimplementedError=t.CramError=void 0;class i extends Error{}t.CramError=i;class n extends Error{}t.CramUnimplementedError=n,t.CramMalformedError=class extends i{},t.CramSizeLimitError=class extends i{},t.CramArgumentError=class extends i{}},7806:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedCramFile=t.CraiIndex=t.CramRecord=t.CramFile=void 0;const r=i(8287);window.Buffer=r.Buffer;var s=i(7390);Object.defineProperty(t,"CramFile",{enumerable:!0,get:function(){return n(s).default}}),Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return s.CramRecord}});var o=i(4923);Object.defineProperty(t,"CraiIndex",{enumerable:!0,get:function(){return n(o).default}});var a=i(6014);Object.defineProperty(t,"IndexedCramFile",{enumerable:!0,get:function(){return n(a).default}})},6014:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(9747),o=r(i(7390));t.default=class{constructor(e){var t;if(this.cram=null!==(t=e.cram)&&void 0!==t?t:new o.default({url:e.cramUrl,path:e.cramPath,filehandle:e.cramFilehandle,seqFetch:e.seqFetch,checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize}),!(this.cram instanceof o.default))throw new Error("invalid arguments: no cramfile");if(this.index=e.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index")}getRecordsForRange(e,t,i){return n(this,arguments,void 0,(function*(e,t,i,n={}){if(n.viewAsPairs=n.viewAsPairs||!1,n.pairAcrossChr=n.pairAcrossChr||!1,n.maxInsertSize=n.maxInsertSize||2e5,"string"==typeof e)throw new s.CramUnimplementedError("string sequence names not yet supported");const r=e,o=yield this.index.getEntriesForRange(r,t,i),a=n=>n.sequenceId===e&&n.alignmentStart<=i&&void 0!==n.lengthOnRef&&n.alignmentStart+n.lengthOnRef-1>=t,c=yield Promise.all(o.map((e=>this.getRecordsInSlice(e,a))));let l=Array.prototype.concat(...c);if(n.viewAsPairs){const e={},t={};for(const i of l){const n=i.readName;if(void 0===n)throw new Error("readName undefined");const r=i.uniqueId;e[n]||(e[n]=0),e[n]+=1,t[r]=1}const i={};Object.entries(e).forEach((([e,t])=>{1===t&&(i[e]=!0)}));const s=[];for(const e of l){const t=e.readName;if(void 0===t)throw new Error("readName undefined");if(i[t]&&e.mate&&(e.mate.sequenceId===r||n.pairAcrossChr)&&Math.abs(e.alignmentStart-e.mate.alignmentStart)<n.maxInsertSize){const t=this.index.getEntriesForRange(e.mate.sequenceId,e.mate.alignmentStart,e.mate.alignmentStart+1);s.push(t)}}const o=yield Promise.all(s);let a=[];for(const e of o)a.push(...e);a=a.sort(((e,t)=>e.toString().localeCompare(t.toString()))).filter(((e,t,i)=>!t||e.toString()!==i[t-1].toString()));const c=[];for(const e of a){let n=this.cram.featureCache.get(e.toString());n||(n=this.getRecordsInSlice(e,(()=>!0)),this.cram.featureCache.set(e.toString(),n));const r=n.then((e=>{const n=[];for(const r of e){if(void 0===r.readName)throw new Error("readName undefined");i[r.readName]&&!t[r.uniqueId]&&n.push(r)}return n}));c.push(r)}const h=yield Promise.all(c);if(h.length){const e=h.reduce(((e,t)=>e.concat(t)));l=l.concat(e)}}return l}))}getRecordsInSlice({containerStart:e,sliceStart:t,sliceBytes:i},n){return this.cram.getContainerAtPosition(e).getSlice(t,i).getRecords(n)}hasDataForReferenceSequence(e){return this.index.hasDataForReferenceSequence(e)}}},5931:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteFile=t.LocalFile=void 0,t.open=function(e,t,i){if(i)return i;if(e)return new n.RemoteFile(e);if(t)return new n.LocalFile(t);throw new Error("no url, path, or filehandle provided, cannot open")};const n=i(1113);var r=i(1113);Object.defineProperty(t,"LocalFile",{enumerable:!0,get:function(){return r.LocalFile}}),Object.defineProperty(t,"RemoteFile",{enumerable:!0,get:function(){return r.RemoteFile}})},6476:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RANS_BYTE_L=t.TOTFREQ=t.TF_SHIFT=void 0,t.TF_SHIFT=12,t.TOTFREQ=4096,t.RANS_BYTE_L=1<<23},997:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,n){let a=e.getInt(),c=e.getInt(),l=e.getInt(),h=e.getInt();const d=n.remaining(),u=-4&d;for(let r=0;r<u;r+=4){const d=t.R[o.default.get(a,s.TF_SHIFT)],u=t.R[o.default.get(c,s.TF_SHIFT)],f=t.R[o.default.get(l,s.TF_SHIFT)],p=t.R[o.default.get(h,s.TF_SHIFT)];n.putAt(r,d),n.putAt(r+1,u),n.putAt(r+2,f),n.putAt(r+3,p),a=o.default.advanceSymbolStep(a,i[255&d],s.TF_SHIFT),c=o.default.advanceSymbolStep(c,i[255&u],s.TF_SHIFT),l=o.default.advanceSymbolStep(l,i[255&f],s.TF_SHIFT),h=o.default.advanceSymbolStep(h,i[255&p],s.TF_SHIFT),a=o.default.renormalize(a,e),c=o.default.renormalize(c,e),l=o.default.renormalize(l,e),h=o.default.renormalize(h,e)}let f;switch(n.setPosition(u),3&d){case 0:break;case 1:f=t.R[o.default.get(a,s.TF_SHIFT)],o.default.advanceSymbol(a,e,i[255&f],s.TF_SHIFT),n.put(f);break;case 2:f=t.R[o.default.get(a,s.TF_SHIFT)],o.default.advanceSymbol(a,e,i[255&f],s.TF_SHIFT),n.put(f),f=t.R[o.default.get(c,s.TF_SHIFT)],o.default.advanceSymbol(c,e,i[255&f],s.TF_SHIFT),n.put(f);break;case 3:f=t.R[o.default.get(a,s.TF_SHIFT)],o.default.advanceSymbol(a,e,i[255&f],s.TF_SHIFT),n.put(f),f=t.R[o.default.get(c,s.TF_SHIFT)],o.default.advanceSymbol(c,e,i[255&f],s.TF_SHIFT),n.put(f),f=t.R[o.default.get(l,s.TF_SHIFT)],o.default.advanceSymbol(l,e,i[255&f],s.TF_SHIFT),n.put(f);break;default:throw new r.CramMalformedError("invalid output size encountered during rANS decoding")}n.setPosition(0)};const r=i(9747),s=i(6476),o=n(i(488))},7960:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,n){const o=t.remaining();let a=e.getInt(),c=e.getInt(),l=e.getInt(),h=e.getInt();const d=o>>2;let u=0,f=d,p=2*d,g=3*d,m=0,w=0,b=0,F=0;for(;u<d;u+=1,f+=1,p+=1,g+=1){const o=255&i[m].R[s.default.get(a,r.TF_SHIFT)],d=255&i[w].R[s.default.get(c,r.TF_SHIFT)],v=255&i[b].R[s.default.get(l,r.TF_SHIFT)],y=255&i[F].R[s.default.get(h,r.TF_SHIFT)];t.putAt(u,o),t.putAt(f,d),t.putAt(p,v),t.putAt(g,y),a=s.default.advanceSymbolStep(a,n[m][o],r.TF_SHIFT),c=s.default.advanceSymbolStep(c,n[w][d],r.TF_SHIFT),l=s.default.advanceSymbolStep(l,n[b][v],r.TF_SHIFT),h=s.default.advanceSymbolStep(h,n[F][y],r.TF_SHIFT),a=s.default.renormalize(a,e),c=s.default.renormalize(c,e),l=s.default.renormalize(l,e),h=s.default.renormalize(h,e),m=o,w=d,b=v,F=y}for(;g<o;g+=1){const o=255&i[F].R[s.default.get(h,r.TF_SHIFT)];t.putAt(g,o),h=s.default.advanceSymbol(h,e,n[F][o],r.TF_SHIFT),F=o}};const r=i(6476),s=n(i(488))},488:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(9747),r=i(6476);class s{constructor(){this.F=void 0,this.C=void 0}}function o(e,t,i,n){return i*(e>>n)+(e&(1<<n)-1)-t}const a={FC:s,AriDecoder:class{constructor(){this.fc=new Array(256);for(let e=0;e<this.fc.length;e+=1)this.fc[e]=new s;this.R=null}},Symbol:class{constructor(){this.start=void 0,this.freq=void 0}},symbolInit:function(e,t,i){if(!(t<=65536))throw new n.CramMalformedError("assertion failed: start <= 1<<16");if(!(i<=65536-t))throw new n.CramMalformedError("assertion failed: freq <= 1<<16");e.start=t,e.freq=i},advanceStep:o,advanceSymbolStep:function(e,t,i){return o(e,t.start,t.freq,i)},get:function(e,t){return e&(1<<t)-1},advanceSymbol:function(e,t,i,n){return function(e,t,i,n,s){if((e=n*(e>>s)+(e&(1<<s)-1)-i)<r.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<r.RANS_BYTE_L);return e}(e,t,i.start,i.freq,n)},renormalize:function(e,t){if(e<r.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<r.RANS_BYTE_L);return e}};t.default=a},1971:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.readStatsO0=function(e,t,i){let n=0,r=0,c=255&e.get();do{null==t.fc[c]&&(t.fc[c]=new o.default.FC),t.fc[c].F=255&e.get(),t.fc[c].F>=128&&(t.fc[c].F&=-129,t.fc[c].F=(127&t.fc[c].F)<<8|255&e.get()),t.fc[c].C=r,o.default.symbolInit(i[c],t.fc[c].C,t.fc[c].F),t.R||(t.R=new Array(s.TOTFREQ)),t.R.fill(c,r,r+t.fc[c].F),r+=t.fc[c].F,0===n&&c+1===(255&e.getByteAt(e.position()))?(c=255&e.get(),n=255&e.get()):0!==n?(n-=1,c+=1):c=255&e.get()}while(0!==c);a(r<s.TOTFREQ)},t.readStatsO1=function(e,t,i){let n=0,r=255&e.get();do{let c=0,l=0,h=255&e.get();null==t[r]&&(t[r]=new o.default.AriDecoder);do{null==t[r].fc[h]&&(t[r].fc[h]=new o.default.FC),t[r].fc[h].F=255&e.get(),t[r].fc[h].F>=128&&(t[r].fc[h].F&=-129,t[r].fc[h].F=(127&t[r].fc[h].F)<<8|255&e.get()),t[r].fc[h].C=l,0===t[r].fc[h].F&&(t[r].fc[h].F=s.TOTFREQ),null==i[r][h]&&(i[r][h]=new o.default.RansDecSymbol),o.default.symbolInit(i[r][h],t[r].fc[h].C,t[r].fc[h].F),null==t[r].R&&(t[r].R=new Array(s.TOTFREQ)),t[r].R.fill(h,l,l+t[r].fc[h].F),l+=t[r].fc[h].F,a(l<=s.TOTFREQ),0===c&&h+1===(255&e.getByteAt(e.position()))?(h=255&e.get(),c=255&e.get()):0!==c?(c-=1,h+=1):h=255&e.get()}while(0!==h);0===n&&r+1===(255&e.getByteAt(e.position()))?(r=255&e.get(),n=255&e.get()):0!==n?(n-=1,r+=1):r=255&e.get()}while(0!==r)};const r=i(9747),s=i(6476),o=n(i(488));function a(e){if(!e)throw new r.CramMalformedError("assertion failed")}},9989:function(e,t,i){var n=i(8287).Buffer,r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i=0){if(0===e.length)return t.fill(0),t;const r=new d(e,i),u=r.get();if(0!==u&&1!==u)throw new s.CramMalformedError(`Invalid rANS order ${u}`);if(r.getInt()!==r.remaining()-h)throw new s.CramMalformedError("Incorrect input length.");const f=r.getInt(),p=new d(t||n.allocUnsafe(f));if(p.length<f)throw new s.CramMalformedError(`Output buffer too small to fit ${f} bytes.`);switch(u){case 0:return function(e,t){const i=new o.default.AriDecoder,n=new Array(256);for(let e=0;e<n.length;e+=1)n[e]=new o.default.Symbol;return(0,a.readStatsO0)(e,i,n),(0,c.default)(e,i,n,t),t}(r,p);case 1:return function(e,t){const i=new Array(256);for(let e=0;e<i.length;e+=1)i[e]=new o.default.AriDecoder;const n=new Array(256);for(let e=0;e<n.length;e+=1){n[e]=new Array(256);for(let t=0;t<n[e].length;t+=1)n[e][t]=new o.default.Symbol}return(0,a.readStatsO1)(e,i,n),(0,l.default)(e,t,i,n),t}(r,p);default:throw new s.CramMalformedError(`Invalid rANS order: ${u}`)}};const s=i(9747),o=r(i(488)),a=i(1971),c=r(i(997)),l=r(i(7960)),h=4;class d{constructor(e,t=0){this._buffer=e,this._position=t,this.length=e.length}get(){const e=this._buffer[this._position];return this._position+=1,e}getByte(){return this.get()}getByteAt(e){return this._buffer[e]}position(){return this._position}put(e){return this._buffer[this._position]=e,this._position+=1,e}putAt(e,t){return this._buffer[e]=t,t}setPosition(e){return this._position=e,e}getInt(){const e=this._buffer.readInt32LE(this._position);return this._position+=4,e}remaining(){return this._buffer.length-this._position}}},5417:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseHeaderText=function(e){const t=e.split(/\r?\n/),i=[];for(const e of t){const[t,...n]=e.split(/\t/);t&&i.push({tag:t.slice(1),data:n.map((e=>{const t=e.indexOf(":");return-1!==t?{tag:e.slice(0,t),value:e.slice(t+1)}:{tag:e,value:""}}))})}return i}},8712:(e,t,i)=>{var n=i(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.unzip=function(e){return n.from((0,r.inflate)(e))};const r=i(1668)},7430:(e,t,i)=>{i.r(t),i.d(t,{default:()=>o});class n{}class r{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(e=new n){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(e),e.aborted?this.handleAborted(e):"function"==typeof e.addEventListener&&e.addEventListener("abort",(()=>{this.handleAborted(e)}))}handleAborted(e){this.signals.delete(e),0===this.signals.size&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}class s{constructor(){this.callbacks=new Set}addCallback(e=()=>{}){this.callbacks.add(e),e(this.currentMessage)}callback(e){this.currentMessage=e;for(const t of this.callbacks)t(e)}}class o{constructor({fill:e,cache:t}){if("function"!=typeof e)throw new TypeError("must pass a fill function");if("object"!=typeof t)throw new TypeError("must pass a cache object");if("function"!=typeof t.get||"function"!=typeof t.set||"function"!=typeof t.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=t,this.fillCallback=e}static isAbortException(e){return"AbortError"===e.name||"ERR_ABORTED"===e.code||"AbortError: aborted"===e.message||"Error: aborted"===e.message}evict(e,t){this.cache.get(e)===t&&this.cache.delete(e)}fill(e,t,i,n){const o=new r,a=new s;a.addCallback(n);const c={aborter:o,promise:this.fillCallback(t,o.signal,(e=>{a.callback(e)})),settled:!1,statusReporter:a,get aborted(){return this.aborter.signal.aborted}};c.aborter.addSignal(i),c.aborter.signal.addEventListener("abort",(()=>{c.settled||this.evict(e,c)})),c.promise.then((()=>{c.settled=!0}),(()=>{c.settled=!0,this.evict(e,c)})).catch((e=>{throw console.error(e),e})),this.cache.set(e,c)}static checkSinglePromise(e,t){function i(){if(null==t?void 0:t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return e.then((e=>(i(),e)),(e=>{throw i(),e}))}has(e){return this.cache.has(e)}get(e,t,i,n){if(!i&&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 r=this.cache.get(e);return r?r.aborted&&!r.settled?(this.evict(e,r),this.get(e,t,i,n)):r.settled?r.promise:(r.aborter.addSignal(i),r.statusReporter.addCallback(n),o.checkSinglePromise(r.promise,i)):(this.fill(e,t,i,n),o.checkSinglePromise(this.cache.get(e).promise,i))}delete(e){const t=this.cache.get(e);t&&(t.settled||t.aborter.abort(),this.cache.delete(e))}clear(){const e=this.cache.keys();let t=0;for(let i=e.next();!i.done;i=e.next())this.delete(i.value),t+=1;return t}}},635:(e,t,i)=>{var n=i(8287).Buffer;const r=i(4646),s=i(8706),o=i(9614),a=i(235),c=128;e.exports=class{decode(e){return this.stream=new s(e),this.decodeStream(this.stream)}decodeStream(e,t=0){var i=this.stream.ReadByte();16&i||(t=this.stream.ReadUint7());var n,r=t,s=1&i;if(8&i)return this.decodeStripe(this.stream,t);if(i&c&&([n,r]=this.decodePackMeta(this.stream)),32&i)var o=this.decodeCat(this.stream,r);else o=4&i?this.decodeExt(this.stream,r):64&i?s?this.decodeRLE1(this.stream,r):this.decodeRLE0(this.stream,r):s?this.decode1(this.stream,r):this.decode0(this.stream,r);return i&c&&(o=this.decodePack(o,n,t)),o}encode(e,t){if(this.stream=new s("",0,1.1*e.length+100),this.stream.WriteByte(t),16&t||this.stream.WriteUint7(e.length),8&t)return n.concat([this.stream.buf.slice(0,this.stream.pos),this.encodeStripe(this.stream,e,t>>8)]);var i,r=1&t,o=e.length;return t&c&&([i,e,o]=this.encodePack(e)),t&c&&this.stream.WriteStream(i),64&t?r?this.encodeRLE1(e,o,this.stream):this.encodeRLE0(e,o,this.stream):r?this.encode1(e,o,this.stream):this.encode0(e,o,this.stream)}decode0(e,t){var i=new n.allocUnsafe(t),s=e.ReadByte();0==s&&(s=256);var a=new o(s),c=new r(e);c.RangeStartDecode(e);for(var l=0;l<t;l++)i[l]=a.ModelDecode(e,c);return i}encode0(e,t,i){for(var n=0,s=0;s<t;s++)n<e[s]&&(n=e[s]);n++;var a=new o(n);i.WriteByte(n);var c=new r(i);for(s=0;s<t;s++)a.ModelEncode(i,c,e[s]);return c.RangeFinishEncode(i),i.buf.slice(0,i.pos)}decode1(e,t){var i=new n.allocUnsafe(t),s=e.ReadByte();0==s&&(s=256);for(var a=new Array(s),c=0;c<s;c++)a[c]=new o(s);var l=new r(e);l.RangeStartDecode(e);var h=0;for(c=0;c<t;c++)i[c]=a[h].ModelDecode(e,l),h=i[c];return i}encode1(e,t,i){for(var n=0,s=0;s<t;s++)n<e[s]&&(n=e[s]);n++;var a=new Array(n);for(s=0;s<n;s++)a[s]=new o(n);i.WriteByte(n);var c=new r(i),l=0;for(s=0;s<t;s++)a[l].ModelEncode(i,c,e[s]),l=e[s];return c.RangeFinishEncode(i),i.buf.slice(0,i.pos)}decodeExt(e,t){var i=new n.allocUnsafe(t),r=a.array(e.buf.slice(e.pos)),s=a.header(r),o=0;do{var c=a.decompress(r,s);-1!=c&&(n.from(c).copy(i,o),o+=c.length,s-=c.length)}while(-1!=c);return i}encodeExt(e,t){}decodeRLE0(e,t){var i=new n.allocUnsafe(t),s=e.ReadByte();0==s&&(s=256);for(var a=new o(s),c=new Array(258),l=0;l<=257;l++)c[l]=new o(4);var h=new r(e);for(h.RangeStartDecode(e),l=0;l<t;){i[l]=a.ModelDecode(e,h);for(var d=c[i[l]].ModelDecode(e,h),u=d,f=256;3==d;)d=c[f].ModelDecode(e,h),f=257,u+=d;for(var p=1;p<=u;p++)i[l+p]=i[l];l+=u+1}return i}encodeRLE0(e,t,i){for(var n=0,s=0;s<t;s++)n<e[s]&&(n=e[s]);n++;var a=new o(n),c=new Array(258);for(s=0;s<=257;s++)c[s]=new o(4);i.WriteByte(n);var l=new r(i);for(s=0;s<t;){a.ModelEncode(i,l,e[s]);for(var h=1;s+h<t&&e[s+h]==e[s];)h++;h--;var d=e[s];e[s],s+=h+1;var u=h>=3?3:h;for(c[d].ModelEncode(i,l,u),h-=u,d=256;3==u;)u=h>=3?3:h,c[d].ModelEncode(i,l,u),d=257,h-=u}return l.RangeFinishEncode(i),i.buf.slice(0,i.pos)}decodeRLE1(e,t){var i=new n.allocUnsafe(t),s=e.ReadByte();0==s&&(s=256);for(var a=new Array(s),c=0;c<s;c++)a[c]=new o(s);var l=new Array(258);for(c=0;c<=257;c++)l[c]=new o(4);var h=new r(e);h.RangeStartDecode(e);var d=0;for(c=0;c<t;){i[c]=a[d].ModelDecode(e,h),d=i[c];for(var u=l[i[c]].ModelDecode(e,h),f=u,p=256;3==u;)u=l[p].ModelDecode(e,h),p=257,f+=u;for(var g=1;g<=f;g++)i[c+g]=i[c];c+=f+1}return i}encodeRLE1(e,t,i){for(var n=0,s=0;s<t;s++)n<e[s]&&(n=e[s]);n++;var a=new Array(n);for(s=0;s<n;s++)a[s]=new o(n);var c=new Array(258);for(s=0;s<=257;s++)c[s]=new o(4);i.WriteByte(n);for(var l=new r(i),h=(s=0,0);s<t;){a[h].ModelEncode(i,l,e[s]);for(var d=1;s+d<t&&e[s+d]==e[s];)d++;d--;var u=e[s];h=e[s],s+=d+1;var f=d>=3?3:d;for(c[u].ModelEncode(i,l,f),d-=f,u=256;3==f;)f=d>=3?3:d,c[u].ModelEncode(i,l,f),u=257,d-=f}return l.RangeFinishEncode(i),i.buf.slice(0,i.pos)}decodePackMeta(e){this.nsym=e.ReadByte();for(var t=new Array(this.nsym),i=0;i<this.nsym;i++)t[i]=e.ReadByte();return[t,e.ReadUint7()]}decodePack(e,t,i){var r=new n.allocUnsafe(i);if(this.nsym<=1)for(var s=0;s<i;s++)r[s]=t[0];else if(this.nsym<=2){s=0;for(var o=0;s<i;s++){if(s%8==0)var a=e[o++];r[s]=t[1&a],a>>=1}}else if(this.nsym<=4)for(s=0,o=0;s<i;s++)s%4==0&&(a=e[o++]),r[s]=t[3&a],a>>=2;else{if(!(this.nsym<=16))return e;for(s=0,o=0;s<i;s++)s%2==0&&(a=e[o++]),r[s]=t[15&a],a>>=4}return r}packMeta(e){for(var t=new s("",0,1024),i=new Array(256),n=0;n<e.length;n++)i[e[n]]=1;var r=0;for(n=0;n<256;n++)i[n]&&(i[n]=++r);for(t.WriteByte(r),n=0;n<256;n++)i[n]&&(t.WriteByte(n),i[n]--);return[t,i,r]}encodePack(e){var t,i,r;[t,i,r]=this.packMeta(e);var s=e.length,o=0;if(r<=1)return t.WriteUint7(0),[t,new n.allocUnsafe(0),0];if(r<=2){for(var a=new n.allocUnsafe(Math.floor((s+7)/8)),c=(o=0,0);o<(-8&s);o+=8,c++)a[c]=(0|i[e[o+0]])+(i[e[o+1]]<<1)+(i[e[o+2]]<<2)+(i[e[o+3]]<<3)+(i[e[o+4]]<<4)+(i[e[o+5]]<<5)+(i[e[o+6]]<<6)+(i[e[o+7]]<<7);if(o<s){a[c]=0;for(var l=0;o<s;)a[c]|=i[e[o++]]<<l,l++;c++}return t.WriteUint7(c),[t,a,a.length]}if(r<=4){for(a=new n.allocUnsafe(Math.floor((s+3)/4)),o=0,c=0;o<(-4&s);o+=4,c++)a[c]=(0|i[e[o+0]])+(i[e[o+1]]<<2)+(i[e[o+2]]<<4)+(i[e[o+3]]<<6);if(o<s){for(a[c]=0,l=0;o<s;)a[c]|=i[e[o++]]<<l,l+=2;c++}return t.WriteUint7(c),[t,a,a.length]}if(r<=16){for(a=new n.allocUnsafe(Math.floor((s+1)/2)),o=0,c=0;o<(-2&s);o+=2,c++)a[c]=(0|i[e[o+0]])+(i[e[o+1]]<<4);return o<s&&(a[c++]=i[e[o++]]),t.WriteUint7(c),[t,a,a.length]}return t.WriteUint7(e.length),[t,e,e.length]}encodeStripe(e,t,i){0==i&&(i=4);for(var n=new Array(i),r=new Array(i),o=0;o<i;o++)r[o]=Math.floor(t.length/i)+(t.length%i>o),n[o]=new Array(r[o]);for(var a=0,c=0;c<t.length;c+=i,a++)for(var l=0;l<i;l++)a<n[l].length&&(n[l][a]=t[c+l]);var h=new Array(i),d=0;for(o=0;o<i;o++){var u=this.encode(n[o],0),f=this.encode(n[o],1);h[o]=f.length<u.length?f:u,d+=h[o].length}var p=new s("",0,d+5*i+1);for(p.WriteByte(i),o=0;o<i;o++)p.WriteUint7(h[o].length);for(o=0;o<i;o++)p.WriteData(h[o],h[o].length);return p.buf.slice(0,p.buf.pos)}decodeStripe(e,t){for(var i=e.ReadByte(),r=new Array(i),s=new Array(i),o=0;o<i;o++)r[o]=e.ReadUint7();var a=new Array(i);for(o=0;o<i;o++)s[o]=Math.floor(t/i)+(t%i>o),a[o]=this.decodeStream(e,s[o]);var c=new n.allocUnsafe(t);for(o=0;o<i;o++)for(var l=0;l<s[o];l++)c[l*i+o]=a[o][l];return c}decodeCat(e,t){for(var i=new n.allocUnsafe(t),r=0;r<t;r++)i[r]=e.ReadByte();return i}}},4646:e=>{e.exports=class{constructor(e){this.low=0,this.range=4294967295,this.code=0,this.FFnum=0,this.carry=0,this.cache=0}RangeStartDecode(e){for(var t=0;t<5;t++)this.code=(this.code<<8)+e.ReadByte();this.code&=4294967295,this.code>>>=0}RangeGetFrequency(e){return this.range=Math.floor(this.range/e),Math.floor(this.code/this.range)}RangeDecode(e,t,i,n){for(this.code-=t*this.range,this.range*=i;this.range<1<<24;)this.range*=256,this.code=256*this.code+e.ReadByte()}RangeShiftLow(e){if(this.low<4278190080|this.carry){for(e.WriteByte(this.cache+this.carry);this.FFnum;)e.WriteByte(this.carry-1),this.FFnum--;this.cache=this.low>>>24,this.carry=0}else this.FFnum++;this.low<<=8,this.low>>>=0}RangeEncode(e,t,i,n){var r=this.low;for(this.range=Math.floor(this.range/n),this.low+=t*this.range,this.low>>>=0,this.range*=i,this.low<r&&(0!=this.carry&&console.log("ERROR: Multiple carry"),this.carry=1);this.range<1<<24;)this.range*=256,this.RangeShiftLow(e)}RangeFinishEncode(e){for(var t=0;t<5;t++)this.RangeShiftLow(e)}}},9614:e=>{e.exports=class{constructor(e=256){this.total_freq=e,this.max_sym=e-1,this.S=new Array,this.F=new Array;for(var t=0;t<=this.max_sym;t++)this.S[t]=t,this.F[t]=1}ModelDecode(e,t){for(var i=t.RangeGetFrequency(this.total_freq),n=0,r=0;n+this.F[r]<=i;)n+=this.F[r++];t.RangeDecode(e,n,this.F[r],this.total_freq),this.F[r]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();var s=this.S[r];if(r>0&&this.F[r]>this.F[r-1]){var o=this.F[r];this.F[r]=this.F[r-1],this.F[r-1]=o,o=this.S[r],this.S[r]=this.S[r-1],this.S[r-1]=o}return s}ModelRenormalise(){this.total_freq=0;for(var e=0;e<=this.max_sym;e++)this.F[e]-=Math.floor(this.F[e]/2),this.total_freq+=this.F[e]}ModelEncode(e,t,i){for(var n=0,r=0;this.S[r]!=i;r++)n+=this.F[r];if(t.RangeEncode(e,n,this.F[r],this.total_freq),this.F[r]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise(),i=this.S[r],r>0&&this.F[r]>this.F[r-1]){var s=this.F[r];this.F[r]=this.F[r-1],this.F[r-1]=s,s=this.S[r],this.S[r]=this.S[r-1],this.S[r-1]=s}}}},6038:(e,t,i)=>{var n=i(8287).Buffer;const r=i(8706),s=i(9614),o=i(4646);function a(e,t,i){for(var n=0,r=0,s=-1,o=new Array(1024);r<i;){var a=e.ReadByte();if(o[n++]=a,r+=a,a==s){var c=e.ReadByte();for(r+=a*c;c--;)o[n++]=a}s=a}var l=0;for(n=0,r=0;r<i;){var h=0;do{var d=o[n++];h+=d}while(255==d);for(;h--;)t[r++]=l;l++}}function c(e,t,i){var n=e.context;return t.qctx=(t.qctx<<e.qshift)+e.qtab[i],n+=(t.qctx&(1<<e.qbits)-1)<<e.qloc,e.do_pos&&(n+=e.ptab[Math.min(t.p,1023)]<<e.ploc),e.do_delta&&(n+=e.dtab[Math.min(t.delta,255)]<<e.dloc,t.delta+=t.prevq!=i?1:0,t.prevq=i),e.do_sel&&(n+=t.s<<e.sloc),t.p--,65535&n}function l(e){var t={};t.context=e.ReadUint16(),t.pflags=e.ReadByte(),t.do_dedup=2&t.pflags,t.fixed_len=4&t.pflags,t.do_sel=8&t.pflags,t.do_qmap=16&t.pflags,t.do_pos=32&t.pflags,t.do_delta=64&t.pflags,t.do_qtab=128&t.pflags,t.max_sym=e.ReadByte();var i=e.ReadByte();if(t.qbits=i>>4,t.qshift=15&i,i=e.ReadByte(),t.qloc=i>>4,t.sloc=15&i,i=e.ReadByte(),t.ploc=i>>4,t.dloc=15&i,t.qmap=new Array(256),16&t.pflags)for(var n=0;n<t.max_sym;n++)t.qmap[n]=e.ReadByte();else for(n=0;n<256;n++)t.qmap[n]=n;if(t.qtab=new Array(1024),t.qbits>0&&128&t.pflags)a(e,t.qtab,256);else for(n=0;n<256;n++)t.qtab[n]=n;return t.ptab=new Array(1024),32&t.pflags&&a(e,t.ptab,1024),t.dtab=new Array(256),64&t.pflags&&a(e,t.dtab,256),t}function h(e,t,i,n,r,s){i.max_sel>0?r.s=n.sel.ModelDecode(e,t):r.s=0,r.x=i.stab[r.s];var o=i.params[r.x];if(o.fixed_len>=0){var a=n.len[0].ModelDecode(e,t);a|=n.len[1].ModelDecode(e,t)<<8,a|=n.len[2].ModelDecode(e,t)<<16,a|=n.len[3].ModelDecode(e,t)<<24,o.fixed_len>0&&(o.fixed_len=-a)}else a=-o.fixed_len;r.len=a,i.do_rev&&(s[r.rec]=n.rev.ModelDecode(e,t)),r.is_dup=0,2&o.pflags&&n.dup.ModelDecode(e,t)&&(r.is_dup=1),r.p=a,r.delta=0,r.qctx=0,r.prevq=0,r.rec++}function d(e,t,i){for(var n=0,r=0,s=new Array(2*i),o=0;n<i;){for(var a=n;n<i&&t[n]==r;)n++;var c=n-a;do{var l=Math.min(255,c);s[o++]=l,c-=l}while(255==l);r++}var h=-1,d=new Array(2*i),u=0;for(n=0;n<o;){var f=s[n++];if(d[u++]=f,f==h){for(a=n;n<o&&s[n]==h&&n-a<255;)n++;d[u++]=n-a}else h=f}e.WriteData(d,u)}e.exports={decode:function(e,t){return function(e,t){var i=e.ReadUint7(),r=function(e){var t={max_sym:0};if(5==e.ReadByte()){var i=e.ReadByte(),n=1&i?e.ReadByte():1,r=i.nparam>1?i.nparam-1:0,s=new Array(256);if(2&i)r=e.ReadByte(),a(e,s,256);else{for(var o=0;o<n;o++)s[o]=o;for(;o<256;o++)s[o]=n-1}t.do_rev=4&i,t.stab=s,t.max_sel=r,t.params=new Array(t.nparam);for(var c=0;c<n;c++)t.params[c]=l(e),t.max_sym<t.params[c].max_sym&&(t.max_sym=t.params[c].max_sym);return t}console.error("Invalid FQZComp version number")}(e);if(r){var d=r.params,u=new Array(t.length),f=function(e){var t={};t.qual=new Array(65536);for(var i=0;i<65536;i++)t.qual[i]=new s(e.max_sym+1);for(t.len=new Array(4),i=0;i<4;i++)t.len[i]=new s(256);return t.rev=new s(2),t.dup=new s(2),e.max_sel>0&&(t.sel=new s(e.max_sel+1)),t}(r),p=new o(e);p.RangeStartDecode(e);for(var g=new n.allocUnsafe(i),m={qctx:0,prevq:0,delta:0,p:0,s:0,x:0,len:0,is_dup:0,rec:0},w=0;w<i;){if(0==m.p){if(h(e,p,r,f,m,u),m.is_dup>0&&f.dup.ModelDecode(e,p)){for(var b=0;b<len;b++)g[w+b]=g[w+b-m.len];w+=m.len,m.p=0;continue}t.push(m.len);var F=(d=r.params[m.x]).context}var v=f.qual[F].ModelDecode(e,p);g[w++]=d.qmap[v],F=c(d,m,v)}return r.do_rev&&function(e,t,i,n){for(var r=0,s=0;s<t;){if(i[r])for(var o=0,a=n[r]-1;o<a;){var c=e[s+o];e[s+o]=e[s+a],e[s+a]=c,o++,a--}s+=n[r++]}}(g,i,u,t),g}}(new r(e),t)},encode:function(e,t,i){for(var n=new Array(2),a=new Array(2),c=new Array(2),l=new Array(2),h=new Array(256),u=0;u<2;u++)n[u]=new Array(256),a[u]=new Array(256),c[u]=new Array(1024),l[u]=new Array(256);(p=new r("",0,1.1*e.length+100)).WriteUint7(e.length);var f=function(e,t,i,n){for(var r=i[0],s=0;s<i.length&&i[s]==r;s++);var o=s==i.length?1:0,a=0,c=0;for(s=0;s<256;s++)n[0][s]=0;var l=0,h=0;for(s=0;s<e.length;s++)0==h&&(h=t[l<t.length-1?l++:l]),n[0][e[s]]++,h--;for(s=0;s<256;s++)n[0][s]&&(c<s&&(c=s),a++);var d=5,u=0;return a<=16&&(u=1,d=a<=2?1:a<=4?2:a<=8?3:4),[{qbits:8+(d>4),qshift:d,qloc:7,pbits:7,pshift:t[0]>128?1:0,ploc:0,dbits:d>4?0:1,dshift:3,dloc:15,sbits:0,sloc:15,do_stab:0,context:0,max_sym:c,nsym:a,do_qmap:u,do_dedup:0,fixed_len:1==t.length?1:0,do_sel:0,do_rev:0,do_pos:1,do_delta:d<=4?1:0,do_qtab:0,qbits:8+(d>4)-(0==o),sbits:1,sloc:15-(d<=4),do_stab:1,do_sel:1}]}(e,t,i,n),p=function(e,t,i,n,r,s,o){for(var a=[0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],c=0;c<t.length;c++)o[c]=c;for(;c<256;c++)o[c]=t.length-1;e.WriteByte(5);var l=(t.length>1?1:0)|(t[0].do_stab?2:0);if(e.WriteByte(l),1&l&&e.WriteByte(t.length),2&l){var h=1<<t[0].sbits;h>0&&h--,e.WriteByte(h),d(e,o,256)}for(var u=0;u<t.length;u++){if(e.WriteUint16(t[u].context),e.WriteByte((t[u].do_qtab?128:0)|(t[u].do_delta?64:0)|(t[u].do_pos?32:0)|(t[u].do_qmap?16:0)|(t[u].do_sel?8:0)|(t[u].fixed_len?4:0)|(t[u].do_dedup?2:0)),t[u].do_qmap?e.WriteByte(t[u].nsym):e.WriteByte(t[u].max_sym),e.WriteByte(t[u].qbits<<4|t[u].qshift),e.WriteByte(t[u].qloc<<4|t[u].sloc),e.WriteByte(t[u].ploc<<4|t[u].dloc),t[u].do_qmap){t[u].max_sym=t[u].nsym;var f=0;for(c=0;c<256;c++)i[u][c]&&(e.WriteByte(c),i[u][c]=f++);for(;f<t[u].nsym;f++)e.WriteByte(0)}else for(c=0;c<256;c++)i[u][c]=c;if(t[u].qbits>0){for(c=0;c<256;c++)n[u][c]=c;t[u].do_qtab&&d(e,n[u],256)}if(t[u].pbits>0){for(c=0;c<1024;c++)r[u][c]=Math.min((1<<t[u].pbits)-1,c>>t[u].pshift);d(e,r[u],1024)}if(t[u].dbits>0){for(c=0;c<256;c++)a[c]>(1<<t[u].dbits)-1&&(a[c]=(1<<t[u].dbits)-1);for(c=0;c<256;c++)s[u][c]=a[Math.min(a.length-1,c>>t[u].dshift)];d(e,s[u],256)}}return e}(p,f,n,a,c,l,h);return function(e,t,i,n,r,a,c,l,h,d){var u=1<<r[0].sbits;u>0&&u--;for(var f=t.length,p=0,g=0;g<r.length;g++)p<r[g].max_sym&&(p=r[g].max_sym);for(var m=new Array(65536),w=0;w<65536;w++)m[w]=new s(p+1);var b=new Array(4);for(w=0;w<4;w++)b[w]=new s(256);new s(2),new s(2);for(var F=new s(u+1),v=new o(t),y=(g=0,w=0,0);w<f;){if(0==g){var A=n[y];r[0].sbits>0&&F.ModelEncode(e,v,A);var C=d[A],_=i[Math.min(i.length-1,y++)];r[C].fixed_len?r[C].fixed_len>0&&(b[0].ModelEncode(e,v,255&_),b[1].ModelEncode(e,v,_>>8&255),b[2].ModelEncode(e,v,_>>16&255),b[3].ModelEncode(e,v,_>>24&255),r[C].fixed_len=-1):(b[0].ModelEncode(e,v,255&_),b[1].ModelEncode(e,v,_>>8&255),b[2].ModelEncode(e,v,_>>16&255),b[3].ModelEncode(e,v,_>>24&255)),r[C].do_dedup&&process.exit(1),g=_;var x=0,k=r[C].context,I=0,S=0}var E=t[w++],N=a[C][E];m[k].ModelEncode(e,v,N),I=(I<<r[C].qshift)+c[C][N],k=r[C].context,k+=(I&(1<<r[C].qbits)-1)<<r[C].qloc,r[C].pbits>0&&(k+=l[C][Math.min(g,1023)]<<r[C].ploc),r[C].dbits>0&&(k+=h[C][Math.min(x,255)]<<r[C].dloc,x+=S!=N?1:0,S=N),r[C].do_sel&&(k+=A<<r[C].sloc),k&=65535,g--}return v.RangeFinishEncode(e),e.buf.slice(0,e.pos)}(p,e,t,i,f,n,a,c,l,h)}}},6960:(e,t,i)=>{var n=i(8287).Buffer,r=i(5460),s=i(8223),o=i(635),a=i(6038),c=i(5997);e.exports={r4x8_uncompress:function(e,t){r.decode(e).copy(t,0,0)},r4x16_uncompress:function(e,t){s.decode(e).copy(t,0,0)},arith_uncompress:function(e,t){o.decode(e).copy(t,0,0)},fqzcomp_uncompress:function(e,t){var i=new Array;a.decode(e,i).copy(t,0,0)},tok3_uncompress:function(e,t){var i=c.decode(e,0,"\0");n.from(i,"binary").copy(t,0,0)}}},8706:(e,t,i)=>{var n=i(8287).Buffer;e.exports=class{constructor(e,t=0,i=0){0!=i?(this.buf=n.allocUnsafe(i),this.length=i):(this.buf=e,this.length=e.length),this.pos=t}EOF(){return this.pos>=this.length}ReadData(e){var t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}ReadByte(){const e=this.buf[this.pos];return this.pos++,e}ReadChar(){const e=this.buf[this.pos];return this.pos++,String.fromCharCode(e)}ReadUint16(){return this.ReadByte()|this.ReadByte()<<8}ReadUint32(){const e=this.buf.readInt32LE(this.pos);return this.pos+=4,e}ReadString(){var e="";do{var t=this.buf[this.pos++];t&&(e+=String.fromCharCode(t))}while(t);return e}ReadUint7(){var e=0;do{var t=this.ReadByte();e=e<<7|127&t}while(128&t);return e}ReadITF8(){var e=this.buf[this.pos];return this.pos++,e>=240?(e=(15&e)<<28,e+=(this.buf[this.pos+0]<<20)+(this.buf[this.pos+1]<<12)+(this.buf[this.pos+2]<<4)+(this.buf[this.pos+3]>>4),this.pos+=4):e>=224?(e=(15&e)<<24,e+=(this.buf[this.pos+0]<<16)+(this.buf[this.pos+1]<<8)+(0|this.buf[this.pos+2]),this.pos+=3):e>=192?(e=(31&e)<<16,e+=(this.buf[this.pos+0]<<8)+(0|this.buf[this.pos+1]),this.pos+=2):e>=128&&(e=(63&e)<<8,e+=this.buf[this.pos],this.pos++),e}WriteByte(e){this.buf[this.pos++]=e}WriteChar(e){this.buf[this.pos++]=e.charCodeAt(0)}WriteString(e){for(var t=0;t<e.length;t++)this.buf[this.pos++]=e.charCodeAt(t);this.buf[this.pos++]=0}WriteData(e,t){for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]}WriteStream(e){this.WriteData(e.buf,e.pos)}WriteUint16(e){this.WriteByte(255&e),this.WriteByte(e>>8&255)}WriteUint32(e){this.buf.writeInt32LE(e,this.pos),this.pos+=4}WriteUint7(e){var t=0,i=e;do{t+=7,i>>=7}while(i>0);do{t-=7,this.WriteByte((e>>t&127)+((t>0)<<7))}while(t>0)}WriteITF8(e){e<0&&(e=1+e),e<=127?this.buf[this.pos++]=e:e<=16383?(this.buf[this.pos++]=128|Math.floor(e/256),this.buf[this.pos++]=255&e):e<131071?(this.buf[this.pos++]=192|Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):e<268435455?(this.buf[this.pos++]=224|Math.floor(e/16777216),this.buf[this.pos++]=255&Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):(this.buf[this.pos++]=240|Math.floor(e/268435456),this.buf[this.pos++]=255&Math.floor(e/1048576),this.buf[this.pos++]=255&Math.floor(e/4096),this.buf[this.pos++]=255&Math.floor(e/4),this.buf[this.pos++]=15&e)}WriteByteNeg(e){this.buf[--this.pos]=e}}},5460:(e,t,i)=>{var n=i(8287).Buffer;const r=i(8706);function s(e){return 4095&e}function o(e,t){for(var i=0;t>=e[i+1];)i++;return i}function a(e){for(var t=new Array(4096),i=0,n=0;n<4096;n++){for(;n>=e[i+1];)i++;t[n]=i}return t}function c(e,t,i){return i*(e>>12)+(4095&e)-t}function l(e,t){for(;t<1<<23;)t=(t<<8)+e.ReadByte();return t}function h(e,t){t.WriteByteNeg(e>>24&255),t.WriteByteNeg(e>>16&255),t.WriteByteNeg(e>>8&255),t.WriteByteNeg(255&e)}function d(e,t,i,n,r){return e=function(e,t,i,n){for(var r=(1<<23>>n<<8)*i;e>=r;)t.WriteByteNeg(255&e),e>>=8;return e}(e,t,n,r),(Math.floor(e/n)<<r)+e%n+i}function u(e,t,i){for(var n=0;n<256;n++)t[n]=0;var r=e.ReadByte(),s=r,o=0;do{var a=e.ReadITF8();t[r]=a,o>0?(o--,r++):(r=e.ReadByte())==s+1&&(o=e.ReadByte()),s=r}while(0!=r);for(i[0]=0,n=0;n<=255;n++)i[n+1]=i[n]+t[n]}function f(e){for(var t=0,i=0;i<256;i++)t+=e[i];const n=4096;var r=n/t;do{var s=0,o=0,a=0;for(t=0,i=0;i<256;i++)0!=e[i]&&(s<e[i]&&(s=e[i],o=i),e[i]=Math.floor(e[i]*r),0==e[i]&&(e[i]=1),t+=e[i]);t<n?e[o]+=n-t:t-n<e[o]/2&&e[o]>2?e[o]-=t-n:t!=n&&(r*=.99,a=1)}while(a)}function p(e,t){for(var i=0,n=0;n<256;n++)if(t[n]){if(i>0)i--;else if(e.WriteByte(n),n>0&&t[n-1]>0){for(i=n+1;i<256&&t[i];i++);i-=n+1,e.WriteByte(i)}e.WriteITF8(t[n])}e.WriteByte(0)}e.exports={decode:function(e){var t=new r(e),i=t.ReadByte(),h=(t.ReadUint32(),t.ReadUint32());return 0==i?function(e,t){var i=new Array(256),r=new Array(256);u(e,i,r);for(var o=a(r),h=new Array(4),d=0;d<4;d++)h[d]=e.ReadUint32();var f=new n.allocUnsafe(t);for(d=0;d<t;d++){var p=d%4,g=o[s(h[p])];f[d]=g,h[p]=c(h[p],r[g],i[g]),h[p]=l(e,h[p])}return f}(t,h):function(e,t){var i=new Array(256),r=new Array(256);!function(e,t,i){for(var n=0;n<256;n++){t[n]=new Array(256),i[n]=new Array(256);for(var r=0;r<256;r++)t[n][r]=0}var s=e.ReadByte(),o=s,a=0;do{u(e,t[s],i[s]),a>0?(a--,s++):(s=e.ReadByte())==o+1&&(a=e.ReadByte()),o=s}while(0!=s)}(e,i,r);for(var h=new Array(256),d=0;d<256;d++)h[d]=a(r[d]);for(var f=new Array(4),p=new Array(4),g=0;g<4;g++)f[g]=e.ReadUint32(),p[g]=0;var m=new n.allocUnsafe(t),w=Math.floor(t/4);for(d=0;d<w;d++)for(g=0;g<4;g++){var b=s(f[g]),F=h[p[g]][b];m[d+g*w]=F,f[g]=c(f[g],r[p[g]][F],i[p[g]][F]),f[g]=l(e,f[g]),p[g]=F}for(d*=4;d<t;)b=s(f[3]),F=o(r[p[3]],b),m[d++]=F,f[3]=c(f[3],r[p[3]][F],i[p[3]][F]),f[3]=l(e,f[3]),p[3]=F;return m}(t,h)},encode:function(e,t){return 0==t?function(e){const t=e.length;var i=new r("",0,780);i.WriteByte(0),i.WriteUint32(0),i.WriteUint32(0);var s=new Array(256);(function(e,t){for(var i=0;i<256;i++)t[i]=0;for(i=0;i<e.length;i++)t[e[i]]++})(e,s),f(s),p(i,s);var o=new Array(256);o[0]=0;for(var a=1;a<256;a++)o[a]=o[a-1]+s[a-1];var c=new Array(4);for(a=0;a<4;a++)c[a]=1<<23;var l=Math.floor(1.05*t+100),u=new r("",l,l);for(a=t-1;a>=0;a--)c[a%4]=d(c[a%4],u,o[e[a]],s[e[a]],12);for(a=3;a>=0;a--)h(c[a],u);var g=i.pos;return i.buf.writeInt32LE(g-9+(u.length-u.pos),1),i.buf.writeInt32LE(t,5),n.concat([i.buf.slice(0,i.pos),u.buf.slice(u.pos,u.length)],i.pos+u.length-u.pos)}(e):function(e){const t=e.length;var i=new r("",0,198156);i.WriteByte(1),i.WriteUint32(0),i.WriteUint32(0);for(var s=new Array(256),o=new Array(256),a=new Array(256),c=0;c<256;c++)o[c]=new Array(256),a[c]=new Array(256);for(function(e,t,i){for(var n=0;n<256;n++){i[n]=0;for(var r=0;r<256;r++)t[n][r]=0}var s=0;for(n=0;n<e.length;n++)i[e[n]]++,t[s][e[n]]++,s=e[n];t[0][e[1*(e.length>>2)]]++,t[0][e[2*(e.length>>2)]]++,t[0][e[3*(e.length>>2)]]++,i[0]+=3}(e,o,s),function(e,t){for(var i=0;i<256;i++)t[i]&&f(e[i])}(o,s),function(e,t,i){for(var n=0,r=0;r<256;r++)if(i[r]){if(n>0)n--;else if(e.WriteByte(r),r>0&&i[r-1]>0){for(n=r+1;n<256&&i[n];n++);n-=r+1,e.WriteByte(n)}p(e,t[r])}e.WriteByte(0)}(i,o,s),c=0;c<256;c++)if(s[c]){a[c][0]=0;for(var l=1;l<256;l++)a[c][l]=a[c][l-1]+o[c][l-1]}var u=new Array(4),g=new Array(4);for(l=0;l<4;l++)u[l]=1<<23,g[l]=0;var m=new r("",t,t),w=Math.floor(t/4),b=new Array(4),F=new Array(4);for(l=0;l<4;l++)b[l]=(l+1)*w-2,F[l]=e[b[l]+1];for(F[3]=e[t-1],c=t-2;c>4*w-2;c--)u[3]=d(u[3],m,a[e[c]][F[3]],o[e[c]][F[3]],12),F[3]=e[c];for(;b[0]>=0;)for(l=3;l>=0;l--){var v=e[b[l]];u[l]=d(u[l],m,a[v][F[l]],o[v][F[l]],12),F[l]=v,b[l]--}for(l=3;l>=0;l--)u[l]=d(u[l],m,a[0][F[l]],o[0][F[l]],12);for(c=3;c>=0;c--)h(u[c],m);var y=i.pos;return i.buf.writeInt32LE(y-9+(m.length-m.pos),1),i.buf.writeInt32LE(t,5),n.concat([i.buf.slice(0,i.pos),m.buf.slice(m.pos,m.length)],i.pos+m.length-m.pos)}(e)}}},8223:(e,t,i)=>{var n=i(8287).Buffer;const r=i(8706);function s(e,t){return e&(1<<t)-1}function o(e,t){for(var i=0;t>=e[i+1];)i++;return i}function a(e,t){for(var i=1<<t,n=new Array(i),r=0,s=0;s<i;s++){for(;s>=e[r+1];)r++;n[s]=r}return n}function c(e,t,i,n){return i*(e>>n)+(e&(1<<n)-1)-t}function l(e,t){return t<32768&&(t=(t<<16)+e.ReadUint16()),t}function h(e,t){t.WriteByteNeg(e>>24&255),t.WriteByteNeg(e>>16&255),t.WriteByteNeg(e>>8&255),t.WriteByteNeg(255&e)}function d(e,t,i,n,r){return e=function(e,t,i,n){for(var r=(1<<31-n)*i;e>=r;)t.WriteByteNeg(e>>8&255),t.WriteByteNeg(255&e),e>>=16;return e}(e,t,n,r),(Math.floor(e/n)<<r)+e%n+i}function u(e,t,i){0==i&&(i=4);for(var n=new Array(i),s=new Array(i),o=0;o<i;o++)s[o]=Math.floor(t.length/i)+(t.length%i>o),n[o]=new Array(s[o]);for(var a=0,c=0;c<t.length;c+=i,a++)for(var l=0;l<i;l++)a<n[l].length&&(n[l][a]=t[c+l]);var h=new Array(i),d=0;for(o=0;o<i;o++){var u=p(n[o],0),f=p(n[o],1);h[o]=f.length<u.length?f:u,d+=h[o].length}var g=new r("",0,d+5*i+1);for(g.WriteByte(i),o=0;o<i;o++)g.WriteUint7(h[o].length);for(o=0;o<i;o++)g.WriteData(h[o],h[o].length);return g.buf.slice(0,g.buf.pos)}function f(e,t){var i=e.ReadByte(),h=1&i,d=8&i,u=32&i,p=64&i,w=128&i;if(16&i||(t=e.ReadUint7()),d)return function(e,t){for(var i=e.ReadByte(),r=new Array(i),s=new Array(i),o=0;o<i;o++)r[o]=e.ReadUint7();var a=new Array(i);for(o=0;o<i;o++)s[o]=Math.floor(t/i)+(t%i>o),a[o]=f(e,s[o]);var c=new n.allocUnsafe(t);for(o=0;o<i;o++)for(var l=0;l<s[o];l++)c[l*i+o]=a[o][l];return c}(e,t);if(w)var F=t,[v,y,t]=function(e){for(var t=e.ReadByte(),i=new Array(t),n=0;n<t;n++)i[n]=e.ReadByte();return[i,t,e.ReadUint7()]}(e);if(p)var A=t,[C,_,t]=function(e){var t=e.ReadUint7(),i=e.ReadUint7();if(1&t)var n=e.ReadData((t-1)/2);else{var s=e.ReadUint7();n=e.ReadData(s),n=m(new r(n),t/2)}n=new r(n);var o=new Array(256),a=n.ReadByte();0==a&&(a=256);for(var c=0;c<a;c++)o[n.ReadByte()]=1;return[o,n,i]}(e);if(u)var x=e.ReadData(t);else x=0==h?m(e,t):function(e,t){var i=(f=e.ReadByte())>>4,h=e;if(1&f){var d=e.ReadUint7(),u=e.ReadUint7(),f=new r(e.ReadData(u));h=new r(m(f,d))}var p=new Array(256),w=new Array(256);!function(e,t,i,n){for(var r=0;r<256;r++){t[r]=new Array(256),i[r]=new Array(256);for(var s=0;s<256;s++)t[r][s]=0}var o=g(e);for(r=0;r<256;r++)if(o[r]){var a=0;for(s=0;s<256;s++)o[s]&&(a>0?a--:(t[r][s]=e.ReadUint7(),0==t[r][s]&&(a=e.ReadByte())));for(b(t[r],n),i[r][0]=0,s=0;s<256;s++)i[r][s+1]=i[r][s]+t[r][s]}}(h,p,w,i);for(var F=new Array(256),v=0;v<256;v++)F[v]=a(w[v],i);for(var y=new Array(4),A=new Array(4),C=0;C<4;C++)y[C]=e.ReadUint32(),A[C]=0;var _=new n.allocUnsafe(t),x=Math.floor(t/4);for(v=0;v<x;v++)for(C=0;C<4;C++){var k=s(y[C],i),I=F[A[C]][k];_[v+C*x]=I,y[C]=c(y[C],w[A[C]][I],p[A[C]][I],i),y[C]=l(e,y[C]),A[C]=I}for(v*=4;v<t;)k=s(y[3],i),I=o(w[A[3]],k),_[v++]=I,y[3]=c(y[3],w[A[3]][I],p[A[3]][I],i),y[3]=l(e,y[3]),A[3]=I;return _}(e,t);return p&&(x=function(e,t,i,s){new r(e);for(var o=new n.allocUnsafe(s),a=0,c=0;a<s;c++){var l=e[c];if(t[l])for(var h=i.ReadUint7(),d=0;d<=h;d++)o[a++]=l;else o[a++]=l}return o}(x,C,_,A)),w&&(x=function(e,t,i,r){var s=new n.allocUnsafe(r),o=0;if(i<=1)for(var a=0;a<r;a++)s[a]=t[0];else if(i<=2)for(a=0;a<r;a++){if(a%8==0)var c=e[o++];s[a]=t[1&c],c>>=1}else if(i<=4)for(a=0;a<r;a++)a%4==0&&(c=e[o++]),s[a]=t[3&c],c>>=2;else if(i<=16)for(a=0;a<r;a++)a%2==0&&(c=e[o++]),s[a]=t[15&c],c>>=4;return s}(x,v,y,F)),x}function p(e,t){var i=new r("",0,10);i.WriteByte(t);var s=1&t,o=8&t,a=32&t,c=64&t,l=128&t,f=t>>8;if(16&t||i.WriteUint7(e.length),o)return n.concat([i.buf.slice(0,i.pos),u(0,e,f)]);var p=new n.alloc(0);l&&([p,e]=function(e){for(var t=new Array(256),i=0;i<256;i++)t[i]=0;for(i=0;i<e.length;i++)t[e[i]]++;var s=new Array(256),o=0;for(i=0;i<256;i++)t[i]>0&&(s[i]=o++);if(!(o>16)){if(o<=1)var a=new n.allocUnsafe(0);else if(o<=2){a=new n.allocUnsafe(Math.ceil(e.length/8));var c=-1;for(i=0;i<e.length;i++)i%8==0&&(a[++c]=0),a[c]+=s[e[i]]<<i%8}else if(o<=4)for(a=new n.allocUnsafe(Math.ceil(e.length/4)),c=-1,i=0;i<e.length;i++)i%4==0&&(a[++c]=0),a[c]+=s[e[i]]<<i%4*2;else for(a=new n.allocUnsafe(Math.ceil(e.length/2)),c=-1,i=0;i<e.length;i++)i%2==0&&(a[++c]=0),a[c]+=s[e[i]]<<i%2*4;var l=new r("",0,o+5);for(l.WriteByte(o),c=0,i=0;i<256;i++)t[i]>0&&(t[i]=c++,l.WriteByte(i));return l.WriteUint7(a.length),[l.buf.slice(0,l.pos),a]}}(e));var g=new n.alloc(0);if(c&&([g,e]=function(e){for(var t=new Array(256),i=0;i<256;i++)t[i]=0;var s=-1;for(i=0;i<e.length;i++)t[e[i]]+=e[i]==s?1:-1,s=e[i];var o=0;for(i=0;i<256;i++)t[i]>0&&o++;for(o||(o=1,t[0]=1),(h=new r("",0,o+1+e.length)).WriteByte(o),i=0;i<256;i++)t[i]>0&&h.WriteByte(i);var a=new n.allocUnsafe(e.length),c=0;for(i=0;i<e.length;i++)if(a[c++]=e[i],t[e[i]]>0){s=e[i];for(var l=0;i+l+1<e.length&&e[i+l+1]==s;)l++;h.WriteUint7(l),i+=l}var h,d=v(h.buf.slice(0,h.pos)),u=new r("",0,16);return u.WriteUint7(2*h.pos),u.WriteUint7(c),u.WriteUint7(d.length),[h=n.concat([u.buf.slice(0,u.pos),d]),a.slice(0,c)]}(e)),e.length<4&&1==s&&(s=0,i.buf[0]&=-2),a)var m=e;else m=0==s?v(e):function(e){const t=e.length;for(var i=new r("",0,198156),s=new Array(256),o=new Array(256),a=new Array(256),c=0;c<256;c++)o[c]=new Array(256),a[c]=new Array(256);(function(e,t,i){for(var n=0;n<256;n++){i[n]=0;for(var r=0;r<256;r++)t[n][r]=0}var s=0;for(n=0;n<e.length;n++)i[s]++,t[s][e[n]]++,s=e[n];i[s]++,t[0][e[1*(e.length>>2)]]++,t[0][e[2*(e.length>>2)]]++,t[0][e[3*(e.length>>2)]]++,i[0]+=3})(e,o,s),function(e,t){for(var i=0;i<256;i++)if(t[i]){var n=Math.ceil(Math.log2(t[i]));n>12&&(n=12),w(e[i],n)}}(o,s);var l=new r("",0,198156);!function(e,t,i){F(e,i);for(var n=0;n<256;n++)if(i[n])for(var r=0,s=0;s<256;s++)if(i[s])if(r)r--;else if(e.WriteUint7(t[n][s]),!t[n][s]){for(var o=s+1;o<256;o++)if(i[o]){if(0!=t[n][o])break;r++}e.WriteByte(r)}}(l,o,s);var u=v(l.buf.slice(0,l.pos));for(u.length<l.pos?(i.WriteByte(193),i.WriteUint7(l.pos),i.WriteUint7(u.length),i.WriteData(u,u.length)):(i.WriteByte(192),i.WriteData(l.buf,l.pos)),function(e,t){for(var i=0;i<256;i++)t[i]&&b(e[i],12)}(o,s),c=0;c<256;c++)if(s[c]){a[c][0]=0;for(var f=1;f<256;f++)a[c][f]=a[c][f-1]+o[c][f-1]}var p=new Array(4),g=new Array(4);for(f=0;f<4;f++)p[f]=32768,g[f]=0;var m=new r("",1.05*t+100|0,1.05*t+100|0),y=Math.floor(t/4),A=new Array(4),C=new Array(4);for(f=0;f<4;f++)A[f]=(f+1)*y-2,C[f]=e[A[f]+1];for(C[3]=e[t-1],c=t-2;c>4*y-2;c--)p[3]=d(p[3],m,a[e[c]][C[3]],o[e[c]][C[3]],12),C[3]=e[c];for(;A[0]>=0;)for(f=3;f>=0;f--){var _=e[A[f]];p[f]=d(p[f],m,a[_][C[f]],o[_][C[f]],12),C[f]=_,A[f]--}for(f=3;f>=0;f--)p[f]=d(p[f],m,a[0][C[f]],o[0][C[f]],12);for(c=3;c>=0;c--)h(p[c],m);return n.concat([i.buf.slice(0,i.pos),m.buf.slice(m.pos,m.length)],i.pos+m.length-m.pos)}(e);return n.concat([i.buf.slice(0,i.pos),p,g,m])}function g(e){for(var t=new Array(256),i=0;i<256;i++)t[i]=0;var n=0,r=e.ReadByte(),s=r;do{t[r]=1,n>0?(n--,r++):(r=e.ReadByte())==s+1&&(n=e.ReadByte()),s=r}while(0!=r);return t}function m(e,t){var i=new Array(256),r=new Array(256);!function(e,t,i){for(var n=0;n<256;n++)t[n]=0;var r=g(e);for(n=0;n<256;n++)r[n]>0&&(t[n]=e.ReadUint7());for(b(t,12),i[0]=0,n=0;n<=255;n++)i[n+1]=i[n]+t[n]}(e,i,r);for(var o=a(r,12),h=new Array(4),d=0;d<4;d++)h[d]=e.ReadUint32();var u=new n.allocUnsafe(t);for(d=0;d<t;d++){var f=d%4,p=o[s(h[f],12)];u[d]=p,h[f]=c(h[f],r[p],i[p],12),h[f]=l(e,h[f])}return u}function w(e,t){for(var i=0,n=0;n<256;n++)i+=e[n];const r=1<<t;var s=r/i;do{var o=0,a=0,c=0;for(i=0,n=0;n<256;n++)0!=e[n]&&(o<e[n]&&(o=e[n],a=n),e[n]=Math.floor(e[n]*s),0==e[n]&&(e[n]=1),i+=e[n]);i<r?e[a]+=r-i:i-r<e[a]/2&&e[a]>2?e[a]-=i-r:i!=r&&(s=r/i,c=1)}while(c)}function b(e,t){for(var i=0,n=0;n<256;n++)i+=e[n];if(0!=i&&i!=1<<t){for(var r=0;i<1<<t;)i*=2,r++;for(n=0;n<256;n++)e[n]<<=r}}function F(e,t){for(var i=0,n=0;n<256;n++)if(t[n])if(i>0)i--;else if(e.WriteByte(n),n>0&&t[n-1]>0){for(i=n+1;i<256&&t[i];i++);i-=n+1,e.WriteByte(i)}e.WriteByte(0)}function v(e){const t=e.length;var i=new r("",0,780),s=new Array(256);!function(e,t){for(var i=0;i<256;i++)t[i]=0;for(i=0;i<e.length;i++)t[e[i]]++}(e,s);var o=Math.ceil(Math.log2(t));o>12&&(o=12),w(s,o),function(e,t){F(e,t);for(var i=0;i<256;i++)t[i]&&e.WriteUint7(t[i])}(i,s),w(s,12);var a=new Array(256);a[0]=0;for(var c=1;c<256;c++)a[c]=a[c-1]+s[c-1];var l=new Array(4);for(c=0;c<4;c++)l[c]=32768;var u=new r("",1.05*t+100|0,1.05*t+100|0);for(c=t-1;c>=0;c--)l[c%4]=d(l[c%4],u,a[e[c]],s[e[c]],12);for(c=3;c>=0;c--)h(l[c],u);return n.concat([i.buf.slice(0,i.pos),u.buf.slice(u.pos,u.length)],i.pos+u.length-u.pos)}e.exports={decode:function(e){return f(new r(e),0)},encode:p}},5997:(e,t,i)=>{var n=i(8287).Buffer;const r=i(8706),s=i(8223);var o=new(i(635));function a(e,t){for(var i=e+"";i.length<t;)i="0"+i;return i}function c(e,t,i,n){var r=e[0][0].ReadByte(),s=n-e[0][r].ReadUint32();if(5==r)return t[n]=t[s],i[n]=i[s],t[n];var o=1;t[n]="",i[n]=new Array(256);do{switch(r=e[o][0].ReadByte()){case 2:i[n][o]=e[o][2].ReadChar();break;case 1:i[n][o]=e[o][1].ReadString();break;case 7:i[n][o]=e[o][7].ReadUint32();break;case 3:var c=e[o][3].ReadUint32(),l=e[o][4].ReadByte();i[n][o]=a(c,l);break;case 8:i[n][o]=(0|i[s][o])+e[o][8].ReadByte();break;case 9:c=(0|i[s][o])+e[o][9].ReadByte(),l=i[s][o].length,i[n][o]=a(c,l);break;case 10:i[n][o]=i[s][o];break;default:i[n][o]=""}t[n]+=i[n][o++]}while(12!=r);return t[n]}function l(e,t,i,n,r,s){for(var o=0;o<n.length;o++)if(!(i>0&&5==t[o][0].type)&&t[o][i])switch(e[0].WriteByte(t[o][i].type),t[o][i].type){case 6:e[6].WriteUint32(t[o][i].val);break;case 5:e[5].WriteUint32(t[o][i].val);break;case 1:e[1].WriteString(t[o][i].val);break;case 2:e[2].WriteChar(t[o][i].val);break;case 7:e[7].WriteUint32(t[o][i].val);break;case 3:e[3].WriteUint32(t[o][i].val),e[4].WriteByte(t[o][i].val.length);break;case 8:case 9:e[t[o][i].type].WriteByte(t[o][i].val)}}function h(e,t,i,n){for(var r=0;r<=12;r++)if(!(e[r].pos<=0)){n.WriteByte(r+(0==r?128:0)),e[r]=e[r].buf.slice(0,e[r].pos);var s=d(e[r],i);n.WriteUint7(s.length),n.WriteData(s,s.length)}}function d(e,t){var i,n=1<<30,r=[0,1,64,65,128,129,201];for(var a in r){var c=r[a];if(!(1&c&&e.length<100||8&c&&e.length%4!=0)){try{var l=t?o.encode(e,c):s.encode(e,c)}catch(e){l=0}l&&n>l.length&&(n=l.length,i=l)}}return i}function u(e,t,i,n,r){var s=0,o=r-1;e[r]=new Array(256),t[n]?e[r][0]={type:5,val:r-t[n]}:e[r][0]={type:6,val:0==r?0:1},t[n]=r;for(var a=n.match(/([a-zA-Z0-9]{1,9})|([^a-zA-Z0-9]+)/g),c=0;c<a.length;c++){var l=c+1,h=1,d=a[c];if(a[c].match(/^0+[0-9]*$/g)?h=3:a[c].match(/^[0-9]+$/g)?h=7:1==a[c].length&&(h=2),o>=0&&e[o][l])if(e[o][l].str==a[c])h=10,d="";else if(7==e[o][l].type||8==e[o][l].type){var u=d-e[o][l].str;i[l]++,u>=0&&u<256&&i[l]>r/2&&(h=8,d=u)}else 3!=e[o][l].type&&9!=e[o][l].type||e[o][l].str.length!=d.length||(u=d-e[o][l].str,i[l]++,u>=0&&u<256&&i[l]>r/2&&(h=9,d=u));e[r][l]={str:a[c],val:d,type:h},s<e[r][l].val.length+3&&(s=e[r][l].val.length+3)}return e[r][++l]={type:12},[l+1,s]}e.exports={encode:function(e,t){var i=e.toString();"\n"==i[i.length-1]&&(i=i.substring(0,i.length-1));var n=i.split("\n"),s=new r("",0,2*i.length+1e4);s.WriteUint32(i.length),s.WriteUint32(n.length),s.WriteByte(t);for(var o=new Array(n.length),a={},c=new Array(256).fill(0),d=0,f=0,p=0;p<n.length;p++){var[g,m]=u(o,a,c,n[p],p);d<g&&(d=g),f<m&&(f=m)}for(var w=0;w<d;w++){for(var b=new Array(13),F=0;F<=12;F++)b[F]=new r("",0,n.length*f);l(b,o,w,n),h(b,0,t,s)}return s.buf.slice(0,s.pos)},decode:function(e,t,i){(e=new r(e)).ReadUint32();var a=e.ReadUint32(),l=e.ReadByte(),h=function(e,t,i,a){for(var c=-1,l=new Array(256);!e.EOF();){var h=e.ReadByte(),d=128&h,u=64&h,f=63&h;if(d&&(l[++c]=new Array(13)),0!=f&&d){var p=new Array(a-1).fill(10);l[c][0]=new r(n.from([f].concat(p)))}if(u){var g=e.ReadByte(),m=e.ReadByte();l[c][f]=new r(l[g][m].buf)}else{var w=e.ReadUint7(),b=e.ReadData(w);l[c][f]=i?o.decode(b):s.decode(b),l[c][f]=new r(l[c][f])}}return l}(e,0,l,a),d=new Array(a),u=new Array(a),f="";void 0===i&&(i="\n");for(var p=0;p<a;p++)f+=c(h,d,u,p)+i;return f}}},7526:(e,t)=>{t.byteLength=function(e){var t=a(e),i=t[0],n=t[1];return 3*(i+n)/4-n},t.toByteArray=function(e){var t,i,s=a(e),o=s[0],c=s[1],l=new r(function(e,t,i){return 3*(t+i)/4-i}(0,o,c)),h=0,d=c>0?o-4:o;for(i=0;i<d;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===c&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,l[h++]=255&t),1===c&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,s=[],o=16383,a=0,l=n-r;a<l;a+=o)s.push(c(e,a,a+o>l?l:a+o));return 1===r?(t=e[n-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")),s.join("")};for(var i=[],n=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)i[o]=s[o],n[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function c(e,t,n){for(var r,s,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[(s=r)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287:(e,t,i)=>{const n=i(7526),r=i(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const i=0|g(e,t);let n=a(i);const r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return f(e,t,i);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return f(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,i);const r=function(e){if(c.isBuffer(e)){const t=0|p(e.length),i=a(t);return 0===i.length||e.copy(i,0,0,t),i}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)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 d(e){return h(e),a(e<0?0:0|p(e))}function u(e){const t=e.length<0?0:0|p(e.length),i=a(t);for(let n=0;n<t;n+=1)i[n]=255&e[n];return i}function f(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return G(e).length;default:if(r)return n?-1:W(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,i){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,i);case"utf8":case"utf-8":return k(this,t,i);case"ascii":return S(this,t,i);case"latin1":case"binary":return E(this,t,i);case"base64":return x(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function b(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),Y(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:F(e,t,i,n,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):F(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function F(e,t,i,n,r){let s,o=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){let n=-1;for(s=i;s<a;s++)if(l(e,s)===l(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===c)return n*o}else-1!==n&&(s-=s-n),n=-1}else for(i+c>a&&(i=a-c),s=i;s>=0;s--){let i=!0;for(let n=0;n<c;n++)if(l(e,s+n)!==l(t,n)){i=!1;break}if(i)return s}return-1}function v(e,t,i,n){i=Number(i)||0;const r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;const s=t.length;let o;for(n>s/2&&(n=s/2),o=0;o<n;++o){const n=parseInt(t.substr(2*o,2),16);if(Y(n))return o;e[i+o]=n}return o}function y(e,t,i,n){return $(W(t,e.length-i),e,i,n)}function A(e,t,i,n){return $(function(e){const t=[];for(let i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function C(e,t,i,n){return $(G(t),e,i,n)}function _(e,t,i,n){return $(function(e,t){let i,n,r;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)i=e.charCodeAt(o),n=i>>8,r=i%256,s.push(r),s.push(n);return s}(t,e.length-i),e,i,n)}function x(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function k(e,t,i){i=Math.min(e.length,i);const n=[];let r=t;for(;r<i;){const t=e[r];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(r+o<=i){let i,n,a,c;switch(o){case 1:t<128&&(s=t);break;case 2:i=e[r+1],128==(192&i)&&(c=(31&t)<<6|63&i,c>127&&(s=c));break;case 3:i=e[r+1],n=e[r+2],128==(192&i)&&128==(192&n)&&(c=(15&t)<<12|(63&i)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:i=e[r+1],n=e[r+2],a=e[r+3],128==(192&i)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&i)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),r+=o}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=I));return i}(n)}t.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),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}}),c.poolSize=8192,c.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,i){return function(e,t,i){return h(e),e<=0?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)}(e,t,i)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let r=0,s=Math.min(i,n);r<s;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const n=c.allocUnsafe(t);let r=0;for(i=0;i<e.length;++i){let t=e[i];if(K(t,Uint8Array))r+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,r)):Uint8Array.prototype.set.call(n,t,r);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,r)}r+=t.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)w(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,i,n,r){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;let s=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0);const a=Math.min(s,o),l=this.slice(n,r),h=e.slice(t,i);for(let e=0;e<a;++e)if(l[e]!==h[e]){s=l[e],o=h[e];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},c.prototype.indexOf=function(e,t,i){return b(this,e,t,i,!0)},c.prototype.lastIndexOf=function(e,t,i){return b(this,e,t,i,!1)},c.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}const r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return v(this,e,t,i);case"utf8":case"utf-8":return y(this,e,t,i);case"ascii":case"latin1":case"binary":return A(this,e,t,i);case"base64":return C(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function S(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function E(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function N(e,t,i){const n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);let r="";for(let n=t;n<i;++n)r+=X[e[n]];return r}function B(e,t,i){const n=e.slice(t,i);let r="";for(let e=0;e<n.length-1;e+=2)r+=String.fromCharCode(n[e]+256*n[e+1]);return r}function M(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,i,n,r,s){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<s)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function D(e,t,i,n,r){q(t,n,r,e,i,7);let s=Number(t&BigInt(4294967295));e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s,s>>=8,e[i++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=o,o>>=8,e[i++]=o,o>>=8,e[i++]=o,o>>=8,e[i++]=o,i}function T(e,t,i,n,r){q(t,n,r,e,i,7);let s=Number(t&BigInt(4294967295));e[i+7]=s,s>>=8,e[i+6]=s,s>>=8,e[i+5]=s,s>>=8,e[i+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=o,o>>=8,e[i+2]=o,o>>=8,e[i+1]=o,o>>=8,e[i]=o,i+8}function L(e,t,i,n,r,s){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function z(e,t,i,n,s){return t=+t,i>>>=0,s||L(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function H(e,t,i,n,s){return t=+t,i>>>=0,s||L(e,0,i,8),r.write(e,t,i,n,52,8),i+8}c.prototype.slice=function(e,t){const i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||M(e,t,this.length);let n=this[e],r=1,s=0;for(;++s<t&&(r*=256);)n+=this[e+s]*r;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||M(e,t,this.length);let n=this[e+--t],r=1;for(;t>0&&(r*=256);)n+=this[e+--t]*r;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Z((function(e){Q(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+i*2**24;return BigInt(n)+(BigInt(r)<<BigInt(32))})),c.prototype.readBigUInt64BE=Z((function(e){Q(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+i;return(BigInt(n)<<BigInt(32))+BigInt(r)})),c.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||M(e,t,this.length);let n=this[e],r=1,s=0;for(;++s<t&&(r*=256);)n+=this[e+s]*r;return r*=128,n>=r&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||M(e,t,this.length);let n=t,r=1,s=this[e+--n];for(;n>0&&(r*=256);)s+=this[e+--n]*r;return r*=128,s>=r&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);const i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);const i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Z((function(e){Q(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=Z((function(e){Q(e>>>=0,"offset");const t=this[e],i=this[e+7];void 0!==t&&void 0!==i||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+i)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),r.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),r.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),r.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),r.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||R(this,e,t,i,Math.pow(2,8*i)-1,0);let r=1,s=0;for(this[t]=255&e;++s<i&&(r*=256);)this[t+s]=e/r&255;return t+i},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,i,n){e=+e,t>>>=0,i>>>=0,n||R(this,e,t,i,Math.pow(2,8*i)-1,0);let r=i-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+i},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Z((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Z((function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}let r=0,s=1,o=0;for(this[t]=255&e;++r<i&&(s*=256);)e<0&&0===o&&0!==this[t+r-1]&&(o=1),this[t+r]=(e/s|0)-o&255;return t+i},c.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}let r=i-1,s=1,o=0;for(this[t+r]=255&e;--r>=0&&(s*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/s|0)-o&255;return t+i},c.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Z((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Z((function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,i){return z(this,e,t,!0,i)},c.prototype.writeFloatBE=function(e,t,i){return z(this,e,t,!1,i)},c.prototype.writeDoubleLE=function(e,t,i){return H(this,e,t,!0,i)},c.prototype.writeDoubleBE=function(e,t,i){return H(this,e,t,!1,i)},c.prototype.copy=function(e,t,i,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);const r=n-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),r},c.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;let r;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(r=t;r<i;++r)this[r]=e;else{const s=c.isBuffer(e)?e:c.from(e,n),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<i-t;++r)this[r+t]=s[r%o]}return this};const P={};function O(e,t,i){P[e]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",i=e.length;const n="-"===e[0]?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}function q(e,t,i,n,r,s){if(e>i||e<t){const n="bigint"==typeof t?"n":"";let r;throw r=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${i}${n}`,new P.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,i){Q(t,"offset"),void 0!==e[t]&&void 0!==e[t+i]||V(t,e.length-(i+1))}(n,r,s)}function Q(e,t){if("number"!=typeof e)throw new P.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,i){if(Math.floor(e)!==e)throw Q(e,i),new P.ERR_OUT_OF_RANGE(i||"offset","an integer",e);if(t<0)throw new P.ERR_BUFFER_OUT_OF_BOUNDS;throw new P.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}O("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),O("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),O("ERR_OUT_OF_RANGE",(function(e,t,i){let n=`The value of "${e}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=U(String(i)):"bigint"==typeof i&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=U(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n}),RangeError);const j=/[^+/0-9A-Za-z-_]/g;function W(e,t){let i;t=t||1/0;const n=e.length;let r=null;const s=[];for(let o=0;o<n;++o){if(i=e.charCodeAt(o),i>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,i,n){let r;for(r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){const n=16*i;for(let r=0;r<16;++r)t[n+r]=e[i]+e[r]}return t}();function Z(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},235:e=>{var t={array:function(e){var t=0,i=0,n=[0,1,3,7,15,31,63,127,255];return function(r){for(var s=0;r>0;){var o=8-t;r>=o?(s<<=o,s|=n[o]&e[i++],t=0,r-=o):(s<<=r,s|=(e[i]&n[r]<<8-r-t)>>8-r-t,t+=r,r=0)}return s}},simple:function(e){var i,n,r=t.header(e),s=[],o=0;do{-1!=(n=t.decompress(e,r))&&(s.push(n),o+=n.byteLength)}while(-1!=n);i=new Uint8Array(o),o=0;for(var a=0;a<s.length;++a)n=s[a],i.set(n,o),o+=n.byteLength;return i},header:function(e){if(4348520!=e(24))throw"No magic number found";var t=e(8)-48;if(t<1||t>9)throw"Not a BZIP archive";return t},decompress:function(e,t,i){for(var n=9e5,r="",s=0;s<6;s++)r+=e(8).toString(16);if("177245385090"==r)return-1;if("314159265359"!=r)throw"eek not valid bzip data";if(e(32),e(1))throw"unsupported obsolete version";var o=e(24);if(o>n)throw"Initial position larger than buffer size";var a=e(16),c=new Uint8Array(256),l=0;for(s=0;s<16;s++)if(a&1<<15-s){var h=e(16);for(g=0;g<16;g++)h&1<<15-g&&(c[l++]=16*s+g)}var d=e(3);if(d<2||d>6)throw"another error";var u=e(15);if(0==u)throw"meh";var f=[];for(s=0;s<d;s++)f[s]=s;var p=new Uint8Array(32768);for(s=0;s<u;s++){for(var g=0;e(1);g++)if(g>=d)throw"whoops another error";var m=f[g];f.splice(g,1),f.splice(0,0,m),p[s]=m}var w=l+2,b=[];for(g=0;g<d;g++){var F,v,y,A=new Uint8Array(258),C=new Uint8Array(21);for(a=e(5),s=0;s<w;s++){for(;;){if(a<1||a>20)throw"I gave up a while ago on writing error messages";if(!e(1))break;e(1)?a--:a++}A[s]=a}for(F=v=A[0],s=1;s<w;s++)A[s]>v?v=A[s]:A[s]<F&&(F=A[s]);(y=b[g]={}).permute=new Uint32Array(258),y.limit=new Uint32Array(21),y.base=new Uint32Array(21),y.minLen=F,y.maxLen=v;var _=y.base.subarray(1),x=y.limit.subarray(1),k=0;for(s=F;s<=v;s++)for(a=0;a<w;a++)A[a]==s&&(y.permute[k++]=a);for(s=F;s<=v;s++)C[s]=x[s]=0;for(s=0;s<w;s++)C[A[s]]++;for(k=a=0,s=F;s<v;s++)k+=C[s],x[s]=k-1,k<<=1,_[s+1]=k-(a+=C[s]);x[v]=k+C[v]-1,_[F]=0}var I,S,E,N=new Uint32Array(256);for(s=0;s<256;s++)f[s]=s;I=S=w=E=0;for(var B=new Uint32Array(n);;){if(!w--){if(w=49,E>=u)throw"meow i'm a kitty, that's an error";_=(y=b[p[E++]]).base.subarray(1),x=y.limit.subarray(1)}for(g=e(s=y.minLen);;){if(s>y.maxLen)throw"rawr i'm a dinosaur";if(g<=x[s])break;s++,g=g<<1|e(1)}if((g-=_[s])<0||g>=258)throw"moo i'm a cow";var M=y.permute[g];if(0!=M&&1!=M){if(I){if(I=0,S+a>=n)throw"Boom.";for(N[m=c[f[0]]]+=a;a--;)B[S++]=m}if(M>l)break;if(S>=n)throw"I can't think of anything. Error";m=f[s=M-1],f.splice(s,1),f.splice(0,0,m),N[m=c[m]]++,B[S++]=m}else I||(I=1,a=0),a+=0==M?I:2*I,I<<=1}if(o<0||o>=S)throw"I'm a monkey and I'm throwing something at someone, namely you";for(g=0,s=0;s<256;s++)h=g+N[s],N[s]=g,g=h;for(s=0;s<S;s++)B[N[m=255&B[s]]]|=s<<8,N[m]++;var R=0,D=0,T=0;S&&(D=255&(R=B[o]),R>>=8,T=-1);var L,z,H,P=new Uint8Array(n),O=0;for(i||(i=1/0);S;){for(S--,z=D,D=255&(R=B[R]),R>>=8,3==T++?(L=D,H=z,D=-1):(L=1,H=D);L--;)if(P[O++]=H,! --i)return P;D!=z&&(T=0)}return P.subarray(0,O)}};e.exports=t},2151:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],i=0;i<e.length;i++)t.push(255&e.charCodeAt(i));return t},bytesToString:function(e){for(var t=[],i=0;i<e.length;i++)t.push(String.fromCharCode(e[i]));return t.join("")}}};e.exports=t},3939:e=>{var t,i;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&i.rotl(e,8)|4278255360&i.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=i.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],i=0,n=0;i<e.length;i++,n+=8)t[n>>>5]|=e[i]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],i=0;i<32*e.length;i+=8)t.push(e[i>>>5]>>>24-i%32&255);return t},bytesToHex:function(e){for(var t=[],i=0;i<e.length;i++)t.push((e[i]>>>4).toString(16)),t.push((15&e[i]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t},bytesToBase64:function(e){for(var i=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],s=0;s<4;s++)8*n+6*s<=8*e.length?i.push(t.charAt(r>>>6*(3-s)&63)):i.push("=");return i.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&i.push((t.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|t.indexOf(e.charAt(n))>>>6-2*r);return i}},e.exports=i},1113:(e,t,i)=>{i.r(t),i.d(t,{BlobFile:()=>l,LocalFile:()=>r(),RemoteFile:()=>a,fromUrl:()=>h,open:()=>d});var n=i(3617),r=i.n(n),s=i(8287);function o(e){return("object"==typeof e&&null!==e&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}class a{async getBufferFromResponse(e){const t=await e.arrayBuffer();return s.Buffer.from(t)}constructor(e,t={}){this.baseOverrides={},this.url=e;const i=t.fetch||globalThis.fetch.bind(globalThis);if(!i)throw new TypeError("no fetch function supplied, and none found in global environment");t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=i}async fetch(e,t){let i;try{i=await this.fetchImplementation(e,t)}catch(n){if(!`${n}`.includes("Failed to fetch"))throw new Error(`${o(n)} fetching ${e}`,{cause:n});console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{i=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(t){throw new Error(`${o(t)} fetching ${e}`,{cause:t})}}return i}async read(e,t=0,i,n=0,r={}){const{headers:s={},signal:o,overrides:a={}}=r;i<1/0?s.range=`bytes=${n}-${n+i}`:i===1/0&&0!==n&&(s.range=`bytes=${n}-`);const c=await this.fetch(this.url,{...this.baseOverrides,...a,headers:{...s,...a.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:o});if(!c.ok)throw new Error(`HTTP ${c.status} fetching ${this.url}`);if(200===c.status&&0===n||206===c.status){const n=await this.getBufferFromResponse(c),r=n.copy(e,t,0,Math.min(i,n.length)),s=c.headers.get("content-range"),o=/\/(\d+)$/.exec(s||"");return(null==o?void 0:o[1])&&(this._stat={size:parseInt(o[1],10)}),{bytesRead:r,buffer:e}}if(200===c.status)throw new Error(`${this.url} fetch returned status 200, expected 206`);throw new Error(`HTTP ${c.status} fetching ${this.url}`)}async readFile(e={}){let t,i;"string"==typeof e?(t=e,i={}):(t=e.encoding,i=e,delete i.encoding);const{headers:n={},signal:r,overrides:s={}}=i,o=await this.fetch(this.url,{headers:n,method:"GET",redirect:"follow",mode:"cors",signal:r,...this.baseOverrides,...s});if(200!==o.status)throw new Error(`HTTP ${o.status} fetching ${this.url}`);if("utf8"===t)return o.text();if(t)throw new Error(`unsupported encoding: ${t}`);return this.getBufferFromResponse(o)}async stat(){if(!this._stat){const e=s.Buffer.allocUnsafe(10);if(await this.read(e,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}function c(e){const t=new FileReader;return new Promise(((i,n)=>{t.onerror=()=>{t.abort(),n(new Error("problem reading blob"))},t.onabort=()=>{n(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&"string"!=typeof t.result?i(t.result):n(new Error("unknown error reading blob"))},t.readAsArrayBuffer(e)}))}class l{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0,i,n=0){if(!i)return{bytesRead:0,buffer:e};const r=n,o=r+i,a=await c(this.blob.slice(r,o)),l=s.Buffer.from(a);return{bytesRead:l.copy(e,t),buffer:l}}async readFile(e){const t="string"==typeof e?e:null==e?void 0:e.encoding;if("utf8"===t)return function(e){const t=new FileReader;return new Promise(((i,n)=>{t.onerror=()=>{t.abort(),n(new Error("problem reading blob"))},t.onabort=()=>{n(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&"string"==typeof t.result?i(t.result):n(new Error("unknown error reading blob"))},t.readAsText(e)}))}(this.blob);if(t)throw new Error(`unsupported encoding: ${t}`);const i=await c(this.blob);return s.Buffer.from(i)}async stat(){return{size:this.size}}async close(){}}function h(e,t={}){return new a(e,t)}function d(e,t,i,n={}){if(void 0!==i)return i;if(void 0!==e)return h(e,n);if(void 0!==t)return new(r())(t,n);throw new Error("no url, path, or filehandle provided, cannot open")}},251:(e,t)=>{t.read=function(e,t,i,n,r){var s,o,a=8*r-n-1,c=(1<<a)-1,l=c>>1,h=-7,d=i?r-1:0,u=i?-1:1,f=e[t+d];for(d+=u,s=f&(1<<-h)-1,f>>=-h,h+=a;h>0;s=256*s+e[t+d],d+=u,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=256*o+e[t+d],d+=u,h-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=l}return(f?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,i,n,r,s){var o,a,c,l=8*s-r-1,h=(1<<l)-1,d=h>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?u/c:u*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=h?(a=0,o=h):o+d>=1?(a=(t*c-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[i+f]=255&a,f+=p,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;e[i+f]=255&o,f+=p,o/=256,l-=8);e[i+f-p]|=128*g}},8570:e=>{e.exports=i;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function i(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function n(e){return!0===(e&&e.__isLong__)}i.prototype.__isLong__,Object.defineProperty(i.prototype,"__isLong__",{value:!0}),i.isLong=n;var r={},s={};function o(e,t){var i,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=s[e])?n:(i=c(e,(0|e)<0?-1:0,!0),o&&(s[e]=i),i):(o=-128<=(e|=0)&&e<128)&&(n=r[e])?n:(i=c(e,e<0?-1:0,!1),o&&(r[e]=i),i)}function a(e,t){if(isNaN(e))return t?w:m;if(t){if(e<0)return w;if(e>=f)return A}else{if(e<=-p)return C;if(e+1>=p)return y}return e<0?a(-e,t).neg():c(e%u|0,e/u|0,t)}function c(e,t,n){return new i(e,t,n)}i.fromInt=o,i.fromNumber=a,i.fromBits=c;var l=Math.pow;function h(e,t,i){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return m;if("number"==typeof t?(i=t,t=!1):t=!!t,(i=i||10)<2||36<i)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return h(e.substring(1),t,i).neg();for(var r=a(l(i,8)),s=m,o=0;o<e.length;o+=8){var c=Math.min(8,e.length-o),d=parseInt(e.substring(o,o+c),i);if(c<8){var u=a(l(i,c));s=s.mul(u).add(a(d))}else s=(s=s.mul(r)).add(a(d))}return s.unsigned=t,s}function d(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?h(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}i.fromString=h,i.fromValue=d;var u=4294967296,f=u*u,p=f/2,g=o(1<<24),m=o(0);i.ZERO=m;var w=o(0,!0);i.UZERO=w;var b=o(1);i.ONE=b;var F=o(1,!0);i.UONE=F;var v=o(-1);i.NEG_ONE=v;var y=c(-1,2147483647,!1);i.MAX_VALUE=y;var A=c(-1,-1,!0);i.MAX_UNSIGNED_VALUE=A;var C=c(0,-2147483648,!1);i.MIN_VALUE=C;var _=i.prototype;_.toInt=function(){return this.unsigned?this.low>>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*u+(this.low>>>0):this.high*u+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(C)){var t=a(e),i=this.div(t),n=i.mul(t).sub(this);return i.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=a(l(e,6),this.unsigned),s=this,o="";;){var c=s.div(r),h=(s.sub(c.mul(r)).toInt()>>>0).toString(e);if((s=c).isZero())return h+o;for(;h.length<6;)h="0"+h;o=""+h+o}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},_.isZero=function(){return 0===this.high&&0===this.low},_.eqz=_.isZero,_.isNegative=function(){return!this.unsigned&&this.high<0},_.isPositive=function(){return this.unsigned||this.high>=0},_.isOdd=function(){return!(1&~this.low)},_.isEven=function(){return!(1&this.low)},_.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.ne=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.le=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.ge=_.greaterThanOrEqual,_.compare=function(e){if(n(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(b)},_.neg=_.negate,_.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,i=65535&this.high,r=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,l=e.low>>>16,h=0,u=0,f=0,p=0;return f+=(p+=s+(65535&e.low))>>>16,u+=(f+=r+l)>>>16,h+=(u+=i+a)>>>16,h+=t+o,c((f&=65535)<<16|(p&=65535),(h&=65535)<<16|(u&=65535),this.unsigned)},_.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return m;if(n(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return m;if(this.eq(C))return e.isOdd()?C:m;if(e.eq(C))return this.isOdd()?C:m;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return a(this.toNumber()*e.toNumber(),this.unsigned);var i=this.high>>>16,r=65535&this.high,s=this.low>>>16,o=65535&this.low,l=e.high>>>16,h=65535&e.high,u=e.low>>>16,f=65535&e.low,p=0,w=0,b=0,F=0;return b+=(F+=o*f)>>>16,w+=(b+=s*f)>>>16,b&=65535,w+=(b+=o*u)>>>16,p+=(w+=r*f)>>>16,w&=65535,p+=(w+=s*u)>>>16,w&=65535,p+=(w+=o*h)>>>16,p+=i*f+r*u+s*h+o*l,c((b&=65535)<<16|(F&=65535),(p&=65535)<<16|(w&=65535),this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var i,r,s;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?w:m;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return w;if(e.gt(this.shru(1)))return F;s=w}else{if(this.eq(C))return e.eq(b)||e.eq(v)?C:e.eq(C)?b:(i=this.shr(1).div(e).shl(1)).eq(m)?e.isNegative()?b:v:(r=this.sub(e.mul(i)),s=i.add(r.div(e)));if(e.eq(C))return this.unsigned?w:m;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=m}for(r=this;r.gte(e);){i=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(i)/Math.LN2),h=o<=48?1:l(2,o-48),u=a(i),f=u.mul(e);f.isNegative()||f.gt(r);)f=(u=a(i-=h,this.unsigned)).mul(e);u.isZero()&&(u=b),s=s.add(u),r=r.sub(f)}return s},_.div=_.divide,_.modulo=function(e){return n(e)||(e=d(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.rem=_.modulo,_.not=function(){return c(~this.low,~this.high,this.unsigned)},_.and=function(e){return n(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return n(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return n(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},_.shl=_.shiftLeft,_.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.shr_u=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},i.fromBytes=function(e,t,n){return n?i.fromBytesLE(e,t):i.fromBytesBE(e,t)},i.fromBytesLE=function(e,t){return new i(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},i.fromBytesBE=function(e,t){return new i(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3503:(e,t,i)=>{var n,r,s,o,a;n=i(3939),r=i(2151).utf8,s=i(652),o=i(2151).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):r.stringToBytes(e):s(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var i=n.bytesToWords(e),c=8*e.length,l=1732584193,h=-271733879,d=-1732584194,u=271733878,f=0;f<i.length;f++)i[f]=16711935&(i[f]<<8|i[f]>>>24)|4278255360&(i[f]<<24|i[f]>>>8);i[c>>>5]|=128<<c%32,i[14+(c+64>>>9<<4)]=c;var p=a._ff,g=a._gg,m=a._hh,w=a._ii;for(f=0;f<i.length;f+=16){var b=l,F=h,v=d,y=u;l=p(l,h,d,u,i[f+0],7,-680876936),u=p(u,l,h,d,i[f+1],12,-389564586),d=p(d,u,l,h,i[f+2],17,606105819),h=p(h,d,u,l,i[f+3],22,-1044525330),l=p(l,h,d,u,i[f+4],7,-176418897),u=p(u,l,h,d,i[f+5],12,1200080426),d=p(d,u,l,h,i[f+6],17,-1473231341),h=p(h,d,u,l,i[f+7],22,-45705983),l=p(l,h,d,u,i[f+8],7,1770035416),u=p(u,l,h,d,i[f+9],12,-1958414417),d=p(d,u,l,h,i[f+10],17,-42063),h=p(h,d,u,l,i[f+11],22,-1990404162),l=p(l,h,d,u,i[f+12],7,1804603682),u=p(u,l,h,d,i[f+13],12,-40341101),d=p(d,u,l,h,i[f+14],17,-1502002290),l=g(l,h=p(h,d,u,l,i[f+15],22,1236535329),d,u,i[f+1],5,-165796510),u=g(u,l,h,d,i[f+6],9,-1069501632),d=g(d,u,l,h,i[f+11],14,643717713),h=g(h,d,u,l,i[f+0],20,-373897302),l=g(l,h,d,u,i[f+5],5,-701558691),u=g(u,l,h,d,i[f+10],9,38016083),d=g(d,u,l,h,i[f+15],14,-660478335),h=g(h,d,u,l,i[f+4],20,-405537848),l=g(l,h,d,u,i[f+9],5,568446438),u=g(u,l,h,d,i[f+14],9,-1019803690),d=g(d,u,l,h,i[f+3],14,-187363961),h=g(h,d,u,l,i[f+8],20,1163531501),l=g(l,h,d,u,i[f+13],5,-1444681467),u=g(u,l,h,d,i[f+2],9,-51403784),d=g(d,u,l,h,i[f+7],14,1735328473),l=m(l,h=g(h,d,u,l,i[f+12],20,-1926607734),d,u,i[f+5],4,-378558),u=m(u,l,h,d,i[f+8],11,-2022574463),d=m(d,u,l,h,i[f+11],16,1839030562),h=m(h,d,u,l,i[f+14],23,-35309556),l=m(l,h,d,u,i[f+1],4,-1530992060),u=m(u,l,h,d,i[f+4],11,1272893353),d=m(d,u,l,h,i[f+7],16,-155497632),h=m(h,d,u,l,i[f+10],23,-1094730640),l=m(l,h,d,u,i[f+13],4,681279174),u=m(u,l,h,d,i[f+0],11,-358537222),d=m(d,u,l,h,i[f+3],16,-722521979),h=m(h,d,u,l,i[f+6],23,76029189),l=m(l,h,d,u,i[f+9],4,-640364487),u=m(u,l,h,d,i[f+12],11,-421815835),d=m(d,u,l,h,i[f+15],16,530742520),l=w(l,h=m(h,d,u,l,i[f+2],23,-995338651),d,u,i[f+0],6,-198630844),u=w(u,l,h,d,i[f+7],10,1126891415),d=w(d,u,l,h,i[f+14],15,-1416354905),h=w(h,d,u,l,i[f+5],21,-57434055),l=w(l,h,d,u,i[f+12],6,1700485571),u=w(u,l,h,d,i[f+3],10,-1894986606),d=w(d,u,l,h,i[f+10],15,-1051523),h=w(h,d,u,l,i[f+1],21,-2054922799),l=w(l,h,d,u,i[f+8],6,1873313359),u=w(u,l,h,d,i[f+15],10,-30611744),d=w(d,u,l,h,i[f+6],15,-1560198380),h=w(h,d,u,l,i[f+13],21,1309151649),l=w(l,h,d,u,i[f+4],6,-145523070),u=w(u,l,h,d,i[f+11],10,-1120210379),d=w(d,u,l,h,i[f+2],15,718787259),h=w(h,d,u,l,i[f+9],21,-343485551),l=l+b>>>0,h=h+F>>>0,d=d+v>>>0,u=u+y>>>0}return n.endian([l,h,d,u])})._ff=function(e,t,i,n,r,s,o){var a=e+(t&i|~t&n)+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._gg=function(e,t,i,n,r,s,o){var a=e+(t&n|i&~n)+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._hh=function(e,t,i,n,r,s,o){var a=e+(t^i^n)+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._ii=function(e,t,i,n,r,s,o){var a=e+(i^(t|~n))+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var i=n.wordsToBytes(a(e,t));return t&&t.asBytes?i:t&&t.asString?o.bytesToString(i):n.bytesToHex(i)}},652:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},1668:(e,t,i)=>{var n={};(0,i(9805).assign)(n,i(3303),i(7083),i(9681)),e.exports=n},3303:(e,t,i)=>{var n=i(8411),r=i(9805),s=i(1996),o=i(4674),a=i(4442),c=Object.prototype.toString,l=0,h=-1,d=0,u=8;function f(e){if(!(this instanceof f))return new f(e);this.options=r.assign({level:h,method:u,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==l)throw new Error(o[i]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(i=n.deflateSetDictionary(this.strm,p))!==l)throw new Error(o[i]);this._dict_set=!0}}function p(e,t){var i=new f(t);if(i.push(e,!0),i.err)throw i.msg||o[i.err];return i.result}f.prototype.push=function(e,t){var i,o,a=this.strm,h=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=s.string2buf(e):"[object ArrayBuffer]"===c.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(h),a.next_out=0,a.avail_out=h),1!==(i=n.deflate(a,o))&&i!==l)return this.onEnd(i),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(s.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==i);return 4===o?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===l):2!==o||(this.onEnd(l),a.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=f,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},7083:(e,t,i)=>{var n=i(1447),r=i(9805),s=i(1996),o=i(9681),a=i(4674),c=i(4442),l=i(7414),h=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,t.windowBits);if(i!==o.Z_OK)throw new Error(a[i]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=s.string2buf(t.dictionary):"[object ArrayBuffer]"===h.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(a[i])}function u(e,t){var i=new d(t);if(i.push(e,!0),i.err)throw i.msg||a[i.err];return i.result}d.prototype.push=function(e,t){var i,a,c,l,d,u=this.strm,f=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?u.input=s.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?u.input=new Uint8Array(e):u.input=e,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new r.Buf8(f),u.next_out=0,u.avail_out=f),(i=n.inflate(u,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(i=n.inflateSetDictionary(this.strm,p)),i===o.Z_BUF_ERROR&&!0===g&&(i=o.Z_OK,g=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),this.ended=!0,!1;u.next_out&&(0!==u.avail_out&&i!==o.Z_STREAM_END&&(0!==u.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(c=s.utf8border(u.output,u.next_out),l=u.next_out-c,d=s.buf2string(u.output,c),u.next_out=l,u.avail_out=f-l,l&&r.arraySet(u.output,u.output,c,l,0),this.onData(d)):this.onData(r.shrinkBuf(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(g=!0)}while((u.avail_in>0||0===u.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),u.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=d,t.inflate=u,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,u(e,t)},t.ungzip=u},9805:(e,t)=>{var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)n(i,r)&&(e[r]=i[r])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),r);else for(var s=0;s<n;s++)e[r+s]=t[i+s]},flattenChunks:function(e){var t,i,n,r,s,o;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(o=new Uint8Array(n),r=0,t=0,i=e.length;t<i;t++)s=e[t],o.set(s,r),r+=s.length;return o}},s={arraySet:function(e,t,i,n,r){for(var s=0;s<n;s++)e[r+s]=t[i+s]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,r)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(i)},1996:(e,t,i)=>{var n=i(9805),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var o=new n.Buf8(256),a=0;a<256;a++)o[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function c(e,t){if(t<65534&&(e.subarray&&s||!e.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var i="",o=0;o<t;o++)i+=String.fromCharCode(e[o]);return i}o[254]=o[254]=1,t.string2buf=function(e){var t,i,r,s,o,a=e.length,c=0;for(s=0;s<a;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),c+=i<128?1:i<2048?2:i<65536?3:4;for(t=new n.Buf8(c),o=0,s=0;o<c;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},t.buf2binstring=function(e){return c(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),i=0,r=t.length;i<r;i++)t[i]=e.charCodeAt(i);return t},t.buf2string=function(e,t){var i,n,r,s,a=t||e.length,l=new Array(2*a);for(n=0,i=0;i<a;)if((r=e[i++])<128)l[n++]=r;else if((s=o[r])>4)l[n++]=65533,i+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&i<a;)r=r<<6|63&e[i++],s--;s>1?l[n++]=65533:r<65536?l[n++]=r:(r-=65536,l[n++]=55296|r>>10&1023,l[n++]=56320|1023&r)}return c(l,n)},t.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+o[e[i]]>t?i:t}},3269:e=>{e.exports=function(e,t,i,n){for(var r=65535&e,s=e>>>16&65535,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{s=s+(r=r+t[n++]|0)|0}while(--o);r%=65521,s%=65521}return r|s<<16}},9681:e=>{e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823:e=>{var t=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();e.exports=function(e,i,n,r){var s=t,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^s[255&(e^i[a])];return~e}},8411:(e,t,i)=>{var n,r=i(9805),s=i(3665),o=i(3269),a=i(4823),c=i(4674),l=0,h=0,d=-2,u=2,f=8,p=286,g=30,m=19,w=2*p+1,b=15,F=3,v=258,y=v+F+1,A=42,C=103,_=113,x=666;function k(e,t){return e.msg=c[t],t}function I(e){return(e<<1)-(e>4?9:0)}function S(e){for(var t=e.length;--t>=0;)e[t]=0}function E(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(r.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))}function N(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,E(e.strm)}function B(e,t){e.pending_buf[e.pending++]=t}function M(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function R(e,t,i,n){var s=e.avail_in;return s>n&&(s=n),0===s?0:(e.avail_in-=s,r.arraySet(t,e.input,e.next_in,s,i),1===e.state.wrap?e.adler=o(e.adler,t,s,i):2===e.state.wrap&&(e.adler=a(e.adler,t,s,i)),e.next_in+=s,e.total_in+=s,s)}function D(e,t){var i,n,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-y?e.strstart-(e.w_size-y):0,l=e.window,h=e.w_mask,d=e.prev,u=e.strstart+v,f=l[s+o-1],p=l[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(l[(i=t)+o]===p&&l[i+o-1]===f&&l[i]===l[s]&&l[++i]===l[s+1]){s+=2,i++;do{}while(l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&s<u);if(n=v-(u-s),s=u-v,n>o){if(e.match_start=t,o=n,n>=a)break;f=l[s+o-1],p=l[s+o]}}}while((t=d[t&h])>c&&0!=--r);return o<=e.lookahead?o:e.lookahead}function T(e){var t,i,n,s,o,a=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-y)){r.arraySet(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,t=i=e.hash_size;do{n=e.head[--t],e.head[t]=n>=a?n-a:0}while(--i);t=i=a;do{n=e.prev[--t],e.prev[t]=n>=a?n-a:0}while(--i);s+=a}if(0===e.strm.avail_in)break;if(i=R(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=i,e.lookahead+e.insert>=F)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+F-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<F)););}while(e.lookahead<y&&0!==e.strm.avail_in)}function L(e,t){for(var i,n;;){if(e.lookahead<y){if(T(e),e.lookahead<y&&t===l)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=F&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-y&&(e.match_length=D(e,i)),e.match_length>=F)if(n=s._tr_tally(e,e.strstart-e.match_start,e.match_length-F),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=F){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(N(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<F-1?e.strstart:F-1,4===t?(N(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?1:2}function z(e,t){for(var i,n,r;;){if(e.lookahead<y){if(T(e),e.lookahead<y&&t===l)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=F&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,i=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=F-1,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-y&&(e.match_length=D(e,i),e.match_length<=5&&(1===e.strategy||e.match_length===F&&e.strstart-e.match_start>4096)&&(e.match_length=F-1)),e.prev_length>=F&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-F,n=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-F),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=F-1,e.strstart++,n&&(N(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=s._tr_tally(e,0,e.window[e.strstart-1]))&&N(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<F-1?e.strstart:F-1,4===t?(N(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?1:2}function H(e,t,i,n,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=r}function P(){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=f,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 r.Buf16(2*w),this.dyn_dtree=new r.Buf16(2*(2*g+1)),this.bl_tree=new r.Buf16(2*(2*m+1)),S(this.dyn_ltree),S(this.dyn_dtree),S(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(b+1),this.heap=new r.Buf16(2*p+1),S(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*p+1),S(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 O(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=u,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?A:_,e.adler=2===t.wrap?0:1,t.last_flush=l,s._tr_init(t),h):k(e,d)}function U(e){var t,i=O(e);return i===h&&((t=e.state).window_size=2*t.w_size,S(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=F-1,t.match_available=0,t.ins_h=0),i}function q(e,t,i,n,s,o){if(!e)return d;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),s<1||s>9||i!==f||n<8||n>15||t<0||t>9||o<0||o>4)return k(e,d);8===n&&(n=9);var c=new P;return e.state=c,c.strm=e,c.wrap=a,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=s+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+F-1)/F),c.window=new r.Buf8(2*c.w_size),c.head=new r.Buf16(c.hash_size),c.prev=new r.Buf16(c.w_size),c.lit_bufsize=1<<s+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new r.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=i,U(e)}n=[new H(0,0,0,0,(function(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(T(e),0===e.lookahead&&t===l)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-y&&(N(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(N(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),1)})),new H(4,4,8,4,L),new H(4,5,16,8,L),new H(4,6,32,32,L),new H(4,4,16,16,z),new H(8,16,32,32,z),new H(8,16,128,128,z),new H(8,32,128,256,z),new H(32,128,258,1024,z),new H(32,258,258,4096,z)],t.deflateInit=function(e,t){return q(e,t,f,15,8,0)},t.deflateInit2=q,t.deflateReset=U,t.deflateResetKeep=O,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?d:(e.state.gzhead=t,h):d},t.deflate=function(e,t){var i,r,o,c;if(!e||!e.state||t>5||t<0)return e?k(e,d):d;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||r.status===x&&4!==t)return k(e,0===e.avail_out?-5:d);if(r.strm=e,i=r.last_flush,r.last_flush=t,r.status===A)if(2===r.wrap)e.adler=0,B(r,31),B(r,139),B(r,8),r.gzhead?(B(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),B(r,255&r.gzhead.time),B(r,r.gzhead.time>>8&255),B(r,r.gzhead.time>>16&255),B(r,r.gzhead.time>>24&255),B(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),B(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(B(r,255&r.gzhead.extra.length),B(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=a(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(B(r,0),B(r,0),B(r,0),B(r,0),B(r,0),B(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),B(r,3),r.status=_);else{var u=f+(r.w_bits-8<<4)<<8;u|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(u|=32),u+=31-u%31,r.status=_,M(r,u),0!==r.strstart&&(M(r,e.adler>>>16),M(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),E(e),o=r.pending,r.pending!==r.pending_buf_size));)B(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),E(e),o=r.pending,r.pending===r.pending_buf_size)){c=1;break}c=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,B(r,c)}while(0!==c);r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===c&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),E(e),o=r.pending,r.pending===r.pending_buf_size)){c=1;break}c=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,B(r,c)}while(0!==c);r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===c&&(r.status=C)}else r.status=C;if(r.status===C&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&E(e),r.pending+2<=r.pending_buf_size&&(B(r,255&e.adler),B(r,e.adler>>8&255),e.adler=0,r.status=_)):r.status=_),0!==r.pending){if(E(e),0===e.avail_out)return r.last_flush=-1,h}else if(0===e.avail_in&&I(t)<=I(i)&&4!==t)return k(e,-5);if(r.status===x&&0!==e.avail_in)return k(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==l&&r.status!==x){var p=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(T(e),0===e.lookahead)){if(t===l)return 1;break}if(e.match_length=0,i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(N(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(N(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var i,n,r,o,a=e.window;;){if(e.lookahead<=v){if(T(e),e.lookahead<=v&&t===l)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=F&&e.strstart>0&&(n=a[r=e.strstart-1])===a[++r]&&n===a[++r]&&n===a[++r]){o=e.strstart+v;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<o);e.match_length=v-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=F?(i=s._tr_tally(e,1,e.match_length-F),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(N(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(N(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?1:2}(r,t):n[r.level].func(r,t);if(3!==p&&4!==p||(r.status=x),1===p||3===p)return 0===e.avail_out&&(r.last_flush=-1),h;if(2===p&&(1===t?s._tr_align(r):5!==t&&(s._tr_stored_block(r,0,0,!1),3===t&&(S(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),E(e),0===e.avail_out))return r.last_flush=-1,h}return 4!==t?h:r.wrap<=0?1:(2===r.wrap?(B(r,255&e.adler),B(r,e.adler>>8&255),B(r,e.adler>>16&255),B(r,e.adler>>24&255),B(r,255&e.total_in),B(r,e.total_in>>8&255),B(r,e.total_in>>16&255),B(r,e.total_in>>24&255)):(M(r,e.adler>>>16),M(r,65535&e.adler)),E(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?h:1)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==A&&69!==t&&73!==t&&91!==t&&t!==C&&t!==_&&t!==x?k(e,d):(e.state=null,t===_?k(e,-3):h):d},t.deflateSetDictionary=function(e,t){var i,n,s,a,c,l,u,f,p=t.length;if(!e||!e.state)return d;if(2===(a=(i=e.state).wrap)||1===a&&i.status!==A||i.lookahead)return d;for(1===a&&(e.adler=o(e.adler,t,p,0)),i.wrap=0,p>=i.w_size&&(0===a&&(S(i.head),i.strstart=0,i.block_start=0,i.insert=0),f=new r.Buf8(i.w_size),r.arraySet(f,t,p-i.w_size,i.w_size,0),t=f,p=i.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=p,e.next_in=0,e.input=t,T(i);i.lookahead>=F;){n=i.strstart,s=i.lookahead-(F-1);do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+F-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++}while(--s);i.strstart=n,i.lookahead=F-1,T(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=F-1,i.match_available=0,e.next_in=l,e.input=u,e.avail_in=c,i.wrap=a,h},t.deflateInfo="pako deflate (from Nodeca project)"},7414:e=>{e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7293:e=>{e.exports=function(e,t){var i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v,y,A,C,_,x,k;i=e.state,n=e.next_in,x=e.input,r=n+(e.avail_in-5),s=e.next_out,k=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),c=i.dmax,l=i.wsize,h=i.whave,d=i.wnext,u=i.window,f=i.hold,p=i.bits,g=i.lencode,m=i.distcode,w=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;e:do{p<15&&(f+=x[n++]<<p,p+=8,f+=x[n++]<<p,p+=8),F=g[f&w];t:for(;;){if(f>>>=v=F>>>24,p-=v,0==(v=F>>>16&255))k[s++]=65535&F;else{if(!(16&v)){if(64&v){if(32&v){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}F=g[(65535&F)+(f&(1<<v)-1)];continue t}for(y=65535&F,(v&=15)&&(p<v&&(f+=x[n++]<<p,p+=8),y+=f&(1<<v)-1,f>>>=v,p-=v),p<15&&(f+=x[n++]<<p,p+=8,f+=x[n++]<<p,p+=8),F=m[f&b];;){if(f>>>=v=F>>>24,p-=v,16&(v=F>>>16&255)){if(A=65535&F,p<(v&=15)&&(f+=x[n++]<<p,(p+=8)<v&&(f+=x[n++]<<p,p+=8)),(A+=f&(1<<v)-1)>c){e.msg="invalid distance too far back",i.mode=30;break e}if(f>>>=v,p-=v,A>(v=s-o)){if((v=A-v)>h&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(C=0,_=u,0===d){if(C+=l-v,v<y){y-=v;do{k[s++]=u[C++]}while(--v);C=s-A,_=k}}else if(d<v){if(C+=l+d-v,(v-=d)<y){y-=v;do{k[s++]=u[C++]}while(--v);if(C=0,d<y){y-=v=d;do{k[s++]=u[C++]}while(--v);C=s-A,_=k}}}else if(C+=d-v,v<y){y-=v;do{k[s++]=u[C++]}while(--v);C=s-A,_=k}for(;y>2;)k[s++]=_[C++],k[s++]=_[C++],k[s++]=_[C++],y-=3;y&&(k[s++]=_[C++],y>1&&(k[s++]=_[C++]))}else{C=s-A;do{k[s++]=k[C++],k[s++]=k[C++],k[s++]=k[C++],y-=3}while(y>2);y&&(k[s++]=k[C++],y>1&&(k[s++]=k[C++]))}break}if(64&v){e.msg="invalid distance code",i.mode=30;break e}F=m[(65535&F)+(f&(1<<v)-1)]}}break}}while(n<r&&s<a);n-=y=p>>3,f&=(1<<(p-=y<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=s<a?a-s+257:257-(s-a),i.hold=f,i.bits=p}},1447:(e,t,i)=>{var n=i(9805),r=i(3269),s=i(4823),o=i(7293),a=i(1998),c=0,l=-2,h=1,d=12,u=30,f=852,p=592;function g(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=h,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(f),t.distcode=t.distdyn=new n.Buf32(p),t.sane=1,t.back=-1,c):l}function b(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,w(e)):l}function F(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,b(e))):l}function v(e,t){var i,n;return e?(n=new m,e.state=n,n.window=null,(i=F(e,t))!==c&&(e.state=null),i):l}var y,A,C=!0;function _(e){if(C){var t;for(y=new n.Buf32(512),A=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,y,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,A,0,e.work,{bits:5}),C=!1}e.lencode=y,e.lenbits=9,e.distcode=A,e.distbits=5}function x(e,t,i,r){var s,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),r>=o.wsize?(n.arraySet(o.window,t,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>r&&(s=r),n.arraySet(o.window,t,i-r,s,o.wnext),(r-=s)?(n.arraySet(o.window,t,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}t.inflateReset=b,t.inflateReset2=F,t.inflateResetKeep=w,t.inflateInit=function(e){return v(e,15)},t.inflateInit2=v,t.inflate=function(e,t){var i,f,p,m,w,b,F,v,y,A,C,k,I,S,E,N,B,M,R,D,T,L,z,H,P=0,O=new n.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;(i=e.state).mode===d&&(i.mode=13),w=e.next_out,p=e.output,F=e.avail_out,m=e.next_in,f=e.input,b=e.avail_in,v=i.hold,y=i.bits,A=b,C=F,L=c;e:for(;;)switch(i.mode){case h:if(0===i.wrap){i.mode=13;break}for(;y<16;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(2&i.wrap&&35615===v){i.check=0,O[0]=255&v,O[1]=v>>>8&255,i.check=s(i.check,O,2,0),v=0,y=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",i.mode=u;break}if(8!=(15&v)){e.msg="unknown compression method",i.mode=u;break}if(y-=4,T=8+(15&(v>>>=4)),0===i.wbits)i.wbits=T;else if(T>i.wbits){e.msg="invalid window size",i.mode=u;break}i.dmax=1<<T,e.adler=i.check=1,i.mode=512&v?10:d,v=0,y=0;break;case 2:for(;y<16;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(i.flags=v,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=u;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=u;break}i.head&&(i.head.text=v>>8&1),512&i.flags&&(O[0]=255&v,O[1]=v>>>8&255,i.check=s(i.check,O,2,0)),v=0,y=0,i.mode=3;case 3:for(;y<32;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}i.head&&(i.head.time=v),512&i.flags&&(O[0]=255&v,O[1]=v>>>8&255,O[2]=v>>>16&255,O[3]=v>>>24&255,i.check=s(i.check,O,4,0)),v=0,y=0,i.mode=4;case 4:for(;y<16;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}i.head&&(i.head.xflags=255&v,i.head.os=v>>8),512&i.flags&&(O[0]=255&v,O[1]=v>>>8&255,i.check=s(i.check,O,2,0)),v=0,y=0,i.mode=5;case 5:if(1024&i.flags){for(;y<16;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}i.length=v,i.head&&(i.head.extra_len=v),512&i.flags&&(O[0]=255&v,O[1]=v>>>8&255,i.check=s(i.check,O,2,0)),v=0,y=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((k=i.length)>b&&(k=b),k&&(i.head&&(T=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,f,m,k,T)),512&i.flags&&(i.check=s(i.check,f,k,m)),b-=k,m+=k,i.length-=k),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break e;k=0;do{T=f[m+k++],i.head&&T&&i.length<65536&&(i.head.name+=String.fromCharCode(T))}while(T&&k<b);if(512&i.flags&&(i.check=s(i.check,f,k,m)),b-=k,m+=k,T)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===b)break e;k=0;do{T=f[m+k++],i.head&&T&&i.length<65536&&(i.head.comment+=String.fromCharCode(T))}while(T&&k<b);if(512&i.flags&&(i.check=s(i.check,f,k,m)),b-=k,m+=k,T)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;y<16;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(v!==(65535&i.check)){e.msg="header crc mismatch",i.mode=u;break}v=0,y=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=d;break;case 10:for(;y<32;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}e.adler=i.check=g(v),v=0,y=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=w,e.avail_out=F,e.next_in=m,e.avail_in=b,i.hold=v,i.bits=y,2;e.adler=i.check=1,i.mode=d;case d:if(5===t||6===t)break e;case 13:if(i.last){v>>>=7&y,y-=7&y,i.mode=27;break}for(;y<3;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}switch(i.last=1&v,y-=1,3&(v>>>=1)){case 0:i.mode=14;break;case 1:if(_(i),i.mode=20,6===t){v>>>=2,y-=2;break e}break;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=u}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",i.mode=u;break}if(i.length=65535&v,v=0,y=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(k=i.length){if(k>b&&(k=b),k>F&&(k=F),0===k)break e;n.arraySet(p,f,m,k,w),b-=k,m+=k,F-=k,w+=k,i.length-=k;break}i.mode=d;break;case 17:for(;y<14;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(i.nlen=257+(31&v),v>>>=5,y-=5,i.ndist=1+(31&v),v>>>=5,y-=5,i.ncode=4+(15&v),v>>>=4,y-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=u;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;y<3;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}i.lens[U[i.have++]]=7&v,v>>>=3,y-=3}for(;i.have<19;)i.lens[U[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,z={bits:i.lenbits},L=a(0,i.lens,0,19,i.lencode,0,i.work,z),i.lenbits=z.bits,L){e.msg="invalid code lengths set",i.mode=u;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;N=(P=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,B=65535&P,!((E=P>>>24)<=y);){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(B<16)v>>>=E,y-=E,i.lens[i.have++]=B;else{if(16===B){for(H=E+2;y<H;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(v>>>=E,y-=E,0===i.have){e.msg="invalid bit length repeat",i.mode=u;break}T=i.lens[i.have-1],k=3+(3&v),v>>>=2,y-=2}else if(17===B){for(H=E+3;y<H;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}y-=E,T=0,k=3+(7&(v>>>=E)),v>>>=3,y-=3}else{for(H=E+7;y<H;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}y-=E,T=0,k=11+(127&(v>>>=E)),v>>>=7,y-=7}if(i.have+k>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=u;break}for(;k--;)i.lens[i.have++]=T}}if(i.mode===u)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=u;break}if(i.lenbits=9,z={bits:i.lenbits},L=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,z),i.lenbits=z.bits,L){e.msg="invalid literal/lengths set",i.mode=u;break}if(i.distbits=6,i.distcode=i.distdyn,z={bits:i.distbits},L=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,z),i.distbits=z.bits,L){e.msg="invalid distances set",i.mode=u;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(b>=6&&F>=258){e.next_out=w,e.avail_out=F,e.next_in=m,e.avail_in=b,i.hold=v,i.bits=y,o(e,C),w=e.next_out,p=e.output,F=e.avail_out,m=e.next_in,f=e.input,b=e.avail_in,v=i.hold,y=i.bits,i.mode===d&&(i.back=-1);break}for(i.back=0;N=(P=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,B=65535&P,!((E=P>>>24)<=y);){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(N&&!(240&N)){for(M=E,R=N,D=B;N=(P=i.lencode[D+((v&(1<<M+R)-1)>>M)])>>>16&255,B=65535&P,!(M+(E=P>>>24)<=y);){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}v>>>=M,y-=M,i.back+=M}if(v>>>=E,y-=E,i.back+=E,i.length=B,0===N){i.mode=26;break}if(32&N){i.back=-1,i.mode=d;break}if(64&N){e.msg="invalid literal/length code",i.mode=u;break}i.extra=15&N,i.mode=22;case 22:if(i.extra){for(H=i.extra;y<H;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}i.length+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;N=(P=i.distcode[v&(1<<i.distbits)-1])>>>16&255,B=65535&P,!((E=P>>>24)<=y);){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(!(240&N)){for(M=E,R=N,D=B;N=(P=i.distcode[D+((v&(1<<M+R)-1)>>M)])>>>16&255,B=65535&P,!(M+(E=P>>>24)<=y);){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}v>>>=M,y-=M,i.back+=M}if(v>>>=E,y-=E,i.back+=E,64&N){e.msg="invalid distance code",i.mode=u;break}i.offset=B,i.extra=15&N,i.mode=24;case 24:if(i.extra){for(H=i.extra;y<H;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}i.offset+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=u;break}i.mode=25;case 25:if(0===F)break e;if(k=C-F,i.offset>k){if((k=i.offset-k)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=u;break}k>i.wnext?(k-=i.wnext,I=i.wsize-k):I=i.wnext-k,k>i.length&&(k=i.length),S=i.window}else S=p,I=w-i.offset,k=i.length;k>F&&(k=F),F-=k,i.length-=k;do{p[w++]=S[I++]}while(--k);0===i.length&&(i.mode=21);break;case 26:if(0===F)break e;p[w++]=i.length,F--,i.mode=21;break;case 27:if(i.wrap){for(;y<32;){if(0===b)break e;b--,v|=f[m++]<<y,y+=8}if(C-=F,e.total_out+=C,i.total+=C,C&&(e.adler=i.check=i.flags?s(i.check,p,C,w-C):r(i.check,p,C,w-C)),C=F,(i.flags?v:g(v))!==i.check){e.msg="incorrect data check",i.mode=u;break}v=0,y=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;y<32;){if(0===b)break e;b--,v+=f[m++]<<y,y+=8}if(v!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=u;break}v=0,y=0}i.mode=29;case 29:L=1;break e;case u:L=-3;break e;case 31:return-4;default:return l}return e.next_out=w,e.avail_out=F,e.next_in=m,e.avail_in=b,i.hold=v,i.bits=y,(i.wsize||C!==e.avail_out&&i.mode<u&&(i.mode<27||4!==t))&&x(e,e.output,e.next_out,C-e.avail_out)?(i.mode=31,-4):(A-=e.avail_in,C-=e.avail_out,e.total_in+=A,e.total_out+=C,i.total+=C,i.wrap&&C&&(e.adler=i.check=i.flags?s(i.check,p,C,e.next_out-C):r(i.check,p,C,e.next_out-C)),e.data_type=i.bits+(i.last?64:0)+(i.mode===d?128:0)+(20===i.mode||15===i.mode?256:0),(0===A&&0===C||4===t)&&L===c&&(L=-5),L)},t.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,c},t.inflateGetHeader=function(e,t){var i;return e&&e.state&&2&(i=e.state).wrap?(i.head=t,t.done=!1,c):l},t.inflateSetDictionary=function(e,t){var i,n=t.length;return e&&e.state?0!==(i=e.state).wrap&&11!==i.mode?l:11===i.mode&&r(1,t,n,0)!==i.check?-3:x(e,t,n,n)?(i.mode=31,-4):(i.havedict=1,c):l},t.inflateInfo="pako inflate (from Nodeca project)"},1998:(e,t,i)=>{var n=i(9805),r=[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],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,i,c,l,h,d,u){var f,p,g,m,w,b,F,v,y,A=u.bits,C=0,_=0,x=0,k=0,I=0,S=0,E=0,N=0,B=0,M=0,R=null,D=0,T=new n.Buf16(16),L=new n.Buf16(16),z=null,H=0;for(C=0;C<=15;C++)T[C]=0;for(_=0;_<c;_++)T[t[i+_]]++;for(I=A,k=15;k>=1&&0===T[k];k--);if(I>k&&(I=k),0===k)return l[h++]=20971520,l[h++]=20971520,u.bits=1,0;for(x=1;x<k&&0===T[x];x++);for(I<x&&(I=x),N=1,C=1;C<=15;C++)if(N<<=1,(N-=T[C])<0)return-1;if(N>0&&(0===e||1!==k))return-1;for(L[1]=0,C=1;C<15;C++)L[C+1]=L[C]+T[C];for(_=0;_<c;_++)0!==t[i+_]&&(d[L[t[i+_]]++]=_);if(0===e?(R=z=d,b=19):1===e?(R=r,D-=257,z=s,H-=257,b=256):(R=o,z=a,b=-1),M=0,_=0,C=x,w=h,S=I,E=0,g=-1,m=(B=1<<I)-1,1===e&&B>852||2===e&&B>592)return 1;for(;;){F=C-E,d[_]<b?(v=0,y=d[_]):d[_]>b?(v=z[H+d[_]],y=R[D+d[_]]):(v=96,y=0),f=1<<C-E,x=p=1<<S;do{l[w+(M>>E)+(p-=f)]=F<<24|v<<16|y}while(0!==p);for(f=1<<C-1;M&f;)f>>=1;if(0!==f?(M&=f-1,M+=f):M=0,_++,0==--T[C]){if(C===k)break;C=t[i+d[_]]}if(C>I&&(M&m)!==g){for(0===E&&(E=I),w+=x,N=1<<(S=C-E);S+E<k&&!((N-=T[S+E])<=0);)S++,N<<=1;if(B+=1<<S,1===e&&B>852||2===e&&B>592)return 1;l[g=M&m]=I<<24|S<<16|w-h}}return 0!==M&&(l[w+M]=C-E<<24|64<<16),u.bits=I,0}},4674:e=>{e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665:(e,t,i)=>{var n=i(9805);function r(e){for(var t=e.length;--t>=0;)e[t]=0}var s=15,o=16,a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],c=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);r(d);var u=new Array(60);r(u);var f=new Array(512);r(f);var p=new Array(256);r(p);var g=new Array(29);r(g);var m,w,b,F=new Array(30);function v(e,t,i,n,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}function y(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function A(e){return e<256?f[e]:f[256+(e>>>7)]}function C(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function _(e,t,i){e.bi_valid>o-i?(e.bi_buf|=t<<e.bi_valid&65535,C(e,e.bi_buf),e.bi_buf=t>>o-e.bi_valid,e.bi_valid+=i-o):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function x(e,t,i){_(e,i[2*t],i[2*t+1])}function k(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1}function I(e,t,i){var n,r,o=new Array(s+1),a=0;for(n=1;n<=s;n++)o[n]=a=a+i[n-1]<<1;for(r=0;r<=t;r++){var c=e[2*r+1];0!==c&&(e[2*r]=k(o[c]++,c))}}function S(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function E(e){e.bi_valid>8?C(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function N(e,t,i,n){var r=2*t,s=2*i;return e[r]<e[s]||e[r]===e[s]&&n[t]<=n[i]}function B(e,t,i){for(var n=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&N(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!N(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function M(e,t,i){var n,r,s,o,l=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],r=e.pending_buf[e.l_buf+l],l++,0===n?x(e,r,t):(x(e,(s=p[r])+256+1,t),0!==(o=a[s])&&_(e,r-=g[s],o),x(e,s=A(--n),i),0!==(o=c[s])&&_(e,n-=F[s],o))}while(l<e.last_lit);x(e,256,t)}function R(e,t){var i,n,r,o=t.dyn_tree,a=t.stat_desc.static_tree,c=t.stat_desc.has_stree,l=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<l;i++)0!==o[2*i]?(e.heap[++e.heap_len]=h=i,e.depth[i]=0):o[2*i+1]=0;for(;e.heap_len<2;)o[2*(r=e.heap[++e.heap_len]=h<2?++h:0)]=1,e.depth[r]=0,e.opt_len--,c&&(e.static_len-=a[2*r+1]);for(t.max_code=h,i=e.heap_len>>1;i>=1;i--)B(e,o,i);r=l;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],B(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=n,o[2*r]=o[2*i]+o[2*n],e.depth[r]=(e.depth[i]>=e.depth[n]?e.depth[i]:e.depth[n])+1,o[2*i+1]=o[2*n+1]=r,e.heap[1]=r++,B(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,n,r,o,a,c,l=t.dyn_tree,h=t.max_code,d=t.stat_desc.static_tree,u=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,g=t.stat_desc.max_length,m=0;for(o=0;o<=s;o++)e.bl_count[o]=0;for(l[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)(o=l[2*l[2*(n=e.heap[i])+1]+1]+1)>g&&(o=g,m++),l[2*n+1]=o,n>h||(e.bl_count[o]++,a=0,n>=p&&(a=f[n-p]),c=l[2*n],e.opt_len+=c*(o+a),u&&(e.static_len+=c*(d[2*n+1]+a)));if(0!==m){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,m-=2}while(m>0);for(o=g;0!==o;o--)for(n=e.bl_count[o];0!==n;)(r=e.heap[--i])>h||(l[2*r+1]!==o&&(e.opt_len+=(o-l[2*r+1])*l[2*r],l[2*r+1]=o),n--)}}(e,t),I(o,h,e.bl_count)}function D(e,t,i){var n,r,s=-1,o=t[1],a=0,c=7,l=4;for(0===o&&(c=138,l=3),t[2*(i+1)+1]=65535,n=0;n<=i;n++)r=o,o=t[2*(n+1)+1],++a<c&&r===o||(a<l?e.bl_tree[2*r]+=a:0!==r?(r!==s&&e.bl_tree[2*r]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,s=r,0===o?(c=138,l=3):r===o?(c=6,l=3):(c=7,l=4))}function T(e,t,i){var n,r,s=-1,o=t[1],a=0,c=7,l=4;for(0===o&&(c=138,l=3),n=0;n<=i;n++)if(r=o,o=t[2*(n+1)+1],!(++a<c&&r===o)){if(a<l)do{x(e,r,e.bl_tree)}while(0!=--a);else 0!==r?(r!==s&&(x(e,r,e.bl_tree),a--),x(e,16,e.bl_tree),_(e,a-3,2)):a<=10?(x(e,17,e.bl_tree),_(e,a-3,3)):(x(e,18,e.bl_tree),_(e,a-11,7));a=0,s=r,0===o?(c=138,l=3):r===o?(c=6,l=3):(c=7,l=4)}}r(F);var L=!1;function z(e,t,i,r){_(e,0+(r?1:0),3),function(e,t,i){E(e),C(e,i),C(e,~i),n.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}(e,t,i)}t._tr_init=function(e){L||(function(){var e,t,i,n,r,o=new Array(s+1);for(i=0,n=0;n<28;n++)for(g[n]=i,e=0;e<1<<a[n];e++)p[i++]=n;for(p[i-1]=n,r=0,n=0;n<16;n++)for(F[n]=r,e=0;e<1<<c[n];e++)f[r++]=n;for(r>>=7;n<30;n++)for(F[n]=r<<7,e=0;e<1<<c[n]-7;e++)f[256+r++]=n;for(t=0;t<=s;t++)o[t]=0;for(e=0;e<=143;)d[2*e+1]=8,e++,o[8]++;for(;e<=255;)d[2*e+1]=9,e++,o[9]++;for(;e<=279;)d[2*e+1]=7,e++,o[7]++;for(;e<=287;)d[2*e+1]=8,e++,o[8]++;for(I(d,287,o),e=0;e<30;e++)u[2*e+1]=5,u[2*e]=k(e,5);m=new v(d,a,257,286,s),w=new v(u,c,0,30,s),b=new v(new Array(0),l,0,19,7)}(),L=!0),e.l_desc=new y(e.dyn_ltree,m),e.d_desc=new y(e.dyn_dtree,w),e.bl_desc=new y(e.bl_tree,b),e.bi_buf=0,e.bi_valid=0,S(e)},t._tr_stored_block=z,t._tr_flush_block=function(e,t,i,n){var r,s,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),R(e,e.l_desc),R(e,e.d_desc),o=function(e){var t;for(D(e,e.dyn_ltree,e.l_desc.max_code),D(e,e.dyn_dtree,e.d_desc.max_code),R(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==t?z(e,t,i,n):4===e.strategy||s===r?(_(e,2+(n?1:0),3),M(e,d,u)):(_(e,4+(n?1:0),3),function(e,t,i,n){var r;for(_(e,t-257,5),_(e,i-1,5),_(e,n-4,4),r=0;r<n;r++)_(e,e.bl_tree[2*h[r]+1],3);T(e,e.dyn_ltree,t-1),T(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),M(e,e.dyn_ltree,e.dyn_dtree)),S(e),n&&E(e)},t._tr_tally=function(e,t,i){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(p[i]+256+1)]++,e.dyn_dtree[2*A(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){_(e,2,3),x(e,256,d),function(e){16===e.bi_valid?(C(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},4442:e=>{e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},7392:e=>{class t{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}e.exports=t},1307:function(e,t,i){var n;n=e=>(()=>{var t=[,e=>{e.exports="data:application/wasm;base64,AGFzbQEAAAABOApgAX8Bf2ABfwBgAABgA39/fwF/YAABf2ACf38AYAN/f34BfmACf38Bf2AEf39/fwF/YAN/f38AAyEgAAABAgMDAwMEAQUAAgMCBgcIBwUDAAMHAQcABwcBAwkFAwEAAgYIAX8BQfCgBAsHTgUGbWVtb3J5AgAOY3JlYXRlX2NvbnRleHQACA9kZXN0cm95X2NvbnRleHQACQxzdXBwbHlfaW5wdXQACg9nZXRfbmV4dF9vdXRwdXQACwqNYCDfAgEFf0EAIQECQCAAQQdqIgJBEEkNAEEBIQEgAkEDdiIDQQJGDQBBAiEBIAJBIEkNAEEDIQEgA0EERg0AQQQhASACQTBJDQBBBSEBIANBBkYNAEEGIQEgAkHIAEkNAEEHIQEgAkHYAEkNAEEIIQEgAkGIAUkNAEEJIQEgAkGIAkkNACAAEIGAgIAAIgBBCGpBACAAGw8LAkACQCABQQJ0QcCIgIAAaiIEKAIAIgANAEEAIQACQAJAQQAoAuSIgIAAIgJFDQBBACACKAIANgLkiICAAAwBC0EAEIGAgIAAIgJFDQILIAJBgIB8cSIAIAJBCHZB/wFxIgJyIAE6AAAgAkEIdCAAckGAAmohAEEAIQJBACABQQJ0QYCIgIAAaigCACIDayEFIAMhAQNAIAAgBWoiACACNgIAIAAhAiABIANqIgFBgQJJDQALIAQgADYCAAsgBCAAKAIANgIACyAAC+4HAQd/AkACQAJAAkACQEEALQC0iICAAEUNAEEAQQA6ALSIgIAAQQAoArCIgIAAIgFFDQFBsIiAgAAhAgNAAkACQCABQQhqIgMgASgCBCIEaiIFQQh2Qf8BcSIGDQAgASECDAELAkADQCAFQYCAfHEgBmotAABB/gFHDQFBsIiAgAAhBgNAIAYiBygCACIGIAVHDQALIAcgBSgCADYCACABIAQgBSgCBGpBCGoiBDYCBCAHIAIgAiAFRhshAiADIARqIgVBCHZB/wFxIgYNAAsLIAIoAgAhAgsgAigCACIBDQALC0EAKAKwiICAACIFRQ0AIABBhwJqQYB+cSEDQX8hAkGwiICAACEEQQAhAUGwiICAACEGA0AgBiEHAkAgBSIGKAIEIgUgAEkNACAFIAJPDQAgBSECIAchBCAGIQEgBUEIaiADRw0AIAchBCAFIQIgBiEBDAQLIAYoAgAiBQ0ACyABDQIMAQtBsIiAgAAhBAs/AEEQdCEBIABBiAJqIQdBACEDAkACQEEAKAK4iICAACICRQ0AQQAhBSABIQYMAQtBACABQfCghIAAQf//A2pBgIB8cSIGayICNgK4iICAACACIQULAkAgByAFTQ0AIAcgBWsiByACQQF2IgIgAiAHSRtB//8DaiIHQRB2QABBf0YNAkEAQQAoAriIgIAAIAdBgIB8cSIDajYCuIiAgAALIAZFDQEgBkH/AToAASAGQQAoArCIgIAANgKAAiAGQYQCaiADIAVqQYCAfHFB+H1qIgI2AgAgBkGAAmohAQsgAUGAgHxxIgYgAUEIdkH/AXFyQf8BOgAAIAQgASgCADYCAAJAIAIgAGtBgH5xIgUNACABDwsgASEDAkAgBiABQQhqIgQgAmoiByAFQX9zakGAgHxxRg0AIARB//8DcSEFAkAgAEH3/QNLDQAgBiAEQQh2Qf8BcWpB/gE6AAAgAUEAKAKwiICAADYCACABQYCABCAFayIFNgIEQQAgATYCsIiAgAAQg4CAgAAgBkGEggRqIAIgBWtB+H1qIgU2AgAgBkGBgARqQf8BOgAAIAZBgIIEaiEDIAUgAGtBgH5xIQUMAQsgAiAFaiAAIAVqQX9qQYCAfHFrQYCAfGohBSABIQMLIAMgAygCBCAFazYCBCAFQfgBaiEGIAcgBWtBCHZB/wFxIQUCQANAIAYiB0GAfmohBiAFIgQNAUEBIQUgB0H4AUcNAAsLAkAgB0H4AUYNACACIAFqIAZrQYCAfHEiBSAEakH+AToAACAFIARBCHRqIgVBACgCsIiAgAA2AgAgBSAGNgIEQQAgBTYCsIiAgAAQg4CAgAALIAMPC0EAC3wBAn8CQCAARQ0AAkAgAEGAgHxxIABBCHZB/wFxciIBLQAAIgJB/wFHDQAgAEF4aiIAQQAoArCIgIAANgIAQQAgADYCsIiAgAAgAUH+AToAAEEAQQE6ALSIgIAADwsgACACQQJ0QcCIgIAAaiICKAIANgIAIAIgADYCAAsLawECfwJAQQAoArCIgIAAIgAoAgRB/wFLDQAgAEGAgHxxIgEgAEEIdkH/AXEiAHJBCToAAEEAQQAoArCIgIAAKAIANgKwiICAACABIABBCHRyIgBBACgC5IiAgAA2AgBBACAANgLkiICAAAsLTgECfwJAIAAgAUYNACACRQ0AA0ACQCAALQAAIgMgAS0AACIERg0AQQFBfyADIARLGw8LIAFBAWohASAAQQFqIQAgAkF/aiICDQALC0EAC3gBAX8CQAJAIAAgAU8NACACRQ0BIAAhAwNAIAMgAS0AADoAACABQQFqIQEgA0EBaiEDIAJBf2oiAg0ADAILCyAAIAFNDQAgAkUNACABQX9qIQEgAEF/aiEDA0AgAyACaiABIAJqLQAAOgAAIAJBf2oiAg0ACwsgAAssAQF/AkAgAkUNACAAIQMDQCADIAE6AAAgA0EBaiEDIAJBf2oiAg0ACwsgAAuCAQEBfwJAAkAgAEEDcQ0AIAEgAnJBA3ENACACQQRJDQEgAkECdiECIAAhAwNAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIAJBf2oiAg0ADAILCyACRQ0AIAAhAwNAIAMgAS0AADoAACABQQFqIQEgA0EBaiEDIAJBf2oiAg0ACwsgAAuIAQECfwJAQQAtAOiIgIAADQBBAEEBOgDoiICAABCMgICAABCOgICAAAtBoIAIEICAgIAAIgBBgIAENgIAQQJBgICAIBCXgICAACEBIABBFGpCgICAgICAwAA3AgAgAEEQaiAAQaCABGo2AgAgAEEIakIANwMAIAAgAEEgajYCBCAAIAE2AhwgAAsVACAAKAIcEJiAgIAAIAAQgoCAgAALFgAgAEEMaiABNgIAIABBCGpBADYCAAsbACAAKAIcIABBBGogAEEMaigCAEUQloCAgAALVAEDf0EAIQADQEEIIQEgACECA0BBACACQQFxa0GghuLtfnEgAkEBdnMhAiABQX9qIgENAAsgAEECdEHwiICAAGogAjYCACAAQQFqIgBBgAJHDQALC0oAIAJBf3MhAgJAIAFFDQADQCACQf8BcSAALQAAc0ECdEHwiICAAGooAgAgAkEIdnMhAiAAQQFqIQAgAUF/aiIBDQALCyACQX9zC10DAX4BfwF+QgAhAANAQQghASAAIQIDQEIAIAJCAYN9QsKenLzd8pW2SYMgAkIBiIUhAiABQX9qIgENAAsgAKdBA3RB8JCAgABqIAI3AwAgAEIBfCIAQoACUg0ACwtLACACQn+FIQICQCABRQ0AA0AgAkL/AYMgADEAAIWnQQN0QfCQgIAAaikDACACQgiIhSECIABBAWohACABQX9qIgENAAsLIAJCf4UL1RACDH8CfgJAAkAgACgCJEUNACAAKAIAIQIMAQtBACECIABBADoAKCAAQgA3AwAgAEIANwMYIABByABqQQBB5AAQhoCAgAAaIABBrAFqQQw2AgALIAAgASgCBCIDNgIQIABBsAFqIQQgAEHgAGohBSAAQcgAaiEGIABBtgFqIQcgAEGoAWohCCABKAIQIQkCQAJAAkACQANAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIOCgECAAQFBgcICQoPCyABKAIAIQogACgCqAEhAiAAKAKsASELIAEoAgQhDCABKAIIIQ0MAgsgCCAAKAKoASIMakEIaiABKAIAIAEoAgQiAmogASgCCCACayICIAAoAqwBIAxrIgwgAiAMSRsiAhCHgICAABogASABKAIEIAJqNgIEQQAhDCAAQQAgACgCqAEgAmoiAiACIAAoAqwBIgtGGzYCqAEgAiALRw0RIABBATYCAAJAIARBqIiAgABBBhCEgICAAEUNAEEFIQwMEgsgB0ECQQAQjYCAgAAgACgAuAFHDRBBBiEMIActAAANESAAIAAtALcBIgI2AiAgAkEESw0RQQEgAnRBE3FFDRELIAEoAgQiDCABKAIIIg1GDQ4CQCABKAIAIgogDGotAAAiCw0AIAAgDDYCECABIAxBAWo2AgRBBiECDAwLQQAhAiAAQQA2AqgBIABBAjYCACAAIAtBAnRBBGoiCzYCrAEgACALNgJACyAIIAJqQQhqIAogDGogDSAMayIMIAsgAmsiAiAMIAJJGyICEIeAgIAAGiABIAIgASgCBGo2AgRBACEMIABBACAAKAKoASACaiICIAIgACgCrAEiC0YbNgKoASACIAtHDQ8gACACQXxqIgI2AqwBQQchDCAEIAJBABCNgICAACAAIAAoAqwBIgtqQbABaigAAEcNDyAAQQI2AqgBIAAtALEBIgJBP3ENDAJAAkAgAkHAAHFFDQAgACAEIAggCxCRgICAAEEBRw0RIAAgACkDCDcDMCAALQCxASECDAELIABCfzcDMAtCfyEOAkAgAkEYdEEYdUF/Sg0AIAAgBCAIIAAoAqwBEJGAgIAAQQFHDRAgACkDCCEOCyAAIA43AzggACgCrAEiDSAAKAKoASICa0ECSQ0PIAAgAkEBaiIKNgKoASAIIAJqQQhqLQAAQSFHDQwgACACQQJqIgs2AqgBIAggCmpBCGotAABBAUcNDCANIAtGDQ8gACACQQNqNgKoASAAKAKwCSAIIAtqQQhqLQAAEJyAgIAAIgwNDyAAKAKoASIMIAAoAqwBIgIgDCACSxshDQJAA0AgDSAMRg0BIAggDEEBaiICNgIAIAQgDGohCyACIQwgCy0AAA0ODAALCyAGQgA3AwAgAEEANgKoASAAQQM2AgAgBkEIakIANwMACyAAIAEoAgQ2AhAgACABKAIQNgIUIAAoArAJIAEQmYCAgAAhDCAAIAApA0ggASgCBCAAKAIQa618Ig43A0ggACAAKQNQIAEoAhAgACgCFCICayILrXwiDzcDUCAOIAApAzBWDQ0gDyAAKQM4Vg0NAkACQAJAAkAgACgCIEF/ag4EAAMDAQMLIAEoAgwgAmogCyAAKAIYEI2AgIAArSEODAELIAEoAgwgAmogCyAAKQMYEI+AgIAAIQ4LIAAgDjcDGAsgDEEBRw0OAkAgACkDMCIOQn9RDQAgDiAGKQMAUg0OCwJAIAApAzgiDkJ/UQ0AQQchDCAOIAApA1BSDQ8LIAAgACkDSCAANQJAfCAAKQNgfCIPNwNgQgQhDgJAAkACQCAAKAIgQX9qDgQBAgIAAgtCCCEOCyAFIA4gD3w3AwALIAAgACkDaCAAKQNQfDcDaCAAIAVBGCAAKAJwEI2AgIAANgJwIABBBDYCACAAIAApA1hCAXw3A1gLAkAgBikDACIOQgODUA0AIA5CAXwhDiABKAIEIQwgASgCCCELA0AgCyAMRg0NIAEgDEEBaiICNgIEIAEoAgAgDGotAAANDiAGIA43AwAgDkIDgyEPIA5CAXwhDiACIQwgD0IAUg0ACwsgAEEFNgIAC0EBIQIgACgCIEF/ag4EBgcHBQcLIAAgARCSgICAACIMQQFHDQsgAEEHNgIAC0EAIAAoAhBrIQggAEGAAWopAwAhDiABKAIEIQwCQANAIA4gCCAMaq18QgODUA0BAkAgDCABKAIIRw0AIAAgARCTgICAAAwLCyABIAxBAWoiAjYCBCABKAIAIAxqIQsgAiEMIAstAAANCwwACwsgACABEJOAgIAAQQchDCAFIABBkAFqQRgQhICAgAANCiAAQQg2AgALIAAgAUEgEJSAgIAAIgxBAUcNCSAAQQk2AgBBDCELIABBDDYCrAEMAQsgACgCrAEhCwsgAEGoAWogACgCqAEiDGpBCGogASgCACABKAIEIgJqIAEoAgggAmsiAiALIAxrIgwgAiAMSRsiAhCHgICAABogASABKAIEIAJqNgIEQQAhDCAAQQAgACgCqAEgAmoiAiACIAAoAqwBIgtGGzYCqAEgAiALRw0HIAAQlYCAgAAhDAwHC0EBIQIgACABQcAAEJSAgIAAIgxBAUcNBgwBC0EBIQIgACABQSAQlICAgAAiDEEBRw0FCyAAIAI2AgAMAAsLQQYhDAwCC0EAIQwMAQtBByEMCwJAAkAgACgCJA0AAkACQCAMDgIAAwELQQdBCCABKAIEIAEoAghGGyEMCyABIAk2AhAgASADNgIEIAwPCwJAIAwNACADIAEoAgRHDQAgCSABKAIQRw0AIAAtACghASAAQQE6ACggAUEDdA8LIABBADoAKAsgDAuaAQEDfwJAIAAoAgQiBA0AIABCADcDCAsgAigCACEFA0ACQCAFIANJDQBBAA8LIAEgBWotAAAhBiACIAVBAWoiBTYCACAAIAZB/wBxrSAErYYgACkDCIQ3AwgCQAJAIAZBgAFxDQACQCAGDQBBByEGIAQNAgsgAEEANgIEQQEPC0EHIQYgACAEQQdqIgQ2AgQgBEE/Rw0BCwsgBguhAgIDfwF+IABBkAFqIQIgAUEEaiEDA0ACQCAAIAEoAgAgAyABKAIIEJGAgIAAIgRBAUYNACAAQYABaiIDIAMpAwAgASgCBCAAKAIQIgNrIgKtfDcDACAAIAMgASgCAGogAiAAKAIYEI2AgIAArTcDGCAEDwsCQAJAAkACQAJAIAAoAngOAwACAQMLIAAgACkDCCIFNwOIAQJAIAUgACkDWFENAEEHDwsgAEEBNgJ4DAMLIAAgACkDmAEgACkDCHw3A5gBIAAgAkEYIAAoAqABEI2AgIAANgKgASAAQQE2AnggACAAKQOIAUJ/fCIFNwOIAQwCCyAAQQI2AnggACAAKQOQASAAKQMIfDcDkAELIAApA4gBIQULIAVCAFINAAtBAQtAAQJ/IABBgAFqIgIgAikDACABKAIEIAAoAhAiAmsiA618NwMAIAAgAiABKAIAaiADIAAoAhgQjYCAgACtNwMYC3wBBH8gASgCBCEDIAEoAgghBANAAkAgBCADRw0AQQAPCyABIANBAWoiBTYCBAJAIAEoAgAgA2otAAAgACkDGCAAKAIEIgOtiKdB/wFxRg0AQQcPCyAAIANBCGoiBjYCBCAFIQMgBiACSQ0ACyAAQQA2AgQgAEIANwMYQQELbwEBf0EHIQECQCAAQboBai8AAEHZtAFHDQAgAEG0AWpBBkEAEI2AgIAAIABBsAFqKAAARw0AIABBgAFqKQMAQgKIIAA1ALQBUg0AIABBuAFqLQAADQBBAUEHIAAoAiAgAEG5AWotAABGGyEBCyABC7QCAQR/AkACQCAAKAIkRQ0AIAAoAgAhAwwBC0EAIQMgAEEAOgAoIABCADcDACAAQgA3AxggAEHIAGpBAEHkABCGgICAABogAEGsAWpBDDYCAEEBIQILIABByABqIQQCQAJAA0ACQCADQQpHDQAgASgCBCIDIAEoAggiBUYNAiABKAIAIQYCQANAIAYgA2otAAANASABIANBAWoiAzYCBCAAIAAoAgRBAWpBA3E2AgQgBSADRg0EDAALCwJAIAAoAgRFDQBBBw8LIAAoAiRFDQAgAEEAOgAoIABCADcDACAAQgA3AxggBEEAQeQAEIaAgIAAGiAAQQw2AqwBCyAAIAEQkICAgAAiA0EBRw0CQQohAyAAQQo2AgAMAAsLAkAgAg0AQQAPC0EHQQEgACgCBBshAwsgAwt1AQF/AkBBuAkQgICAgAAiAkUNACACIAA2AiQgAiAAIAEQm4CAgAAiADYCsAkCQCAARQ0AIAJBADoAKCACQgA3AwAgAkIANwMYIAJByABqQQBB5AAQhoCAgAAaIAJBrAFqQQw2AgAgAg8LIAIQgoCAgAALQQALHgACQCAARQ0AIAAoArAJEJ2AgIAAIAAQgoCAgAALC4ARAQx/IABB6N0BaiECIABB1ABqIQMgAEEcaiIEQQhqIQUCQAJAA0AgACgCQCEGAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgASgCBCIHIAEoAggiCEkNACAGQQdGDQEMEgsgBg4JAQIDBAUGBwAJDwsgACgCTCEGDAcLQQEhCSABIAdBAWo2AgQgASgCACAHai0AACIHRQ0IAkACQCAHQd8BSw0AIAdBAUcNAQsgAEGAAjsBUAJAIAAoAjwNACAAIAEoAgwgASgCECIGajYCGCAAIAEoAhQgBms2AiwLIARCADcCACAFQgA3AgAMCwsgAC0AUEUNCgwOCyABIAdBAWo2AgQgASgCACAHai0AACEHIABBAjYCQCAAIAdBCHQgACgCSGo2AkgMDAsgASAHQQFqNgIEIAEoAgAgB2otAAAhByAAQQM2AkAgACAHIAAoAkhqQQFqNgJIDAsLIAEgB0EBajYCBCABKAIAIAdqLQAAIQcgAEEENgJAIAAgB0EIdDYCTAwKCyABIAdBAWo2AgQgASgCACAHai0AACEHIAAgACgCRDYCQCAAIAcgACgCTGpBAWo2AkwMCQsgASAHQQFqNgIEQQchCSABKAIAIAdqLQAAIgdB4AFLDQNBACEGAkACQCAHQS1PDQBBACEIDAELIAdBU2oiByAHQf8BcUEtbiIIQS1sayEHIAhBAWohCAsgAEF/IAh0QX9zNgJ0AkAgB0H/AXFBCUkNACAHQXdqIgcgB0H/AXFBCW4iBkEJbGshByAGQQFqIQYLIAAgBjYCcCAAIAdB/wFxIgc2AmwgBiAHakEESw0DIANCADcCACADQQhqQgA3AgAgA0EQakEANgIAIABBfyAGdEF/czYCcEH4ACEHA0AgACAHakGACDsBACAHQQJqIgdB5N0BRw0ACyAAQQY2AkAgAEEFNgIIIABC/////w83AgALIAAoAkwiCUEFSQ0IAkAgACgCCCIHRQ0AIAdBf2ohBiABKAIEIQcgASgCCCEKA0AgCiAHRg0LIAEgB0EBaiIINgIEIAEoAgAgB2otAAAhByAAIAY2AgggACAHIAAoAgRBCHRyNgIEIAghByAGQX9qIgZBf0cNAAsLIABBBzYCQCAAIAlBe2oiBjYCTAsgACAAKAIgIgcgASgCFCABKAIQayIIIAAoAkgiCiAIIApJGyIIaiAAKAIsIgogCiAHayAISxs2AiggASgCCCIJIAEoAgQiCGshBwJAAkACQCAAKALk3QEiCg0AIAYNAUEAIQYLIABB5N0BaiILIApqQQRqIAEoAgAgCGogByAGIAprIgZBKiAKayIIIAggBksbIgYgBiAHSxsiBxCHgICAABoCQAJAIAcgACgC5N0BIghqIgYgACgCTEcNACALIAhqIAdqQQRqQQBBPyAGaxCGgICAABogACgC5N0BIAdqIQYMAQsCQCAGQRRLDQAgACAGNgLk3QEgASABKAIEIAdqNgIEDAMLIAZBa2ohBgsgAEEANgIQIAAgAjYCDCAAIAY2AhRBByEJIAAQmoCAgABFDQMgACgCECIIIAAoAuTdASIKIAdqSw0DIAAgACgCTCAIayIGNgJMAkAgCiAITQ0AIAAgCiAIayIHNgLk3QEgAiALIAhqQQRqIAcQhYCAgAAaDAILIABBADYC5N0BIAEgASgCBCAIIApraiIINgIEIAEoAggiCSAIayEHCwJAIAdBFUkNACAAIAg2AhAgACABKAIANgIMIAAgCUFraiAIIAZqIAcgBkEVakkbNgIUQQchCSAAEJqAgIAARQ0DIAAoAkwiByAAKAIQIgggASgCBGsiBkkNAyABIAg2AgQgACAHIAZrIgY2AkwgASgCCCAIayIHQRRLDQELIAIgASgCACAIaiAGIAcgByAGSxsiBxCHgICAABogACAHNgLk3QEgASABKAIEIAdqNgIECyAAKAIgIgYgACgCHCIIayEHAkAgACgCPEUNAAJAIAYgACgCLEcNACAAQQA2AiALIAEoAgwgASgCEGogACgCGCAIaiAHEIeAgIAAGiAAKAIgIQYLIAAgBjYCHCABIAEoAhAgB2oiBjYCECAAIAAoAkggB2siBzYCSAJAIAcNAEEHIQkgACgCTA0CIAAoAmgNAiAAKAIEDQIgAEEANgJADAULQQAhCSAGIAEoAhRGDQEgASgCBCABKAIIRw0GIAAoAuTdASAAKAJMTw0GDAELIAAoAkwiCkUNAUEAIQkgCCAHTQ0AA0AgASgCFCIGIAEoAhAiC00NASAAIAogCiAAKAIsIAAoAiAiDGsiDSAIIAdrIgggBiALayIGIAggBkkbIgYgBiANSxsiBiAGIApLGyIGazYCTCAMIAAoAhhqIAEoAgAgB2ogBhCFgICAABogACAAKAIgIAZqIgc2AiACQCAAKAIkIAdPDQAgACAHNgIkCwJAIAAoAjxFDQACQCAHIAAoAixHDQAgAEEANgIgCyABKAIMIAEoAhBqIAEoAgAgASgCBGogBhCFgICAABogACgCICEHCyAAIAc2AhwgASABKAIQIAZqNgIQIAEgASgCBCAGaiIHNgIEIAAoAkwiCkUNAiABKAIIIgggB0sNAAsLIAkPCyAAQQA2AkAMAwsgB0EYdEEYdUF/Sg0BIABBATYCQCAAIAdBEHRBgID8AHE2AkgCQCAHQcABSQ0AIABBBTYCRCAAQQA6AFEMAwsgAC0AUQ0DIABBBjYCRCAHQaABSQ0CIANCADcCACADQRBqQQA2AgAgA0EIakIANwIAQfgAIQcDQCAAIAdqQYAIOwEAIAdBAmoiB0Hk3QFHDQALCyAAQQU2AgggAEL/////DzcCAAwBCyAHQQJLDQEgAEKDgICAgAE3AkAMAAsLQQcPC0EAC/8XARJ/IABBGGohAQJAIABBIGooAgAiAiAAQShqKAIAIgNPDQAgAEHoAGoiBCgCAEUNACABIAQgACgCVBCegICAABogACgCKCEDIAAoAiAhAgsCQCACIANPDQAgAEHcDWohBSAAQegAaiEGIABB4BVqIQcgAEHUAGohCANAIAAoAhAiCSAAKAIUSw0BIAAgACgCZCIKQQV0aiAAKAJ0IAJxIgtBAXRqIgxB+ABqIQ0CQAJAIAAoAgAiBEGAgIAISQ0AIAAoAgQhDgwBCyAAIARBCHQiBDYCACAAIAlBAWoiAzYCECAAIAAoAgRBCHQgACgCDCAJai0AAHIiDjYCBCADIQkLAkACQCAOIARBC3YgDS8BACIPbCIDTw0AIAAgAzYCACANIA9BgBAgD2tBBXZqOwEAIAJBf2ohBAJAIAINACAAKAIsIARqIQQLAkACQCAAKAIkIg8NAEEAIQQMAQsgACgCGCAEai0AACEECyAAKAJwIAJxIAAoAmwiDXQgBEEIIA1rdmohDAJAAkAgCkEGSw0AQQEhBANAIAAgDEGADGxqIARBAXQiBGpB5B1qIQ0CQAJAIANB////B00NACADIQoMAQsgACADQQh0Igo2AgAgACAJQQFqIgM2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQgAyEJCwJAAkAgDiAKQQt2IA0vAQAiD2wiA0kNACAAIA4gA2siDjYCBCAAIAogA2siAzYCACANIA8gD0EFdms7AQAgBEEBciEEDAELIAAgAzYCACANIA9BgBAgD2tBBXZqOwEACyAEQYACSQ0ADAILCyACIAAoAlQiDUF/c2ohBAJAIAIgDUsNACAAKAIsIARqIQQLAkACQCAPDQBBACEQDAELIAAoAhggBGotAAAhEAtBASEEQYACIQ0DQCAAIAxBgAxsaiAQQQF0IhAgDXEiESANaiAEakEBdGpB5B1qIQ8CQAJAIANB////B00NACADIQsMAQsgACADQQh0Igs2AgAgACAJQQFqIgM2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQgAyEJCwJAAkAgDiALQQt2IA8vAQAiCmwiA08iEg0AIAAgAzYCACAKQYAQIAprQQV2aiEKDAELIAAgDiADayIONgIEIAAgCyADayIDNgIAIAogCkEFdmshCkEAIQ0LIA8gCjsBACANIBFzIQ0gBEEBdCASciIEQYACSQ0ACwsgACACQQFqNgIgIAAoAhggAmogBDoAAAJAIAAoAiQgACgCICICTw0AIAAgAjYCJAtBACEDAkAgACgCZCIEQQRJDQACQCAEQQlLDQAgBEF9aiEDDAELIARBemohAwsgACADNgJkDAELIAAgDiADayIONgIEIAAgBCADayIDNgIAIA0gDyAPQQV2azsBACAAIApBAXRqIg9B+ANqIQQCQAJAIANB////B00NACAJIQoMAQsgACADQQh0IgM2AgAgACAJQQFqIgo2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQLAkACQCAOIANBC3YgBC8BACINbCIJSQ0AIAAgDiAJayIONgIEIAAgAyAJayIDNgIAIAQgDSANQQV2azsBACAPQZAEaiENAkACQCADQf///wdNDQAgCiEQDAELIAAgA0EIdCIDNgIAIAAgCkEBaiIQNgIQIAAgDkEIdCAAKAIMIApqLQAAciIONgIECwJAAkAgDiADQQt2IA0vAQAiCWwiBE8NACANIAlBgBAgCWtBBXZqOwEAIAxB2ARqIQMCQCAEQf///wdLDQAgACAEQQh0IgQ2AgAgACAQQQFqNgIQIAAgDkEIdCAAKAIMIBBqLQAAciIONgIECwJAIA4gBEELdiADLwEAIg1sIglJDQAgACAOIAlrNgIEIAAgBCAJazYCACADIA0gDUEFdms7AQAMAgsgAyANQYAQIA1rQQV2ajsBACAAIAk2AgAgAEEBNgJoIABBCUELIAAoAmRBB0kbNgJkDAMLIAAgDiAEayIONgIEIA0gCSAJQQV2azsBACAPQagEaiENAkACQCADIARrIgNB////B00NACAQIQoMAQsgACADQQh0IgM2AgAgACAQQQFqIgo2AhAgACAOQQh0IAAoAgwgEGotAAByIg42AgQLAkACQCAOIANBC3YgDS8BACIEbCIJTw0AIAAgCTYCACANIARBgBAgBGtBBXZqOwEAIAAoAlghAwwBCyAAIA4gCWsiDjYCBCANIAQgBEEFdms7AQAgD0HABGohBAJAIAMgCWsiA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgCkEBajYCECAAIA5BCHQgACgCDCAKai0AAHIiDjYCBAsCQAJAIA4gA0ELdiAELwEAIg1sIglPDQAgACAJNgIAIAQgDUGAECANa0EFdmo7AQAgACgCXCEDDAELIAAgDiAJazYCBCAAIAMgCWs2AgAgACgCYCEDIAAgACgCXDYCYCAEIA0gDUEFdms7AQALIAAgACgCWDYCXAsgACAAKAJUNgJYIAAgAzYCVAsgAEEIQQsgACgCZEEHSRs2AmQgACAHIAsQn4CAgAAMAQsgBCANQYAQIA1rQQV2ajsBACAAIAk2AgAgACAAKAJcNgJgIAAgACkCVDcCWCAAQQdBCiAAKAJkQQdJGzYCZCAAIAUgCxCfgICAACAAKAJoIgNBfmpBAyADQQZJGyEKIAAoAgAhA0EBIQ4DQCAAIApBB3RqIA5BAXQiDmpB2AdqIQ0CQAJAIANBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgRBAWo2AhAgACAAKAIEQQh0IAQgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgDS8BACIJbCIPSQ0AIAAgBCAPayIENgIEIAAgAyAPayIDNgIAIA0gCSAJQQV2azsBACAOQQFyIQ4MAQsgACAPNgIAIA0gCUGAECAJa0EFdmo7AQAgDyEDCyAOQcAASQ0ACwJAIA5BQGoiCUEDSw0AIAAgCTYCVAwBCyAAIA5BAXFBAnIiDTYCVCAJQQF2IQ8CQCAJQQ1LDQAgACANIA9Bf2oiDHQiCzYCVEEBIQ0gCCALQQF0akGEC2ohEEE/IA5rIRFBACEPA0AgECARIA1qQQF0aiEOAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA4vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACAOIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDUEBdEEBciENDAELIAAgAzYCACAOIAlBgBAgCWtBBXZqOwEAIA1BAXQhDQsgDCAPQQFqIg9HDQAMAgsLIA9Be2ohDgNAAkAgA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgACgCECIJQQFqNgIQIARBCHQgCSAAKAIMai0AAHIhBAsgACADQQF2IgM2AgAgACAEIANrIgRBH3UiCSANQQF0akEBaiINNgJUIAAgCSADcSAEaiIENgIEIA5Bf2oiDg0ACyAAIA1BBHQiCzYCVEEAIQ9BASEOA0AgACAOQQF0Ig5qQbwNaiENAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA0vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACANIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDkEBciEODAELIAAgAzYCACANIAlBgBAgCWtBBXZqOwEACyAPQQFqIg9BBEcNAAsLAkAgASAGIAAoAlQQnoCAgAANAEEADwsgACgCICECCyACIAAoAihJDQALC0EBIQMCQCAAKAIAIgRB////B0sNACAAIARBCHQ2AgBBASEDIAAgACgCECIEQQFqNgIQIAAgACgCBEEIdCAEIAAoAgxqLQAAcjYCBAsgAwtwAQF/AkBBqN4BEICAgIAAIgJFDQAgAkE0aiABNgIAIAJBPGogADYCAAJAAkACQCAAQX9qDgIAAQILIAIgARCAgICAACIANgIYIAANASACEIKAgIAADAILIAJBADYCGCACQThqQQA2AgALIAIPC0EAC9IBAQJ/QQYhAgJAIAFBJ0sNACAAQTBqIAFBAXFBAnIgAUEBdkELanQiATYCAAJAAkAgAEE8aigCACIDRQ0AQQQhAiABIABBNGooAgBLDQIgAEEsaiABNgIAIANBAkcNACAAQThqIgMoAgAgAU8NACAAIAE2AjggACgCGBCCgICAACAAIAAoAjAQgICAgAAiATYCGCABDQBBAyECDAELQQAhAiAAQQA2AkAgAEHQAGpBAToAACAAQegAakEANgIAIABB5N0BaiEDCyADQQA2AgALIAILIwACQCAAQTxqKAIARQ0AIAAoAhgQgoCAgAALIAAQgoCAgAAL9QEBBH9BACEDAkAgACgCDCACTQ0AIAAoAhggAk0NACABIAEoAgAiBCAAKAIQIAAoAggiBWsiBiAEIAYgBEkbIgRrNgIAIAUgAkF/c2ohAQJAIAUgAksNACAAKAIUIAFqIQELIAAoAgAiAiABai0AACEGQQEhAyAAIAVBAWo2AgggAiAFaiAGOgAAAkAgBEF/aiICRQ0AA0AgACgCACIFQQAgAUEBaiIBIAEgACgCFEYbIgFqLQAAIQQgACAAKAIIIgZBAWo2AgggBSAGaiAEOgAAIAJBf2oiAg0ACwsgACgCDCAAKAIIIgFPDQAgACABNgIMCyADC8gEAQd/AkACQCAAKAIAIgNBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAAKAIEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgAS8BACIGbCIFTw0AIAEgBkGAECAGa0EFdmo7AQAgASACQQR0akEEaiEHQQghCEECIQkMAQsgACAEIAVrIgQ2AgQgASAGIAZBBXZrOwEAAkAgAyAFayIDQf///wdLDQAgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkAgBCADQQt2IAEvAQIiBmwiBU8NACABIAZBgBAgBmtBBXZqOwECIAEgAkEEdGpBhAJqIQdBCCEIQQohCQwBCyAAIAQgBWsiBDYCBCABIAYgBkEFdms7AQIgAUGEBGohByADIAVrIQVBgAIhCEESIQkLIABB6ABqIAk2AgBBASEBA0AgByABQQF0IgFqIQMCQAJAIAVB////B00NACAFIQIMAQsgACAFQQh0IgI2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIAJBC3YgAy8BACIGbCIFSQ0AIAAgBCAFayIENgIEIAAgAiAFayIFNgIAIAMgBiAGQQV2azsBACABQQFyIQEMAQsgACAFNgIAIAMgBkGAECAGa0EFdmo7AQALIAEgCEkNAAsgAEHoAGogASAIayAJajYCAAsLNQEAQYAICy4IAAAAEAAAABgAAAAgAAAAKAAAADAAAABAAAAAUAAAAIAAAAAAAQAA/Td6WFoA"},t=>{t.exports=e}],i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{n.r(r),n.d(r,{XzReadableStream:()=>s});var e=n(1);const t=globalThis.ReadableStream||n(2).ReadableStream;class i{constructor(e){this.exports=e.exports,this.memory=this.exports.memory,this.ptr=this.exports.create_context(),this._refresh(),this.bufSize=this.mem32[0],this.inStart=this.mem32[1]-this.ptr,this.inEnd=this.inStart+this.bufSize,this.outStart=this.mem32[4]-this.ptr}supplyInput(e){this._refresh(),this.mem8.subarray(this.inStart,this.inEnd).set(e,0),this.exports.supply_input(this.ptr,e.byteLength),this._refresh()}getNextOutput(){const e=this.exports.get_next_output(this.ptr);if(this._refresh(),0!==e&&1!==e)throw new Error(`get_next_output failed with error code ${e}`);return{outChunk:this.mem8.slice(this.outStart,this.outStart+this.mem32[5]),finished:1===e}}needsMoreInput(){return this.mem32[2]===this.mem32[3]}outputBufferIsFull(){return this.mem32[5]===this.bufSize}resetOutputBuffer(){this.outPos=this.mem32[5]=0}dispose(){this.exports.destroy_context(this.ptr),this.exports=null}_refresh(){this.memory.buffer!==this.mem8?.buffer&&(this.mem8=new Uint8Array(this.memory.buffer,this.ptr),this.mem32=new Uint32Array(this.memory.buffer,this.ptr))}}class s extends t{static _moduleInstancePromise;static _moduleInstance;static async _getModuleInstance(){const t=e.replace("data:application/wasm;base64,",""),i=Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer,n=await WebAssembly.instantiate(i,{});s._moduleInstance=n.instance}constructor(e){let t,n=null;const r=e.getReader();super({async start(e){s._moduleInstance||await(s._moduleInstancePromise||(s._moduleInstancePromise=s._getModuleInstance())),t=new i(s._moduleInstance)},async pull(e){if(t.needsMoreInput()){if(null===n||0===n.byteLength){const{done:e,value:t}=await r.read();e||(n=t)}const e=Math.min(t.bufSize,n.byteLength);t.supplyInput(n.subarray(0,e)),n=n.subarray(e)}const i=t.getNextOutput();e.enqueue(i.outChunk),t.resetOutputBuffer(),i.finished&&(t.dispose(),e.close())},cancel:()=>(t.dispose(),r.cancel())})}}})(),r})(),e.exports=n(i(772))},3617:()=>{},772:()=>{},4132:(e,t,i)=>{var n=i(8287).Buffer;const r=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function s(e){if(n.isBuffer(e))return e;if("number"==typeof e)return n.alloc(e);if("string"==typeof e)return n.from(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function o(e,t){e=s(e),n.isBuffer(t)&&(t=t.readUInt32BE(0));let i=~t;for(var o=0;o<e.length;o++)i=r[255&(i^e[o])]^i>>>8;return~i}function a(){return function(e){const t=s(4);return t.writeInt32BE(e,0),t}(o.apply(null,arguments))}a.signed=function(){return o.apply(null,arguments)},a.unsigned=function(){return o.apply(null,arguments)>>>0};const c=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(a);e.exports=c}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}return i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(7806)})(),Vp=[],jp=[],Wp="undefined"!=typeof Uint8Array?Uint8Array:Array,Gp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$p=0;$p<64;++$p)Vp[$p]=Gp[$p],jp[Gp.charCodeAt($p)]=$p;function Kp(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function Yp(e,t,i){for(var n,r,s=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(Vp[(r=n)>>18&63]+Vp[r>>12&63]+Vp[r>>6&63]+Vp[63&r]);return s.join("")}jp["-".charCodeAt(0)]=62,jp["_".charCodeAt(0)]=63;var Xp={byteLength:function(e){var t=Kp(e),i=t[0],n=t[1];return 3*(i+n)/4-n},toByteArray:function(e){var t,i,n=Kp(e),r=n[0],s=n[1],o=new Wp(function(e,t,i){return 3*(t+i)/4-i}(0,r,s)),a=0,c=s>0?r-4:r;for(i=0;i<c;i+=4)t=jp[e.charCodeAt(i)]<<18|jp[e.charCodeAt(i+1)]<<12|jp[e.charCodeAt(i+2)]<<6|jp[e.charCodeAt(i+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=255&t;return 2===s&&(t=jp[e.charCodeAt(i)]<<2|jp[e.charCodeAt(i+1)]>>4,o[a++]=255&t),1===s&&(t=jp[e.charCodeAt(i)]<<10|jp[e.charCodeAt(i+1)]<<4|jp[e.charCodeAt(i+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t),o},fromByteArray:function(e){for(var t,i=e.length,n=i%3,r=[],s=16383,o=0,a=i-n;o<a;o+=s)r.push(Yp(e,o,o+s>a?a:o+s));return 1===n?(t=e[i-1],r.push(Vp[t>>2]+Vp[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],r.push(Vp[t>>10]+Vp[t>>4&63]+Vp[t<<2&63]+"=")),r.join("")}};
44
44
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Zp={read:function(e,t,i,n,r){var s,o,a=8*r-n-1,c=(1<<a)-1,l=c>>1,h=-7,d=i?r-1:0,u=i?-1:1,f=e[t+d];for(d+=u,s=f&(1<<-h)-1,f>>=-h,h+=a;h>0;s=256*s+e[t+d],d+=u,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=n;h>0;o=256*o+e[t+d],d+=u,h-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=l}return(f?-1:1)*o*Math.pow(2,s-n)},write:function(e,t,i,n,r,s){var o,a,c,l=8*s-r-1,h=(1<<l)-1,d=h>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?u/c:u*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=h?(a=0,o=h):o+d>=1?(a=(t*c-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[i+f]=255&a,f+=p,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;e[i+f]=255&o,f+=p,o/=256,l-=8);e[i+f-p]|=128*g}};
45
45
  /*!
@@ -55,6 +55,6 @@ function(e){var t,i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v="sizzle"+1*new Date,y=e.
55
55
  * Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
56
56
  * Released under the ISC license.
57
57
  */var lm=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},hm=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),dm=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){r=!0,s=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var i=this;i.length<e;)i=t+i;return i};var um={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function fm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString())||"0"}var pm=function(){function e(t,i,n,r){lm(this,e);var s=this;if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===n){var o=t&&""+t;o&&function(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),n=dm(i,4),r=n[0],o=n[1],a=n[2],c=n[3];void 0===c&&(c=1),r/=360,o/=100,a/=100,s.hsla=[r,o,a,c]}else if(t.startsWith("rgb")){var l=t.match(/([\-\d\.e]+)/g).map(Number),h=dm(l,4),d=h[0],u=h[1],f=h[2],p=h[3];void 0===p&&(p=1),s.rgba=[d,u,f,p]}else t.startsWith("#")?s.rgba=e.hexToRgb(t):s.rgba=e.nameToRgb(t)||e.hexToRgb(t)}(o.toLowerCase())}else this.rgba=[t,i,n,void 0===r?1:r]}return hm(e,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return fm(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],i=["","%","%",""],n=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,n){return fm(e*t[n],3===n?3:1)+i[n]}));return e?"hsla("+n+")":"hsl("+n+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=e.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=e.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var e=this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)}));return"#"+e.map((function(e){return e.padStart(2,"0")})).join("")},set:function(t){this.rgba=e.hexToRgb(t)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var i=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(t){var i=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),n=um[i];return void 0===n?n:e.hexToRgb(n.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=dm(e,4),i=t[0],n=t[1],r=t[2],s=t[3];i/=255,n/=255,r/=255;var o=Math.max(i,n,r),a=Math.min(i,n,r),c=void 0,l=void 0,h=(o+a)/2;if(o===a)c=l=0;else{var d=o-a;switch(l=h>.5?d/(2-o-a):d/(o+a),o){case i:c=(n-r)/d+(n<r?6:0);break;case n:c=(r-i)/d+2;break;case r:c=(i-n)/d+4}c/=6}return[c,l,h,s]}},{key:"hslToRgb",value:function(e){var t=dm(e,4),i=t[0],n=t[1],r=t[2],s=t[3],o=void 0,a=void 0,c=void 0;if(0===n)o=a=c=r;else{var l=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},h=r<.5?r*(1+n):r+n-r*n,d=2*r-h;o=l(d,h,i+1/3),a=l(d,h,i),c=l(d,h,i-1/3)}var u=[255*o,255*a,255*c].map(Math.round);return u[3]=s,u}}]),e}(),gm=function(){function e(){lm(this,e),this._events=[]}return hm(e,[{key:"add",value:function(e,t,i){e.addEventListener(t,i,!1),this._events.push({target:e,type:t,handler:i})}},{key:"remove",value:function(t,i,n){this._events=this._events.filter((function(r){var s=!0;return t&&t!==r.target&&(s=!1),i&&i!==r.type&&(s=!1),n&&n!==r.handler&&(s=!1),s&&e._doRemove(r.target,r.type,r.handler),!s}))}},{key:"destroy",value:function(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,i){e.removeEventListener(t,i,!1)}}]),e}();function mm(e,t,i){var n=!1;function r(e,t,i){return Math.max(t,Math.min(e,i))}function s(e,s,o){if(o&&(n=!0),n){e.preventDefault();var a=t.getBoundingClientRect(),c=a.width,l=a.height,h=s.clientX,d=s.clientY,u=r(h-a.left,0,c),f=r(d-a.top,0,l);i(u/c,f/l)}}function o(e,t){1===(void 0===e.buttons?e.which:e.buttons)?s(e,e,t):n=!1}function a(e,t){1===e.touches.length?s(e,e.touches[0],t):n=!1}e.add(t,"mousedown",(function(e){o(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",o),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){n=!1})),e.add(t,"touchend",(function(e){n=!1})),e.add(t,"touchcancel",(function(e){n=!1}))}var wm="keydown",bm="mousedown",Fm="focusin";function vm(e,t){return(t||document).querySelector(e)}function ym(e){e.preventDefault(),e.stopPropagation()}function Am(e,t,i,n,r){e.add(t,wm,(function(e){i.indexOf(e.key)>=0&&(r&&ym(e),n(e))}))}var Cm=function(){function e(t){lm(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new gm,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return hm(e,[{key:"setOptions",value:function(e){var t=this;if(e){var i=this.settings;if(e instanceof HTMLElement)i.parent=e;else{i.parent&&e.parent&&i.parent!==e.parent&&(this._events.remove(i.parent),this._popupInited=!1),function(e,t,i){for(var n in e)i&&i.indexOf(n)>=0||(t[n]=e[n])}(e,i),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var n=e.color||e.colour;n&&this._setColor(n)}var r=i.parent;if(r&&i.popup&&!this._popupInited){var s=function(e){return t.openHandler(e)};this._events.add(r,"click",s),Am(this._events,r,[" ","Spacebar","Enter"],s),this._popupInited=!0}else e.parent&&!i.popup&&this.show()}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&e.type===wm?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,i=!1;if(e)if(t===bm||t===Fm){var n=(this.__containedEvent||0)+100;e.timeStamp>n&&(i=!0)}else ym(e),i=!0;else i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",t!==bm&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function(e,t){if("string"==typeof e&&(e=e.trim()),e){t=t||{};var i=void 0;try{i=new pm(e)}catch(e){if(t.failSilently)return;throw e}if(!this.settings.alpha){var n=i.hsla;n[3]=1,i.hsla=n}this.colour=this.color=i,this._setHSLA(null,null,null,null,t)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}(this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>');return this.domElement=t,this._domH=vm(".picker_hue",t),this._domSL=vm(".picker_sl",t),this._domA=vm(".picker_alpha",t),this._domEdit=vm(".picker_editor input",t),this._domSample=vm(".picker_sample",t),this._domOkay=vm(".picker_done button",t),this._domCancel=vm(".picker_cancel button",t),t.classList.add("layout_"+this.settings.layout),this.settings.alpha||t.classList.add("no_alpha"),this.settings.editor||t.classList.add("no_editor"),this.settings.cancelButton||t.classList.add("no_cancel"),this._ifPopup((function(){return t.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=this.domElement,n=this._events;function r(e,t,i){n.add(e,t,i)}r(i,"click",(function(e){return e.preventDefault()})),mm(n,this._domH,(function(e,i){return t._setHSLA(e)})),mm(n,this._domSL,(function(e,i){return t._setHSLA(null,e,1-i)})),this.settings.alpha&&mm(n,this._domA,(function(e,i){return t._setHSLA(null,null,null,1-i)}));var s=this._domEdit;r(s,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(s,"focus",(function(e){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};r(window,bm,t),r(window,Fm,t),Am(n,i,["Esc","Escape"],t);var s=function(t){e.__containedEvent=t.timeStamp};r(i,bm,s),r(i,Fm,s),r(e._domCancel,"click",t)}));var o=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};r(this._domOkay,"click",o),Am(n,i,["Enter"],o)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(i){"static"===getComputedStyle(e).position&&(e.style.position="relative");var n=!0===i?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===n?t.classList.add(e):t.classList.remove(e)})),t.classList.add(n)}))}},{key:"_setHSLA",value:function(e,t,i,n,r){r=r||{};var s=this.colour,o=s.hsla;[e,t,i,n].forEach((function(e,t){(e||0===e)&&(o[t]=e)})),s.hsla=o,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(s)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,i=t.hsla,n="hsl("+360*i[0]+", 100%, 50%)",r=t.hslString,s=t.hslaString,o=this._domH,a=this._domSL,c=this._domA,l=vm(".picker_selector",o),h=vm(".picker_selector",a),d=vm(".picker_selector",c);b(0,l,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,b(0,h,i[1]),F(0,h,1-i[2]),a.style.color=r,F(0,d,1-i[3]);var u=r,f=u.replace("hsl","hsla").replace(")",", 0)"),p="linear-gradient("+[u,f]+")";if(this._domA.style.background=p+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!e.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,w=void 0;switch(g){case"rgb":w=t.printRGB(m);break;case"hsl":w=t.printHSL(m);break;default:w=t.printHex(m)}this._domEdit.value=w}this._domSample.style.color=s}function b(e,t,i){t.style.left=100*i+"%"}function F(e,t,i){t.style.top=100*i+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var i=e?"":"none",n=t.style.display!==i;return n&&(t.style.display=i),n}}]),e}(),_m=document.createElement("style");function xm(e){if(km[e])return km[e];if(km["chr"+e]){const t=km["chr"+e];return km[e]=t,t}{const r=(t=Math.round(255*Math.random()).toString(10),i=Math.round(255*Math.random()).toString(10),n=Math.round(255*Math.random()).toString(10),"rgb("+t+","+i+","+n+")");return km[e]=r,r}var t,i,n}_m.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(_m),Cm.StyleElement=_m;const km={chrX:"rgb(204, 153, 0)",chrY:"rgb(153, 204, 0",chrUn:"rgb(50, 50, 50)",chr1:"rgb(80, 80, 255)",chrI:"rgb(139, 155, 187)",chr2:"rgb(206, 61, 50)",chrII:"rgb(206, 61, 50)",chr2a:"rgb(216, 71, 60)",chr2b:"rgb(226, 81, 70)",chr3:"rgb(116, 155, 88)",chrIII:"rgb(116, 155, 88)",chr4:"rgb(240, 230, 133)",chrIV:"rgb(240, 230, 133)",chr5:"rgb(70, 105, 131)",chr6:"rgb(186, 99, 56)",chr7:"rgb(93, 177, 221)",chr8:"rgb(128, 34, 104)",chr9:"rgb(107, 215, 107)",chr10:"rgb(213, 149, 167)",chr11:"rgb(146, 72, 34)",chr12:"rgb(131, 123, 141)",chr13:"rgb(199, 81, 39)",chr14:"rgb(213, 143, 92)",chr15:"rgb(122, 101, 165)",chr16:"rgb(228, 175, 105)",chr17:"rgb(59, 27, 83)",chr18:"rgb(205, 222, 183)",chr19:"rgb(97, 42, 121)",chr20:"rgb(174, 31, 99)",chr21:"rgb(231, 199, 111)",chr22:"rgb(90, 101, 94)",chr23:"rgb(204, 153, 0)",chr24:"rgb(153, 204, 0)",chr25:"rgb(51, 204, 0)",chr26:"rgb(0, 204, 51)",chr27:"rgb(0, 204, 153)",chr28:"rgb(0, 153, 204)",chr29:"rgb(10, 71, 255)",chr30:"rgb(71, 117, 255)",chr31:"rgb(255, 194, 10)",chr32:"rgb(255, 209, 71)",chr33:"rgb(153, 0, 51)",chr34:"rgb(153, 26, 0)",chr35:"rgb(153, 102, 0)",chr36:"rgb(128, 153, 0)",chr37:"rgb(51, 153, 0)",chr38:"rgb(0, 153, 26)",chr39:"rgb(0, 153, 102)",chr40:"rgb(0, 128, 153)",chr41:"rgb(0, 51, 153)",chr42:"rgb(26, 0, 153)",chr43:"rgb(102, 0, 153)",chr44:"rgb(153, 0, 128)",chr45:"rgb(214, 0, 71)",chr46:"rgb(255, 20, 99)",chr47:"rgb(0, 214, 143)",chr48:"rgb(20, 255, 177)"};class Im{constructor(e){this.tracks=[],this.chordSets=[]}addChordSet(e){this.chordSets=this.chordSets.filter((t=>t.name!==e.name)),this.chordSets.push(e);let t=this.tracks.find((t=>e.trackName===t.name));t&&(t.chordSets=t.chordSets.filter((t=>t.name!==e.name)),t.chordSets.push(e)),t||(t=new Sm(e),this.tracks.push(t))}clearChords(){this.tracks=[],this.chordSets=[]}getTrack(e){return this.tracks.find((t=>e===t.name))}getChordSet(e){return this.chordSets.find((t=>e===t.name))}}class Sm{constructor(e){this.name=e.trackName,this.color=e.trackColor,this.visible=!0,this.chordSets=[e],this.id=("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)}get chords(){if(1===this.chordSets.length)return this.chordSets[0].chords;const e=[];for(let t of this.chordSets)for(let i of t.chords)e.push(i);return e}}const Em=Math.exp(5);class Nm{static isInstalled(){return void 0!==window.JBrowseReactCircularGenomeView&&void 0!==window.React&&void 0!==window.ReactDOM}constructor(e,t){if(t=t||{},this.config=t,Nm.isInstalled()){this.parent=e,this.groupByTrack=!0===t.groupByTrack,this.chordManager=new Im(t);const i=document.createElement("div");i.className="igv-circview-container",e.appendChild(i),this.createControls(i),this.resetControlPanel();const n=document.createElement("div");n.className="igv-circview-circular-genome-view",i.appendChild(n),this.container=n,t.assembly&&this.setAssembly(t.assembly),this.width=t.width||500,this.height=t.height||500,this.setSize(this.width,this.height)}else console.error("JBrowse circular view is not installed")}createControls(e){const t=document.createElement("div");t.className="igv-circview-toolbar",e.appendChild(t),this.toolbar=t;const i=document.createElement("div");i.className="igv-circview-track-panel",e.appendChild(i),this.controlPanel=i,this.controlPanel.style.display="none";const n=document.createElement("div");n.className="igv-circview-toolbar-button-container",this.toolbar.appendChild(n),this.showControlsButton=document.createElement("div"),this.showControlsButton.className="igv-circview-button",n.appendChild(this.showControlsButton),this.showControlsButton.innerText="none"===this.controlPanel.style.display?"Show Controls":"Hide Controls",this.showControlsButton.addEventListener("click",(e=>{this.controlPanel.querySelectorAll("div").length>0&&("none"===this.controlPanel.style.display?(this.controlPanel.style.display="flex",e.target.innerText="Hide Controls"):(this.controlPanel.style.display="none",e.target.innerText="Show Controls"))}));let r=document.createElement("div");r.className="igv-circview-button",n.appendChild(r),r.innerText="Clear All",r.addEventListener("click",(()=>{this.clearChords()})),!1!==this.config.showCloseButton&&(r=document.createElement("div"),r.className="igv-circview-button",n.appendChild(r),r.innerText="Close",r.addEventListener("click",(()=>{this.visible=!1})))}resetControlPanel(){this.controlPanel.innerHTML="",this.controlPanel.appendChild(this.createGroupByCB());const e=this.groupByTrack?this.chordManager.tracks:this.chordManager.chordSets;for(let t of e)this.addToControlPanel(t)}createGroupByCB(){const e=document.createElement("input");e.type="checkbox",e.id="groupByCB",e.style.width="1.4em",e.style.height="1.4em",e.checked=this.groupByTrack,e.onclick=e=>{this.groupByTrack=e.target.checked,this.resetControlPanel(),this.render()};const t=document.createElement("label");t.for="groupByCB",t.innerText="Group by track",t.style.color="black",t.style.paddingLeft="10px";const i=document.createElement("div");return i.style.width="100%",i.style.paddingTop="5px",i.style.paddingBottom="5px",i.style.background="rgb(216, 230, 234)",i.appendChild(e),i.appendChild(t),i}addToControlPanel(e){const t=document.createElement("div");this.controlPanel.appendChild(t);const i=document.createElement("div");i.className="igv-circview-button",t.appendChild(i),i.innerText=!0===e.visible?"Hide":"Show",i.addEventListener("click",(t=>{!0===e.visible?(this.hideChordSet(e.name),t.target.innerText="Show"):(this.showChordSet(e.name),t.target.innerText="Hide")}));const n=document.createElement("input"),r=e=>200*Math.log(e*Em),s=document.createElement("div");s.className="igv-circview-button",s.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;",t.appendChild(s),s.style.backgroundColor=Bm(e.color,1);const o={parent:s,popup:"right",editorFormat:"rgb",color:e.color,onChange:({rgbaString:t})=>{s.style.backgroundColor=Bm(t,1),this.setColor(e.name,t),n.value=r(Mm(e.color))}},a=new Cm(o);n.setAttribute("title","Adjust transparency of arcs"),n.type="range",n.style.width="100px",n.style.marginRight="10px",n.setAttribute("class","range"),n.setAttribute("min","0"),n.setAttribute("max","1000"),n.value=r(Mm(e.color)),n.oninput=()=>{const t=(i=n.value,Math.exp(i/200)/Em);var i;this.setColor(e.name,Bm(e.color,t)),a.setColor(e.color)},t.appendChild(n);const c=document.createElement("div");c.style.color="black",t.appendChild(c),c.innerText=c.title=e.name}setAssembly(e){const t=this.genomeId||Tm();if(this.genomeId===t)return;this.chordManager.clearChords(),this.genomeId=t,this.chrNames=new Set(e.chromosomes.map((e=>Rm(e.name))));const i=[],n=[];for(let t of e.chromosomes){const e=Rm(t.name);n.push(t.color||xm(e)),i.push({refName:e,uniqueId:e,start:0,end:t.bpLength})}this.assembly={name:e.name,sequence:{trackId:t,type:"ReferenceSequenceTrack",adapter:{type:"FromConfigSequenceAdapter",features:i}},refNameColors:n},this.render()}addChords(e,t={}){const i=t.name||t.track||"*",n=i.split(" ")[0].replaceAll("%20"," "),r={name:i.replaceAll("%20"," "),trackName:n,chords:e,color:t.color||"black",trackColor:t.trackColor||t.color||"black",visible:!0,id:t.id||Tm()};this.chordManager.addChordSet(r),this.resetControlPanel(),this.render()}setSize(e,t){if(t=t||e,this.width=e,this.height=t,this.viewState){const i=this.viewState.session.view;i.setWidth(e),i.setHeight(t),i.setBpPerPx(i.minBpPerPx)}}getSize(){return Math.min(this.width,this.height)}clearChords(){this.chordManager.clearChords(),this.resetControlPanel(),this.render()}clearSelection(){this.viewState.pluginManager.rootModel.session.clearSelection()}show(){this.parent.style.display="block"}hide(){this.parent.style.display="none"}get visible(){return"none"!==this.parent.style.display}set visible(e){this.parent.style.display=e?"block":"none"}hideChordSet(e){let t=this.getChordSet(e);t?(t.visible=!1,this.render()):console.warn(`No track with name: ${name}`)}showChordSet(e){let t=this.getChordSet(e);t?(t.visible=!0,this.render()):console.warn(`No track with name: ${e}`)}deleteTrack(e){let t=this.tracks.findIndex((t=>e===t.name));t>=0&&this.tracks.splice(t,1),this.render()}getChordSet(e){return this.groupByTrack?this.chordManager.getTrack(e):this.chordManager.getChordSet(e)}setColor(e,t){const i=this.getChordSet(e);if(i){i.color=t;const e=i.id;for(let i of this.viewState.config.tracks)if(e===i.trackId){i.displays[0].renderer.strokeColor.set(t);break}}}render(){const{createViewState:e,JBrowseCircularGenomeView:t}=JBrowseReactCircularGenomeView;ReactDOM.unmountComponentAtNode(this.container);const i=(this.groupByTrack?this.chordManager.tracks:this.chordManager.chordSets).filter((e=>e.visible)),n=[],r=[];for(let e of i)n.push({trackId:e.id,name:e.name,assemblyNames:["forIGV"],type:"VariantTrack",adapter:{type:"FromConfigAdapter",features:e.chords}}),r.push(e.color);this.viewState=e({assembly:this.assembly,tracks:n});for(let e=0;e<i.length;e++)this.viewState.config.tracks[e].displays[0].renderer.strokeColor.set(r[e]);this.element=React.createElement(t,{viewState:this.viewState}),this.setSize(this.width,this.height),ReactDOM.render(this.element,this.container);const s=this.config.onChordClick||Dm;for(let e=0;e<i.length;e++)this.viewState.session.view.showTrack(this.viewState.config.tracks[e].trackId),s&&(this.viewState.pluginManager.jexl.addFunction("onChordClick",s),this.viewState.config.tracks[e].displays[0].onChordClick.set("jexl:onChordClick(feature, track, pluginManager)"))}}function Bm(e,t){const[i,n,r,s]=e.split(",");return`${i},${n},${r},${t})`}function Mm(e){return e.startsWith("rgba(")?Number(e.split(",")[3].replace(")","")):1}function Rm(e){return e.startsWith("chr")?e.substring(3):e}function Dm(e,t,i){console.log(e)}function Tm(){return("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)}if("undefined"!=typeof document){function EA(e){for(let t of document.styleSheets)if(t=t.href?t.href.replace(/^.*[\\\/]/,""):"",t===e)return!0;return!1}EA("circular-view.css")||function(){const e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML='.igv-circview-container {\n width: fit-content;\n height: fit-content;\n box-sizing: content-box;\n color: dimgray;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n background-color: white;\n border-color: dimgray;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-circview-toolbar {\n position: relative;\n width: 100%;\n height: 32px;\n background-color: lightgrey;\n border-bottom-style: solid;\n border-bottom-color: dimgray;\n border-bottom-width: thin;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n\n.igv-circview-toolbar-button-container {\n height: 100%;\n width: fit-content;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-circview-toolbar-button-container > div {\n margin: 4px;\n}\n\n.igv-circview-track-panel {\n z-index: 1024;\n position: absolute;\n top: 33px;\n left: 0;\n width: 100%;\n height: fit-content;\n border-bottom-style: solid;\n border-bottom-color: dimgray;\n border-bottom-width: thin;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n}\n.igv-circview-track-panel > div {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-circview-track-panel > div > div {\n margin: 4px;\n}\n\n.igv-circview-swatch-button {\n cursor: pointer;\n padding: 5px;\n width: 8px;\n height: 8px;\n border: 1px solid #8d8b8b;\n border-radius: 16px;\n}\n\n.igv-circview-button {\n cursor: pointer;\n padding: 5px;\n color: #444;\n vertical-align: middle;\n text-align: center;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n border: 1px solid #8d8b8b;\n border-radius: 4px;\n background: #efefef;\n box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.2);\n}\n\n.igv-circview-button:hover {\n background: #efefef;\n box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.6);\n}\n\n.igv-circview-button:active {\n color: #007bff;\n box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.6);\n}\n\n/*# sourceMappingURL=circular-view.css.map */\n',document.head.insertBefore(e,document.head.childNodes[document.head.childNodes.length-1])}()}const Lm=e=>e.startsWith("chr")?e.substring(3):e;function zm(e){const t=[],i=[];if(e.wgChromosomeNames)for(let n of e.wgChromosomeNames){const r=e.getChromosome(n);i.push(Nu(r.name)),t.push({name:r.name,bpLength:r.bpLength})}return t}function Hm(e,t,i,n){const r=t.color||"rgb(0,0,255)",s=_s.addAlpha("all"===i.chr?r:Nu(i.chr),n),o=_s.addAlpha(r,n),a=t.name.replaceAll(" ","%20"),c="all"===i.chr?a:`${a} ${i.chr}:${i.start}-${i.end}`;t.browser.circularView.addChords(e,{track:c,color:s,trackColor:o}),t.browser.circularViewVisible||(t.browser.circularViewVisible=!0)}class Pm{constructor(e,{minTLENPercentile:t,maxTLENPercentile:i}){this.totalCount=0,this.frCount=0,this.rfCount=0,this.ffCount=0,this.sumF=0,this.sumF2=0,this.lp=void 0===t?.1:t,this.up=void 0===i?99.5:i,this.isizes=[],this.compute(e)}compute(e){for(let n of e)if(n.isProperPair()){var t=Math.abs(n.fragmentLength);this.sumF+=t,this.sumF2+=t*t,this.isizes.push(t);var i=n.pairOrientation;if("string"==typeof i&&4===i.length)switch(""+i.charAt(0)+i.charAt(2)){case"FF":case"RR":this.ffCount++;break;case"FR":this.frCount++;break;case"RF":this.rfCount++}this.totalCount++}this.ffCount/this.totalCount>.9?this.orienation="ff":this.frCount/this.totalCount>.9?this.orienation="fr":this.rfCount/this.totalCount>.9&&(this.orienation="rf"),this.minTLEN=0===this.lp?0:Om(this.isizes,this.lp),this.maxTLEN=Om(this.isizes,this.up)}}function Om(e,t){if(0!==e.length){var i=Math.floor(e.length*(t/100));return e.sort((function(e,t){return e-t})),e[i]}}const Um="rgb(255,0,255)",qm="rgb(0,0,255)",Qm="rgb(132, 178, 158)",Vm=new Map;Vm.set("m","rgb(255,0,0)"),Vm.set("h",Um),Vm.set("o","rgb(111, 78, 129)"),Vm.set("f","rgb(246, 200, 95)"),Vm.set("c","rgb(157, 216, 102)"),Vm.set("g","rgb(255, 160, 86)"),Vm.set("e","rgb(141, 221, 208)"),Vm.set("b","rgb(202, 71, 47)"),Vm.set("h",Um),Vm.set("a","rgb(51,0,111)"),Vm.set("NONE_A",qm),Vm.set("NONE_C",qm),Vm.set("NONE_T",qm),Vm.set("NONE_G",qm),Vm.set("NONE_N",qm);const jm=new Map;function Wm(e,t,i){let n=function(e){return Vm.has(e)?Vm.get(e):Qm}(e),r=Xf(t);if(r>255)return n;const s=e+r+i;if(r<0&&(r=0),!jm.has(s)){const e="basemod2"===i?Math.max(20,Math.min(255,r*r/50-4*r+200+20)):Math.max(20,Math.min(255,.006127*r*r)),[t,o,a]=_s.rgbComponents(n);jm.set(s,`rgba(${t},${o},${a},${e/255})`)}return jm.get(s)}class Gm{constructor(e){this.alignmentTrack=e}updateContext(e){this.context=e}drawModifications(e,t,i,n,r,s){const{ctx:o,pixelEnd:a,bpStart:c,bpPerPixel:l}=n,h=e.getBaseModificationSets();if(h){let n;const d=r.split(":");2==d.length&&(r=d[0],n=d[1]);for(let d of e.blocks){if("S"===d.type)continue;const e=t,u=i;let f=Math.max(1,1/l);for(let t=d.seqOffset;t<d.seqOffset+d.len;t++){let i=(d.start+(t-d.seqOffset)-c)/l;if(i>a)break;if(i+f<0)continue;let p,g=-1,m=255,w=0;for(let e of h)if((!n||e.modification===n)&&e.containsPosition(t)){const i=Xf(e.likelihoods.get(t));m-=i,(!p||i>g)&&(p=e.modification,w=e.canonicalBase,g=i)}if(p){const t=255*s;let n;m>g&&"basemod2"===r&&m>=t?n=Wm("NONE_"+w,m,r):g>=t&&(n=Wm(p,g,r)),o.fillStyle=n,f<3&&(f=3,i--),o.fillRect(i,e,f,Math.max(1,u-2))}}}}}}const $m=new Set(["firstOfPairStrand"]);class Km extends Hl{static defaults={viewAsPairs:!1,showSoftClips:!1,showAllBases:!1,showInsertions:!0,showMismatches:!0,colorBy:void 0,groupBy:void 0,displayMode:"EXPANDED",alignmentRowHeight:14,squishedRowHeight:3,negStrandColor:"rgba(150, 150, 230, 0.75)",posStrandColor:"rgba(230, 150, 150, 0.75)",baseModPosStrandColor:"rgb(195, 195, 195)",baseModNegStrandColor:"rgb(195, 210, 195)",insertionColor:"rgb(138, 94, 161)",insertionTextColor:"white",showInsertionText:!1,deletionColor:"black",deletionTextColor:"black",showDeletionText:!1,skippedColor:"rgb(150, 170, 170)",pairConnectorColor:void 0,smallTLENColor:"rgb(0, 0, 150)",largeTLENColor:"rgb(200, 0, 0)",expectedPairOrientation:"fr",rlColor:"rgb(0, 150, 0)",rrColor:"rgb(20, 50, 200)",llColor:"rgb(0, 150, 150)",bamColorTag:"YC",hideSmallIndels:!1,indelSizeThreshold:1,highlightColor:void 0,minTLEN:void 0,maxTLEN:void 0,tagColorPallete:"Set1"};_colorTables=new Map;_baseModifications=new Set;constructor(e,t){super(e,t),(e.colorTable||e.tagColorTable)&&(this.colorTable=new ao(e.tagColorTable)),e.largeFragmentLengthColor&&(this.largeTLENColor=e.largeFragmentLengthColor),e.pairOrienation&&(this.expectedPairOrientation=e.pairOrientation),e.smallFragmentLengthColor&&(this.smallTLENColor=e.smallFragmentLengthColor),e.largeFragmentLengthColor&&(this.largeTLENColor=e.largeFragmentLengthColor),e.minFragmentLength&&(this.minTLEN=e.minFragmentLength),e.maxFragmentLength&&(this.maxTLEN=e.maxFragmentLength),e.displayMode&&(this.displayMode=e.displayMode.toUpperCase()),e.colorBy&&e.colorByTag&&(this.colorBy=e.colorBy+":"+e.colorByTag),this.featureSource=this.parent.featureSource,this.top=0===e.coverageTrackHeight?0:e.coverageTrackHeight+5,this.pairColors={RL:this.rlColor,RR:this.rrColor,LL:this.llColor},e.highlightedReads&&this.setHighlightedReads(e.highlightedReads),this.hasPairs=!1,this.hasSupplemental=!1,this._groupByTags=[],this._groupByPositions=[],e.groupBy&&(this.groupBy=e.groupBy,e.groupBy.startsWith("base:")&&this._groupByPositions.push(e.groupBy.substring(5)),e.groupBy.startsWith("tag:")&&this._groupByTags.push(e.groupBy.substring(4))),this._locusChange=Xm.bind(this),this.browser.on("locuschange",this._locusChange)}init(e){this.parent=e.parent,delete e.parent,super.init(e)}dispose(){this.browser.off("locuschage",this._locusChange)}get baseModRenderer(){return this._baseModRenderer||(this._baseModRenderer=new Gm(this)),this._baseModRenderer}get baseModificationThreshold(){return this.parent.baseModificationThreshold}setTop(e,t){this.top=0===e.height||!1===t?0:5+e.height}setHighlightedReads(e,t){if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new Error("AlignmentTrack.setHighlightedReads() only accept array of strings");t&&(this.highlightColor=t),this.highlightedReads=new Set(e)}computePixelHeight(e){if(e.packedGroups){let t=e.hasDownsampledIntervals()?15:0;const i="SQUISHED"===this.displayMode?this.squishedRowHeight:this.alignmentRowHeight;for(let n of e.packedGroups.values())t+=i*n.length+10;return t+5}return 0}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=r+s*n+1,a=this.showSoftClips,c=this.showAllBases,l=this.browser.nucleotideColors;i.save();for(let e of t.baseModificationKeys)this._baseModifications.add(e.modification);let h=t.sequence;h&&(h=h.toUpperCase());let d=0;this.colorBy||(this.colorBy=this.hasPairs?"unexpectedPair":"none");let u=e.pixelTop;this.top&&i.translate(0,this.top);const f=u+e.pixelHeight;t.hasDownsampledIntervals()?(d=15,t.downsampledIntervals.forEach((function(e){var t=(e.start-r)/n,s=(e.end-r)/n;s-t>5&&(t+=1,s-=1),xo.fillRect(i,t,2,s-t,8,{fillStyle:"black"})}))):d=0,this.alignmentsYOffset=d;const p="SQUISHED"===this.displayMode?this.squishedRowHeight:this.alignmentRowHeight,g=t.packedGroups;if(g){let t=d;for(let n of g.keys()){const a=g.get(n),c=a.rows,l=c.length;a.pixelTop=t;for(let e=0;e<l;e++){const i=c[e],n=p<=4?p:p-2;if(t>f)break;if(t+n<u)t+=p;else{for(let e of i.alignments)if(this.browser.circularView&&(this.hasSupplemental=this.hasSupplemental||e.hasTag("SA")),!(e.start+e.lengthOnRef<r)){if(e.start>o)break;!0!==e.hidden&&(e instanceof Qf?(m.call(this,e,t,n),w.call(this,e.firstAlignment,t,n),e.secondAlignment&&w.call(this,e.secondAlignment,t,n)):w.call(this,e,t,n))}t+=p}}if(a.pixelBottom=t,this.groupBy&&n){i.save(),i.font="400 12px sans-serif";const r=i.measureText(n),o=r.width+10,c=-e.pixelShift+e.viewportWidth-o-10,l=r.actualBoundingBoxAscent+r.actualBoundingBoxDescent+10,h=Math.min(a.pixelTop+l-1,a.pixelBottom);i.textAlign="center",i.fillStyle="white",i.strokeStyle="lightGray",i.beginPath(),i.roundRect(c,h-r.actualBoundingBoxAscent-5,o,l,2),i.fill(),i.stroke(),i.fillStyle="black",i.fillText(n,c+o/2,h),xo.dashedLine(i,0,t,s,t),i.restore(),t+=10}}}function m(e,t,s){var a=this.getConnectorColor(e.firstAlignment),c=(e.connectingStart-r)/n,l=(e.connectingEnd-r)/n,h=t+s/2;e.connectingEnd<r||e.connectingStart>o||(e.mq<=0&&(a=_s.addAlpha(a,.15)),xo.setProperties(i,{fillStyle:a,strokeStyle:a}),xo.strokeLine(i,c,h,l,h))}function w(e,d,u){if(e.start+e.lengthOnRef<r||e.start>o)return;const f=a?e.blocks:e.blocks.filter((e=>"S"!==e.type));let g=this.getAlignmentColor(e);const m=g;e.mq<=0&&(g=_s.addAlpha(g,.15)),xo.setProperties(i,{fillStyle:g,strokeStyle:m});const w=[];for(let e=0;e<f.length;e++){const t=f[e];if(!(e!==f.length-1&&f[e+1].start<r)&&(w.push(...b.call(this,t,e)),t.start+t.len>o))break}if(e.gaps){const t=d+u/2;for(let s of e.gaps){const e=(s.start-r)/n,o=(s.start+s.len-r)/n,a=o-e,c=s.len.toString(),l=6*c.length,h=e+a/2,u="D"===s.type?this.deletionColor:this.skippedColor;if(xo.strokeLine(i,e,t,o,t,{strokeStyle:u,lineWidth:2}),this.showDeletionText&&s.len>1&&a>=l+8){const e=h-l/2;xo.fillRect(i,e-1,d-1,l+2,12,{fillStyle:"white"}),xo.fillText(i,c,e,d+10,{font:"normal 10px monospace",fillStyle:this.deletionTextColor})}}}if(e.insertions&&this.showInsertions){let t=-1;for(let s of e.insertions){if(this.hideSmallIndels&&s.len<=this.indelSizeThreshold)continue;if(s.start<r)continue;if(s.start>o)break;const e=s.start-r,a=s.len.toString(),c=2+6*a.length,l=this.showInsertionText&&1!==s.len?Math.round(s.len/n):2,h=Math.max(Math.min(c,l),2),f=e/n-h/2;if(f-t>2){const e={fillStyle:this.insertionColor};xo.fillRect(i,f-2,d,h+4,2,e),xo.fillRect(i,f,d+2,h,u-4,e),xo.fillRect(i,f-2,d+u-2,h+4,2,e),this.showInsertionText&&s.len>1&&l>c&&xo.fillText(i,a,f+1,d+10,{font:"normal 10px monospace",fillStyle:this.insertionTextColor}),t=f}}}for(let{bbox:e,baseColor:t,readChar:r}of w){if(n<=.1&&e.height>=8){const n=Math.min(10,e.height);i.font=n+"px sans-serif";const s=e.x+e.width/2;xo.strokeText(i,r,s-i.measureText(r).width/2,n-1+e.y,{strokeStyle:t})}else xo.fillRect(i,e.x,e.y,e.width,e.height,{fillStyle:t})}if(this.colorBy&&this.colorBy.startsWith("basemod")){const t={ctx:i,bpPerPixel:n,bpStart:r,bpEnd:o,pixelEnd:s};this.baseModRenderer.drawModifications(e,d,u,t,this.colorBy,this.baseModificationThreshold)}function b(o,a){const w=[],b=o.start-t.start,F=(o.start-r)/n,v=(o.start+o.len-r)/n,y=Math.max(1,v-F),A=100/n,C=Math.min(p/2,A/6),_="S"===o.type,x=e.mq<=0||this.selectedReadName===e.readName||_||this.highlightedReads&&this.highlightedReads.has(e.readName);let k=m;this.selectedReadName===e.readName?k="red":_?k="rgb(50,50,50)":this.highlightedReads&&this.highlightedReads.has(e.readName)&&(k=this.highlightColor||"#00ff00");const I=!0===e.strand&&a===f.length-1,S=!1===e.strand&&0===a;if(I|S){let e,t;I?(e=[F,v,v+C,v,F,F],t=[d,d,d+u/2,d+u,d+u,d]):S&&(e=[v,F,F-C,F,v,v],t=[d,d,d+u/2,d+u,d+u,d]),xo.fillPolygon(i,e,t,{fillStyle:g}),x&&xo.strokePolygon(i,e,t,{strokeStyle:k})}else xo.fillRect(i,F,d,y,u,{fillStyle:g}),x&&(i.save(),i.strokeStyle=k,i.strokeRect(F,d,y,u),i.restore());if(_||c||this.showMismatches&&h&&e.seq&&"*"!==e.seq){const t=e.seq?e.seq.toUpperCase():void 0,i=e.qual,a=o.seqOffset,f=Math.max(1,1/n);for(let e=0,p=o.len;e<p;e++){const p=(o.start+e-r)/n;if(p+f<0)continue;if(p>s)break;let g=t?t.charAt(a+e):"";const m=b+e>=0?h.charAt(b+e):"";if("="===g&&(g=m),"X"===g||m!==g||_||c){let t=l[g]||"rgb(0,0,0)";if(!_&&void 0!==i&&i.length>a+e){t=Ym(i[a+e],t)}w.push({bbox:{x:p,y:d,width:f,height:u},baseColor:t,readChar:g})}}}return w}}i.restore()}popupData(e){const t=this.getClickedObject(e);return t?t.popupData(e.genomicLocation):void 0}menuItemList(){let e=[];e.push("<hr/>");const t=Bt('<div class="igv-track-menu-category">');t.text("Color by:"),e.push({name:void 0,object:t,click:void 0,init:void 0});const i=[];i.push({key:"none",label:"none"}),i.push({key:"strand",label:"read strand"}),this.hasPairs&&(i.push({key:"firstOfPairStrand",label:"first-of-pair strand"}),i.push({key:"pairOrientation",label:"pair orientation"}),i.push({key:"tlen",label:"insert size (TLEN)"}),i.push({key:"unexpectedPair",label:"pair orientation & insert size (TLEN)"})),i.push({key:"tag",label:"tag"});for(let t of i){const i=void 0===this.colorBy&&"none"===t.key||this.colorBy===t.key;e.push(this.colorByCB(t,i))}const n=this._baseModifications.size;if(n>0){e.push('<hr style="border-top:1px dotted;border-bottom: none;">');let t=1===n?"base modification":"base modification (all)";if(e.push(this.basemodColorByCB({key:"basemod",label:t})),n>1)for(let t of this._baseModifications)e.push(this.basemodColorByCB({key:"basemod:"+t,label:`base modification (${Kf(t)})`}));if(e.push('<hr style="border-top:1px dotted;border-bottom: none;">'),t=1===n?"base modification 2-color":"base modification 2-color (all)",e.push(this.basemodColorByCB({key:"basemod2",label:t})),n>1)for(let t of this._baseModifications)e.push(this.basemodColorByCB({key:"basemod2:"+t,label:`base modification 2-color (${Kf(t)})`}))}e.push("<hr/>");const r=Bt('<div class="igv-track-menu-category">');r.text("Group by:"),e.push({name:void 0,object:r,click:void 0,init:void 0});const s=[];s.push({key:"none",label:"none"}),s.push({key:"strand",label:"read strand"}),this.hasPairs&&(s.push({key:"firstOfPairStrand",label:"first-of-pair strand"}),s.push({key:"pairOrientation",label:"pair orientation"}),s.push({key:"mateChr",label:"chromosome of mate"})),s.push({key:"chimeric",label:"chimeric"}),s.push({key:"supplementary",label:"supplementary flag"}),s.push({key:"readOrder",label:"read order"});for(let e of this._groupByTags)s.push({key:`tag:${e}`,label:`tag:${e}`});for(let e of this._groupByPositions)s.push({key:`base:${e}`,label:`base:${e}`});s.push({key:"tag",label:"tag..."});for(let t of s){const i=void 0===this.groupBy&&"none"===t.key||this.groupBy===t.key;e.push(this.groupByCB(t,i))}e.push("<hr/>"),e.push({object:Bt(Dl("Show all bases",this.showAllBases)),click:function(){this.alignmentTrack.showAllBases=!this.alignmentTrack.showAllBases,this.trackView.repaintViews()}}),e.push({object:Bt(Dl("Show mismatches",this.showMismatches)),click:function(){this.alignmentTrack.showMismatches=!this.alignmentTrack.showMismatches,this.trackView.repaintViews()}}),e.push({object:Bt(Dl("Show insertions",this.showInsertions)),click:function(){this.alignmentTrack.showInsertions=!this.alignmentTrack.showInsertions,this.trackView.repaintViews()}}),e.push({object:Bt(Dl("Show soft clips",this.showSoftClips)),click:function(){this.alignmentTrack.showSoftClips=!this.alignmentTrack.showSoftClips;const e=this.getCachedAlignmentContainers();for(let t of e)t.pack(this);this.trackView.repaintViews()}}),this.hasPairs&&(e.push("<hr/>"),e.push({object:Bt(Dl("View as pairs",this.viewAsPairs)),click:function(){const e=!this.alignmentTrack.viewAsPairs;if(e&&this.groupBy&&!$m.has(this.groupBy))return void this.browser.alert.present(`'View as Pairs' is incompatible with 'Group By ${this.groupBy}'`);this.alignmentTrack.viewAsPairs=e;const t=this.getCachedAlignmentContainers();for(let e of t)e.pack(this);this.trackView.checkContentHeight(),this.trackView.repaintViews()}})),this.browser.circularView&&(this.hasPairs||this.hasSupplemental)&&(e.push("<hr/>"),this.hasPairs&&e.push({label:"Add discordant pairs to circular view",click:function(){for(let e of this.trackView.viewports)this.addPairedChordsForViewport(e)}}),this.hasSupplemental&&e.push({label:"Add split reads to circular view",click:function(){for(let e of this.trackView.viewports)this.addSplitChordsForViewport(e)}})),e.push("<hr/>");const o=Bt('<div class="igv-track-menu-category">');o.text("Display mode:"),e.push({name:void 0,object:o,click:void 0,init:void 0});for(let t of["EXPANDED","SQUISHED","FULL"])e.push({object:Bt(Dl(t.toLowerCase(),this.displayMode===t)),click:function(){this.alignmentTrack.setDisplayMode(t)}});return e}setDisplayMode(e){const t="FULL"===this.displayMode||"FULL"===e;if(this.displayMode=e,t){const e=this.getCachedAlignmentContainers();for(let t of e)t.pack(this)}this.trackView.checkContentHeight(),this.trackView.repaintViews()}colorByCB(e,t){const i=Bt(Dl(e.label,t));if("tag"!==e.key){function n(){this.alignmentTrack.colorBy=e.key,this.trackView.repaintViews()}return{name:void 0,object:i,click:n,init:void 0}}{function r(e){const t=this.alignmentTrack.colorBy.startsWith("tag:")?this.alignmentTrack.colorBy.substring(4):"";this.browser.inputDialog.present({label:"Tag Name",value:t,callback:e=>{const t=this.alignmentTrack;e?(t.colorBy="tag:"+e,t.colorTable||(t.colorTable=new oo("Set1"))):t.colorBy=void 0,this.trackView.repaintViews()}},e)}return{name:void 0,object:i,dialog:r,init:void 0}}}basemodColorByCB(e){const t=this.colorBy===e.key;return{name:void 0,object:Bt(Dl(e.label,t)),click:function(){this.alignmentTrack.colorBy=e.key,"strand"!==this.alignmentTrack.groupBy&&(this.alignmentTrack.groupBy="strand",this.alignmentTrack.repackAlignments()),this.trackView.repaintViews()},init:void 0}}groupByCB(e,t){return{name:void 0,object:Bt(Dl(e.label,t)),dialog:function(t){const i=()=>this.alignmentTrack.repackAlignments();if("tag"===e.key){let e="";this.alignmentTrack.groupBy&&this.alignmentTrack.groupBy.startsWith("tag:")&&(e=this.alignmentTrack.groupBy.substring(4)),this.browser.inputDialog.present({label:"Tag Name",value:e,callback:e=>{e&&(this.alignmentTrack.groupBy="tag:"+e,this.alignmentTrack._groupByTags.push(e),i())}},t)}else"none"===e.key?this.alignmentTrack.groupBy=void 0:this.alignmentTrack.groupBy=e.key,i()},init:void 0}}repackAlignments(){const e=this.getCachedAlignmentContainers();for(let t of e)"function"==typeof t.pack&&t.pack(this);this.trackView.checkContentHeight(),this.trackView.repaintViews()}contextMenuItemList(e){const t=e.viewport,i=[],n=i=>{const n=this.sortObject,r=!n||n.position!==Math.floor(e.genomicLocation)||!n.direction,s={chr:t.referenceFrame.chr,position:Math.floor(e.genomicLocation),option:i,direction:r,sortAsPairs:t.trackView.track.viewAsPairs};this.sortObject=s,t.cachedFeatures.sortRows(s),t.repaint()};i.push("<b>Sort by...</b>"),i.push({label:"&nbsp; base",click:()=>n("BASE")}),i.push({label:"&nbsp; read strand",click:()=>n("strand")}),i.push({label:"&nbsp; start location",click:()=>n("START")}),i.push({label:"&nbsp; insert size",click:()=>n("INSERT_SIZE")}),i.push({label:"&nbsp; gap size",click:()=>n("GAP_SIZE")}),i.push({label:"&nbsp; chromosome of mate",click:()=>n("MATE_CHR")}),i.push({label:"&nbsp; mapping quality",click:()=>n("MQ")}),i.push({label:"&nbsp; read name",click:()=>n("READ_NAME")}),i.push({label:"&nbsp; aligned read length",click:()=>n("ALIGNED_READ_LENGTH")}),i.push({label:"&nbsp; tag",click:()=>{const i=this.sortObject,n=!i||i.position!==Math.floor(e.genomicLocation)||!i.direction,r={label:"Tag Name",value:this.sortByTag?this.sortByTag:"",callback:i=>{if(i){const r={chr:t.referenceFrame.chr,position:Math.floor(e.genomicLocation),option:"TAG",tag:i,direction:n};this.sortByTag=i,this.sortObject=r,t.cachedFeatures.sortRows(r),t.repaint()}}};this.browser.inputDialog.present(r,e.event)}}),i.push("<hr/>");const r=`${t.referenceFrame.chr}:${Rt(Math.floor(e.genomicLocation)+1)}`;i.push({label:`Group by base @${r}`,click:()=>{this._groupByPositions.push(r),this.groupBy=`base:${r}`;const e=this.getCachedAlignmentContainers();for(let t of e)t.pack(this);this.trackView.checkContentHeight(),this.trackView.repaintViews()}}),i.push("<hr/>");const s=this.getClickedObject(e);if(s){const t=this.showSoftClips,n="function"==typeof s.alignmentContaining?s.alignmentContaining(e.genomicLocation,t):s;if(n){n.isPaired()&&n.isMateMapped()&&i.push({label:"View mate in split screen",click:()=>{if(n.mate){const t=e.viewport.referenceFrame,i=this.browser.genome.getChromosome(n.mate.chr);if(i){this.selectedReadName=n.readName;const r=t.bpPerPixel*e.viewport.getWidth(),s=n.mate.position-r/2,o=n.mate.position+r/2;this.browser.addMultiLocusPanel(i.name,s,o,t)}else this.browser.alert.present(`Reference does not contain chromosome: ${n.mate.chr}`)}},init:void 0}),i.push({label:"View read sequence",click:()=>{const e=n.seq;e&&"*"!==e?this.browser.alert.present(e):this.browser.alert.present("Read sequence: *")}}),Za()&&i.push({label:"Copy read sequence",click:async()=>{const e=n.seq;try{await navigator.clipboard.writeText(e)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}});const t=n.seq;if(t&&"*"!==t){t.length<Qd&&i.push({label:"BLAT read sequence",click:()=>{const e=n.isNegativeStrand()?lc(t):t,i=`${n.readName} - blat`,r=`${this.name} - ${i}`;jd({sequence:e,browser:this.browser,name:i,title:r})}});const e=n.softClippedBlocks();e.left&&e.left.len>20&&e.left.len<Qd&&i.push({label:"BLAT left soft-clipped sequence",click:()=>{const i=t.substr(e.left.seqOffset,e.left.len),r=n.isNegativeStrand()?lc(i):i,s=`${n.readName} - blat left clip`,o=`${this.name} - ${s}`;jd({sequence:r,browser:this.browser,name:s,title:o})}}),e.right&&e.right.len>20&&e.right.len<Qd&&i.push({label:"BLAT right soft-clipped sequence",click:()=>{const i=t.substr(e.right.seqOffset,e.right.len),r=n.isNegativeStrand()?lc(i):i,s=`${n.readName} - blat right clip`,o=`${this.name} - ${s}`;jd({sequence:r,browser:this.browser,name:s,title:o})}})}i.push("<hr/>")}}return this.browser.circularView&&(this.hasPairs||this.hasSupplemental)&&(this.hasPairs&&i.push({label:"Add discordant pairs to circular view",click:()=>{this.addPairedChordsForViewport(t)}}),this.hasSupplemental&&i.push({label:"Add split reads to circular view",click:()=>{this.addSplitChordsForViewport(t)}}),i.push("<hr/>")),i}getClickedObject(e){let t=e.viewport.cachedFeatures;if(!t)return;const i=e.y-this.top,n=e.genomicLocation;if(t.packedGroups){let e=Number.MAX_VALUE;for(let r of t.packedGroups.values())if(e=Math.min(e,r.pixelTop),i>r.pixelTop&&i<=r.pixelBottom){const e="SQUISHED"===this.displayMode?this.squishedRowHeight:this.alignmentRowHeight;let t=Math.floor((i-r.pixelTop)/e);if(t>=0&&t<r.length){const e=r.rows[t].alignments.filter((e=>e.containsLocation(n,this.showSoftClips)));if(e.length>0)return e[0]}}}if(i<minGroupY&&t.downsampledIntervals)for(const e of t.downsampledIntervals)if(e.start<=n&&e.end>=n)return e}getConnectorColor(e){if(this.pairConnectorColor)return this.pairConnectorColor;let t=this.colorBy;switch(t&&t.startsWith("tag:")&&(t.substring(4),t="tag"),t){case"strand":case"firstOfPairStrand":case"pairOrientation":case"tag":return this.color?"function"==typeof this.color?this.color(e):this.color:"rgb(200, 200, 200)";default:return this.getAlignmentColor(e)}}getAlignmentColor(e){let t;t=this.color?"function"==typeof this.color?this.color(e):this.color:"rgb(185, 185, 185)";let i,n=this.colorBy;switch(n&&n.startsWith("tag:")&&(i=n.substring(4),n="tag"),n){case"basemod":case"basemod2":t=e.strand?this.baseModPosStrandColor:this.baseModNegStrandColor;break;case"strand":t=e.strand?this.posStrandColor:this.negStrandColor;break;case"firstOfPairStrand":const r=e.firstOfPairStrand;void 0!==r&&(t=r?this.posStrandColor:this.negStrandColor);break;case"unexpectedPair":case"pairOrientation":if(e.pairOrientation){const i=ep[this.expectedPairOrientation];if(i){const n=this.pairColors[i[e.pairOrientation]];if(n){t=n;break}}}if("pairOrientation"===n)break;case"tlen":case"fragmentLength":e.mate&&e.isMateMapped()&&(e.mate.chr!==e.chr?t=Nu(e.mate.chr):this.minTemplateLength&&Math.abs(e.fragmentLength)<this.minTemplateLength?t=this.smallTLENColor:this.maxTemplateLength&&Math.abs(e.fragmentLength)>this.maxTemplateLength&&(t=this.largeTLENColor));break;case"tag":const s=e.tags()[i];void 0!==s&&(this.bamColorTag===i&&(t=_s.createColorStringSafe(s)),this.colorTable||(this.colorTable=new oo(this.tagColorPallete)),t=this.colorTable.getColor(s))}return t}get nucleotideColors(){return this.browser.nucleotideColors}get minTemplateLength(){return void 0!==this.minTLEN?this.minTLEN:this.parent._pairedEndStats?this.parent._pairedEndStats.minTLEN:0}get maxTemplateLength(){return void 0!==this.maxTLEN?this.maxTLEN:this.parent._pairedEndStats?this.parent._pairedEndStats.maxTLEN:1e3}getState(){const e=super.getState();return this.highlightedReads&&(e.highlightedReads=Array.from(this.highlightedReads)),e}get name(){return this.parent.name}set name(e){this.parent.name=e}get color(){return this.parent.color}set color(e){this.parent.color=e}get trackView(){return this.parent.trackView}get getCachedAlignmentContainers(){return this.parent.getCachedAlignmentContainers}get sortObject(){return this.parent.sortObject}set sortObject(e){this.parent.sortObject=e}addPairedChordsForViewport(e){return this.parent.addPairedChordsForViewport(e)}addSplitChordsForViewport(e){return this.parent.addSplitChordsForViewport(e)}}function Ym(e,t){let i;return i=e<5?.1:Math.max(.1,Math.min(1,.1+.9*(e-5)/15)),i=Math.round(10*i)/10,i<1&&(t=_s.addAlpha(t,i)),t}function Xm(){"FULL"!==this.displayMode||this.browser.isTrackPanning()||this.repackAlignments()}function Zm(e,t,i,n,r,s,o,a,c){const l=o.baseModCounts,h=o.coverageMap;if(l){let o;const d=a.split(":");2==d.length&&(a=d[0],o=d[1]);const u=Array.from(l.allModifications);u.sort(Vf.compare);const f=h.getTotalCount(s);if(!u.filter((e=>o?o===e.modification:!e.modification.startsWith("NONE_"))).find((e=>l.getCount(s,e,0,!1)>0)))return;for(let d of u){if(d.modification.startsWith("NONE_")&&"basemod2"!==a)continue;if(o&&o!==d.modification&&!d.modification.startsWith("NONE_"))continue;const u=d.base,p=ac(u),g=h.getCount(s,u)+h.getCount(s,p),m=l.simplexModifications.has(d.modification)?h.getPosCount(s,u)+h.getNegCount(s,p):g;if(0==m)continue;const w="basemod2"===a,b=l.getCount(s,d,c,w);if(0==b)continue;const F=g/f*(b/m),v=Math.round(F*r),y=l.getLikelihoodSum(s,d,c,w)/b,A=i-v,C=Wm(d.modification,y,a);e.fillStyle=C,e.fillRect(t,A,n,v),i=A}}}class Jm{constructor(e,t){this.featureType="numeric",this.parent=t,this.featureSource=t.featureSource,this.paintAxis=cd,this.top=0,this.autoscale=e.autoscale||void 0===e.max,e.coverageColor&&(this.color=e.coverageColor),this.autoscale||(this.dataRange={min:e.min||0,max:e.max})}get height(){return this.parent.coverageTrackHeight}draw(e){const t=e.pixelTop;e.pixelHeight;const i=this.parent.browser.nucleotideColors;if(t>this.height)return;const n=e.context,r=e.features,s=r.coverageMap;let o;s.refSeq&&(o=s.refSeq.toUpperCase());const a=e.bpPerPixel,c=e.bpStart,l=c+e.pixelWidth*a+1;let h;h=this.color?this.color:this.parent.color&&"function"!=typeof this.parent.color?_s.darkenLighten(this.parent.color,-35):"rgb(150, 150, 150)",xo.setProperties(n,{fillStyle:h,strokeStyle:h});const d=Math.max(1,1/a);for(let e=0,t=s.coverage.length;e<t;e++){const t=s.bpStart+e;if(t<c)continue;if(t>l)break;const i=s.coverage[e];if(!i)continue;const r=i.total/this.dataRange.max*this.height,o=this.height-r,h=(t-c)/a;xo.fillRect(n,h,o,d,r)}if(o)for(let e=0,t=s.coverage.length;e<t;e++){const t=s.bpStart+e;if(t<c)continue;if(t>l)break;const h=s.coverage[e];if(!h)continue;const u=h.total/this.dataRange.max*this.height;let f=this.height-u;const p=Math.floor((t-c)/a),g=o[e];if(this.parent.colorBy&&this.parent.colorBy.startsWith("basemod"))Zm(n,p,this.height,d,u,t,r,this.parent.colorBy,this.parent.baseModificationThreshold);else if(h.isMismatch(g)){xo.setProperties(n,{fillStyle:i[g]}),xo.fillRect(n,p,f,d,u);let e=0;for(let t of["A","C","T","G"]){const r=(h["pos"+t]+h["neg"+t])/this.dataRange.max*this.height;f=this.height-r-e,e+=r,xo.setProperties(n,{fillStyle:i[t]}),xo.fillRect(n,p,f,d,r)}}}}getClickedObject(e){let t=e.viewport.cachedFeatures;if(!t||0===t.length)return;const i=Math.floor(e.genomicLocation),n=t.coverageMap,r=Math.floor(i-n.bpStart),s=n.coverage[r];return s?{coverage:s,baseModCounts:t.baseModCounts,hoverText:()=>n.coverage[r].hoverText()}:void 0}popupData(e){const t=[],{coverage:i,baseModCounts:n}=this.getClickedObject(e);if(i){const r=Math.floor(e.genomicLocation),s=e.viewport.referenceFrame;t.push(s.chr+":"+Rt(1+r)),t.push({name:"Total Count",value:i.total});let o=i.posA+i.negA;o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posA+"+, "+i.negA+"- )"),t.push({name:"A",value:o}),o=i.posC+i.negC,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posC+"+, "+i.negC+"- )"),t.push({name:"C",value:o}),o=i.posG+i.negG,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posG+"+, "+i.negG+"- )"),t.push({name:"G",value:o}),o=i.posT+i.negT,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posT+"+, "+i.negT+"- )"),t.push({name:"T",value:o}),o=i.posN+i.negN,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posN+"+, "+i.negN+"- )"),t.push({name:"N",value:o}),t.push("<HR/>"),t.push({name:"DEL",value:i.del.toString()}),t.push({name:"INS",value:i.ins.toString()}),n&&(t.push("<hr/>"),t.push(...n.popupData(r,this.parent.colorBy)))}return t}}class ew extends Hl{static defaults={alleleFreqThreshold:.2,visibilityWindow:3e4,showCoverage:!0,showAlignments:!0,height:300,coverageTrackHeight:50,baseModificationThreshold:0};constructor(e,t){super(e,t)}init(e){this.type="alignment",this.featureSource=new am(e,this.browser);const t=Object.assign({parent:this},e);this.coverageTrack=new Jm(t,this);const i=Object.assign({parent:this},e);this.alignmentTrack=new Km(i,this.browser),super.init(e),this.showAlignments||(this._height=this.coverageTrackHeight),e.sort&&(Array.isArray(e.sort)?this.assignSort(e.sort[0]):this.assignSort(e.sort))}dispose(){this.alignmentTrack.dispose()}setHighlightedReads(e,t){this.alignmentTrack.setHighlightedReads(e,t),this.updateViews()}get expectedPairOrientation(){return this.alignmentTrack.expectedPairOrientation}get viewAsPairs(){return this.alignmentTrack.viewAsPairs}get colorBy(){return this.alignmentTrack.colorBy}set height(e){this._height=e,this.showAlignments&&(this.alignmentTrack.height=this.showCoverage?e-this.coverageTrackHeight:e)}get height(){return this._height}sort(e){e=this.assignSort(e);for(let t of this.trackView.viewports)if(t.containsPosition(e.chr,e.position)){const i=t.cachedFeatures;i&&(i.sortRows(e),t.repaint())}}assignSort(e){if(e.locus){const t=function(e){const t=e.split(":"),i=t[1].split("-"),n={chr:t[0],start:Number.parseInt(i[0].replace(/,/g,""))-1};return i.length>1?n.end=Number.parseInt(i[1].replace(/,/g,"")):n.end=n.start+1,n}(e.locus);e.chr=t.chr,e.position=t.start}else e.position--;return e.direction="ASC"===e.direction||!0===e.direction,e.chr=this.browser.genome.getChromosomeName(e.chr),this.sortObject=e,this.sortObject}async getFeatures(e,t,i,n,r){const s=await this.featureSource.getAlignments(e,t,i);if(s.viewport=r,s.hasPairs&&!this._pairedEndStats&&!this.config.maxFragmentLength){const e=new Pm(s.allAlignments(),this.config);e.totalCount>99&&(this._pairedEndStats=e)}s.pack(this.alignmentTrack);const o=this.sortObject;return o&&o.chr===e&&o.position>=t&&o.position<=i&&s.sortRows(o),this.alignmentTrack.hasPairs=this.alignmentTrack.hasPairs||s.hasPairs,s}computePixelHeight(e){return(this.showCoverage?this.coverageTrackHeight:0)+(this.showAlignments?this.alignmentTrack.computePixelHeight(e):0)}draw(e){xo.fillRect(e.context,0,e.pixelTop,e.pixelWidth,e.pixelHeight,{fillStyle:"rgb(255, 255, 255)"}),!0===this.showCoverage&&this.coverageTrackHeight>0?(this.trackView.axisCanvas.style.display="block",this.coverageTrack.draw(e)):this.trackView.axisCanvas.style.display="none",!0===this.showAlignments&&(this.alignmentTrack.setTop(this.coverageTrack,this.showCoverage),this.alignmentTrack.draw(e))}paintAxis(e,t,i){this.coverageTrack.paintAxis(e,t,this.coverageTrackHeight)}contextMenuItemList(e){return this.alignmentTrack.contextMenuItemList(e)}popupData(e){return!0===this.showCoverage&&e.y>=this.coverageTrack.top&&e.y<this.coverageTrackHeight?this.coverageTrack.popupData(e):this.alignmentTrack.popupData(e)}clickedFeatures(e){let t;return t=!0===this.showCoverage&&e.y>=this.coverageTrack.top&&e.y<this.coverageTrackHeight?this.coverageTrack.getClickedObject(e):this.alignmentTrack.getClickedObject(e),t?[t]:void 0}hoverText(e){if(!0===this.showCoverage&&e.y>=this.coverageTrack.top&&e.y<this.coverageTrackHeight){const t=this.coverageTrack.getClickedObject(e);if(t)return t.hoverText()}}menuItemList(){let e=[];e=e.concat(this.numericDataMenuItems()),e=e.concat(this.alignmentTrack.menuItemList());const t=()=>{if(!this.autoHeight){const e=(this.showCoverage?this.coverageTrackHeight:0)+(this.showAlignments?this.alignmentTrack.height:0);this.trackView.setTrackHeight(e)}};return e.push("<hr/>"),e.push({object:Bt(Dl("Show Coverage",this.showCoverage)),click:function(){this.showCoverage=!this.showCoverage,t(),this.trackView.checkContentHeight(),this.trackView.repaintViews()}}),e.push({object:Bt(Dl("Show Alignments",this.showAlignments)),click:function(){this.showAlignments=!this.showAlignments,t(),this.trackView.checkContentHeight(),this.trackView.repaintViews()}}),e}getState(){const e=super.getState();return this.sortObject&&(e.sort={chr:this.sortObject.chr,position:this.sortObject.position+1,option:this.sortObject.option,direction:this.sortObject.direction?"ASC":"DESC"}),Object.assign(e,this.alignmentTrack.getState()),e}getCachedAlignmentContainers(){return this.trackView.viewports.map((e=>e.cachedFeatures))}get dataRange(){return this.coverageTrack.dataRange}set dataRange(e){this.coverageTrack.dataRange=e}get logScale(){return this.coverageTrack.logScale}set logScale(e){this.coverageTrack.logScale=e}get autoscale(){return this.coverageTrack.autoscale}set autoscale(e){this.coverageTrack.autoscale=e}addPairedChordsForViewport(e){const t=this.maxTemplateLength,i=[],n=e.referenceFrame;for(let r of e.cachedFeatures.allAlignments())r.end>=n.start&&r.start<=n.end&&(r.paired?r.end-r.start>t&&i.push(r):r.mate&&r.mate.chr&&(r.mate.chr!==r.chr||Math.max(r.fragmentLength)>t)&&i.push(r));Hm((e=>{const t=[];for(let i of e)if(i.paired)i.firstAlignment&&i.secondAlignment&&t.push({uniqueId:i.readName,refName:Lm(i.firstAlignment.chr),start:i.firstAlignment.start,end:i.firstAlignment.end,mate:{refName:Lm(i.secondAlignment.chr),start:i.secondAlignment.start,end:i.secondAlignment.end}});else{const e=i.mate;e&&e.chr&&e.position&&t.push({uniqueId:i.readName,refName:Lm(i.chr),start:i.start,end:i.end,mate:{refName:Lm(e.chr),start:e.position-1,end:e.position}})}return t})(i),this,n,.02)}addSplitChordsForViewport(e){const t=[],i=e.referenceFrame;for(let n of e.cachedFeatures.allAlignments()){const e=n.hasTag("SA");n.end>=i.start&&n.start<=i.end&&e&&t.push(n)}Hm((e=>{const t=e=>{const t=gp(e.tags().SA);let n=0;for(let r of t)r.start!==e.start&&i.push({uniqueId:`${e.readName}_${n++}`,refName:Lm(e.chr),start:e.start,end:e.end,mate:{refName:Lm(r.chr),start:r.start,end:r.start+r.lenOnRef}})},i=[];for(let i of e)i.paired?(t(i.firstAlignment),i.secondAlignment&&t(i.secondAlignment)):t(i);return i})(t),this,i,.02)}}class tw extends Hl{static defaults={height:250,theta:Math.PI/4,arcOrientation:"UP",showBlocks:!0,blockHeight:3,thickness:1,color:"rgb(180,25,137)",alpha:.02,logScale:!0};constructor(e,t){super(e,t)}init(e){super.init(e),!1===e.arcOrientation?this.arcOrientation="DOWN":!0===e.arcOrientation?this.arcOrientation="UP":e.arcOrientation?this.arcOrientation=e.arcOrientation.toUpperCase():this.arcOrientation="UP",this.sinTheta=Math.sin(this.theta),this.cosTheta=Math.cos(this.theta),this.arcType=function(e){if(!e.arcType)return"nested";switch(e.arcType){case"chiapet":return"inView";case"chiapetoutbound":return"partialInView";default:return e.arcType}}(e),this.painter={flipAxis:"DOWN"===this.arcOrientation,dataRange:this.dataRange,paintAxis:cd},e.valueColumn?(this.valueColumn=e.valueColumn,this.hasValue=!0):e.useScore&&(this.hasValue=!0,this.valueColumn="score"),e.max?(this.dataRange={min:e.min||0,max:e.max},this.autoscale=!1):this.autoscale=!0,e.featureSource?(this.featureSource=e.featureSource,delete e._featureSource):(this.featureSource=Ad(e,this.browser.genome),this.featureSource.getWGFeatures=ow)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow(),this.featureSource.visibilityWindow=this.visibilityWindow),this}get supportsWholeGenome(){return!0}async getFeatures(e,t,i){const n=this.visibilityWindow,r=await this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n});return void 0===this.hasValue&&r&&r.length>0&&(this.hasValue=void 0!==r[0].score),r}draw(e){"proportional"===this.arcType||"inView"===this.arcType||"partialInView"===this.arcType?this.drawProportional(e):this.drawNested(e)}drawNested(e){const t=e.context,i=e.pixelWidth,n=e.pixelHeight,r=e.viewportWidth,s=e.bpPerPixel,o=e.bpStart,a=s;xo.fillRect(t,0,e.pixelTop,i,n,{fillStyle:"rgb(255, 255, 255)"});const c=e.features;if(c){(function(){let e=0;for(let t of c){let n=(t.start-o)/a,r=(t.end-o)/a;n>=0&&r<=i&&(e=Math.max(e,r-n))}let t=Math.min(r,e)/2;if(e>0){let e=(n-10)/t;this.theta=function(e){let t,i=[.01570925532366355,.15838444032453644,.3249196962329063,.5095254494944288,.7265425280053609,.9999999999999999],n=[.031415926535897934,.3141592653589793,.6283185307179586,.9424777960769379,1.2566370614359172,1.5707963267948966];for(t=0;t<i.length&&!(i[t]>e);t++);let r=0===t?0:i[t-1],s=t<i.length?i[t]:1,o=(e-r)/(s-r),a=0===t?0:n[t-1],c=t<n.length?n[t]:Math.PI/2;return Math.min(Math.PI/2,a+o*(c-a))}(e),this.sinTheta=Math.sin(this.theta),this.cosTheta=Math.cos(this.theta)}}).call(this);const s="UP"===this.arcOrientation,h=s?e.pixelHeight:0;t.font="8px sans-serif",t.textAlign="center";for(let e of c){let n;if(e.drawState=void 0,"function"==typeof this.color?n=this.color(e):(n=this.color||e.color||"rgb(180,25,137)",n&&this.config.useScore&&(n=sw(n,(l=e.score,Math.min(1,.11+l/779*.89).toString())))),t.lineWidth=e.thickness||this.thickness||1,e.chr1===e.chr2||"all"===e.chr){const{m1:c,m2:l}=iw(e,this.browser.genome);let d=Math.round((c-o)/a),u=Math.round((l-o)/a);if(u<0||d>i)continue;let f=u-d;f<3&&(f=3,d--);const p=f/2,g=p/this.sinTheta,m=this.cosTheta*g,w=d+p;let b,F,v;if(s?(b=this.height+m,F=Math.PI+Math.PI/2-this.theta,v=Math.PI+Math.PI/2+this.theta):(b=-m,F=Math.PI/2-this.theta,v=Math.PI/2+this.theta),this.showBlocks&&"all"!==e.chr){const i=(e.start1-o)/a,n=(e.end1-o)/a,r=(e.start2-o)/a,c=(e.end2-o)/a,l=s?-this.blockHeight:this.blockHeight;t.fillRect(i,h,n-i,l),t.fillRect(r,h,c-r,l)}n&&!this.config.useScore&&f>r&&(n=sw(n,this.alpha)),t.strokeStyle=n,t.fillStyle=n,t.beginPath(),t.arc(w,b,g,F,v,!1),t.stroke(),e.drawState={xc:w,yc:b,r:g}}else{let r=Math.round((e.start-o)/a),c=Math.round((e.end-o)/a);if(c<0||r>i)continue;let l=c-r;l<3&&(l=3,r--);const h=e.chr===e.chr1?e.chr2:e.chr1;t.strokeStyle=n,t.fillStyle=sw(Nu(h),.5),s?(t.fillRect(r,this.height/2,l,this.height/2),t.fillText(h,r+l/2,this.height/2-5),e.drawState={x:r,y:this.height/2,w:l,h:this.height/2}):(t.fillRect(r,0,l,this.height/2),t.fillText(h,r+l/2,this.height/2+13),e.drawState={x:r,y:0,w:l,h:this.height/2})}}}var l}getScaleFactor(e,t,i,n){return n?i/(Math.log10(t+1)-(e<=0?0:Math.log10(e+1))):i/(t-e)}drawProportional(e){const t=e.context,i=e.pixelWidth,n=e.pixelHeight,r=e.bpPerPixel,s=e.bpStart,o=r,a=e.referenceFrame.start,c=e.referenceFrame.end,l="UP"===this.arcOrientation;xo.fillRect(t,0,e.pixelTop,i,n,{fillStyle:"rgb(255, 255, 255)"});const h=e.features;if(h&&h.length>0){const n=0,r=this.getScaleFactor(n,this.dataRange.max,e.pixelHeight-1,this.logScale),d=l?e.pixelHeight:0;for(let e of h){e.drawState=void 0;const n=this.valueColumn?e[this.valueColumn]:e.score;if(void 0===n||Number.isNaN(n))continue;const h=Math.round((this.logScale?Math.log10(n+1):n)*r);if(e.chr1===e.chr2||"all"===e.chr){const{m1:i,m2:r}=iw(e,this.browser.genome);let u=Math.round((i-s)/o),f=Math.round((r-s)/o)-u;if(f<3&&(f=3,u--),n<this.dataRange.min||n>this.dataRange.max)continue;if("proportional"!==this.arcType){const e="partialInView"===this.arcType,t=i>=a&&r<=c;let n=!1,s=!1;if(!t&&e&&(n=a<=i&&i<=c,n||(s=a<=r&&r<=c)),!(t||n||s))continue}const p=f/2,g=u+f/2;e.drawState={xc:g,yc:d,radiusX:p,radiusY:h};const m=l,w=e.color||this.color;if(t.strokeStyle=w,t.lineWidth=e.thickness||this.thickness||1,!0===t.isSVG?t.strokeEllipse(g,d,p,h,0,0,Math.PI,m):(t.beginPath(),t.ellipse(g,d,p,h,0,0,Math.PI,m),t.stroke()),this.alpha&&(t.fillStyle=sw(w,this.alpha),!0===t.isSVG?t.fillEllipse(g,d,p,h,0,0,Math.PI,m):t.fill()),this.showBlocks&&"all"!==e.chr){t.fillStyle=w;const i=(e.start1-s)/o,n=(e.end1-s)/o,r=(e.start2-s)/o,a=(e.end2-s)/o,c=l?-this.blockHeight:this.blockHeight;t.fillRect(i,d,n-i,c),t.fillRect(r,d,a-r,c)}}else{let r=Math.round((e.start-s)/o),a=Math.round((e.end-s)/o);if(a<0||r>i||n<this.dataRange.min||n>this.dataRange.max)continue;const c=Math.min(h,this.height-13);let d=a-r;d<3&&(d=3,r--);const u=e.chr===e.chr1?e.chr2:e.chr1;if(t.font="8px sans-serif",t.textAlign="center",t.fillStyle=sw(Nu(u),.5),l){const i=this.height-c;t.fillRect(r,i,d,c),t.fillText(u,r+d/2,i-5),e.drawState={x:r,y:i,w:d,h:c}}else t.fillRect(r,0,d,c),t.fillText(u,r+d/2,c+13),e.drawState={x:r,y:0,w:d,h:c}}}}}clearAxis(e,t,i){xo.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"})}paintAxis(e,t,i){const n={min:0,max:this.dataRange.max};"proportional"===this.arcType||"inView"===this.arcType||"partialInView"===this.arcType?(this.painter.flipAxis="DOWN"===this.arcOrientation,this.painter.dataRange=n,this.painter.paintAxis(e,t,i)):this.clearAxis(e,t,i)}menuItemList(){let e=[];if(this.hasValue){e.push("<hr/>");const t={nested:"Nested",proportional:"Proportional - All",inView:"Proportional - Both Ends in View",partialInView:"Proportional - One End in View"};e.push("<b>Arc Type</b>");for(let i of["nested","proportional","inView","partialInView"])e.push({object:Bt(Dl(t[i],i===this.arcType)),click:function(){this.arcType=i,this.trackView.repaintViews()}})}return e.push("<hr/>"),e.push({name:"Toggle arc direction",click:function(){this.arcOrientation="UP"===this.arcOrientation?"DOWN":"UP",this.trackView.repaintViews()}}),e.push({name:this.showBlocks?"Hide Blocks":"Show Blocks",click:function(){this.showBlocks=!this.showBlocks,this.trackView.repaintViews()}}),"proportional"!==this.arcType&&"inView"!==this.arcType&&"partialInView"!==this.arcType||(e=e.concat(this.numericDataMenuItems())),this.browser.circularView&&(e.push("<hr/>"),e.push({label:"Add interactions to circular view",click:function(){for(let e of this.trackView.viewports)this.addChordsForViewport(e.referenceFrame)}})),e}contextMenuItemList(e){if(this.browser.circularView){const t=e.viewport,i=[];return i.push({label:"Add interactions to circular view",click:()=>{const e=t.referenceFrame;this.addChordsForViewport(e)}}),i.push("<hr/>"),i}}addChordsForViewport(e){let t;if("all"===e.chr)t=Object.values(this.featureSource.getAllFeatures()).flat();else{t=this.featureSource.featureCache.queryFeatures(e.chr,e.start,e.end).filter((e=>e.drawState))}if(0===t.length)return;Hm(t.map((e=>{const t=e._f||e;return{uniqueId:`${t.chr1}:${t.start1}-${t.end1}_${t.chr2}:${t.start2}-${t.end2}`,refName:Lm(t.chr1),start:t.start1,end:t.end1,mate:{refName:Lm(t.chr2),start:t.start2,end:t.end2}}})),this,e,.5)}doAutoscale(e){let t=0;if(e)for(let i of e){const e=this.valueColumn?i[this.valueColumn]:i.score;Number.isNaN(e)||(t=Math.max(t,e))}return{min:0,max:t}}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){const t=e._||e;if(i.push({name:"Region 1",value:nw(t.chr1,t.start1,t.end1,t.strand1)}),i.push({name:"Region 2",value:nw(t.chr2,t.start2,t.end2,t.strand2)}),t.name&&i.push({name:"Name",value:t.name}),void 0!==t.value&&i.push({name:"Value",value:t.value}),void 0!==t.score&&i.push({name:"Score",value:t.score}),t.extras&&this.header&&this.header.columnNames){const e=this.header.columnNames,n=this.header.hiccups?6:10;for(let r=n;r<e.length;r++)this.header.colorColumn!==r&&("info"===e[r]?aw(i,t.extras[r-n]):i.push({name:e[r],value:t.extras[r-n]}))}break}return i}clickedFeatures(e){const t=e.viewport.cachedFeatures,i=[];if(t){const n="proportional"===this.arcType||"inView"===this.arcType||"partialInView"===this.arcType;for(let r of t)if(r.drawState)if(r.chr1===r.chr2||"all"===r.chr)if(n){const{xc:t,yc:n,radiusX:s,radiusY:o}=r.drawState,a=e.canvasX-t,c=e.canvasY-n,l=a/s*(a/s)+c/o*(c/o);l<=1&&i.push({score:1/l,feature:r})}else{const{xc:t,yc:n,r:s}=r.drawState,o=e.canvasX-t,a=e.canvasY-n,c=Math.abs(Math.sqrt(o*o+a*a)-s);c<5&&i.push({score:c,feature:r})}else{const{x:t,y:n,w:s,h:o}=r.drawState,a=5;if(e.canvasX>=t-a&&e.canvasX<=t+s+a&&e.canvasY>=n&&e.canvasY<=n+o){const n=-Math.abs(e.canvasX-(t+s/2));i.push({score:n,feature:r});break}}}return i.length>1&&i.sort(((e,t)=>e.score-t.score)),i.map((e=>e.feature))}}function iw(e,t){let i=(e.start1+e.end1)/2,n=(e.start2+e.end2)/2;if("all"===e.chr&&(i=t.getGenomeCoordinate(e.chr1,i),n=t.getGenomeCoordinate(e.chr2,n)),i>n){const e=i;i=n,n=e}return{m1:i,m2:n}}function nw(e,t,i,n){return n&&"."!==n?`${e}:${Rt(t+1)}-${Rt(i)} (${n})`:`${e}:${Rt(t+1)}-${Rt(i)}`}const rw=new Map;function sw(e,t){const i=`${e}_${t}`;let n=rw.get(i);return n||(n=_s.addAlpha(e,t),rw.set(i,n)),n}function ow(e){const t=e=>{const t=Object.assign({},e);return t.chr="all",t.start=i.getGenomeCoordinate(e.chr1,e.start1),t.end=i.getGenomeCoordinate(e.chr2,e.end2),t},i=this.genome;let n,r=0;for(let t of i.wgChromosomeNames){let i=e[t];if(i)for(let e of i)e.dup||(r++,e.score&&(!n||e.score>n.score)&&(n=e))}const s=this.maxWGCount,o=n&&n.score>0&&r>s?5:1,a=Math.floor(s/o),c=n&&n.score>0?Math.log(n.score)/o:Number.MAX_SAFE_INTEGER;let l,h=[],d=[];for(let e=0;e<o;e++)d.push([0]),h.push([]);for(let n of i.wgChromosomeNames){let i=e[n];if(i)for(let e of i)if(!e.dup){const i=e.score?Math.max(0,Math.min(o-1,Math.floor(Math.log(e.score)/c))):0;if(h[i].length<a)h[i].push(t(e));else{const n=a/(d[i]+1);if(Math.random()<n){const n=Math.floor(Math.random()*(a-1));h[i][n]=t(e)}}d[i]++}}if(1===o)l=h[0];else{l=[];for(let e of h)for(let t of e)l.push(t);n&&l.push(t(n)),l.sort((function(e,t){return e.start-t.start})),console.log(l.length)}return l}function aw(e,t){const i=t.split(";");for(let t of i){const i=t.split("=");2===i.length&&e.push({name:i[0],value:i[1]})}}class cw{constructor(e){var t;this.config=e,this.url=(t=e.path||e.url).includes("//www.dropbox.com")?t.replace("//www.dropbox.com","//dl.dropboxusercontent.com"):t.startsWith("ftp://ftp.ncbi.nlm.nih.gov")?t.replace("ftp://","https://"):t}async read(e,t){const i=this.config.headers||{};if(void 0!==e&&t){const n="bytes="+e+"-"+(e+t-1);i.Range=n}let n=this.url.slice();if(this.config.oauthToken){const e=async function(e){return"function"==typeof e?await Promise.resolve(e()):e}(this.config.oauthToken);i.Authorization=`Bearer ${e}`}this.config.apiKey&&(n=function(e,t,i){const n=e.includes("?")?"&":"?";return e+n+t+"="+i}(n,"key",this.config.apiKey));const r=await fetch(n,{method:"GET",headers:i,redirect:"follow",mode:"cors"}),s=r.status;if(s>=400){const e=Error(r.statusText);throw e.code=s,e}return r.arrayBuffer()}}class lw{constructor(e){this.file=e.file,this.fetchSize=e.fetchSize||16e3,this.maxSize=e.maxSize||1e6,this.buffers=[]}async read(e,t){let i=this.buffers.filter((i=>i.overlaps(e,e+t)));for(let n of i)if(n.contains(e,e+t))return n.slice(e,e+t);if(0===i.length){let i=Math.max(t,this.fetchSize);this.buffers.sort(((e,t)=>e.start-t.start));const n=function(e,t,i){let n=i-1,r=e.length;for(;1+n<r;){const i=n+(r-n>>1);t(e[i])?r=i:n=i}return r}(this.buffers,(t=>t.start>e),0);n<this.buffers.length&&(i=Math.min(i,this.buffers[n].start-e));const r=e,s=await this.file.read(r,i),o=new hw(r,s);return this.addBuffer(o),o.slice(e,e+t)}{i.sort(((e,t)=>e.start-t.start));const n=[];let r=e;for(let e of i){if(r<e.start){const t=r,i=e.start-r,s=await this.file.read(t,i),o=new hw(t,s);n.push(o)}n.push(e),r=e.end}const s=e+t;if(s>r){const e=r,t=s-e,i=await this.file.read(e,t),o=new hw(e,i);n.push(o)}const o=n[0].start,a=function(e){const t=e.reduce(((e,t)=>e+t.byteLength),0),i=new Uint8Array(t);let n=0;for(let t of e)i.set(new Uint8Array(t),n),n+=t.byteLength;return i.buffer}(n.map((e=>e.buffer))),c=new hw(o,a),l=new Set(i);return this.buffers=this.buffers.filter((e=>!l.has(e))),this.addBuffer(c),c.slice(e,e+t)}}addBuffer(e){const t=this.buffers.reduce(((e,t)=>e+t.size),0)+e.size;if(t>this.maxSize){const e=t-this.maxSize;this.buffers.sort(((e,t)=>e.creationTime-t.creationTime));let i,n=0;for(i=0;i<this.buffers.length&&(n+=this.buffers[i].size,!(n>e));i++);this.buffers=i<this.buffers.length-1?this.buffers.slice(i):[]}e.size<=this.maxSize&&this.buffers.push(e)}}class hw{constructor(e,t){this.creationTime=Date.now(),this.start=e,this.buffer=t}slice(e,t){if(e<this.start||t-e>this.buffer.byteLength)throw Error("buffer bounds error");return this.buffer.slice(e-this.start,t-this.start)}get end(){return this.start+this.buffer.byteLength}get size(){return this.buffer.byteLength}contains(e,t){return e>=this.start&&t<=this.end}overlaps(e,t){return e>this.start&&e<this.end||t>this.start&&t<this.end}toString(){return`Buffer ${this.creationTime} ${this.start} - ${this.end}`}}class dw{constructor(e){this.file=e}async read(e,t){if(0===t)return new ArrayBuffer;return(null!=e&&t?this.file.slice(e,e+t):this.file).arrayBuffer()}}var uw=Object.defineProperty,fw=(e,t,i)=>(((e,t,i)=>{t in e?uw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);async function pw(e,t,i=0){var n=new Map;for(let[r,s]of e.entries()){let e=await yw.unpack_from_async("<"+s,t,i);i+=yw.calcsize(s),1==e.length&&(e=e[0]),n.set(r,e)}return n}function gw(e,t,i=0){var n=new Map;for(let[r,s]of e.entries()){let e=yw.unpack_from("<"+s,t,i);i+=yw.calcsize(s),1==e.length&&(e=e[0]),n.set(r,e)}return n}function mw(e){e||e()}function ww(e){var t="<"+Array.from(e.values()).join("");return yw.calcsize(t)}function bw(e,t=8){return Math.ceil(e/t)*t}var Fw={u:"Uint",i:"Int",f:"Float"};function vw(e){var t,i,n=yw._is_big_endian(e);if(/S/.test(e))t="getString",i=0|((e.match(/S(\d*)/)||[])[1]||1);else{let[n,r,s]=e.match(/[<>=!@]?(i|u|f)(\d*)/);i=parseInt(s||4,10),t="get"+Fw[r]+(8*i).toFixed()}return[t,n,i]}var yw=new class{constructor(){this.big_endian=function(){const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])}(),this.getters={s:"getUint8",b:"getInt8",B:"getUint8",h:"getInt16",H:"getUint16",i:"getInt32",I:"getUint32",l:"getInt32",L:"getUint32",q:"getInt64",Q:"getUint64",f:"getFloat32",d:"getFloat64"},this.byte_lengths={s:1,b:1,B:1,h:2,H:2,i:4,I:4,l:4,L:4,q:8,Q:8,f:4,d:8};let e=Object.keys(this.byte_lengths).join("");this.fmt_size_regex="(\\d*)(["+e+"])"}calcsize(e){for(var t,i=0,n=new RegExp(this.fmt_size_regex,"g");null!==(t=n.exec(e));){let e=parseInt(t[1]||1,10),n=t[2];i+=e*this.byte_lengths[n]}return i}_is_big_endian(e){return!/^</.test(e)&&(!!/^(!|>)/.test(e)||this.big_endian)}async unpack_from_async(e,t,i){i=Number.parseInt(i||0);const n=this.calcsize(e),r=await t.slice(i,i+n);let s=0;for(var o,a=new Aw(r),c=[],l=this._is_big_endian(e),h=new RegExp(this.fmt_size_regex,"g");null!==(o=h.exec(e));){let e=parseInt(o[1]||1,10),t=o[2],i=this.getters[t],n=this.byte_lengths[t];if("s"==t)c.push((new TextDecoder).decode(r.slice(s,s+e))),s+=e;else for(var d=0;d<e;d++)c.push(a[i](s,!l)),s+=n}return c}unpack_from(e,t,i){i=Number.parseInt(i||0);const n=this.calcsize(e),r=t.slice(i,i+n);let s=0;for(var o,a=new Aw(r),c=[],l=this._is_big_endian(e),h=new RegExp(this.fmt_size_regex,"g");null!==(o=h.exec(e));){let e=parseInt(o[1]||1,10),t=o[2],i=this.getters[t],n=this.byte_lengths[t];if("s"==t)c.push((new TextDecoder).decode(r.slice(s,s+e))),s+=e;else for(var d=0;d<e;d++)c.push(a[i](s,!l)),s+=n}return c}};var Aw=class extends DataView{getUint64(e,t){const i=BigInt(this.getUint32(e,t)),n=BigInt(this.getUint32(e+4,t));let r=t?i+(n<<32n):(i<<32n)+n;return Number.parseInt(r)}getInt64(e,t){var i,n;t?(i=this.getUint32(e,!0),n=this.getInt32(e+4,!0)):(n=this.getInt32(e,!1),i=this.getUint32(e+4,!1));let r=BigInt(i)+(BigInt(n)<<32n);return Number.parseInt(r)}getString(e,t,i){const n=this.buffer.slice(e,e+i);return(new TextDecoder).decode(n)}getVLENStruct(e,t,i){return[this.getUint32(e,t),this.getUint64(e+4,t),this.getUint32(e+12,t)]}};function Cw(e){return e.toString(2).length}function _w(e,t,i=0,n=!0){const r=t.slice(i,i+e);let s=new Uint8Array(r);n||s.reverse();let o=s.reduce(((e,t,i)=>e+(t<<8*i)),0);return o}var xw=class{constructor(e,t){this.buf=e,this.offset=t,this.dtype=this.determine_dtype()}async determine_dtype(){let e=await pw(kw,this.buf,this.offset);this.offset+=Iw;let t=15&e.get("class_and_version");if(t==Sw)return this._determine_dtype_fixed_point(e);if(t==Ew)return this._determine_dtype_floating_point(e);if(t==Nw)throw"Time datatype class not supported.";if(t==Bw)return this._determine_dtype_string(e);if(t==Mw)throw"Bitfield datatype class not supported.";if(t==Rw)return{datatype_class:Rw,size:e.get("size")};if(t==Dw)return this._determine_dtype_compound(e);if(t==Tw)return["REFERENCE",e.get("size")];if(t==Lw)return this.determine_dtype();if(t==Hw)throw"Array datatype class not supported.";if(t==zw){let t=this._determine_dtype_vlen(e);if("VLEN_SEQUENCE"==t[0]){t=["VLEN_SEQUENCE",this.determine_dtype()]}return t}throw"Invalid datatype class "+t}_determine_dtype_fixed_point(e){let t=e.get("size");if(![1,2,4,8].includes(t))throw"Unsupported datatype size";var i;var n;return i=(8&e.get("class_bit_field_0"))>0?"i":"u",n=0==(1&e.get("class_bit_field_0"))?"<":">",this.offset+=4,n+i+t.toFixed()}_determine_dtype_floating_point(e){let t=e.get("size");if(![1,2,4,8].includes(t))throw"Unsupported datatype size";var i;return i=0==(1&e.get("class_bit_field_0"))?"<":">",this.offset+=12,i+"f"+t.toFixed()}_determine_dtype_string(e){return"S"+e.get("size").toFixed()}_determine_dtype_vlen(e){return 1!=(1&e.get("class_bit_field_0"))?["VLEN_SEQUENCE",0,0]:["VLEN_STRING",e.get("class_bit_field_0")>>4,1&e.get("class_bit_field_1")]}_determine_dtype_compound(e){throw"Compound type not yet implemented!"}},kw=new Map([["class_and_version","B"],["class_bit_field_0","B"],["class_bit_field_1","B"],["class_bit_field_2","B"],["size","I"]]),Iw=ww(kw);ww(new Map([["offset","I"],["dimensionality","B"],["reserved_0","B"],["reserved_1","B"],["reserved_2","B"],["permutation","I"],["reserved_3","I"],["dim_size_1","I"],["dim_size_2","I"],["dim_size_3","I"],["dim_size_4","I"]]));var Sw=0,Ew=1,Nw=2,Bw=3,Mw=4,Rw=5,Dw=6,Tw=7,Lw=8,zw=9,Hw=10;function Pw(e){let t=e.length;for(;--t>=0;)e[t]=0}Pw(new Array(576)),Pw(new Array(60)),Pw(new Array(512)),Pw(new Array(256)),Pw(new Array(29)),Pw(new Array(30));var Ow=(e,t,i,n)=>{let r=65535&e,s=e>>>16&65535,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do{r=r+t[n++]|0,s=s+r|0}while(--o);r%=65521,s%=65521}return r|s<<16},Uw=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})()),qw=(e,t,i,n)=>{const r=Uw,s=n+i;e^=-1;for(let i=n;i<s;i++)e=e>>>8^r[255&(e^t[i])];return~e},Qw={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"},Vw={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_MEM_ERROR:-4,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},jw=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ww={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)jw(i,t)&&(e[t]=i[t])}}return e},flattenChunks:e=>{let t=0;for(let i=0,n=e.length;i<n;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,n=0,r=e.length;t<r;t++){let r=e[t];i.set(r,n),n+=r.length}return i}},Gw=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(NA){Gw=!1}var $w=new Uint8Array(256);for(let BA=0;BA<256;BA++)$w[BA]=BA>=252?6:BA>=248?5:BA>=240?4:BA>=224?3:BA>=192?2:1;$w[254]=$w[254]=1;var Kw={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,n,r,s,o=e.length,a=0;for(r=0;r<o;r++)i=e.charCodeAt(r),55296==(64512&i)&&r+1<o&&(n=e.charCodeAt(r+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(a),s=0,r=0;s<a;r++)i=e.charCodeAt(r),55296==(64512&i)&&r+1<o&&(n=e.charCodeAt(r+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[s++]=i:i<2048?(t[s++]=192|i>>>6,t[s++]=128|63&i):i<65536?(t[s++]=224|i>>>12,t[s++]=128|i>>>6&63,t[s++]=128|63&i):(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63,t[s++]=128|i>>>6&63,t[s++]=128|63&i);return t},buf2string:(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,r;const s=new Array(2*i);for(r=0,n=0;n<i;){let t=e[n++];if(t<128){s[r++]=t;continue}let o=$w[t];if(o>4)s[r++]=65533,n+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&n<i;)t=t<<6|63&e[n++],o--;o>1?s[r++]=65533:t<65536?s[r++]=t:(t-=65536,s[r++]=55296|t>>10&1023,s[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Gw)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i})(s,r)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+$w[e[i]]>t?i:t}};var Yw=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Xw=function(e,t){let i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v,y,A,C,_,x;const k=e.state;i=e.next_in,_=e.input,n=i+(e.avail_in-5),r=e.next_out,x=e.output,s=r-(t-e.avail_out),o=r+(e.avail_out-257),a=k.dmax,c=k.wsize,l=k.whave,h=k.wnext,d=k.window,u=k.hold,f=k.bits,p=k.lencode,g=k.distcode,m=(1<<k.lenbits)-1,w=(1<<k.distbits)-1;e:do{f<15&&(u+=_[i++]<<f,f+=8,u+=_[i++]<<f,f+=8),b=p[u&m];t:for(;;){if(F=b>>>24,u>>>=F,f-=F,F=b>>>16&255,0===F)x[r++]=65535&b;else{if(!(16&F)){if(64&F){if(32&F){k.mode=12;break e}e.msg="invalid literal/length code",k.mode=30;break e}b=p[(65535&b)+(u&(1<<F)-1)];continue t}for(v=65535&b,F&=15,F&&(f<F&&(u+=_[i++]<<f,f+=8),v+=u&(1<<F)-1,u>>>=F,f-=F),f<15&&(u+=_[i++]<<f,f+=8,u+=_[i++]<<f,f+=8),b=g[u&w];;){if(F=b>>>24,u>>>=F,f-=F,F=b>>>16&255,16&F){if(y=65535&b,F&=15,f<F&&(u+=_[i++]<<f,f+=8,f<F&&(u+=_[i++]<<f,f+=8)),y+=u&(1<<F)-1,y>a){e.msg="invalid distance too far back",k.mode=30;break e}if(u>>>=F,f-=F,F=r-s,y>F){if(F=y-F,F>l&&k.sane){e.msg="invalid distance too far back",k.mode=30;break e}if(A=0,C=d,0===h){if(A+=c-F,F<v){v-=F;do{x[r++]=d[A++]}while(--F);A=r-y,C=x}}else if(h<F){if(A+=c+h-F,F-=h,F<v){v-=F;do{x[r++]=d[A++]}while(--F);if(A=0,h<v){F=h,v-=F;do{x[r++]=d[A++]}while(--F);A=r-y,C=x}}}else if(A+=h-F,F<v){v-=F;do{x[r++]=d[A++]}while(--F);A=r-y,C=x}for(;v>2;)x[r++]=C[A++],x[r++]=C[A++],x[r++]=C[A++],v-=3;v&&(x[r++]=C[A++],v>1&&(x[r++]=C[A++]))}else{A=r-y;do{x[r++]=x[A++],x[r++]=x[A++],x[r++]=x[A++],v-=3}while(v>2);v&&(x[r++]=x[A++],v>1&&(x[r++]=x[A++]))}break}if(64&F){e.msg="invalid distance code",k.mode=30;break e}b=g[(65535&b)+(u&(1<<F)-1)]}}break}}while(i<n&&r<o);v=f>>3,i-=v,f-=v<<3,u&=(1<<f)-1,e.next_in=i,e.next_out=r,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=r<o?o-r+257:257-(r-o),k.hold=u,k.bits=f},Zw=15,Jw=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]),eb=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]),tb=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]),ib=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]),nb=(e,t,i,n,r,s,o,a)=>{const c=a.bits;let l,h,d,u,f,p,g=0,m=0,w=0,b=0,F=0,v=0,y=0,A=0,C=0,_=0,x=null,k=0;const I=new Uint16Array(16),S=new Uint16Array(16);let E,N,B,M=null,R=0;for(g=0;g<=Zw;g++)I[g]=0;for(m=0;m<n;m++)I[t[i+m]]++;for(F=c,b=Zw;b>=1&&0===I[b];b--);if(F>b&&(F=b),0===b)return r[s++]=20971520,r[s++]=20971520,a.bits=1,0;for(w=1;w<b&&0===I[w];w++);for(F<w&&(F=w),A=1,g=1;g<=Zw;g++)if(A<<=1,A-=I[g],A<0)return-1;if(A>0&&(0===e||1!==b))return-1;for(S[1]=0,g=1;g<Zw;g++)S[g+1]=S[g]+I[g];for(m=0;m<n;m++)0!==t[i+m]&&(o[S[t[i+m]]++]=m);if(0===e?(x=M=o,p=19):1===e?(x=Jw,k-=257,M=eb,R-=257,p=256):(x=tb,M=ib,p=-1),_=0,m=0,g=w,f=s,v=F,y=0,d=-1,C=1<<F,u=C-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){E=g-y,o[m]<p?(N=0,B=o[m]):o[m]>p?(N=M[R+o[m]],B=x[k+o[m]]):(N=96,B=0),l=1<<g-y,h=1<<v,w=h;do{h-=l,r[f+(_>>y)+h]=E<<24|N<<16|B}while(0!==h);for(l=1<<g-1;_&l;)l>>=1;if(0!==l?(_&=l-1,_+=l):_=0,m++,0==--I[g]){if(g===b)break;g=t[i+o[m]]}if(g>F&&(_&u)!==d){for(0===y&&(y=F),f+=w,v=g-y,A=1<<v;v+y<b&&(A-=I[v+y],!(A<=0));)v++,A<<=1;if(C+=1<<v,1===e&&C>852||2===e&&C>592)return 1;d=_&u,r[d]=F<<24|v<<16|f-s}}return 0!==_&&(r[f+_]=g-y<<24|64<<16),a.bits=F,0},{Z_FINISH:rb,Z_BLOCK:sb,Z_TREES:ob,Z_OK:ab,Z_STREAM_END:cb,Z_NEED_DICT:lb,Z_STREAM_ERROR:hb,Z_DATA_ERROR:db,Z_MEM_ERROR:ub,Z_BUF_ERROR:fb,Z_DEFLATED:pb}=Vw,gb=12,mb=30,wb=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function bb(){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}var Fb,vb,yb=e=>{if(!e||!e.state)return hb;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,ab},Ab=e=>{if(!e||!e.state)return hb;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,yb(e)},Cb=(e,t)=>{let i;if(!e||!e.state)return hb;const n=e.state;return t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?hb:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,Ab(e))},_b=(e,t)=>{if(!e)return hb;const i=new bb;e.state=i,i.window=null;const n=Cb(e,t);return n!==ab&&(e.state=null),n},xb=!0,kb=e=>{if(xb){Fb=new Int32Array(512),vb=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(nb(1,e.lens,0,288,Fb,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;nb(2,e.lens,0,32,vb,0,e.work,{bits:5}),xb=!1}e.lencode=Fb,e.lenbits=9,e.distcode=vb,e.distbits=5},Ib=(e,t,i,n)=>{let r;const s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(t.subarray(i-s.wsize,i),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>n&&(r=n),s.window.set(t.subarray(i-n,i-n+r),s.wnext),(n-=r)?(s.window.set(t.subarray(i-n,i),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},Sb=(e,t)=>{let i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v,y,A,C,_=0;const x=new Uint8Array(4);let k,I;const S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return hb;i=e.state,i.mode===gb&&(i.mode=13),o=e.next_out,r=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,l=i.hold,h=i.bits,d=a,u=c,C=ab;e:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(2&i.wrap&&35615===l){i.check=0,x[0]=255&l,x[1]=l>>>8&255,i.check=qw(i.check,x,2,0),l=0,h=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=mb;break}if((15&l)!==pb){e.msg="unknown compression method",i.mode=mb;break}if(l>>>=4,h-=4,A=8+(15&l),0===i.wbits)i.wbits=A;else if(A>i.wbits){e.msg="invalid window size",i.mode=mb;break}i.dmax=1<<i.wbits,e.adler=i.check=1,i.mode=512&l?10:gb,l=0,h=0;break;case 2:for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(i.flags=l,(255&i.flags)!==pb){e.msg="unknown compression method",i.mode=mb;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=mb;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=qw(i.check,x,2,0)),l=0,h=0,i.mode=3;case 3:for(;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.head&&(i.head.time=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,i.check=qw(i.check,x,4,0)),l=0,h=0,i.mode=4;case 4:for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=qw(i.check,x,2,0)),l=0,h=0,i.mode=5;case 5:if(1024&i.flags){for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=qw(i.check,x,2,0)),l=0,h=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(f=i.length,f>a&&(f=a),f&&(i.head&&(A=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(n.subarray(s,s+f),A)),512&i.flags&&(i.check=qw(i.check,n,f,s)),a-=f,s+=f,i.length-=f),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===a)break e;f=0;do{A=n[s+f++],i.head&&A&&i.length<65536&&(i.head.name+=String.fromCharCode(A))}while(A&&f<a);if(512&i.flags&&(i.check=qw(i.check,n,f,s)),a-=f,s+=f,A)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===a)break e;f=0;do{A=n[s+f++],i.head&&A&&i.length<65536&&(i.head.comment+=String.fromCharCode(A))}while(A&&f<a);if(512&i.flags&&(i.check=qw(i.check,n,f,s)),a-=f,s+=f,A)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(l!==(65535&i.check)){e.msg="header crc mismatch",i.mode=mb;break}l=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=gb;break;case 10:for(;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}e.adler=i.check=wb(l),l=0,h=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,i.hold=l,i.bits=h,lb;e.adler=i.check=1,i.mode=gb;case gb:if(t===sb||t===ob)break e;case 13:if(i.last){l>>>=7&h,h-=7&h,i.mode=27;break}for(;h<3;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}switch(i.last=1&l,l>>>=1,h-=1,3&l){case 0:i.mode=14;break;case 1:if(kb(i),i.mode=20,t===ob){l>>>=2,h-=2;break e}break;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=mb}l>>>=2,h-=2;break;case 14:for(l>>>=7&h,h-=7&h;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=mb;break}if(i.length=65535&l,l=0,h=0,i.mode=15,t===ob)break e;case 15:i.mode=16;case 16:if(f=i.length,f){if(f>a&&(f=a),f>c&&(f=c),0===f)break e;r.set(n.subarray(s,s+f),o),a-=f,s+=f,c-=f,o+=f,i.length-=f;break}i.mode=gb;break;case 17:for(;h<14;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(i.nlen=257+(31&l),l>>>=5,h-=5,i.ndist=1+(31&l),l>>>=5,h-=5,i.ncode=4+(15&l),l>>>=4,h-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=mb;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;h<3;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.lens[S[i.have++]]=7&l,l>>>=3,h-=3}for(;i.have<19;)i.lens[S[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,k={bits:i.lenbits},C=nb(0,i.lens,0,19,i.lencode,0,i.work,k),i.lenbits=k.bits,C){e.msg="invalid code lengths set",i.mode=mb;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;_=i.lencode[l&(1<<i.lenbits)-1],m=_>>>24,w=_>>>16&255,b=65535&_,!(m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(b<16)l>>>=m,h-=m,i.lens[i.have++]=b;else{if(16===b){for(I=m+2;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(l>>>=m,h-=m,0===i.have){e.msg="invalid bit length repeat",i.mode=mb;break}A=i.lens[i.have-1],f=3+(3&l),l>>>=2,h-=2}else if(17===b){for(I=m+3;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=m,h-=m,A=0,f=3+(7&l),l>>>=3,h-=3}else{for(I=m+7;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=m,h-=m,A=0,f=11+(127&l),l>>>=7,h-=7}if(i.have+f>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=mb;break}for(;f--;)i.lens[i.have++]=A}}if(i.mode===mb)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=mb;break}if(i.lenbits=9,k={bits:i.lenbits},C=nb(1,i.lens,0,i.nlen,i.lencode,0,i.work,k),i.lenbits=k.bits,C){e.msg="invalid literal/lengths set",i.mode=mb;break}if(i.distbits=6,i.distcode=i.distdyn,k={bits:i.distbits},C=nb(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,k),i.distbits=k.bits,C){e.msg="invalid distances set",i.mode=mb;break}if(i.mode=20,t===ob)break e;case 20:i.mode=21;case 21:if(a>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,i.hold=l,i.bits=h,Xw(e,u),o=e.next_out,r=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,l=i.hold,h=i.bits,i.mode===gb&&(i.back=-1);break}for(i.back=0;_=i.lencode[l&(1<<i.lenbits)-1],m=_>>>24,w=_>>>16&255,b=65535&_,!(m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(w&&!(240&w)){for(F=m,v=w,y=b;_=i.lencode[y+((l&(1<<F+v)-1)>>F)],m=_>>>24,w=_>>>16&255,b=65535&_,!(F+m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=F,h-=F,i.back+=F}if(l>>>=m,h-=m,i.back+=m,i.length=b,0===w){i.mode=26;break}if(32&w){i.back=-1,i.mode=gb;break}if(64&w){e.msg="invalid literal/length code",i.mode=mb;break}i.extra=15&w,i.mode=22;case 22:if(i.extra){for(I=i.extra;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;_=i.distcode[l&(1<<i.distbits)-1],m=_>>>24,w=_>>>16&255,b=65535&_,!(m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(!(240&w)){for(F=m,v=w,y=b;_=i.distcode[y+((l&(1<<F+v)-1)>>F)],m=_>>>24,w=_>>>16&255,b=65535&_,!(F+m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=F,h-=F,i.back+=F}if(l>>>=m,h-=m,i.back+=m,64&w){e.msg="invalid distance code",i.mode=mb;break}i.offset=b,i.extra=15&w,i.mode=24;case 24:if(i.extra){for(I=i.extra;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=mb;break}i.mode=25;case 25:if(0===c)break e;if(f=u-c,i.offset>f){if(f=i.offset-f,f>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=mb;break}f>i.wnext?(f-=i.wnext,p=i.wsize-f):p=i.wnext-f,f>i.length&&(f=i.length),g=i.window}else g=r,p=o-i.offset,f=i.length;f>c&&(f=c),c-=f,i.length-=f;do{r[o++]=g[p++]}while(--f);0===i.length&&(i.mode=21);break;case 26:if(0===c)break e;r[o++]=i.length,c--,i.mode=21;break;case 27:if(i.wrap){for(;h<32;){if(0===a)break e;a--,l|=n[s++]<<h,h+=8}if(u-=c,e.total_out+=u,i.total+=u,u&&(e.adler=i.check=i.flags?qw(i.check,r,u,o-u):Ow(i.check,r,u,o-u)),u=c,(i.flags?l:wb(l))!==i.check){e.msg="incorrect data check",i.mode=mb;break}l=0,h=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(l!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=mb;break}l=0,h=0}i.mode=29;case 29:C=cb;break e;case mb:C=db;break e;case 31:return ub;default:return hb}return e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,i.hold=l,i.bits=h,(i.wsize||u!==e.avail_out&&i.mode<mb&&(i.mode<27||t!==rb))&&Ib(e,e.output,e.next_out,u-e.avail_out),d-=e.avail_in,u-=e.avail_out,e.total_in+=d,e.total_out+=u,i.total+=u,i.wrap&&u&&(e.adler=i.check=i.flags?qw(i.check,r,u,e.next_out-u):Ow(i.check,r,u,e.next_out-u)),e.data_type=i.bits+(i.last?64:0)+(i.mode===gb?128:0)+(20===i.mode||15===i.mode?256:0),(0===d&&0===u||t===rb)&&C===ab&&(C=fb),C},Eb={inflateReset:Ab,inflateReset2:Cb,inflateResetKeep:yb,inflateInit:e=>_b(e,15),inflateInit2:_b,inflate:Sb,inflateEnd:e=>{if(!e||!e.state)return hb;let t=e.state;return t.window&&(t.window=null),e.state=null,ab},inflateGetHeader:(e,t)=>{if(!e||!e.state)return hb;const i=e.state;return 2&i.wrap?(i.head=t,t.done=!1,ab):hb},inflateSetDictionary:(e,t)=>{const i=t.length;let n,r,s;return e&&e.state?(n=e.state,0!==n.wrap&&11!==n.mode?hb:11===n.mode&&(r=1,r=Ow(r,t,i,0),r!==n.check)?db:(s=Ib(e,t,i,i),s?(n.mode=31,ub):(n.havedict=1,ab))):hb},inflateInfo:"pako inflate (from Nodeca project)"};var Nb=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Bb=Object.prototype.toString,{Z_NO_FLUSH:Mb,Z_FINISH:Rb,Z_OK:Db,Z_STREAM_END:Tb,Z_NEED_DICT:Lb,Z_STREAM_ERROR:zb,Z_DATA_ERROR:Hb,Z_MEM_ERROR:Pb}=Vw;function Ob(e){this.options=Ww.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yw,this.strm.avail_out=0;let i=Eb.inflateInit2(this.strm,t.windowBits);if(i!==Db)throw new Error(Qw[i]);if(this.header=new Nb,Eb.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Kw.string2buf(t.dictionary):"[object ArrayBuffer]"===Bb.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=Eb.inflateSetDictionary(this.strm,t.dictionary),i!==Db)))throw new Error(Qw[i])}function Ub(e,t){const i=new Ob(t);if(i.push(e),i.err)throw i.msg||Qw[i.err];return i.result}Ob.prototype.push=function(e,t){const i=this.strm,n=this.options.chunkSize,r=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Rb:Mb,"[object ArrayBuffer]"===Bb.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(n),i.next_out=0,i.avail_out=n),s=Eb.inflate(i,o),s===Lb&&r&&(s=Eb.inflateSetDictionary(i,r),s===Db?s=Eb.inflate(i,o):s===Hb&&(s=Lb));i.avail_in>0&&s===Tb&&i.state.wrap>0&&0!==e[i.next_in];)Eb.inflateReset(i),s=Eb.inflate(i,o);switch(s){case zb:case Hb:case Lb:case Pb:return this.onEnd(s),this.ended=!0,!1}if(a=i.avail_out,i.next_out&&(0===i.avail_out||s===Tb))if("string"===this.options.to){let e=Kw.utf8border(i.output,i.next_out),t=i.next_out-e,r=Kw.buf2string(i.output,e);i.next_out=t,i.avail_out=n-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(r)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(s!==Db||0!==a){if(s===Tb)return s=Eb.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},Ob.prototype.onData=function(e){this.chunks.push(e)},Ob.prototype.onEnd=function(e){e===Db&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ww.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var qb=function(e,t){return(t=t||{}).raw=!0,Ub(e,t)},Qb={Inflate:Ob,inflate:Ub,inflateRaw:qb,ungzip:Ub,constants:Vw},{Inflate:Vb,inflate:jb,inflateRaw:Wb,ungzip:Gb}=Qb,$b=jb,Kb=Gb;var Yb=new Map([[1,function(e,t){let i=new Uint8Array(e);return $b(i).buffer}],[2,function(e,t){let i=e.byteLength,n=new Uint8Array(i),r=Math.floor(i/t),s=new DataView(e);for(var o=0;o<t;o++)for(var a=0;a<r;a++)n[o+a*t]=s.getUint8(o*r+a);return n.buffer}],[3,function(e,t){return function(e){for(var t=e.byteLength%2!=0,i=e.byteLength-4,n=new DataView(e),r=0,s=0,o=0;o<i-1;o+=2){s=(s+(r=(r+n.getUint16(o,!0))%65535))%65535}if(t){s=(s+(r=(r+n.getUint8(i-1))%65535))%65535}var[a,c]=yw.unpack_from(">HH",e,i);if(c%=65535,r!=(a%=65535)||s!=c)throw'ValueError("fletcher32 checksum invalid")'}(e),e.slice(0,-4)}]]),Xb=class{constructor(e,t){this.fh=e,this.offset=t,this.depth=null}async init(){this.all_nodes=new Map,await this._read_root_node(),await this._read_children()}async _read_children(){let e=this.depth;for(;e>0;){for(var t of this.all_nodes.get(e))for(var i of t.get("addresses"))this._add_node(await this._read_node(i,e-1));e--}}async _read_root_node(){let e=await this._read_node(this.offset,null);this._add_node(e),this.depth=e.get("node_level")}_add_node(e){let t=e.get("node_level");this.all_nodes.has(t)?this.all_nodes.get(t).push(e):this.all_nodes.set(t,[e])}async _read_node(e,t){let i=await this._read_node_header(e,t);return i.set("keys",[]),i.set("addresses",[]),i}async _read_node_header(e){throw"NotImplementedError: must define _read_node_header in implementation class"}},Zb=class extends Xb{constructor(){super(...arguments),fw(this,"B_LINK_NODE",new Map([["signature","4s"],["node_type","B"],["node_level","B"],["entries_used","H"],["left_sibling","Q"],["right_sibling","Q"]]))}async _read_node_header(e,t){let i=await pw(this.B_LINK_NODE,this.fh,e);if(null!=t&&i.get("node_level")!=t)throw"node level does not match";return i}},Jb=class extends Zb{constructor(e,t){super(e,t),fw(this,"NODE_TYPE",0),this.ready=this.init()}async _read_node(e,t){let i=await this._read_node_header(e,t);e+=ww(this.B_LINK_NODE);let n=[],r=[],s=i.get("entries_used");for(var o=0;o<s;o++){let t=(await yw.unpack_from_async("<Q",this.fh,e))[0];e+=8;let i=(await yw.unpack_from_async("<Q",this.fh,e))[0];e+=8,n.push(t),r.push(i)}return n.push((await yw.unpack_from_async("<Q",this.fh,e))[0]),i.set("keys",n),i.set("addresses",r),i}symbol_table_addresses(){var e=[],t=this.all_nodes.get(0);for(var i of t)e=e.concat(i.get("addresses"));return e}},eF=class extends Zb{constructor(e,t,i){super(e,t),fw(this,"NODE_TYPE",1),this.dims=i,this.ready=this.init()}async _read_node(e,t){let i=await this._read_node_header(e,t);e+=ww(this.B_LINK_NODE);var n=[],r=[];let s=i.get("entries_used");for(var o=0;o<s;o++){let[t,i]=await yw.unpack_from_async("<II",this.fh,e);e+=8;let s="<"+this.dims.toFixed()+"Q",o=yw.calcsize(s),a=await yw.unpack_from_async(s,this.fh,e);e+=o;let c=(await yw.unpack_from_async("<Q",this.fh,e))[0];e+=8,n.push(new Map([["chunk_size",t],["filter_mask",i],["chunk_offset",a]])),r.push(c)}return i.set("keys",n),i.set("addresses",r),i}async construct_data_from_chunks(e,t,i,n){var r,s,o;if(i instanceof Array){let e=i[0];if("REFERENCE"==e){if(8!=i[1])throw"NotImplementedError('Unsupported Reference type')";i="<u8",r="getUint64",s=!1,o=8}else{if("VLEN_STRING"!=e&&"VLEN_SEQUENCE"!=e)throw"NotImplementedError('datatype not implemented')";r="getVLENStruct",s=!1,o=16}}else[r,s,o]=vw(i);var a=t.reduce((function(e,t){return e*t}),1),c=e.reduce((function(e,t){return e*t}),1);let l=t.length;var h=1;e.slice().map((function(e){let t=h;return h*=e,t}));h=1;var d=t.slice().reverse().map((function(e){let t=h;return h*=e,t})).reverse(),u=new Array(a);let f=c*o;for(var p of this.all_nodes.get(0)){let i=p.get("keys"),a=p.get("addresses"),h=i.length;for(var g=0;g<h;g++){let h=i[g],p=a[g];var m;if(null==n)m=await this.fh.slice(p,p+f);else{m=await this.fh.slice(p,p+h.get("chunk_size"));let e=h.get("filter_mask");m=this._filter_chunk(m,e,n,o)}for(var w=h.get("chunk_offset").slice(),b=w.slice(),F=b.map((function(){return 0})),v=new Aw(m),y=0;y<c;y++){for(var A=l-1;A>=0&&F[A]>=e[A];A--)F[A]=0,b[A]=w[A],A>0&&(F[A-1]+=1,b[A-1]+=1);if(b.slice(0,-1).every((function(e,i){return e<t[i]}))){let e=y*o,t=v[r](e,!s,o),i=b.slice(0,-1).reduce((function(e,t,i){return t*d[i]+e}),0);u[i]=t}F[l-1]+=1,b[l-1]+=1}}}return u}_filter_chunk(e,t,i,n){let r=i.length,s=e.slice();for(var o=r-1;o>=0;o--){if(t&1<<o)continue;let e=i[o],r=e.get("filter_id"),a=e.get("client_data");if(!Yb.has(r))throw'NotImplementedError("Filter with id:'+r.toFixed()+' not supported")';s=Yb.get(r)(s,n,a)}return s}},tF=class extends Xb{constructor(e,t){super(e,t),fw(this,"B_TREE_HEADER",new Map([["signature","4s"],["version","B"],["node_type","B"],["node_size","I"],["record_size","H"],["depth","H"],["split_percent","B"],["merge_percent","B"],["root_address","Q"],["root_nrecords","H"],["total_nrecords","Q"]])),fw(this,"B_LINK_NODE",new Map([["signature","4s"],["version","B"],["node_type","B"]])),this.ready=this.init()}async _read_root_node(){let e=await this._read_tree_header(this.offset);this.address_formats=this._calculate_address_formats(e),this.header=e,this.depth=e.get("depth");let t=[e.get("root_address"),e.get("root_nrecords"),e.get("total_nrecords")],i=await this._read_node(t,this.depth);this._add_node(i)}async _read_tree_header(e){return await pw(this.B_TREE_HEADER,this.fh,this.offset)}_calculate_address_formats(e){let t=e.get("node_size"),i=e.get("record_size"),n=0,r=0,s=new Map,o=e.get("depth");for(var a=0;a<=o;a++){let e,c,l,h="",d="",u="";if(0==a?(e=0,c=0,l=0):1==a?(e=8,h="<Q",c=this._required_bytes(n),d=this._int_format(c),l=0):(e=8,h="<Q",c=this._required_bytes(n),d=this._int_format(c),l=this._required_bytes(r),u=this._int_format(l)),s.set(a,[e,c,l,h,d,u]),a<o){let s=e+c+l;n=this._nrecords_max(t,i,s),r>0?r*=n:r=n}}return s}_nrecords_max(e,t,i){return Math.floor((e-10-i)/(t+i))}_required_bytes(e){return Math.ceil(Cw(e)/8)}_int_format(e){return["<B","<H","<I","<Q"][e-1]}async _read_node(e,t){let[i,n,r]=e,s=this._read_node_header(i,t);i+=ww(this.B_LINK_NODE);let o=this.header.get("record_size"),a=[];for(let e=0;e<n;e++){let e=await this._parse_record(this.fh,i,o);i+=o,a.push(e)}let c=[],l=this.address_formats.get(t);if(0!=t){let[e,t,r,s,o,a]=l;for(let l=0;l<=n;l++){let n=(await yw.unpack_from_async(s,this.fh,i))[0];i+=e;let l=(await yw.unpack_from_async(o,this.fh,i))[0];i+=t;let h=l;r>0&&(h=(await yw.unpack_from_async(a,this.fh,i))[0],i+=r),c.push([n,l,h])}}return s.set("keys",a),s.set("addresses",c),s}async _read_node_header(e,t){let i=await pw(this.B_LINK_NODE,this.fh,e);return i.set("node_level",t),i}*iter_records(){for(let e of this.all_nodes.values())for(let t of e)for(let e of t.get("keys"))yield e}_parse_record(e){throw"NotImplementedError"}},iF=class extends tF{constructor(){super(...arguments),fw(this,"NODE_TYPE",5)}async _parse_record(e,t,i){let n=(await yw.unpack_from_async("<I",e,t))[0];t+=4;const r=await e.slice(t,t+7);return new Map([["namehash",n],["heapid",r]])}},nF=class extends tF{constructor(){super(...arguments),fw(this,"NODE_TYPE",6)}async _parse_record(e,t,i){let n=(await yw.unpack_from_async("<Q",e,t))[0];t+=8;const r=await e.slice(t,t+7);return new Map([["creationorder",n],["heapid",r]])}},rF=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=await yw.unpack_from_async("<B",e,t+8);var n;if(0==i)n=await pw(dF,e,t),this._end_of_sblock=t+uF;else{if(2!=i&&3!=i)throw"unsupported superblock version: "+i.toFixed();n=await pw(fF,e,t),this._end_of_sblock=t+pF}if(n.get("format_signature")!=lF)throw"Incorrect file signature: "+n.get("format_signature");if(8!=n.get("offset_size")||8!=n.get("length_size"))throw"File uses non-64-bit addressing";this.version=n.get("superblock_version"),this._contents=n,this._root_symbol_table=null,this._fh=e}async get_offset_to_dataobjects(){if(0==this.version){var e=new oF(this._fh,this._end_of_sblock,!0);return await e.ready,this._root_symbol_table=e,e.group_offset}if(2==this.version||3==this.version)return this._contents.get("root_group_address");throw"Not implemented version = "+this.version.toFixed()}},sF=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=await pw(FF,e,t);mw("HEAP"==i.get("signature")),mw(0==i.get("version"));let n=i.get("address_of_data_segment"),r=await e.slice(n,n+i.get("data_segment_size"));i.set("heap_data",r),this._contents=i,this.data=r}get_object_name(e){let t=new Uint8Array(this.data).indexOf(0,e)-e;return yw.unpack_from("<"+t.toFixed()+"s",this.data,e)[0]}},oF=class{constructor(e,t,i=!1){this.ready=this.init(e,t,i)}async init(e,t,i){var n;if(i)n=new Map([["symbols",1]]);else{if("SNOD"!=(n=await pw(wF,e,t)).get("signature"))throw"incorrect node type";t+=bF}for(var r=[],s=n.get("symbols"),o=0;o<s;o++)r.push(await pw(gF,e,t)),t+=mF;return i&&(this.group_offset=r[0].get("object_header_address")),this.entries=r,this._contents=n,this}assign_name(e){this.entries.forEach((function(t){let i=t.get("link_name_offset"),n=e.get_object_name(i);t.set("link_name",n)}))}get_links(e){var t={};return this.entries.forEach((function(i){let n=i.get("cache_type"),r=i.get("link_name");if(0==n||1==n)t[r]=i.get("object_header_address");else if(2==n){let n=i.get("scratch"),o=new ArrayBuffer(4),a=new Uint8Array(o);for(var s=0;s<4;s++)a[s]=n.charCodeAt(s);let c=yw.unpack_from("<I",o,0)[0];t[r]=e.get_object_name(c)}})),t}},aF=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=await pw(vF,e,t);t+=yF;let n=i.get("collection_size")-yF,r=await e.slice(t,t+n);this.heap_data=r,this._header=i,this._objects=null}get objects(){if(null==this._objects){this._objects=new Map;for(var e=0;e<=this.heap_data.byteLength-CF;){let t=gw(AF,this.heap_data,e);if(0==t.get("object_index"))break;e+=CF;let i=this.heap_data.slice(e,e+t.get("object_size"));this._objects.set(t.get("object_index"),i),e+=bw(t.get("object_size"))}}return this._objects}},cF=class{constructor(e,t){this.fh=e,this.ready=this.init(t)}async init(e){let t=await pw(_F,this.fh,e);if(e+=ww(_F),mw("FRHP"==t.get("signature")),mw(0==t.get("version")),t.get("filter_info_size")>0)throw"Filter info size not supported on FractalHeap";if(t.get("btree_address_huge_objects")!=hF)throw"Huge objects not implemented in FractalHeap";t.set("btree_address_huge_objects",null),t.get("root_block_address")==hF&&t.set("root_block_address",null);let i=t.get("log2_maximum_heap_size"),n=this._min_size_nbits(i),r=new Map([["signature","4s"],["version","B"],["heap_header_adddress","Q"],["block_offset",`${n}B`]]);this.indirect_block_header=new Map(r),this.indirect_block_header_size=ww(r),2&~t.get("flags")||r.set("checksum","I"),this.direct_block_header=r,this.direct_block_header_size=ww(r);let s=t.get("maximum_direct_block_size");this._managed_object_offset_size=this._min_size_nbits(i);let o=Math.min(s,t.get("max_managed_object_size"));this._managed_object_length_size=this._min_size_integer(o);let a=t.get("starting_block_size"),c=t.get("table_width");if(!(a>0))throw"Starting block size == 0 not implemented";let l=Number(Math.floor(Math.log2(s)));mw(1n<<BigInt(l)==s);let h=Number(Math.floor(Math.log2(a)));mw(1n<<BigInt(h)==a),this._max_direct_nrows=l-h+2;let d=Math.floor(Math.log2(c));mw(1<<d==c),this._indirect_nrows_sub=d+h-1,this.header=t,this.nobjects=t.get("managed_object_count")+t.get("huge_object_count")+t.get("tiny_object_count");let u=[],f=t.get("root_block_address"),p=0;if(null!=f&&(p=t.get("indirect_current_rows_count")),p>0)for await(let e of this._iter_indirect_block(this.fh,f,p))u.push(e);else{let e=await this._read_direct_block(this.fh,f,a);u.push(e)}let g=u.reduce(((e,t)=>e+t.byteLength),0),m=new Uint8Array(g),w=0;u.forEach((e=>{m.set(new Uint8Array(e),w),w+=e.byteLength})),this.managed=m.buffer}async _read_direct_block(e,t,i){let n=await e.slice(t,t+i);return mw("FHDB"==gw(this.direct_block_header,n).get("signature")),n}get_data(e){let t=yw.unpack_from("<B",e,0)[0],i=t>>4&3,n=1;if(0==i){mw(0==t>>6);let i=this._managed_object_offset_size,r=_w(i,e,n);n+=i,i=this._managed_object_length_size;let s=_w(i,e,n);return this.managed.slice(r,r+s)}throw 1==i?"tiny objectID not supported in FractalHeap":2==i?"huge objectID not supported in FractalHeap":"unknown objectID type in FractalHeap"}_min_size_integer(e){return this._min_size_nbits(Cw(e))}_min_size_nbits(e){return Math.ceil(e/8)}async*_iter_indirect_block(e,t,i){let n=await pw(this.indirect_block_header,e,t);t+=this.indirect_block_header_size,mw("FHIB"==n.get("signature"));let r=n.get("block_offset").reduce(((e,t,i)=>e+(t<<8*i)),0);n.set("block_offset",r);let[s,o]=this._indirect_info(i),a=[];for(let i=0;i<s;i++){let n=(await yw.unpack_from_async("<Q",e,t))[0];if(t+=8,n==hF)break;let r=this._calc_block_size(i);a.push([n,r])}let c=[];for(let i=s;i<s+o;i++){let n=(await yw.unpack_from_async("<Q",e,t))[0];if(t+=8,n==hF)break;let r=this._calc_block_size(i),s=this._iblock_nrows_from_block_size(r);c.push([n,s])}for(let[t,i]of a){let n=await this._read_direct_block(e,t,i);yield n}for(let[t,i]of c)for await(let n of this._iter_indirect_block(e,t,i))yield n}_calc_block_size(e){let t=Math.floor(e/this.header.get("table_width"));return 2**Math.max(t-1,0)*this.header.get("starting_block_size")}_iblock_nrows_from_block_size(e){let t=Math.floor(Math.log2(e));return mw(2**t==e),t-this._indirect_nrows_sub}_indirect_info(e){let t,i,n=this.header.get("table_width"),r=e*n,s=this._max_direct_nrows*n;return e<=s?(t=r,i=0):(t=s,i=r-s),[t,i]}_int_format(e){return["B","H","I","Q"][e-1]}},lF=yw.unpack_from("8s",new Uint8Array([137,72,68,70,13,10,26,10]).buffer)[0],hF=yw.unpack_from("<Q",new Uint8Array([255,255,255,255,255,255,255,255]).buffer)[0],dF=new Map([["format_signature","8s"],["superblock_version","B"],["free_storage_version","B"],["root_group_version","B"],["reserved_0","B"],["shared_header_version","B"],["offset_size","B"],["length_size","B"],["reserved_1","B"],["group_leaf_node_k","H"],["group_internal_node_k","H"],["file_consistency_flags","L"],["base_address_lower","Q"],["free_space_address","Q"],["end_of_file_address","Q"],["driver_information_address","Q"]]),uF=ww(dF),fF=new Map([["format_signature","8s"],["superblock_version","B"],["offset_size","B"],["length_size","B"],["file_consistency_flags","B"],["base_address","Q"],["superblock_extension_address","Q"],["end_of_file_address","Q"],["root_group_address","Q"],["superblock_checksum","I"]]),pF=ww(fF),gF=new Map([["link_name_offset","Q"],["object_header_address","Q"],["cache_type","I"],["reserved","I"],["scratch","16s"]]),mF=ww(gF),wF=new Map([["signature","4s"],["version","B"],["reserved_0","B"],["symbols","H"]]),bF=ww(wF),FF=new Map([["signature","4s"],["version","B"],["reserved","3s"],["data_segment_size","Q"],["offset_to_free_list","Q"],["address_of_data_segment","Q"]]),vF=new Map([["signature","4s"],["version","B"],["reserved","3s"],["collection_size","Q"]]),yF=ww(vF),AF=new Map([["object_index","H"],["reference_count","H"],["reserved","I"],["object_size","Q"]]),CF=ww(AF),_F=new Map([["signature","4s"],["version","B"],["object_index_size","H"],["filter_info_size","H"],["flags","B"],["max_managed_object_size","I"],["next_huge_object_index","Q"],["btree_address_huge_objects","Q"],["managed_freespace_size","Q"],["freespace_manager_address","Q"],["managed_space_size","Q"],["managed_alloc_size","Q"],["next_directblock_iterator_address","Q"],["managed_object_count","Q"],["huge_objects_total_size","Q"],["huge_object_count","Q"],["tiny_objects_total_size","Q"],["tiny_object_count","Q"],["table_width","H"],["starting_block_size","Q"],["maximum_direct_block_size","Q"],["log2_maximum_heap_size","H"],["indirect_starting_rows_count","H"],["root_block_address","Q"],["indirect_current_rows_count","H"]]),xF=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=(await yw.unpack_from_async("<B",e,t))[0];if(1==i)var[n,r,s]=await this._parse_v1_objects(e,t);else{if(i!="O".charCodeAt(0))throw"InvalidHDF5File('unknown Data Object Header')";var[n,r,s]=await this._parse_v2_objects(e,t)}this.fh=e,this.msgs=n,this.msg_data=r,this.offset=t,this._global_heaps={},this._header=s,this._filter_pipeline=null,this._chunk_params_set=!1,this._chunks=null,this._chunk_dims=null,this._chunk_address=null}get dtype(){let e=this.find_msg_type(JF)[0].get("offset_to_message");return new xw(this.fh,e).dtype}get chunks(){return this._get_chunk_params().then((()=>this._chunks))}get shape(){let e=this.find_msg_type(XF)[0].get("offset_to_message");return async function(e,t){let i=(await yw.unpack_from_async("<B",e,t))[0];var n;if(1==i)mw(1==(n=await pw(DF,e,t)).get("version")),t+=TF;else{if(2!=i)throw"InvalidHDF5File('unknown dataspace message version')";mw(2==(n=await pw(LF,e,t)).get("version")),t+=zF}let r=n.get("dimensionality");return(await yw.unpack_from_async("<"+(2*r).toFixed()+"I",e,t)).filter((function(e,t){return t%2==0}))}(this.fh,e)}async get_filter_pipeline(){if(null!=this._filter_pipeline)return this._filter_pipeline;let e=this.find_msg_type(nv);if(!e.length)return this._filter_pipeline=null,this._filter_pipeline;var t=e[0].get("offset_to_message");let[i,n]=await yw.unpack_from_async("<BB",this.fh,t);t+=yw.calcsize("<BB");var r=[];if(1==i){await yw.unpack_from_async("<HI",this.fh,t),t+=yw.calcsize("<HI");for(var s=0;s<n;s++){let e=await pw(KF,this.fh,t);t+=YF;let i=bw(e.get("name_length"),8),n="<"+i.toFixed()+"s",s=(await yw.unpack_from_async(n,this.fh,t))[0];e.set("filter_name",s),t+=i,n="<"+e.get("client_data_values").toFixed()+"I";let o=await yw.unpack_from_async(n,this.fh,t);e.set("client_data",o),t+=4*e.get("client_data_values"),e.get("client_data_values")%2&&(t+=4),r.push(e)}}else{if(2!=i)throw`version ${i} is not supported`;for(let e=0;e<n;e++){let e=new Map,i=this.fh,n=(await yw.unpack_from_async("<H",i,t))[0];t+=2,e.set("filter_id",n);let s=0;n>255&&(s=(await yw.unpack_from_async("<H",i,t))[0],t+=2);let o=(await yw.unpack_from_async("<H",i,t))[0];t+=2;let a=(1&o)>0;e.set("optional",a);let c,l=(await yw.unpack_from_async("<H",i,t))[0];t+=2,s>0&&(c=(await yw.unpack_from_async(`${s}s`,i,t))[0],t+=s),e.set("name",c);let h=await yw.unpack_from_async(`<${l}i`,i,t);t+=4*l,e.set("client_data_values",h),r.push(e)}}return this._filter_pipeline=r,this._filter_pipeline}find_msg_type(e){return this.msgs.filter((function(t){return t.get("type")==e}))}async get_attributes(){let e={},t=this.find_msg_type(rv);for(let i of t){let t=i.get("offset_to_message"),[n,r]=await this.unpack_attribute(t);e[n]=r}return e}async get_fillvalue(){var e,t=this.find_msg_type(ev)[0].get("offset_to_message");let i=(await yw.unpack_from_async("<B",this.fh,t))[0];var n,r,s;if(1==i||2==i)n=await pw(jF,this.fh,t),t+=WF,e=n.get("fillvalue_defined");else{if(3!=i)throw'InvalidHDF5File("Unknown fillvalue msg version: "'+String(i);n=await pw(GF,this.fh,t),t+=$F,e=32&n.get("flags")}if(e?(r=(await yw.unpack_from_async("<I",this.fh,t))[0],t+=4):r=0,r){let[e,i,n]=vw(await this.dtype);s=new Aw(await this.fh.slice(t,t+n))[e](t,!i,n)}else s=0;return s}async unpack_attribute(e){let t=(await yw.unpack_from_async("<B",this.fh,e))[0];var i,n;if(1==t)mw(1==(i=await pw(SF,this.fh,e)).get("version")),e+=EF,n=8;else{if(3!=t)throw"unsupported attribute message version: "+t;mw(3==(i=await pw(NF,this.fh,e)).get("version")),e+=BF,n=1}let r=i.get("name_size"),s=(await yw.unpack_from_async("<"+r.toFixed()+"s",this.fh,e))[0];var o;s=s.replace(/\x00$/,""),e+=bw(r,n);try{o=await new xw(this.fh,e).dtype}catch(e){return console.warn("Attribute "+s+" type not implemented, set to null."),[s,null]}e+=bw(i.get("datatype_size"),n);let a=await this.determine_data_shape(this.fh,e),c=a.reduce((function(e,t){return e*t}),1);if(e+=bw(i.get("dataspace_size"),n),5===o.datatype_class)l=await this.fh.slice(e,e+o.size);else{var l=await this._attr_value(o,this.fh,c,e);0==a.length&&(l=l[0])}return[s,l]}async determine_data_shape(e,t){let i=(await yw.unpack_from_async("<B",e,t))[0];var n;if(1==i)mw(1==(n=await pw(DF,e,t)).get("version")),t+=TF;else{if(2!=i)throw"unknown dataspace message version";mw(2==(n=await pw(LF,e,t)).get("version")),t+=zF}let r=n.get("dimensionality");return await yw.unpack_from_async("<"+r.toFixed()+"Q",e,t)}async _attr_value(e,t,i,n){var r=new Array(i);if(e instanceof Array){let l=e[0];for(var s=0;s<i;s++)if("VLEN_STRING"==l){let i=e[2];var[o,a]=await this._vlen_size_and_data(t,n);const c=new TextDecoder(0==i?"ascii":"utf-8");r[s]=c.decode(a),n+=16}else if("REFERENCE"==l){var c=await yw.unpack_from_async("<Q",t,n);r[s]=c,n+=8}else{if("VLEN_SEQUENCE"!=l)throw"NotImplementedError";{let i=e[1];var[o,a]=this._vlen_size_and_data(t,n);r[s]=this._attr_value(i,a,o,0),n+=16}}}else{let[o,a,c]=vw(e);const l=await t.slice(n,n+i*c);let h=new Aw(l,0),d=0;for(s=0;s<i;s++)r[s]=h[o](d,!a,c),d+=c}return r}async _vlen_size_and_data(e,t){let i=(await yw.unpack_from_async("<I",e,t))[0],n=await pw(IF,e,t+4),r=n.get("collection_address");var s;return mw(n.get("collection_address")<Number.MAX_SAFE_INTEGER),r in this._global_heaps||(s=new aF(this.fh,r),await s.ready,this._global_heaps[r]=s),[i,(s=this._global_heaps[r]).objects.get(n.get("object_index"))]}async _parse_v1_objects(e,t){let i=await pw(MF,e,t);mw(1==i.get("version"));let n=i.get("total_header_messages");for(var r=i.get("object_header_size"),s=t+ww(MF),o=await e.slice(s,s+r),a=[[s,r]],c=0,l=0,h=new Array(n),d=0;d<n;d++){l>=r&&([s,r]=a[++c],l=0);let t=await pw(HF,e,s+l),i=s+l+PF;if(t.set("offset_to_message",i),t.get("type")==sv){var[u,f]=await yw.unpack_from_async("<QQ",e,i);a.push([u,f])}l+=PF+t.get("size"),h[d]=t}return[h,o,i]}async _parse_v2_objects(e,t){var[i,n,r]=await this._parse_v2_header(e,t);t=r;for(var s=[],o=i.get("size_of_chunk_0"),a=e.slice(t,t+=o),c=[[r,o]],l=0,h=0;;){if(h>=o-UF){let e=c[++l];if(null==e)break;[r,o]=e,h=0}let t=await pw(OF,e,r+h),i=r+h+UF+n;if(t.set("offset_to_message",i),t.get("type")==sv){var[d,u]=await yw.unpack_from_async("<QQ",e,i);c.push([d+4,u-4])}h+=UF+t.get("size")+n,s.push(t)}return[s,a,i]}async _parse_v2_header(e,t){let i=await pw(RF,e,t);var n;if(t+=ww(RF),mw(2==i.get("version")),n=4&i.get("flags")?2:0,mw(!(16&i.get("flags"))),32&i.get("flags")){let n=await yw.unpack_from_async("<4I",e,t);t+=16,i.set("access_time",n[0]),i.set("modification_time",n[1]),i.set("change_time",n[2]),i.set("birth_time",n[3])}let r=["<B","<H","<I","<Q"][3&i.get("flags")];return i.set("size_of_chunk_0",(await yw.unpack_from_async(r,e,t))[0]),[i,n,t+=yw.calcsize(r)]}async find_link(e){if(this._links){for(link of this._links)if(e===link[0])return link}else{const t=[];for await(const i of this.iter_links()){if(e===i[0])return i;t.push(i)}this._links=t}}async get_links(){const e=[];for await(const t of this.iter_links())e.push(t);return Object.fromEntries(e)}async*iter_links(){for(let e of this.msgs)e.get("type")==ov?yield*this._iter_links_from_symbol_tables(e):e.get("type")==tv?yield this._get_link_from_link_msg(e):e.get("type")==ZF&&(yield*this._iter_link_from_link_info_msg(e))}async*_iter_links_from_symbol_tables(e){mw(16==e.get("size"));let t=await pw(qF,this.fh,e.get("offset_to_message"));yield*this._iter_links_btree_v1(t.get("btree_address"),t.get("heap_address"))}async*_iter_links_btree_v1(e,t){let i=new Jb(this.fh,e);await i.ready;let n=new sF(this.fh,t);await n.ready;for(let e of i.symbol_table_addresses()){let t=new oF(this.fh,e);await t.ready,t.assign_name(n),yield*Object.entries(t.get_links(n))}}async _get_link_from_link_msg(e){let t=e.get("offset_to_message");return await this._decode_link_msg(this.fh,t)[1]}async _decode_link_msg(e,t){let[i,n]=await yw.unpack_from_async("<BB",e,t);t+=2,mw(1==i);let r,s,o=2**(3&n),a=(16&n)>0,c=(4&n)>0;(8&n)>0?(r=(await yw.unpack_from_async("<B",e,t))[0],t+=1):r=0,mw([0,1].includes(r)),c&&(s=(await yw.unpack_from_async("<Q",e,t))[0],t+=8);let l=0;a&&(l=(await yw.unpack_from_async("<B",e,t))[0],t+=1);let h=0==l?"ascii":"utf-8",d=["<B","<H","<I","<Q"][3&n],u=(await yw.unpack_from_async(d,e,t))[0];t+=o;let f,p=new TextDecoder(h).decode(await e.slice(t,t+u));if(t+=u,0==r)f=(await yw.unpack_from_async("<Q",e,t))[0];else if(1==r){let i=(await yw.unpack_from_async("<H",e,t))[0];t+=2,f=new TextDecoder(h).decode(await e.slice(t,t+i))}return[s,[p,f]]}async*_iter_link_from_link_info_msg(e){let t=e.get("offset_to_message"),i=await this._decode_link_info_msg(this.fh,t),n=i.get("heap_address"),r=i.get("name_btree_address"),s=i.get("order_btree_address");null!=r&&(yield*this._iter_links_btree_v2(r,s,n))}async*_iter_links_btree_v2(e,t,i){let n,r=new cF(this.fh,i);await r.ready;const s=null!=t;s?(n=new nF(this.fh,t),await n.ready):(n=new iF(this.fh,e),await n.ready);let o=new Map;for(let e of n.iter_records()){let t=r.get_data(e.get("heapid")),[i,n]=await this._decode_link_msg(t,0);const a=s?i:n[0];o.set(a,n)}let a=Array.from(o.keys()).sort();for(let e of a)yield o.get(e)}async _decode_link_info_msg(e,t){let[i,n]=await yw.unpack_from_async("<BB",e,t);mw(0==i),t+=2,(1&n)>0&&(t+=8);let r=(2&n)>0?VF:QF,s=await pw(r,e,t),o=new Map;for(let[e,t]of s.entries())o.set(e,t==kF?null:t);return o}get is_dataset(){return this.find_msg_type(XF).length>0}async get_data(){let e=this.find_msg_type(iv)[0].get("offset_to_message");var[t,i,n,r]=await this._get_data_message_properties(e);if(0==n)throw"Compact storage of DataObject not implemented";return 1==n?this._get_contiguous_data(r):2==n?this._get_chunked_data(e):void 0}async _get_data_message_properties(e){let t,i,n,[r,s,o]=await yw.unpack_from_async("<BBB",this.fh,e);return 1==r||2==r?(t=s,i=o,n=e,n+=yw.calcsize("<BBB"),n+=yw.calcsize("<BI"),mw(1==i||2==i)):3!=r&&4!=r||(i=s,n=e,n+=yw.calcsize("<BB")),mw(r>=1&&r<=4),[r,t,i,n]}async _get_contiguous_data(e){let[t]=await yw.unpack_from_async("<Q",this.fh,e);const i=await this.shape,n=await this.dtype;if(t==kF){let e=i.reduce((function(e,t){return e*t}),1);return new Array(e)}var r=i.reduce((function(e,t){return e*t}),1);if(n instanceof Array){let e=n[0];if("REFERENCE"==e){if(8!=n[1])throw"NotImplementedError('Unsupported Reference type')";return await this.fh.slice(t,t+r)}if("VLEN_STRING"==e){let e=n[2];const i=new TextDecoder(0==e?"ascii":"utf-8");var s=[];for(o=0;o<r;o++){const[e,n]=await this._vlen_size_and_data(this.fh,t);s[o]=i.decode(n),t+=16}return s}throw"NotImplementedError('datatype not implemented')"}if(/[<>=!@\|]?(i|u|f|S)(\d*)/.test(n)){let[e,i,s]=vw(n),a=new Array(r);const c=await this.fh.slice(t,t+s*r);let l=new Aw(c);for(var o=0;o<r;o++)a[o]=l[e](o*s,!i,s);return a}if(5===n.datatype_class)return this.fh.slice(t,t+n.size);throw"not Implemented - no proper dtype defined"}async _get_chunked_data(e){if(await this._get_chunk_params(),this._chunk_address==kF)return[];var t=new eF(this.fh,this._chunk_address,this._chunk_dims);await t.ready;const i=await this.dtype,n=await this.shape,r=await this.chunks,s=await this.get_filter_pipeline();let o=await t.construct_data_from_chunks(r,n,i,s);if(i instanceof Array&&/^VLEN/.test(i[0])){let e=i[0];for(var a=0;a<o.length;a++){let[t,n,r]=o[a];var c;n in this._global_heaps?c=this._global_heaps[n]:(c=new aF(this.fh,n),await c.ready,this._global_heaps[n]=c);let s=c.objects.get(r);if("VLEN_STRING"==e){let e=i[2];const t=new TextDecoder(0==e?"ascii":"utf-8");o[a]=t.decode(s)}}}return o}async _get_chunk_params(){if(!this._chunk_params_set){this._chunk_params_set=!0;var e=this.find_msg_type(iv)[0].get("offset_to_message"),[t,i,n,r]=await this._get_data_message_properties(e);if(2==n){var s;if(1==t||2==t){var o=(await yw.unpack_from_async("<Q",this.fh,r))[0];s=r+yw.calcsize("<Q")}else if(3==t){var[i,o]=await yw.unpack_from_async("<BQ",this.fh,r);s=r+yw.calcsize("<BQ")}mw(t>=1&&t<=3);var a="<"+(i-1).toFixed()+"I",c=await yw.unpack_from_async(a,this.fh,s);this._chunks=c,this._chunk_dims=i,this._chunk_address=o}}}};var kF=yw.unpack_from("<Q",new Uint8Array([255,255,255,255,255,255,255,255]).buffer),IF=new Map([["collection_address","Q"],["object_index","I"]]);ww(IF);var SF=new Map([["version","B"],["reserved","B"],["name_size","H"],["datatype_size","H"],["dataspace_size","H"]]),EF=ww(SF),NF=new Map([["version","B"],["flags","B"],["name_size","H"],["datatype_size","H"],["dataspace_size","H"],["character_set_encoding","B"]]),BF=ww(NF),MF=new Map([["version","B"],["reserved","B"],["total_header_messages","H"],["object_reference_count","I"],["object_header_size","I"],["padding","I"]]),RF=new Map([["signature","4s"],["version","B"],["flags","B"]]),DF=new Map([["version","B"],["dimensionality","B"],["flags","B"],["reserved_0","B"],["reserved_1","I"]]),TF=ww(DF),LF=new Map([["version","B"],["dimensionality","B"],["flags","B"],["type","B"]]),zF=ww(LF),HF=new Map([["type","H"],["size","H"],["flags","B"],["reserved","3s"]]),PF=ww(HF),OF=new Map([["type","B"],["size","H"],["flags","B"]]),UF=ww(OF),qF=new Map([["btree_address","Q"],["heap_address","Q"]]),QF=new Map([["heap_address","Q"],["name_btree_address","Q"]]),VF=new Map([["heap_address","Q"],["name_btree_address","Q"],["order_btree_address","Q"]]),jF=new Map([["version","B"],["space_allocation_time","B"],["fillvalue_write_time","B"],["fillvalue_defined","B"]]),WF=ww(jF),GF=new Map([["version","B"],["flags","B"]]),$F=ww(GF),KF=new Map([["filter_id","H"],["name_length","H"],["flags","H"],["client_data_values","H"]]),YF=ww(KF),XF=1,ZF=2,JF=3,ev=5,tv=6,iv=8,nv=11,rv=12,sv=16,ov=17,av=class{constructor(e,t){null==t?(this.parent=this,this.file=this):(this.parent=t,this.file=t.file),this.name=e}async init(e){const t=this.file.index;t&&this.name in t?this._links=t[this.name]:this._links=await e.get_links(),this._dataobjects=e,this._attrs=null,this._keys=null}get keys(){return null==this._keys&&(this._keys=Object.keys(this._links)),this._keys.slice()}get values(){return this.keys.map((e=>this.get(e)))}length(){return this.keys.length}_dereference(e){if(!e)throw"cannot deference null reference";let t=this.file._get_object_by_address(e);if(null==t)throw"reference not found in file";return t}async get(e){if("number"==typeof e)return this._dereference(e);var t=hv(e);if("/"==t)return this.file;if("."==t)return this;if(/^\//.test(t))return this.file.get(t.slice(1));if(""!=function(e){let t="/",i=e.lastIndexOf(t)+1,n=e.slice(0,i),r=new RegExp("^"+t+"+$"),s=new RegExp(t+"$");n&&!r.test(n)&&(n=n.replace(s,""));return n}(t))var[i,n]=t.split(/\/(.*)/);else var i=t,n=".";if(!(i in this._links))throw i+" not found in group";var r=hv(this.name+"/"+i);let s=this._links[i];if("string"==typeof s)try{return this.get(s)}catch(e){return null}var o=new xF(this.file._fh,s);if(await o.ready,o.is_dataset){if("."!=n)throw r+" is a dataset, not a group";return new lv(r,o,this)}var a=new av(r,this);return await a.init(o),a.get(n)}visit(e){return this.visititems(((t,i)=>e(t)))}visititems(e){var t=this.name.length;/\/$/.test(this.name)||(t+=1);for(var i=this.values.slice();i;){let n=i.shift();1==i.length&&console.log(n);let r=e(n.name.slice(t),n);if(null!=r)return r;n instanceof av&&(i=i.concat(n.values))}return null}get attrs(){return null==this._attrs&&(this._attrs=this._dataobjects.get_attributes()),this._attrs}},cv=class extends av{constructor(e,t,i){super("/",null),this.ready=this.init(e,t,i)}async init(e,t,i){var n=new rF(e,0);await n.ready;var r=await n.get_offset_to_dataobjects(),s=new xF(e,r);if(await s.ready,this.parent=this,this.file=this,this.name="/",this._dataobjects=s,this._attrs=null,this._keys=null,this._fh=e,this.filename=t||"",this.mode="r",this.userblock_size=0,i&&i.index)this.index=i.index;else{let t;if(i&&i.indexOffset)t=i.indexOffset;else{const e=await this.attrs;if(e.hasOwnProperty("_index_offset"))t=e._index_offset;else{const e=this.indexName||"_index",i=await s.find_link(e);i&&(t=i[1])}}if(t)try{const i=new xF(e,t);await i.ready;const n=await i.get_data(),r=Kb(n),s=(new TextDecoder).decode(r);this.index=JSON.parse(s)}catch(e){console.error(`Error loading index by offset ${e}`)}}this.index&&this.name in this.index?this._links=this.index[this.name]:this._links=await s.get_links()}_get_object_by_address(e){return this._dataobjects.offset==e?this:this.visititems((e=>{e._dataobjects.offset}))}},lv=class extends Array{constructor(e,t,i){super(),this.parent=i,this.file=i.file,this.name=e,this._dataobjects=t,this._attrs=null,this._astype=null}get value(){var e=this._dataobjects.get_data();return null==this._astype?this.getValue(e):e.astype(this._astype)}get shape(){return this._dataobjects.shape}get attrs(){return this._dataobjects.get_attributes()}get dtype(){return this._dataobjects.dtype}get fillvalue(){return this._dataobjects.get_fillvalue()}async to_array(){return function(e,t){const i=e.length,n=t.reduce(((e,t)=>e*t),1);i!==n&&console.warn(`shape product: ${n} does not match length of flattened array: ${i}`);let r=e;const s=t.slice(1).reverse();for(let e of s){const t=[],{length:i}=r;let n=0;for(;n<i;)t.push(r.slice(n,n+=e));r=t}return r}
58
- /*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */(await this.value,await this.shape)}async getValue(e){const t=await this.dtype;return("string"==typeof t||t instanceof String)&&t.startsWith("S")?(await e).map((e=>{let t=e.indexOf("\0");return t>=0?e.substring(0,t):e})):e}};function hv(e){return e.replace(/\/(\/)+/g,"/")}async function dv(e){var t;e.url&&("function"==typeof(t=e.url).slice&&"function"==typeof t.arrayBuffer)&&(e.file=e.url,e.url=void 0);const i=void 0!==e.url;let n=e.reader?e.reader:function(e){if(e.url)return new cw(e);if(e.path)return new NodeLocalFile(e);if(e.file)return new dw(e.file);throw Error("One of 'url', 'path (node only)', or 'file (browser only)' must be specified")}(e);const r=e.fetchSize||2e3,s=e.maxSize||2e5;i&&(n=new lw({file:n,fetchSize:r,maxSize:s}));const o=new uv(n),a=await async function(e){let t;if(e.indexReader)t=e.indexReader;else{if(e.index)return e.index;e.indexURL?t=new cw({url:e.indexURL}):e.indexPath?t=new NodeLocalFile({path:e.indexPath}):e.indexFile&&(t=new dw({file:e.indexFile}))}if(t){const e=await t.read(),i=(new TextDecoder).decode(e);return JSON.parse(i)}return}(e),c=e.indexOffset,l=function(e){if(e.url)return fv(e.url);if(e.path)return fv(e.path);if(e.file)return e.file.name}(e),h=new cv(o,l,{index:a,indexOffset:c});return await h.ready,h}class uv{constructor(e){this.fileReader=e}async slice(e,t){return this.fileReader.read(e,t-e)}}function fv(e){const t=e.lastIndexOf("/");return t>0?e.substring(t+1):e}class pv{constructor(e,t){this.chrom=e,this.signal_bin_size=t;this.signals={raw_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}`,gc_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}_GC`,gc_partition:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_merge`,baf:`snp_likelihood_${this.chrom}_${this.signal_bin_size}_mask`,baf_i1:`snp_i1_${this.chrom}_${this.signal_bin_size}_mask`,Mosaic_segments:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_segments_2d`,Mosaic_calls:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_call_2d`}}}class gv{constructor(e,t=1e5){this.h5_file=e,this.bin_size=t,this.h5_obj=void 0}async fetch(){return this.h5_obj||(this.h5_obj=await dv({url:this.h5_file,fetchSize:1e6,maxSize:2e8})),this.h5_obj}async get_keys(){return(await this.fetch()).keys}async get_rd_signal(e=this.bin_size){let t=await this.fetch();this.h5_obj=t,this.pytor_keys=t.keys;let i=new mv(this.pytor_keys),n=i.get_rd_bins(),r=i.get_snp_bins();this.available_bins=[...new Set(n,r)],this.available_bins.includes(e)||(e=this.available_bins.at(-1));const s=await t.get("rd_chromosomes");await s.dtype;let o=await s.value,a=await this.rd_stat(e);var c=[],l=[],h=[],d=[],u=[],f=[];for(let t of o){let i=new pv(t,e);var p=i.signals.raw_RD;let n=await this.get_chr_signal(t,e,p,a);c=c.concat(n);var g=i.signals.gc_RD;let r=await this.get_chr_signal(t,e,g,a);l=l.concat(r);let s=i.signals.gc_partition,o=await this.get_chr_signal(t,e,s,a);h=h.concat(o);let m=await this.rd_call_combined(t,e,a,i);d=d.concat(m);let w=i.signals.baf_i1,b=await this.get_baf_signals_v2(t,e,w);u=u.concat(b[0]),f=f.concat(b[1])}this.callers=[],0!=d.length&&this.callers.push("ReadDepth"),0!=d.length&&this.callers.push("2D");var m={},w={RD_Raw:c,RD_Raw_gc_coor:l,ReadDepth:h,"2D":d,BAF1:u,BAF2:f};return m[e]=w,m}decode_segments(e){let t=[],i=[];for(let n of e)4294967295==n?(t.push(i),i=[]):i.push(n);return t}async rd_call_combined(e,t,i,n){let r,s=[],o=n.signals.Mosaic_segments;if(this.pytor_keys.includes(o)){const e=await this.h5_obj.get(o);let t=await e.value;r=this.decode_segments(t)}let a=n.signals.Mosaic_calls;if(this.pytor_keys.includes(a)){const n=await this.h5_obj.get(a);let o=await n.to_array();r.forEach(((n,r)=>{n.forEach(((n,a)=>{s.push({chr:e,start:n*t,end:(n+1)*t,value:o[0][r]/i[4]*2})}))}))}return s}async rd_stat(e){let t,i=`rd_stat_${e}_auto`;if(this.pytor_keys.includes(i)){const e=await this.h5_obj.get(i);t=await e.value}return t}async get_chr_signal(e,t,i,n){let r=[];if(this.pytor_keys.includes(i)){const s=await this.h5_obj.get(i);(await s.value).forEach(((i,s)=>{r.push({chr:e,start:s*t,end:(s+1)*t,value:i/n[4]*2})}))}return r}async get_baf_signals(e,t,i,n=-1){let r=[],s=[];if(this.pytor_keys.includes(i)){let o=await this.h5_obj.get(i);(await o.to_array()).forEach(((i,o)=>{let a=Math.max(...i);const c=i.indexOf(a);let l=Math.max(c/200,1-c/200);r.push({chr:e,start:o*t,end:(o+1)*t,value:n*l}),.5!=l&&s.push({chr:e,start:o*t,end:(o+1)*t,value:n*(1-l)})}))}return[r,s]}async get_baf_signals_v2(e,t,i,n=-1){let r=[],s=[];if(this.pytor_keys.includes(i)){let o=await this.h5_obj.get(i);(await o.to_array()).forEach(((i,o)=>{isNaN(i)||(r.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5-i)}),.5!=i&&s.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5+i)}))}))}return[r,s]}}class mv{constructor(e){this.signals=e}get_rd_bins(){let e=[];this.signals.forEach((t=>{let i=t.match(/^his_rd_p_(.*)_(\d+)$/);i&&e.push({chr:i[1],bin_size:i[2]})}));return[...new Set(e.map((e=>Number(e.bin_size))))]}get_snp_bins(){let e=[];this.signals.forEach((t=>{let i=t.match(/^snp_likelihood_(.*)_(\d+)_mask$/);i&&e.push({chr:i[1],bin_size:i[2]})}));return[...new Set(e.map((e=>Number(e.bin_size))))]}}function wv(e){let t=function(e){if(e.length<4)return e;let t,i,n,r,s,o;return t=e.slice().sort(((e,t)=>e-t)),t.length/4%1==0?(i=.5*(t[t.length/4]+t[t.length/4+1]),n=.5*(t[t.length*(3/4)]+t[t.length*(3/4)+1])):(i=t[Math.floor(t.length/4+1)],n=t[Math.ceil(t.length*(3/4)+1)]),r=n-i,s=n+1.5*r,o=i-1.5*r,t.filter((e=>e>=o&&e<=s))}(e);const i=t.length,n=t.reduce(((e,t)=>e+t))/i,r=Math.sqrt(t.map((e=>Math.pow(e-n,2))).reduce(((e,t)=>e+t))/i);return[n,r]}var bv={range_function:function(e,t,i){return Array(Math.ceil((t-e)/i)).fill(e).map(((e,t)=>e+t*i))},getDistParams:wv,linspace:function(e,t,i){if(void 0===i&&(i=Math.max(Math.round(t-e)+1,1)),i<2)return 1===i?[e]:[];var n=Array(i);for(let r=--i;r>=0;r--)n[r]=(r*t+(i-r)*e)/i;return n},GetFit:class{constructor(e){this.allBins=e}getValues(){return Object.values(this.allBins).reduce(((e,t)=>e.concat(t.filter((e=>e.binScore>0)).map((e=>e.binScore)))),[])}getMean(e){return e.reduce((function(e,t){return e+t}))/e.length}fit_data(){return wv(this.getValues())}histogram(e,t){const i=t[1]-t[0],n=[];e.forEach(((e,r)=>{t.forEach(((t,r)=>{if(n[t]||(n[t]={count:0}),t<=e&&e<t+i)return n[t].count++,!1}))}));const r=[];return n.forEach(((e,t)=>{r.push(e.count)})),r}}};function Fv(e,t){return isNaN(e)||isNaN(t)||t<=0?NaN:0===e?.5:.5+.5*(vv(.5*t,.5,1)-vv(.5*t,.5,t/(t+e*e)))*Math.sign(e)}function vv(e,t,i){if(0==i)return 0;if(1==i)return 1;{let n=_v(e+t)-_v(e)-_v(t)+e*Math.log(i)+t*Math.log(1-i);return i<(e+1)/(e+t+2)?Math.exp(n)*yv(e,t,i)/e:1-Math.exp(n)*yv(t,e,1-i)/t}}function yv(e,t,i,n=1e3){let r=1,s=1,o=1,a=e+t,c=e+1,l=e-1,h=1-a*i/c;for(let d=0;d<=n;d++){let n=parseFloat(d+1),u=n+n,f=n*(t-n)*i/((l+u)*(e+u)),p=r+f*s,g=h+f*o;f=-(e+n)*(a+n)*i/((c+u)*(e+u));let m=g+f*h,w=r;if(s=p/m,o=g/m,r=(p+f*r)/m,h=1,Math.abs(r-w)<3e-7*Math.abs(r))return r}}function Av(e){if(0==e||1==e)return 1;return e*Av(e-1)}function Cv(e){let t;var i=[75122.633153,80916.6278952,36308.2951477,8687.24529705,1168.92649479,83.8676043424,2.50662827511],n=0,r=1;if(0==e)t=1e99;else if(e%1==0)t=Av(e-1);else{for(let t=0;t<i.length;t++)n+=i[t]*Math.pow(e,t),r*=e+t;t=n*Math.pow(e+5.5,e+.5)*Math.exp(-(e+5.5))/r}return t}function _v(e){return Math.log(Cv(e))}var xv={TdistributionCDF:Fv,gamma:Cv,t_test_1_sample:function(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-Fv(Math.abs(r),n-1)},t_test_2_samples:function(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-Fv(Math.abs(o),parseInt(a+.5))}};function kv(e){return e.reduce((function(e,t){return e>t?e:t}))}function Iv(e,t,i,n){return t*Math.exp(-1*(e-i)**2/(2*n**2))/Math.sqrt(2*Math.PI)/n}function Sv(e,t,i,n){return Math.exp(-1*(e-i)**2/(t**2+n**2))}function Ev(e,t){let i;try{i=e.reduce(((e,i,n)=>e+Math.min(i,t[n])))}catch{return console.log("Failed to find likelihood overlap: ",e,t),0}return i}function Nv(e,t,i,n){return 0==t&&0==n?{nl:.5*(e+i),ne:0}:{nl:(e*n*n+i*t*t)/(t*t+n*n),ne:Math.sqrt(t*t*n*n/(t*t+n*n))}}function Bv(e,t){let i=parseInt(t*(e.length-1)),n=t*(e.length-1)-i;return i<e.length-1?e[i]*(1-n)+e[i+1]*n:e[i]}function Mv(e){const t=e.length,i=Math.max(...e);let n=e.indexOf(i);n>Math.floor(t/2)&&(n=t-1-n);const r=(t/2-n)/(t+1),s=Math.floor((t/2+n)/2),o=t-1-s;let a=e.slice(s,o+1).reduce(((e,t)=>e+t),0)/e.reduce(((e,t)=>e+t),0);return n===Math.floor(t/2)&&(a=1),{mean:r,p:a}}var Rv=class{constructor(e,t){this.wigFeatures=e,this.binSize=t}get_fit(){var e=new bv.GetFit(this.wigFeatures),[t,i]=e.fit_data();return{globalMean:t,globalStd:i}}async call_2d(e=null,t=null,i="both",n=.1,r=0,s=10,o=0){let a=this.get_fit();this.globalMean=a.globalMean,this.globalStd=a.globalStd;let c=null==e?.05*this.binSize/3e9:e,l=null==t?parseInt(this.binSize/1e4):t,h=[],d=[],u=[],f=[],p=[],g=[];for(const[e,t]of Object.entries(this.wigFeatures)){let e=[],i=[],s=[];t.forEach(((t,n)=>{t.hets_count>4&&t.dp_count>l&&(e.push([n]),i.push(t.binScore),s.push(t.likelihood_score),delete t.likelihood_score)}));let o=[];for(let e=1;e<i.length;e++)o.push(Math.abs(i[e]-i[e-1]));let a=[0];for(let e=1;e<o.length;e++)a.push(Math.min(o[e-1],o[e]));a.push(0);let g=i.map(((e,t)=>Math.sqrt(Math.sqrt(e)**2+this.globalStd**2+Math.pow(a[t]/2,2)))),m=[];for(let t=0;t<e.length-1;t++){let n=0;try{n=Ev(s[t],s[t+1])}catch{console.log("Overlap failed: ",t,s[t],e[t+1],s[t+1])}let r=Sv(i[t],g[t],i[t+1],g[t+1]);m.push(r*n)}for(;m.length>0;){m=m.filter((e=>"number"==typeof e));let t=kv(m);if(isNaN(t)&&console.log("NaN value",m),t<c)break;let n,r,o=m.indexOf(t),a=Nv(i[o],g[o],i[o+1],g[o+1]);try{n=s[o].map(((e,t)=>e*s[o+1][t])),r=n.reduce(((e,t)=>e+t))}catch{console.log(s),console.log("max_overlap:",t,o,m.length),console.log("likelihood: ",o,s[o],s[o+1]),console.log("nlh: ",r)}if(i[o]=a.nl,g[o]=a.ne,s[o]=n.map((function(e){return e/r})),e[o].push(...e[o+1]),i.splice(o+1,1),g.splice(o+1,1),e.splice(o+1,1),s.splice(o+1,1),m.splice(o,1),o<m.length){let e=Sv(i[o],g[o],i[o+1],g[o+1])*Ev(s[o],s[o+1]);m[o]=e}if(o>0){let e=Sv(i[o-1],g[o-1],i[o],g[o])*Ev(s[o-1],s[o]);m[o-1]=e}}let w=-1;for(;;){m=[];for(let t=0;t<i.length;t++)for(let r=t;r<i.length;r++)e[r][0]-e[t].at(-1)<n*(e[t].length+e[r].length)&&m.push(Sv(i[t],g[t],i[r],g[r])*Ev(s[t],s[r]));if(0==m.length)break;let t=kv(m);if(t<c)break;let r=0,o=1;for(;r<e.length-1;){let a=Sv(i[r],g[r],i[o],g[o])*Ev(s[r],s[o]);if(e[o][0]-e[r].at(-1)<n*(e[r].length+e[o].length)&&a==t){let t=Nv(i[r],g[r],i[r+1],g[r+1]);i[r]=t.nl,g[r]=t.ne;let n=s[r].map(((e,t)=>e*s[r+1][t])),a=n.reduce(((e,t)=>e+t));s[r]=n.map((function(e){return e/a})),e[r].push(...e[r+1]),e[r]=e[r].sort(((e,t)=>e-t)),i.splice(o,1),g.splice(o,1),e.splice(o,1),s.splice(o,1),o>=e.length&&(r+=1,o=r+1)}else o+=1,o>=e.length&&(r+=1,o=r+1)}if(w==e.length)break;w=e.length}e.forEach(((e,n)=>{let o=Mv(s[n]);e.length>1&&(e.forEach(((e,s)=>{d.push(t[e]),o.mean<=r&&h.push(t[e]),t[e].segment_score=i[n]})),u.push(i[n]),f.push(g[n]),p.push(s[n]))}))}let m=parseInt(1e3*(1-o));0==m&&(m=1);let w=bv.linspace(o,1,m),b={},F={};for(let e=10;e>-1;e--)for(let t=0;t<e/2+1;t++){let n,r,s=e-t,o=w.map(((t,i)=>1-t+t*e/2)),a=e/2;e>0?(n=.5-t/(t+s),r=w.map(((e,i)=>.5-(1-e+e*t)/(2-2*e+(t+s)*e)))):(n=0,r=w.map(((e,t)=>0*e)));for(let i=0;i<u.length;i++){let c=Iv(a*this.globalMean,1,u[i],f[i])*Bv(p[i],.5+n);i in F?F[i].push([e,t,s,c,1]):F[i]=[e,t,s,c,1];let l=0,h=0,d=0;o.forEach(((e,t)=>{if(!isNaN(r[t])){let n=Iv(e*this.globalMean,1,u[i],f[i])*Bv(p[i],.5+r[t]);l+=n,n>h&&(h=n,d=w[t])}})),i in b?b[i].push([e,t,s,l/w.length,d]):b[i]=[e,t,s,l/w.length,d]}for(let e=0;e<u.length;e++)if("germline"==i)b[e].sort(((e,t)=>e[3]-t[3]));else if(b[e].sort(((e,t)=>e[3]-t[3])),"both"==i&&(F[e].sort(((e,t)=>e[3]-t[3])),F[e][0][3]>b[e][0][3])){let t=b[e].filter((t=>t[0]!=F[e][0][0]&&t[1]<=F[e][0][1]));b[e]=[F[e][0]].push(...t)}for(let e=0;e<u.length;e++)b[e][0][0],b[e][0][0],u[e],this.globalMean,xv.t_test_1_sample(this.globalMean,u[e],f[e],g[e])}return{binScore:this.formatDataStructure(this.wigFeatures,"binScore",this.globalMean),segment_score:this.formatDataStructure(this.wigFeatures,"segment_score",this.globalMean)}}formatDataStructure(e,t,i=1){const n=[];for(const[r,s]of Object.entries(e))s.forEach((e=>{var r={...e};1!=i&&(r.value=e[t]/i*2),n.push(r)}));return n}formatDataStructure_BAF(e,t=-1){const i=[],n=[];for(const[r,s]of Object.entries(this.wigFeatures))s.forEach((r=>{var s={...r},o={...r};let a=r[e];.5!=a&&(o.value=t*(1-a),n.push(o)),s.value=t*a,i.push(s)}));return[i,n]}};const Dv=2871e6;function Tv(e){for(var t=1,i=1,n=1*e,r=1;r<50;r++)t*=r,n+=(i*=-1)*Math.pow(e,2*r+1)/(t*(2*r+1));return 2*n/Math.sqrt(3.14159265358979)}function Lv(e,t,i,n,r){var s=new Pv(i.slice(n,r));return 0==s.std&&(s.std=t>0?t*s.mean/e:1),Ov(e,s.mean,s.std,r-n)/(r-n)}function zv(e,t,i,n,r){var s=new Pv(i.slice(n,r));if(s.mean<e){var o=(s.max-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1+Tv(o)),r-n)}o=(s.min-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1-Tv(o)),r-n)}function Hv(e,t,i,n,r,s,o=1e3){for(var a=Lv(e,t,i,n,r),c=0,l=!1;a>s&!l&c<o;){l=!0,c+=1;var[h,d,u,f]=[1e10,1e10,1e10,1e10];if(n>0&&(h=Lv(e,t,i,n-1,r)),r-n>2)var d=Lv(e,t,i,n+1,r),u=Lv(e,t,i,n,r-1);if(r<i.length)var f=Lv(e,t,i,n,r+1);Math.min[f]<a&&(l=!1,h==Math.min[f]&&(n-=1,a=h),elif(d==Math.min[f]),n+=1,a=d,elif(u==Math.min[f]),r-=1,a=u,elif(f==Math.min[f]),r+=1,a=f)}return a<=s?r:0}class Pv{constructor(e){this.data=e,this.mean=e.reduce(((e,t)=>e+t))/e.length,this.std=Math.sqrt(e.reduce(((e,t)=>(t-this.mean)**2))/e.length)}}function Ov(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-xv.TdistributionCDF(Math.abs(r),n-1)}function Uv(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-xv.TdistributionCDF(Math.abs(o),parseInt(a+.5))}var qv=class{constructor(e,t,i){this.rd=e,this.mean=t,this.std=i,this.bin_bands=[2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128]}get_rd_signal_bandwidth(e){var t=[];return e.forEach(((e,i)=>{var n=0;n=e>this.mean/4?this.mean/(this.std**2*e):4/this.std**2,t.push(n)})),t}meanShiftCaller(e,t=3){var i={};return Object.entries(this.rd).forEach((([e,n])=>{var r=new Array(n.length).fill(!1),s=new Array(n.length);for(let e=0;e<n.length;e++)r[e]||(s[e]=n[e]);this.bin_bands.forEach(((e,i)=>{var o=r.map(((e,t)=>!e)),a=[];Object.entries(n).forEach((([e,t])=>{a.push(t.binScore)}));var c=[0],l=0;for(let e=0;e<r.length;e++)r[e]?l>0&&(c.push(c[c.length-1]+l-1),l=0):l+=1;c.shift();for(let i=0;i<t;i++){var h=this.get_rd_signal_bandwidth(a),d=new Array(a.length).fill(0);for(let t=0;t<a.length;t++)for(let i=t-3*e;i<=t+3*e+1;i++)if(!(i<0||i>=a.length||Math.abs(t-i)>=a.length)){var u=(i-t)*Math.exp(-.5*(i-t)**2/e**2)*Math.exp(-.5*(a[t]-a[i])**2*h[t]);d[t]+=u}for(var f=new Array,p=0;p<d.length-1;p++)d[p]<0&d[p+1]>=0&&f.push(p);f.push(d.length-1),f=f.concat(c).sort(((e,t)=>e-t)),f=Array.from(new Set(f));var g=0;for(p=0;p<f.length;p++){var m=a.slice(g,f[p]+1),w=m.reduce(((e,t)=>e+t))/m.length;a.fill(w,g,f[p]+1),g=f[p]+1}}p=0;for(var b=0;p<s.length;p++)o[p]&&(s[p]=a[b],b++);for(f=new Array,p=0;p<s.length-1;p++){Math.abs(s[p+1]-s[p])>.01&&f.push(p+1)}f.unshift(0),f.push(s.length),r=new Array(this.rd.length).fill(!1);for(p=1;p<f.length;p++){var F=[f[p-1],f[p]],v=[f[p-1],f[p-1]];if(!(p>1))continue;v[0]=f[p-2];var y=[f[p],f[p]];if(!(p<f.length-1))continue;y[1]=f[p+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(A<=1)continue;var x=new Pv(s.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(s[v[0]]/this.mean)*this.std;if(Math.abs(s[v[0]]-s[F[0]])<k)continue;if(k=1.8*Math.sqrt(s[y[0]]/this.mean)*this.std,Math.abs(s[y[0]]-s[F[0]])<k)continue}else{var I=s.slice(v[0],v[1]),S=new Pv(I),E=s.slice(y[0],y[1]),N=new Pv(E);if(Uv(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>.01/Dv*bin_size*(A+C))continue;if(Uv(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>.01/Dv*bin_size*(A+_))continue}if(Ov(this.mean,x.mean,x.std,x.data.length)>.05)continue;let e=a.slice(F[0],F[1]);var B=new Pv(e);r.fill(!0,F[0],F[1]),s.fill(B.mean,F[0],F[1])}})),i[e]=s})),i}call_mean_shift(e=3){for(var t=new Array(this.rd.length).fill(!1),i=new Array(this.rd.length),n=0;n<this.rd.length;n++)t[n]||(i[n]=this.rd[n]);return this.bin_bands.forEach(((n,r)=>{var s=t.map(((e,t)=>!e)),o=[];s.forEach(((e,t)=>{e&&o.push(this.rd[t])}));for(var a=[0],c=0,l=0;l<t.length;l++)t[l]?c>0&&(a.push(a[a.length-1]+c-1),c=0):c+=1;a.shift();for(var h=0;h<e;h++){var d=this.get_rd_signal_bandwidth(o),u=new Array(o.length).fill(0);for(l=0;l<o.length;l++)for(var f=l-3*n;f<=l+3*n+1;f++)if(!(f<0||f>=o.length||Math.abs(l-f)>=o.length)){var p=(f-l)*Math.exp(-.5*(f-l)**2/n**2)*Math.exp(-.5*(o[l]-o[f])**2*d[l]);u[l]+=p}var g=new Array;for(l=0;l<u.length-1;l++)u[l]<0&u[l+1]>=0&&g.push(l);g.push(u.length-1),g=g.concat(a).sort(((e,t)=>e-t)),g=Array.from(new Set(g));var m=0;for(l=0;l<g.length;l++){var w=o.slice(m,g[l]+1),b=w.reduce(((e,t)=>e+t))/w.length;o.fill(b,m,g[l]+1),m=g[l]+1}}for(l=0,f=0;l<i.length;l++)s[l]&&(i[l]=o[f],f++);for(g=new Array,l=0;l<i.length-1;l++){Math.abs(i[l+1]-i[l])>.01&&g.push(l+1)}g.unshift(0),g.push(i.length),t=new Array(this.rd.length).fill(!1);for(l=1;l<g.length;l++){var F=[g[l-1],g[l]],v=[g[l-1],g[l-1]];if(l>1){v[0]=g[l-2];var y=[g[l],g[l]];if(l<g.length-1){y[1]=g[l+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(!(A<=1)){var x=new Pv(i.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(i[v[0]]/this.mean)*this.std;if(Math.abs(i[v[0]]-i[F[0]])<k)continue;if(k=1.8*Math.sqrt(i[y[0]]/this.mean)*this.std,Math.abs(i[y[0]]-i[F[0]])<k)continue}else{var I=i.slice(v[0],v[1]),S=new Pv(I),E=i.slice(y[0],y[1]),N=new Pv(E);if(Uv(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>3.483106931382794e-9*(A+C))continue;if(Uv(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>3.483106931382794e-9*(A+_))continue}if(!(Ov(this.mean,x.mean,x.std,x.data.length)>.05)){var B=new Pv(this.rd.slice(F[0],F[1]));t.fill(!0,F[0],F[1]),i.fill(B.mean,F[0],F[1])}}}}}})),i}cnv_calling(e=1e5){var t=.25*this.mean,i=this.mean-t,n=this.mean+t,r=2971e6,s=this.meanShiftCaller(e),o={},a=[];return Object.entries(s).forEach((([c,l])=>{for(var h=!1;!h;){h=!0;var d=new Array(1).fill(0);for(let e=0;e<l.length-1;e++){Math.abs(l[e+1]-l[e])>.01&&d.push(e+1)}d.push(l.length);for(let e=0;e<d.length-2;e++){var u=Math.abs(l[d[e]]-l[d[e+1]]);if(u<t){var f=u+1,p=u+1;if(e>0&&(f=Math.abs(l[d[e]]-l[d[e-1]])),e<d.length-3&&(p=Math.abs(s[d[e+1]]-l[d[e+2]])),u<f&&u<p){h=!1;var g=new Pv(l.slice(d[e],d[e+2]));l.fill(g.mean,d[e],d[e+2]),d.splice(e+1,e+1)}}}}var m=[];Object.entries(this.rd[c]).forEach((([e,t])=>{m.push(t.binScore)}));for(var w,b=new Array(l.length).fill(""),F=0,v=.05*e/r;F<l.length;){for(var y=F,A=F;F<l.length&l[F]<i;)F+=1;if((_=F)>A+1){var C=Hv(this.mean,this.std,m,A,_,v);if(C){var _=C;b.fill("D",A,_)}}for(A=F;F<l.length&l[F]>n;)F+=1;(_=F)>A+1&&(C=Hv(this.mean,this.std,m,A,_,v))&&(_=C,b.fill("A",A,_)),F==y&&(F+=1)}for(F=0;F<l.length;){for(;F<l.length&""!=b[F];)F+=1;for(A=F;F<l.length&l[F]<i;)F+=1;(_=F)>A+1&&(zv(this.mean,this.std,m,A,_)<1682935038707506e-26&&b.fill(["d"]*(_-A),A,_),F-=1),F+=1}(F=0)<l.length&&(w=b[F]),A=0;for(var x=[...m];F<l.length;){for(;b[F]==w&&!((F+=1)>=b.length););if(F>A){var k=new Pv(x.slice(A,F));x.fill(k.mean,A,F)}F<l.length&&(w=b[F]),A=F}for(o[c]=x,F=0;F<l.length;){if(""==(w=b[F])){F+=1;continue}for(A=F;F<l.length&w==b[F];)F+=1;let t,i=new Pv(x.slice(A,F)).mean/this.mean;t="D"==w?"deletion":"duplication";let n={chr:c,start:e*A+1,end:e*F,size:e*(F-A+1),value:2*i,event_type:t};a.push(n)}})),[o,a]}};class Qv{constructor(e,t){this.allVariants=e,this.rowBinSize=1e4,this.binSize=t,this.binFactor=parseInt(t/this.rowBinSize)}async read_rd_baf(e="ReadDepth"){var t={};for(let e=this.allVariants.length-1;e>=0;e--){var i;let n=this.allVariants[e];this.allVariants.splice(e,1);let r=n.chr;i=Math.max(Math.floor(n.start/this.rowBinSize),0),t[r]||(t[r]=[]),t[r][i]||(t[r][i]={chr:r,start:i*this.rowBinSize,end:(i+1)*this.rowBinSize,dp_sum_score:0,dp_count:0,hets_count:0,hets:[]});const s=Object.values(n.calls);if(1!==s.length)throw Error(`Unexpected number of genotypes: ${s.length}. CNVPytor expects 1 and only 1 genotype`);const o=s[0],a=o.info.DP;a&&(t[r][i].dp_sum_score+=Number.parseInt(a),t[r][i].dp_count++);let c=o.info.AD.split(","),l=o.genotype;if(0==l[0]&&1==l[1]||1==l[0]&&0==l[1]){t[r][i].hets_count++;let e=parseInt(c[0]),n=parseInt(c[1]);t[r][i].hets.push({ref:e,alt:n})}}this.chromosomes=Object.keys(t);var n,r=this.adjust_bin_size(t);if("ReadDepth"==e){n=new jv(r,this.binSize).ReadDepth_caller();var s=this.formatDataStructure_BAF(r,"max_likelihood")}else if("2D"==e){let e=new Rv(r,this.binSize),t=await e.call_2d();n=[t.binScore,[],t.segment_score];s=e.formatDataStructure_BAF("max_likelihood",-1)}return[n,s]}formatDataStructure(e,t,i=1){const n=[];for(const[s,o]of Object.entries(e))for(let e of o){var r={...e};1!=i&&(r.value=e[t]/i*2),n.push(r)}return n}format_BAF_likelihood(e){const t=[];for(const[n,r]of Object.entries(e))for(let e of r){var i={...e};.5!=e.value&&(i.value=1-e.value,t.push(i))}return t}get_max_min_score(e){if(e.likelihood_score.length>0){const t=Math.max(...e.likelihood_score),i=e.likelihood_score.indexOf(t);e.value=Math.max(i/100,1-i/100),e.min_score=Math.min(i/100,1-i/100)}else e.score=0;return e}async getAllbins(){const e=await this.computeDepthFeatures();return new bv.GetFit(e).fit_data(),e}formatDataStructure_BAF(e,t,i=-1){const n=[],r=[];for(const[a,c]of Object.entries(e))for(let e of c){var s={...e},o={...e};let a=e[t];.5!=a&&(o.value=i*(1-a),r.push(o)),s.value=i*a,n.push(s)}return[n,r]}adjust_bin_size(e){var t={};for(let r of this.chromosomes){t[r]||(t[r]=[]);for(let s=0;s<e[r].length/this.binFactor;s++){const o=s;t[r][s]||(t[r][s]={chr:r,start:o*this.binSize,end:(o+1)*this.binSize,dp_count:0,hets_count:0,binScore:0,likelihood_score:[],dp_sum_score:0});for(var i=s*this.binFactor;i<this.binFactor*s+this.binFactor;i++)if(e[r][i]&&(t[r][s].dp_sum_score+=e[r][i].dp_sum_score,t[r][s].dp_count+=e[r][i].dp_count,t[r][s].hets_count+=e[r][i].hets_count,0!=e[r][i].hets.length))for(let o of e[r][i].hets)if(0==t[r][s].likelihood_score.length)t[r][s].likelihood_score=bv.linspace(0,1,100).map(((e,t)=>Vv(o.ref,o.alt,e)));else{var n=0;t[r][s].likelihood_score=bv.linspace(0,1,100).map(((e,i)=>{var a=t[r][s].likelihood_score[i]*Vv(o.ref,o.alt,e);return n+=a,a})),t[r][s].likelihood_score=bv.linspace(0,1,100).map(((e,i)=>t[r][s].likelihood_score[i]/n))}t[r][s].binScore=100*parseInt(t[r][s].dp_sum_score/t[r][s].dp_count);const a=this.get_max_min_score(t[r][s]);t[r][s].max_likelihood=a.value}}return t}}function Vv(e,t,i,n=!0){return Math.pow(i,e)*Math.pow(1-i,t)+Math.pow(i,t)*Math.pow(1-i,e)}class jv{constructor(e,t){this.wigFeatures=e,this.binSize=t}ReadDepth_caller(){var e=new bv.GetFit(this.wigFeatures),[t,i]=e.fit_data(),n=new qv(this.wigFeatures,t,i),r=n.meanShiftCaller(this.binSize),s=n.cnv_calling();return Object.entries(this.wigFeatures).forEach((([e,t])=>{t.forEach(((t,i)=>{t.partition_level=parseInt(r[e][i]),t.partition_call=parseInt(s[0][e][i])}))})),[this.formatDataStructure("binScore",t),this.formatDataStructure("partition_level",t),this.formatDataStructure("partition_call",t),s[1]]}formatDataStructure(e,t=1){const i=[];for(const[r,s]of Object.entries(this.wigFeatures))for(let r of s){var n={...r};1!=t&&(n.value=r[e]/t*2),i.push(n)}return i}}class Wv extends Hl{static DEFAULT_TRACK_HEIGHT=250;constructor(e,t){super(e,t)}init(e){this.featureType="numeric",this.type="cnvpytor",e.max||(this.defaultScale=!0,this.autoscale=!1),e.height||(e.height=Wv.DEFAULT_TRACK_HEIGHT),this.type="cnvpytor",this.graphType=e.graphType||"points",this.bin_size=e.bin_size||1e5,this.signal_name=e.signal_name||"rd_snp",this.cnv_caller=e.cnv_caller||"2D",this.colors=e.colors||["gray","black","green","blue"],super.init(e)}get supportsWholeGenome(){return!0}get_signals(){let e=[];return"rd_snp"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller,"BAF1","BAF2"]:"rd"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller]:"snp"==this.signal_name?e=["BAF1","BAF2"]:"cnh"==this.signal_name&&(e=[this.cnv_caller]),e}get_signal_colors(){return[{singal_name:"RD_Raw",color:this.colors[0]},{singal_name:"RD_Raw_gc_coor",color:this.colors[1]},{singal_name:"ReadDepth",color:this.colors[2]},{singal_name:"2D",color:this.colors[2]},{singal_name:"BAF1",color:this.colors[3]},{singal_name:"BAF2",color:this.colors[3]}]}async postInit(){if("vcf"==this.config.format){let e;this.featureSource?e=Object.values(this.featureSource.getAllFeatures()).flat():(this.featureSource=this.featureSource||Ad(this.config,this.browser.genome),this.header=await this.getHeader(),e=this.featureSource.reader.features);const t=new Qv(e,this.bin_size);let i,n,r;this.wigFeatures_obj={},this.wigFeatures_obj[this.bin_size]={},"2D"==this.cnv_caller?(r=await t.read_rd_baf("2D"),i=r[0],n=r[1],this.wigFeatures_obj[this.bin_size]["2D"]=i[2],this.available_callers=["2D"]):(r=await t.read_rd_baf(),i=r[0],n=r[1],this.wigFeatures_obj[this.bin_size].ReadDepth=i[2],this.available_callers=["ReadDepth"]),this.wigFeatures_obj[this.bin_size].RD_Raw=i[0],this.wigFeatures_obj[this.bin_size].RD_Raw_gc_coor=i[1],this.wigFeatures_obj[this.bin_size].BAF1=n[0],this.wigFeatures_obj[this.bin_size].BAF2=n[1],this.available_bins=[this.bin_size],this.set_available_callers()}else this.cnvpytor_obj=new gv(this.config.url,this.bin_size),this.wigFeatures_obj=await this.cnvpytor_obj.get_rd_signal(this.bin_size),this.available_bins=this.cnvpytor_obj.available_bins,this.available_callers=this.cnvpytor_obj.callers,this.set_available_callers();this.tracks=[];const e=[];this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(let t in this.wigFeatures_obj)for(const[i,n]of Object.entries(this.wigFeatures_obj[t]))if(this.signals.includes(i)){let t={type:"wig"};t.features=n,t.name=i,t.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(t);r?(r.isMergedTrack=!0,r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+t),"function"==typeof r.postInit&&e.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(e)}set_available_callers(){this.available_callers.includes(this.cnv_caller)||(this.available_callers.length>0?this.cnv_caller=this.available_callers[0]:this.cnv_caller=null)}async getHeader(){if(!this.header){if("function"==typeof this.featureSource.getHeader){const e=await this.featureSource.getHeader();e&&(this.callSets=e.callSets||[]),this.header=e}this.sampleKeys=this.callSets?this.callSets.map((e=>e.sample)):[],this.sampleNames=this.sampleKeys}return this.header}get height(){return this._height}set height(e){if(this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}menuItemList(){let e=[];void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e=e.concat(this.numericDataMenuItems()),e.push("<hr/>"),e.push("Bin Sizes");for(let t of this.available_bins){const i=Dl(t,t===this.bin_size);e.push({object:Bt(i),click:async function(){this.bin_size=t,this.trackView.startSpinner(),await this.recreate_tracks(t),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}})}e.push("<hr/>"),e.push("Signal Type");let t={rd_snp:"RD and BAF Likelihood",rd:"RD Signal",snp:"BAF Likelihood"};for(let i in t){const n=Dl(t[i],i===this.signal_name);e.push({object:Bt(n),click:async function(){this.signal_name=i,await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}})}e.push("<hr/>"),e.push("CNV caller");for(let t of this.available_callers){const i=Dl(t,t===this.cnv_caller);e.push({object:Bt(i),click:async function(){this.cnv_caller=t,this.trackView.startSpinner(),await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}})}if(this.variantState){e.push("<hr/>");for(let t of this.available_callers)e.push({label:"Convert to variant track",click:()=>{this.convertToVariant()}})}return e}async recreate_tracks(e){this.tracks=[];const t=[];e in this.wigFeatures_obj||(this.wigFeatures_obj={...this.wigFeatures_obj,...await this.cnvpytor_obj.get_rd_signal(e)}),this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(const[i,n]of Object.entries(this.wigFeatures_obj[e]))if(this.signals.includes(i)){let e={type:"wig"};e.features=n,e.name=i,e.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(e);r?(r.isMergedTrack=!0,r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+e),"function"==typeof r.postInit&&t.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(t)}async getFeatures(e,t,i,n){if(this.tracks){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n)));return Promise.all(r)}}getScaleFactor(e,t,i,n){return n?i/(Math.log10(t+1)-(e<=0?0:Math.log10(e+1))):i/(t-e)}computeYPixelValue(e,t){return(this.flipAxis?e-this.dataRange.min:this.dataRange.max-e)*t}computeYPixelValueInLogScale(e,t){let i=this.dataRange.max,n=this.dataRange.min;return i<=0?0:(n<=-1&&(n=0),n=n<=0?0:Math.log10(n+1),i=Math.log10(i+1),e=Math.log10(e+1),(this.flipAxis?e-n:i-e)*t)}draw(e){const t=e.features;if(!t)return;if(this.defaultScale&&("rd_snp"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||5}:"rd"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||0,max:this.config.max||this.dataRange.max||5}:"snp"==this.signal_name&&(this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||0})),this.autoscale&&(this.dataRange=function(e,t){let i=0,n=-Number.MAX_VALUE;for(let e of t)for(let t of e)void 0===t.value||Number.isNaN(t.value)||(i=Math.min(i,t.value),n=Math.max(n,t.value));return{min:i,max:n}}(e.referenceFrame.chr,t)),this.tracks)for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t[i],this.tracks[i].dataRange=this.dataRange,this.tracks[i].flipAxis=this.flipAxis,this.tracks[i].logScale=this.logScale,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}const i=this.getScaleFactor(this.dataRange.min,this.dataRange.max,e.pixelHeight,this.logScale),n=e=>this.logScale?this.computeYPixelValueInLogScale(e,i):this.computeYPixelValue(e,i);if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=n(t.y),r={strokeStyle:t.color,strokeWidth:1};t.dotted?xo.dashedLine(e.context,0,i,e.pixelWidth,i,5,r):xo.strokeLine(e.context,0,i,e.pixelWidth,i,r)}let r=n(2);xo.dashedLine(e.context,0,r,e.pixelWidth,r,5,{strokeStyle:"lightgray",strokeWidth:.5})}paintAxis(e,t,i){var n,r,s,o,a,c,l,h={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};if(void 0===this.dataRange||void 0===this.dataRange.max||void 0===this.dataRange.min)return;let d=void 0!==this.flipAxis&&this.flipAxis;function u(e){return e<0?Math.abs(e):0===e?"0":Math.abs(e)>=10||e%1==0?e.toFixed():Math.abs(e)>=1?e.toFixed(1):e.toFixed(2)}xo.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"}),n=(l=.95*t)-8,a={x:r=l,y:s=o=.01*i},xo.strokeLine(e,n,s,r,o,h),xo.fillText(e,u(d?this.dataRange.min:this.dataRange.max),n+4,s+12,h),c={x:r,y:s=o=.99*i},xo.strokeLine(e,n,s,r,o,h),xo.fillText(e,u(d?this.dataRange.max:this.dataRange.min),n+4,s-4,h),xo.strokeLine(e,a.x,a.y,c.x,c.y,h);const f=this.getScaleFactor(this.dataRange.min,this.dataRange.max,i,this.logScale),p=e=>this.logScale?this.computeYPixelValueInLogScale(e,f):this.computeYPixelValue(e,f),g=Math.ceil((this.dataRange.max-this.dataRange.min)/10);for(let t=Math.ceil(this.dataRange.min+1);t<Math.round(this.dataRange.max-.4);t+=g){const i=p(t);xo.strokeLine(e,45,i,50,i,h),xo.fillText(e,u(d?this.dataRange.max-t:t),44,i+4,h)}}popupData(e,t){const i=t||e.viewport.cachedFeatures;if(i&&i.length===this.tracks.length){const t=[];for(let n=0;n<this.tracks.length;n++){n>0&&t.push("<hr/>"),t.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${this.tracks[n].name}</div>`);const r=this.tracks[n].popupData(e,i[n]);t.push(...r)}return t}}async convertToVariant(){this.variantState&&(Object.setPrototypeOf(this,Kv.prototype),this.init(this.variantState),await this.postInit(),this.trackView.clearCachedFeatures(),this.variantState.trackHeight&&this.trackView.setTrackHeight(this.variantState.trackHeight),this.trackView.checkContentHeight(),this.trackView.updateViews(),delete this.variantState)}}const Gv=Mt,$v=10;class Kv extends Hl{static defaults={displayMode:"EXPANDED",sortDirection:"ASC",showGenotypes:!0,expandedVariantHeight:10,squishedVariantHeight:2,squishedCallHeight:1,expandedCallHeight:10,expandedVGap:2,squishedVGap:1,expandedGroupGap:10,squishedGroupGap:5,featureHeight:14,noGenotypeColor:"rgb(200,180,180)",noCallColor:"rgb(225, 225, 225)",nonRefColor:"rgb(200, 200, 215)",mixedColor:"rgb(200, 220, 200)",homrefColor:"rgb(200, 200, 200)",homvarColor:"rgb(17,248,254)",hetvarColor:"rgb(34,12,253)",refColor:"rgb(0,0,220)",altColor:"rgb(255,0,0)",visibilityWindow:void 0,labelDisplayMode:void 0,type:"variant"};_sortDirections=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),e.variantHeight&&(this.expandedVariantHeight=e.variantHeight),this.featureSource=Ad(e,this.browser.genome),this.colorTables=new Map,e.colorTable){const t=e.colorBy||"*";this.colorTables.set(t,new ao(e.colorTable))}if(this.strokecolor=e.strokecolor,this._context_hook=e.context_hook,e.color&&(this.colorBy=void 0),this.nVariantRows=1,e.samples)for(let t of e.samples)this.sampleKeys=e.samples;e.sort&&(this.initialSort=e.sort),this._colorByItems=new Map([["none","None"]])}async postInit(){if(this.header=await this.getHeader(),this.header.INFO){const e=new Set(Object.keys(this.header.INFO));this.config.colorBy?this.colorBy=this.config.colorBy:!this.config.color&&e.has("AF")&&(this.colorBy="AF"),e.has("AF")&&this._colorByItems.set("AF","Allele frequency"),e.has("VT")&&this._colorByItems.set("VT","Variant Type"),e.has("SVTYPE")&&this._colorByItems.set("SVTYPE","SV Type")}if(this.config.colorBy&&!this._colorByItems.has(this.config.colorBy)&&this._colorByItems.set(this.config.colorBy,this.config.colorBy),!this.disposed){if(this.header&&!this.sampleKeys&&(this.sampleKeys=this.header.sampleNameMap?Array.from(this.header.sampleNameMap.keys()):[]),void 0===this.visibilityWindow&&!1!==this.config.indexed){const e=Ht(this.config.url)?this.config.url.name:this.config.url;Gv(e)&&e.toLowerCase().includes("gnomad")?this.visibilityWindow=1e3:"function"==typeof this.featureSource.defaultVisibilityWindow?this.visibilityWindow=await this.featureSource.defaultVisibilityWindow():this.visibilityWindow=1e6}return this}}get supportsWholeGenome(){return!this.config.indexURL||!0===this.config.supportsWholeGenome}get color(){return this._color||"rgb(0,0,150)"}set color(e){this._color=e,e&&(this.colorBy=void 0)}async getHeader(){return this.header||"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader()),this.header}getSampleCount(){return this.sampleKeys?this.sampleKeys.length:0}async getFeatures(e,t,i,n){void 0===this.header&&(this.header=await this.getHeader());const r=await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:this.visibilityWindow});if(this.initialSort){const e=this.initialSort;if(void 0===e.option||"GENOTYPE"===e.option.toUpperCase())this.sortSamplesByGenotype(e,r);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="ASC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return r}hasSamples(){return this.getSampleCount()>0}getSamples(){const e="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=t*(("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight)+e),r=$v+t*(i+e);return{names:this.sampleKeys,yOffset:r,height:n}}computePixelHeight(e){if(!e||0===e.length)return $v;const t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,n="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,r="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s=!1===this.showGenotypes?0:this.getSampleCount()*t;return $v+t*(n+i)+i+(s+1)*(r+i)}variantRowCount(e){this.nVariantRows=e}draw({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n,bpStart:r,pixelTop:s,features:o}){xo.fillRect(e,0,s,t,i,{fillStyle:"rgb(255, 255, 255)"});const a="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,c="COLLAPSED"===this.displayMode?1:this.nVariantRows,l="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight;this.variantBandHeight=$v+c*(l+a);let h=this.sampleColumns;const d=this.hasSamples();if(h&&d&&!1!==this.showGenotypes&&xo.strokeLine(e,0,this.variantBandHeight,t,this.variantBandHeight,{strokeStyle:"rgb(224,224,224) "}),o){const i="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,a=r+t*n+1;for(let t of o){if(t.end<r)continue;if(t.start>a)break;const o="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,c=$v+("COLLAPSED"===this.displayMode?0:t.row*(o+s)),l=o;let h=(t.start-r)/n,u=(t.end-r)/n,f=Math.max(1,u-h);f<3?(f=3,h-=1):f>5&&(h+=1,f-=2);const p=t._f||t;let g;try{g=p.alleleFreq()}catch(e){console.log(e)}if("AF"===this.colorBy&&g){const t=Math.min(1,g)*l,i=l-t;e.fillStyle=p.isFiltered()?this.refColorFiltered:this.refColor,e.fillRect(h,c,f,i),e.fillStyle=p.isFiltered()?this.altColorFiltered:this.altColor,e.fillRect(h,c+i,f,t)}else e.fillStyle=this.getColorForFeature(p),e.fillRect(h,c,f,l);let m=this.getVariantStrokecolor(p);if(m&&(e.strokeStyle=m,e.strokeRect(h,c,f,l)),this.callContextHook(p,e,h,c,f,l),d&&!1!==this.showGenotypes){const t="COLLAPSED"===this.displayMode?1:this.nVariantRows;this.sampleYOffset=this.variantBandHeight+s,this.sampleHeight=t*(i+s);let n=0;for(let t of this.sampleKeys){const r=this.header.sampleNameMap.get(t),o=p.calls[r];if(o){const t="COLLAPSED"===this.displayMode?0:p.row,r=this.sampleYOffset+n*this.sampleHeight+t*(i+s);let a=!0,c=!0,l=!1;if(o.genotype)for(let e of o.genotype){if("."===e){l=!0;break}0!==e&&(c=!1),0===e&&(a=!1)}o.genotype?e.fillStyle=l?this.noCallColor:c?this.homrefColor:a?this.homvarColor:this.hetvarColor:e.fillStyle=this.noGenotypeColor,e.fillRect(h,r,f,i)}n++}}}}else console.log("No feature list")}get refColorFiltered(){return this._refColorFiltered||(this._refColorFiltered=_s.addAlpha(this.refColor,.2)),this._refColorFiltered}get altColorFiltered(){return this._altColorFiltered||(this._altColorFiltered=_s.addAlpha(this.altColor,.2)),this._altColorFiltered}getColorForFeature(e){const t=e._f||e;let i;if(this.colorBy&&"none"!==this.colorBy){const e=t.getAttributeValue(this.colorBy);i=void 0!==e?this.getVariantColorTable(this.colorBy).getColor(e):"gray"}else i=this.color?"function"==typeof this.color?this.color(e):this.color:"NONVARIANT"===t.type?this.nonRefColor:"MIXED"===t.type?this.mixedColor:this.color;return t.isFiltered()&&(i=_s.addAlpha(i,.2)),i}getVariantStrokecolor(e){const t=e._f||e;let i;return i=this.strokecolor?"function"==typeof this.strokecolor?this.strokecolor(t):this.strokecolor:void 0,i}callContextHook(e,t,i,n,r,s){if(this._context_hook&&"function"==typeof this._context_hook){const o=e._f||e;t.save(),this._context_hook(o,t,i,n,r,s),t.restore()}}clickedFeatures(e){let t=super.clickedFeatures(e);const i="EXPANDED"===this.displayMode?this.expandedVGap:this.squishedVGap,n=i+("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight),r=e.y;if(r<=this.variantBandHeight){const e="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=Math.floor((r-$v)/(e+i));"COLLAPSED"!==this.displayMode&&(t=t.filter((e=>e.row===n)))}else if(this.sampleKeys){const e=r-this.variantBandHeight,i=Math.floor(e/this.sampleHeight);if(i>=0&&i<this.sampleKeys.length){const r=Math.floor((e-i*this.sampleHeight)/n),s="COLLAPSED"===this.displayMode?t:t.filter((e=>e.row===r)),o=this.sampleKeys[i],a=this.header.sampleNameMap.get(o);t=s.map((e=>{const t=e.calls[a];return t.genotypeString=function(e,t){if(e.genotype){let i="";if("."===t.alternateBases)i="No Call";else{const n=t.alternateBases.split(",");for(let r of e.genotype)if(i.length>0&&(i+=" | "),"."===r)i+=".";else if(0===r)i+=t.referenceBases;else{i+=n[r-1].replace("<","&lt;")}}return i}}(t,e),t}))}}return t}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=this.browser.genome.id;let r=[];for(let e of t){const t=e._f||e;if(r.length>0&&r.push({html:'<hr style="border-top-width:2px ;border-color: #c9c3ba" />'}),"function"==typeof t.popupData){const e=t.popupData(i,n);Array.prototype.push.apply(r,e)}}return r}menuItemList(){const e=[];if(this.header.INFO&&this.header.INFO){const t=this._colorByItems;e.push("<hr/>");const i=Bt('<div class="igv-track-menu-category igv-track-menu-border-top">');i.text("Color by:"),e.push({name:void 0,object:i,click:void 0,init:void 0});for(let n of t.keys()){const r=this.colorBy===n;e.push(this.colorByCB({key:n,label:t.get(n)},r))}e.push(this.colorByCB({key:"info",label:"Info field..."}))}if(!0===Hf(this.browser.sampleInfo,this.sampleKeys)){e.push("<hr/>"),e.push("Sort by attribute:");for(const s of this.browser.sampleInfo.attributeNames)if(this.sampleKeys.some((e=>{const t=this.browser.sampleInfo.getAttributes(e);return t&&t[s]}))){const o=Bt("<div>");function a(){const e=this._sortDirections.get(s)||1;this.sortByAttribute(s,e),this.config.sort={option:"ATTRIBUTE",attribute:s,direction:e>0?"ASC":"DESC"},this._sortDirections.set(s,-1*e)}o.html(`&nbsp;&nbsp;${s.split(Uu.emptySpaceReplacement).join(" ")}`),e.push({object:o,click:a})}}e.push("<hr/>"),this.getSampleCount()>0&&(e.push({object:Bt('<div class="igv-track-menu-border-top">')}),e.push({object:Bt(Dl("Show Genotypes",this.showGenotypes)),click:function(){this.showGenotypes=!this.showGenotypes,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.browser.sampleNameControl.performClickWithState(this.browser,this.showGenotypes),this.browser.sampleInfoControl.performClickWithState(this.browser,this.showGenotypes)}})),e.push({object:Bt('<div class="igv-track-menu-border-top">')});for(let c of["COLLAPSED","SQUISHED","EXPANDED"]){e.push({object:Bt(Dl({COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"}[c],c===this.displayMode)),click:function(){this.displayMode=c,this.trackView.checkContentHeight(),this.trackView.repaintViews()}})}return this.browser.circularView&&(e.push("<hr>"),e.push({label:"Add SVs to circular view",click:function(){for(let e of this.trackView.viewports)this.sendChordsForViewport(e)}})),this.canCovertToPytor()&&(e.push("<hr>"),e.push({label:"Convert to CNVpytor track",click:function(){this.convertToPytor()}})),e}contextMenuItemList(e){const t=[];if(this.hasSamples()&&this.showGenotypes){const i=e.viewport.referenceFrame,n=e.genomicLocation,r=i.toBP(2.5),s=this._sortDirections.get("genotype")||1;this._sortDirections.set("genotype",-1*s),t.push({label:"Sort by genotype",click:t=>{const i={direction:s,option:"genotype",chr:e.viewport.referenceFrame.chr,start:Math.floor(n-r),end:Math.ceil(n+r)},o=e.viewport.cachedFeatures;this.sortSamplesByGenotype(i,o),this.config.sort=i}}),t.push("<hr/>")}if(this.browser.circularView){const i=e.viewport;t.push({label:"Add SVs to Circular View",click:()=>{this.sendChordsForViewport(i)}}),t.push("<hr/>")}return t}async sortSamplesByGenotype({chr:e,position:t,start:i,end:n,direction:r},s){if(void 0===i&&(i=t-1),void 0===n&&(n=t),s||(s=await this.featureSource.getFeatures({chr:e,start:i,end:n})),!s)return;const o=new Map,a="ASC"===r?1:-1;for(let e of s)if(!(e.end<i)){if(e.start>n)break;for(let t of e.calls){const e=t.sample,i=t.zygosityScore();o.set(e,o.has(e)?o.get(e)+i:i)}}this.sampleKeys.sort((function(e,t){let i=o.get(e)||0,n=o.get(t)||0;return a*(i-n)})),this.trackView.repaintViews()}sortByAttribute(e,t){this.config.sort={option:"ATTRIBUTE",attribute:e,direction:1===t?"ASC":"DESC"},this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}sendChordsForViewport(e){const t=e.referenceFrame;let i;if("all"===t.chr){const e=this.featureSource.getAllFeatures(),t=Object.keys(e).map((t=>e[t]));i=[].concat(...t)}else i=this.featureSource.featureCache.queryFeatures(t.chr,t.start,t.end);Hm(i.filter((e=>{const t=e._f||e;return t.info&&t.info.CHR2&&t.info.END&&(t.info.CHR2!==t.chr||Math.abs(Number.parseInt(t.info.END)-t.pos)>1e6)})).map((e=>{const t=e._f||e,i=Number.parseInt(t.info.END),n=i-100,r=i+100;return{uniqueId:`${t.chr}:${t.start}-${t.end}_${t.info.CHR2}:${t.info.END}`,refName:Lm(t.chr),start:t.start,end:t.end,mate:{refName:Lm(t.info.CHR2),start:n,end:r}}})),this,t,.5)}colorByCB(e,t){const i=Bt(Dl(e.label,t));if("info"!==e.key){function n(){const t="none"===e.key?void 0:e.key;this.colorBy=t,this.config.colorBy=t,this.trackView.repaintViews()}return{name:void 0,object:i,click:n,init:void 0}}{function r(e){this.browser.inputDialog.present({label:"Info field",value:"",callback:e=>{e?(this.colorBy=e,this._colorByItems.set(e,e)):this.colorBy=void 0,this.trackView.repaintViews()}},e)}return{name:void 0,object:i,dialog:r,init:void 0}}}getState(){const e=super.getState();return this.color&&"function"!=typeof this.color&&(e.color=this.color),e}getVariantColorTable(e){if(this.colorTables.has(e))return this.colorTables.get(e);if(this.colorTables.has("*"))return this.colorTables.get("*");{let t;if("SVTYPE"===e)t=Yv;else t=new oo("Set1");return this.colorTables.set(e,t),t}}paintAxis(){}canCovertToPytor(){return!this.config.indexURL&&(!!this.header&&(1===Object.keys(this.sampleKeys).length&&this.header.FORMAT&&this.header.FORMAT.AD&&this.header.FORMAT.DP))}async convertToPytor(){this.variantState={...this.config,...this.getState()},this.variantState.trackHeight=this.height,this.trackView.startSpinner(),setTimeout((async()=>{try{const e=Object.assign({},this.config);Object.setPrototypeOf(this,Wv.prototype),this.init(e),await this.postInit(),this.trackView.clearCachedFeatures(),this.trackView.setTrackHeight(this.config.height||Wv.DEFAULT_TRACK_HEIGHT),this.trackView.checkContentHeight(),this.trackView.updateViews(),this.trackView.track.autoHeight=!1}finally{this.trackView.stopSpinner()}}),100)}}const Yv=new ao({DEL:"#ff2101",INS:"#001888",DUP:"#028401",INV:"#008688",CNV:"#8931ff",BND:"#891100","*":"#002eff"}),Xv={timeout:5e3,type:"plain",url:"https://igv.org/genomes/locus.php?genome=$GENOME$&name=$FEATURE$",coords:0};async function Zv(e,t){const i=e.searchConfig||Xv;let n;const r=e.tracks.filter((e=>e.searchable));for(let e of r){const i=await e.search(t);if(i)return i}if(e.config&&!1!==e.config.search)try{return n=await async function(e,t,i){let n=i.url.replace("$FEATURE$",t.toUpperCase());n.indexOf("$GENOME$")>-1&&(n=n.replace("$GENOME$",e.genome.id?e.genome.id:"hg19"));const r=i.timeout?{timeout:i.timeout}:void 0,s=await Qs.loadString(n,r);return function(e,t,i){let n;n="plain"===i.type?function(e,t){const i=[],n=Dt(t);for(let t of n){const n=t.split("\t");if(n.length>=3){const t=n[1].split(":"),r=t[1].split("-");i.push({chromosome:e.genome.getChromosomeName(t[0].trim()),start:parseInt(r[0].replace(/,/g,"")),end:parseInt(r[1].replace(/,/g,"")),name:n[0].toUpperCase()})}}return i}(e,t):JSON.parse(t);i.resultsField&&(n=n[i.resultsField]);if(n&&0!==n.length){const e=i.chromosomeField||"chromosome",t=i.startField||"start",r=i.endField||"end",s=i.coords||1;let o;o=Array.isArray(n)?n[0]:n,o.hasOwnProperty(e)&&o.hasOwnProperty(t)||console.error("Search service results must include chromosome and start fields: "+o);const a=o[e];let c=o[t]-s,l=o[r];void 0===l&&(l=c+1);const h={chr:a,start:c,end:l};if(!o.type||o.type,i.geneField&&i.snpField){const e=o[i.geneField]||o[i.snpField];e&&(h.name=e.toUpperCase())}return h}return}(e,s,i)}(e,t,i),n}catch(e){console.log("Search service not available "+e)}}function Jv(e,t=!1){const i=e.split("\t");if(i.length>2)try{const e=i[0],t=parseInt(i[1].replace(/,/g,""),10)-1,n=parseInt(i[2].replace(/,/g,""),10);if(!isNaN(t)&&!isNaN(n))return{chr:e,start:t,end:n}}catch(e){}const n=e.split(":"),r={chr:n[0]};if(n.length>1){let e,i=n[1].split("-");if(i.length>2){if(!n[1].startsWith("-"))return;{const e=n[1].indexOf("-",1);if(e>0){i=[n[1].substring(0,e),n[1].substring(e+1)]}}}if(e=i[0].replace(/,/g,""),isNaN(e))return;if(r.start=parseInt(e,10)-1,r.end=r.start+1,1===i.length&&(r.start-=20,r.end+=20),2===i.length){if(e=i[1].replace(/,/g,""),isNaN(e))return;if(r.end=parseInt(e,10),r.start<0&&!t){const e=-extent.start;r.start+=e,r.end+=e}}}return r}class ey extends Hl{constructor(e,t){super(e,t)}init(e){super.init(e),this.type="qtl",this.name=e.name;const t=e.minLogP||e.min,i=e.maxLogP||e.max;this.dataRange={min:void 0!==t?t:3.5,max:i||25},this.autoscale=!i||e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||2,this.height=e.height||100,this.autoHeight=!1,this.disableButtons=e.disableButtons,this.featureSource=Ad(e,this.browser.genome)}paintAxis(e,t,i){const n=(this.dataRange.max-this.dataRange.min)/i,r={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};xo.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});const s=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let o=4;o<=this.dataRange.max;o+=s){const s=.85*t,a=s-5,c=s,l=i-(o-this.dataRange.min)/n;xo.strokeLine(e,a,l,c,l,r),l>8&&xo.fillText(e,o,a-1,l+2,r)}r.textAlign="center",xo.fillText(e,"-log10(pvalue)",t/4,i/2,r,{rotate:{angle:-90}})}async getFeatures(e,t,i){const n=this.visibilityWindow;return await this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const{context:t,referenceFrame:i,pixelWidth:n,pixelHeight:r}=e;this.background&&xo.fillRect(t,0,0,n,r,{fillStyle:this.background}),xo.strokeLine(t,0,r-1,n,r-1,{strokeStyle:this.divider}),i.feature&&i.feature.match(/RS[0-9]+/);const s=i=>{const s=i?2*this.dotSize:this.dotSize,o=e.bpStart,a=(this.dataRange.max-this.dataRange.min)/r;for(let d of e.features){const u=(d.start-o+.5)/e.bpPerPixel;if(u<0)continue;if(u>n)break;const f=d.phenotype;let p;if(this.browser.qtlSelections.qtl?(l=this.browser.qtlSelections.qtl,h=d,p=l.chr===h.chr&&l.start===h.start&&l.pValue===h.pValue):p=this.browser.qtlSelections.snps.size>0?this.browser.qtlSelections.hasSnp(d.snp)&&this.browser.qtlSelections.hasPhenotype(f):this.browser.qtlSelections.hasPhenotype(f),!i||p){var c=-Math.log(d.pValue)/Math.LN10;if(c>=this.dataRange.min){let e;c>this.dataRange.max?(c=this.dataRange.max,e=!0):e=!1;const n=Math.max(0+s,r-Math.round((c-this.dataRange.min)/a));let o;d.px=u,d.py=n,d.radius=s,i&&p?(o=this.browser.qtlSelections.colorForGene(f),xo.setProperties(t,{fillStyle:o,strokeStyle:"black"})):(o=e?"rgb(150, 150, 150)":"rgb(180, 180, 180)",xo.setProperties(t,{fillStyle:o,strokeStyle:o})),xo.fillCircle(t,u,n,s),xo.strokeCircle(t,u,n,s)}}}var l,h};s(!1),s(!0)}popupData(e,t){if(void 0===t&&(t=e.viewport.cachedFeatures),!t||0===t.length)return[];const i=this.name,n=[];for(let r of this._clickedFeatures(e,t))n.length>0&&n.push("<hr/>"),"function"==typeof r.popupData?n.push(...r.popupData(e)):n.push({name:"snp id",value:r.snp},{name:"gene id",value:r.gencodeId},{name:"gene name",value:r.geneSymbol},{name:"p value",value:r.pValue},{name:"tissue",value:i});return n}_clickedFeatures(e,t){const i=(e,t)=>Math.sqrt((e.px-t.canvasX)*(e.px-t.canvasX)+(e.py-t.canvasY)*(e.py-t.canvasY)),n=t.filter((t=>i(t,e)<6));if(n.length>1){n.sort(((t,n)=>i(t,e)-i(n,e)));const t=i(n[0],e);return n.filter((n=>i(n,e)<=t))}return n}contextMenuItemList(e){const t=[],i=e.viewport.cachedFeatures;if(i){const n=this._clickedFeatures(e,i);n.length>0&&(t.push({label:"Highlight associated features",click:async()=>{this.browser.qtlSelections.clear();for(let e of n)this.browser.qtlSelections.qtl=e,this.browser.qtlSelections.addPhenotype(e.phenotype);this.browser.repaintViews()}}),t.push("<hr>"))}return t}menuItemList(){const e=[];return e.push(...this.numericDataMenuItems()),e.push("<hr/>"),e.push({label:"Search for...",dialog:function(e){this.browser.inputDialog.present({label:"Search for snp or phenotype",value:"",callback:async e=>{if(e){e=e.trim().toUpperCase();const t=t=>((t.phenotype&&t.phenotype.toUpperCase())===e||t.snp&&t.snp.toUpperCase()===e)&&-Math.log(t.pValue)/Math.LN10>this.dataRange.min;let i,n,r,s=await this.featureSource.findFeatures(t);if(0==s.length){await this.browser.search(e)&&(s=await this.featureSource.findFeatures(t))}if(s.length>0){this.browser.qtlSelections.clear();const t=new Set;i=s[0].chr,n=s[0].start,r=s[0].end;for(let o of s)o.snp&&o.snp.toUpperCase()===e&&this.browser.qtlSelections.addSnp(o.snp),this.browser.qtlSelections.addPhenotype(o.phenotype),t.add(o.phenotype),o.chr===i&&(n=Math.min(n,o.start),r=Math.max(r,o.end));const o=this.browser.genome.getChromosomeName(i);for(let e of t){const t=await Zv(this.browser,e);t&&o===this.browser.genome.getChromosomeName(t.chr)&&(n=Math.min(n,t.start),r=Math.max(r,t.end))}const a=Math.floor(.1*(r-n));n=Math.max(0,n-a),r+=a,await this.browser.search(`${i}:${n}-${r}`)}}}},e)}}),e}doAutoscale(e){let t=this.config.max||25;if(e.length>0){const i=e.map((e=>-Math.log(e.pValue)/Math.LN10));i.sort(((e,t)=>e-t));t=i[Math.floor(i.length*(this.autoscalePercentile/100))]}return this.dataRange.max=Math.max(t,10),this.dataRange}}const ty={X:"rgb(204, 153, 0)",Y:"rgb(153, 204, 0)",Un:"darkGray)",1:"rgb(80, 80, 255)",2:"rgb(206, 61, 50)","2a":"rgb(210, 65, 55)","2b":"rgb(215, 70, 60)",3:"rgb(116, 155, 88)",4:"rgb(240, 230, 133)",5:"rgb(70, 105, 131)",6:"rgb(186, 99, 56)",7:"rgb(93, 177, 221)",8:"rgb(128, 34, 104)",9:"rgb(107, 215, 107)",10:"rgb(213, 149, 167)",11:"rgb(146, 72, 34)",12:"rgb(131, 123, 141)",13:"rgb(199, 81, 39)",14:"rgb(213, 143, 92)",15:"rgb(122, 101, 165)",16:"rgb(228, 175, 105)",17:"rgb(59, 27, 83)",18:"rgb(205, 222, 183)",19:"rgb(97, 42, 121)",20:"rgb(174, 31, 99)",21:"rgb(231, 199, 111)",22:"rgb(90, 101, 94)",23:"rgb(204, 153, 0)",24:"rgb(153, 204, 0)",25:"rgb(51, 204, 0)",26:"rgb(0, 204, 51)",27:"rgb(0, 204, 153)",28:"rgb(0, 153, 204)",29:"rgb(10, 71, 255)",30:"rgb(71, 117, 255)",31:"rgb(255, 194, 10)",32:"rgb(255, 209, 71)",33:"rgb(153, 0, 51)",34:"rgb(153, 26, 0)",35:"rgb(153, 102, 0)",36:"rgb(128, 153, 0)",37:"rgb(51, 153, 0)",38:"rgb(0, 153, 26)",39:"rgb(0, 153, 102)",40:"rgb(0, 128, 153)",41:"rgb(0, 51, 153)",42:"rgb(26, 0, 153)",43:"rgb(102, 0, 153)",44:"rgb(153, 0, 128)",45:"rgb(214, 0, 71)",46:"rgb(255, 20, 99)",47:"rgb(0, 214, 143)",48:"rgb(20, 255, 177)"};for(let MA of Object.keys(ty)){ty["chr"+MA]=ty[MA]}for(let RA=1;RA<=48;RA++){if(10===RA)continue;const DA=iy(RA);ty[DA]=ty[RA.toString()]}function iy(e){if(!+e)return!1;for(var t=String(+e).split(""),i=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],n="",r=3;r--;)n=(i[+t.pop()+10*r]||"")+n;return Array(+t.join("")+1).join("M")+n}class ny extends Hl{constructor(e,t){super(e,t)}init(e){super.init(e),this.useChrColors=void 0===e.useChrColors||e.useChrColors,this.trait=e.trait,this.posteriorProbability=e.posteriorProbability,this.valueProperty="bed"===e.format?"score":"value",this.height=e.height||100,this.autoscale=e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||3,this.popoverWindow=void 0===e.popoverWindow?1e8:e.popoverWindow,this.useChrColors?this.colorScale=new ao(e.colorTable||ty):e.color?this.colorScale=new ff(e.color):this.colorScale=new df(e.colorScale||{thresholds:[5e-8,5e-4,.5],colors:["rgb(255,50,50)","rgb(251,100,100)","rgb(251,170,170)","rgb(227,238,249)"]}),this.featureSource=Ad(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),this.autoscale||(this.posteriorProbability?this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?1:this.config.max}:this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?25:this.config.max}),this}get supportsWholeGenome(){return!0}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.features,i=e.context,n=e.pixelWidth,r=e.pixelHeight;if(this.background&&xo.fillRect(i,0,0,n,r,{fillStyle:this.background}),xo.strokeLine(i,0,r-1,n,r-1,{strokeStyle:this.divider}),t){const s=e.bpPerPixel,o=e.bpStart,a=o+n*s+1;for(let e of t){const t=e.start;if(t<o)continue;if(t>a)break;let n;if(this.posteriorProbability)n=e[this.valueProperty];else{const t=e[this.valueProperty];if(!t)continue;n=-Math.log10(t)}const c=this.useChrColors?e._f?e._f.chr:e.chr:n,l=this.colorScale.getColor(c),h=(this.dataRange.max-this.dataRange.min)/r,d=Math.round((t-o)/s),u=Math.max(this.dotSize,r-Math.round((n-this.dataRange.min)/h));l&&xo.setProperties(i,{fillStyle:l,strokeStyle:"black"}),xo.fillCircle(i,d,u,this.dotSize),e.px=d,e.py=u}}}paintAxis(e,t,i){xo.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});var n={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};const r=(this.dataRange.max-this.dataRange.min)/i;if(this.posteriorProbability){const t=.1;for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);xo.strokeLine(e,45,t-2,50,t-2,n),xo.fillText(e,s.toFixed(1),44,t+2,n)}}else{const t=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);xo.strokeLine(e,45,t,50,t,n),xo.fillText(e,Math.floor(s),44,t+4,n)}}n.textAlign="center",this.posteriorProbability?xo.fillText(e,"PPA",t/2,i/2,n,{rotate:{angle:-90}}):xo.fillText(e,"-log10(pvalue)",t/2,i/2,n,{rotate:{angle:-90}})}popupData(e,t){void 0===t&&(t=e.viewport.cachedFeatures);let i=[];const n=e.viewport.trackView.track;if(t){let r=0;for(let s of t){const t=Math.abs(e.canvasX-s.px),o=Math.abs(e.canvasY-s.py);if(t<this.dotSize&&o<this.dotSize){if(r>0&&i.push("<HR/>"),5==r){i.push("...");break}if(s=s._f||s,"function"==typeof s.popupData)i=i.concat(s.popupData());else{const e=s[this.valueProperty],t=s.chr,r=Rt(s.start+1);i.push({name:"chromosome",value:t}),i.push({name:"position",value:r}),i.push({name:"name",value:s.name}),n.posteriorProbability?i.push({name:"posterior probability",value:e}):i.push({name:"pValue",value:e})}r++}}}return i}menuItemList(){return this.numericDataMenuItems()}doAutoscale(e){if(e.length>0){const t=this.valueProperty,i=this.posteriorProbability,n=e.map((function(e){const n=e[t];return{value:i?n:-Math.log(n)/Math.LN10}}));this.dataRange=Qa(n)}else this.posteriorProbability?this.dataRange={min:this.config.min||0,max:this.config.max||1}:this.dataRange={min:this.config.max||25,max:this.config.min||0};return this.dataRange}}class ry extends Hl{constructor(e,t){super(e,t)}init(e){super.init(e),this.autoscale=e.autoscale||void 0===e.max,this.dataRange={min:e.min||0,max:e.max},this.windowFunction=e.windowFunction||"mean",this.paintAxis=cd,this.graphType=e.graphType||"bar",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=Ad(this.config,this.browser.genome),this.visibilityWindow=-1,this.featureSource.visibilityWindow=this.visibilityWindow}async postInit(){if("function"==typeof this.featureSource.getHeader){if(this.header=await this.featureSource.getHeader(),this.disposed)return;if(this.sampleKeys=this.header.columnNames.slice(3),this.setTrackProperties(this.header),this.header.hasOwnProperty("clickToHighlight")){let e=this.header.clickToHighlight;this.config.clickToHighlight=e,this.config.samplesClickedToHighlight={}}if(this.header.hasOwnProperty("highlight")){this.config.highlightSamples={};let e=this.header.highlight;Array.isArray(e)||(e=[e]);for(let t of e){const e=t.split(";");2===e.length&&(this.config.highlightSamples[e[0]]=e[1])}}}}menuItemList(){return this.numericDataMenuItems()}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:0,end:Number.MAX_SAFE_INTEGER,visibilityWindow:this.visibilityWindow});let r,s;for(let e=1;e<n.length-1;e++)if(void 0===r&&n[e].end>t&&(r=e-1),void 0===s&&n[e].start>i){s=e+1;break}return void 0===r&&(r=0),void 0===s&&(s=n.length),n.slice(r,s)}draw(e){const{features:t,context:i,bpPerPixel:n,bpStart:r,pixelWidth:s,pixelHeight:o}=e,a=e=>(this.dataRange.max-e)/(this.dataRange.max-this.dataRange.min)*o,c=function(e){let t=Math.floor((e-r)/n);return isNaN(t)&&console.warn("isNaN(x). feature start "+Rt(e)+" bp start "+Rt(r)),t};if(t&&t.length>0&&(void 0===this.dataRange.min&&(this.dataRange.min=0),this.dataRange.max>this.dataRange.min)){const e=this.config.highlightSamples,n=this.config.onlyHandleClicksForHighlightedSamples,r=this.config.clickToHighlight;let s=-1,o={},l=[],h=[];this.clickDetectorCache={};for(let d of t){const t=c(d.start),u=c(d.end),f=s>=0?c(s):t;if(!isNaN(t)&&!isNaN(u)){this.clickDetectorCache[t]=[],this.clickDetectorCache[u]=[];for(let s=0;s<d.values.length;s++){const c=this.sampleKeys[s],p=d.values[s],g=a(p);if(t-f>=1){const s=o[c],h=a(s),d=e&&e[c];d?l.push([f,h,t,g,d]):r&&c in this.config.samplesClickedToHighlight?l.push([f,h,t,g,this.config.samplesClickedToHighlight[c]]):xo.strokeLine(i,f,h,t,g,{strokeStyle:"#D9D9D9"}),n&&!(c in e)||this.clickDetectorCache[t].push([f,h,t,g,c,d||"gray"])}if(u-t>=1){const s=e&&e[c];s?h.push([t,g,u,g,s]):r&&c in this.config.samplesClickedToHighlight?h.push([t,g,u,g,this.config.samplesClickedToHighlight[c]]):xo.strokeLine(i,t,g,u,g,{strokeStyle:"gray"}),n&&!(c in e)||this.clickDetectorCache[u].push([t,g,u,g,c,s||"gray"])}o[c]=p}s=d.end}}for(let e of l)xo.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:1.3});for(let e of h)xo.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:2})}(e=>{if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=a(t.y),n={strokeStyle:t.color,strokeWidth:2};t.dotted?xo.dashedLine(e.context,0,i,e.pixelWidth,i,5,n):xo.strokeLine(e.context,0,i,e.pixelWidth,i,n)}})(e)}doAutoscale(e){let t,i;return e.length>0?(t=Number.MAX_VALUE,i=-Number.MAX_VALUE,e.forEach((function(e){t=Math.min(t,...e.values),i=Math.max(i,...e.values)})),t-=.01,i+=.01):(t=0,i=100),{min:t,max:i}}clickedFeatures(e){const t=e.canvasX,i=e.canvasY;let n=null;for(n of Object.keys(this.clickDetectorCache))if(n=parseInt(n),n>=t)break;if(n){let e=Number.MAX_VALUE,o=[];const a=this.clickDetectorCache[n];for(let n of a){const r=n[0],s=n[2];if(t<r||t>s)return[];const a=n[1],c=n[3];if(i<Math.min(a,c)-10||i>Math.max(a,c)+10)continue;const l=sy(t,i,r,a,s,c);l<e&&(o=[{name:n[4],color:n[5]}],e=l)}if(e<5){if(this.config.clickToHighlight){if(o[0].name in this.config.samplesClickedToHighlight)delete this.config.samplesClickedToHighlight[o[0].name];else if("any"===this.config.clickToHighlight){var r=["red","darkblue","green","teal","olivedrab","orange","maroon","purple","blue","gold"],s=r[Math.floor(Math.random()*(r.length+1))];this.config.samplesClickedToHighlight[o[0].name]=s}else this.config.samplesClickedToHighlight[o[0].name]=this.config.clickToHighlight;this.trackView.repaintViews()}return o}}return[]}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];return t.forEach((function(e){for(let t of Object.keys(e))Ua(e[t])&&i.push({name:t,value:e[t]})})),i}get supportsWholeGenome(){return!1}}function sy(e,t,i,n,r,s){const o=r-i,a=s-n,c=Math.abs(o*(n-t)-(i-e)*a),l=Math.sqrt(o*o+a*a);return l>0?c/l:0}class oy extends Hl{static defaults={height:300,theta:Math.PI/2,arcOrientation:"UP"};constructor(e,t){super(e,t),!1===e.arcOrientation?this.arcOrientation="DOWN":!0===e.arcOrientation?this.arcOrientation="UP":e.arcOrientation?this.arcOrientation=e.arcOrientation.toUpperCase():this.arcOrientation="UP","bp"===e.format?this.featureSource=new cy(e,t.genome):this.featureSource=new ud(e,t.genome)}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.context,i=Math.PI/2,n=e.pixelWidth,r=e.pixelHeight;e.viewportWidth;const s=e.bpPerPixel,o=e.bpStart,a=s,c="UP"===this.arcOrientation;xo.fillRect(t,0,e.pixelTop,n,r,{fillStyle:"rgb(255, 255, 255)"});const l=e.features;if(l){ay(l,1);for(let e of l)if(e.startLeft){let n=Math.round((e.startLeft-o)/a),r=Math.round((e.startRight-o)/a),s=Math.round((e.endLeft-o)/a),l=Math.round((e.endRight-o)/a);t.fillStyle=e.color,t.strokeStyle=e.color,t.beginPath();let h=(n+l)/2,d=(l-n)/2,u=this.height,f=Math.PI+(Math.PI/2-i),p=2*Math.PI-(Math.PI/2-i);c?(t.arc(h,u,d,f,p),t.lineTo(s,u)):(u=0,t.arc(h,u,d,p,f),t.lineTo(l,u));const g=(r+s)/2,m=(s-r)/2,w=u;c?(t.arc(g,w,m,p,f,!0),t.lineTo(n,w)):(t.arc(g,w,m,f,p,!0),t.lineTo(s,w)),t.stroke(),t.fill(),e.drawState={x1:h,y1:u,r1:d,x2:g,y2:w,r2:m,sa:f,ea:p}}else{let n=Math.round((e.start-o)/a),r=Math.round((e.end-o)/a);t.strokeStyle=e.color,t.beginPath();let s=(n+r)/2,l=(r-n)/2,h=this.height,d=Math.PI+(Math.PI/2-i),u=2*Math.PI-(Math.PI/2-i);c?t.arc(s,h,l,d,u):(h=0,t.arc(s,h,l,u,d)),t.stroke(),e.drawState={x1:s,y1:h,r1:l,sa:d,ea:u}}}}clickedFeatures(e){const t=super.clickedFeatures(e),i=[];ay(t,-1);for(let n of t){const t=n.drawState,r=e.canvasX-t.x1,s=e.canvasY-t.y1,o=Math.sqrt(r*r+s*s),a=t.r1+3;let c,l;if(void 0===t.x2)c=o,l=t.r1-3;else{const i=e.canvasX-t.x2,n=e.canvasY-t.y2;c=Math.sqrt(i*i+n*n),l=t.r2-3}if(o<a&&c>l){i.push(n);break}}return i}popupData(e,t){if(void 0===t&&(t=this.clickedFeatures(e)),t&&t.length>0)return this.extractPopupData(t[0],this.getGenomeId())}menuItemList(){return[{name:"Toggle arc direction",click:function(){this.arcOrientation="UP"===this.arcOrientation?"DOWN":"UP",this.trackView.repaintViews()}}]}}function ay(e,t){e.sort((function(e,i){const n=void 0===e.score?-Number.MAX_VALUE:e.score,r=void 0===i.score?-Number.MAX_VALUE:i.score;return(void 0===t?1:t)*(n-r)}))}class cy{constructor(e,t){this.config=e,this.genome=t}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){const s=this.genome;if(this.featureCache)return this.featureCache.queryFeatures(e,t,i);{const n=qa(this.config),r=await Qs.loadByteArray(this.config.url,n);return this.featureCache=new Zs(function(e){if(!e)return null;const t=mh(e);let i,n=!0;const r=[],s=[],o=[];for(;void 0!==(i=t.nextLine());){const e=i.split("\t");if(n&&i.startsWith("color:")){const t="rgb("+e[1]+","+e[2]+","+e[3]+")";r.push(t),e.length>4&&s.push(e[4])}else{n=!1;const t=e[0],i=Number.parseInt(e[1])-1,c=Number.parseInt(e[2])-1,l=Number.parseInt(e[3]),h=Number.parseInt(e[4]);var a=Number.parseInt(e[5]);const d=r[a];let u;u=i<=h?{chr:t,startLeft:Math.min(i,c),startRight:Math.max(i,c),endLeft:Math.min(l,h),endRight:Math.max(l,h),color:d,score:a}:{chr:t,startLeft:Math.min(l,h),startRight:Math.max(l,h),endLeft:Math.min(i,c),endRight:Math.max(i,c),color:d,score:a},u.start=u.startLeft,u.end=u.endRight,s.length>a&&(u.description=s[a]),o.push(u)}}return o}(r),s),this.featureCache.queryFeatures(e,t,i)}}}class ly{constructor(e){this.browser=e,this.type="ideogram",this.height=16,this.order=Number.MIN_SAFE_INTEGER,this.disableButtons=!0,this.ignoreTrackMenu=!0}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,features:r}){const s=t.chr,o=t.genome.getChromosome(s);if(void 0===o||i<=0||n<=0||"all"===s.toLowerCase())return;!function({ctx:e,chr:t,referenceFrame:i,genome:n,width:r,height:s,stainColors:o,features:a}){const c=1,l=.5*c,h=0;if(void 0===n)return;xo.fillRect(e,0,0,r,s,{fillStyle:_s.greyScale(255)});const d=a;if(d){const t=h+s/2,i=[],n=[];if(0===d.length)return;const a=r/d[d.length-1].end;e.beginPath(),xo.roundRect(e,l,l+h,r-2*l,s-2*l,(s-2*l)/2,0,1),e.clip();for(let r=0;r<d.length;r++){const l=d[r],u=a*l.start,f=a*l.end;"c"===l.type?("p"===l.name.charAt(0)?(i[0]=u,n[0]=s+h,i[1]=u,n[1]=h,i[2]=f,n[2]=t):(i[0]=f,n[0]=s+h,i[1]=f,n[1]=h,i[2]=u,n[2]=t),e.fillStyle="rgb(150, 0, 0)",e.strokeStyle="rgb(150, 0, 0)",xo.polygon(e,i,n,1,0)):(e.fillStyle=hy(o,l),xo.fillRect(e,u,c+h,f-u,s-2*c))}}e.strokeStyle=_s.greyScale(41),xo.roundRect(e,l,l+h,r-2*l,s-2*l,(s-2*l)/2,0,1)}({ctx:e,features:r,chr:s,referenceFrame:t,genome:t.genome,width:i,height:n,stainColors:[]});const a=Math.round(t.bpPerPixel*i),c=t.start;let l=o.bpLength;const h=t.genome.getCytobands(s);if(h&&h.length>0&&h[h.length-1].end&&(l=Math.max(l,h[h.length-1].end),o.bpLength=l),a<l){const t=a/l,r=c/l;let s=Math.floor(r*i),o=Math.floor(t*i);s=Math.max(0,s),s=Math.min(i-o,s),e.save(),e.strokeStyle="red",e.lineWidth=o<2?1:2;const h=s+e.lineWidth/2;o=o<2?1:o-e.lineWidth;const d=e.lineWidth/2,u=n-e.lineWidth;e.strokeRect(h,d,o,u),e.restore()}}dispose(){this.trackView=void 0}}function hy(e,t){if("c"===t.type)return"rgb(150, 10, 10)";var i=t.stain,n=230;"p"===t.type&&(n=Math.floor(230-i/100*230));var r=e[n];return r||(r="rgb("+n+","+n+","+n+")",e[n]=r),r}let dy=new oo("Dark2");["GT/AG","CT/AC","GC/AG","CT/GC","AT/AC","GT/AT","non-canonical"].forEach((e=>{dy.getColor(e)}));class uy extends Hl{static defaults={margin:10,colorByNumReadsThreshold:5,height:100};constructor(e,t){super(e,t)}init(e){super.init(e),this.type=e.type||"junctions",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=e.featureSource?e.featureSource:Ad(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow()),this}get supportsWholeGenome(){return!1}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}computePixelHeight(e){return this.height}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=e.pixelHeight,a=r+s*n+1;if(this.isMergedTrack||xo.fillRect(i,0,e.pixelTop,s,o,{fillStyle:"rgb(255, 255, 255)"}),t){const s={};s.referenceFrame=e.viewport.referenceFrame,s.referenceFrameStart=s.referenceFrame.start,s.referenceFrameEnd=s.referenceFrameStart+s.referenceFrame.toBP(e.viewport.getWidth()),s.featureZoomOutTracker={};for(let e of t)if(!(e.end<r)){if(e.start>a)break;this.renderJunction(e,r,n,o,i,s)}}else console.log("No feature list")}renderJunction(e,t,i,n,r,s){e.isVisible=!1;const o=Math.round((e.start-t)/i),a=Math.round((e.end-t)/i),c=(o+a)/2;if(a-o<=3){if(c in s.featureZoomOutTracker)return;s.featureZoomOutTracker[c]=!0}if(this.config.hideAnnotatedJunctions&&"true"===e.attributes.annotated_junction)return;if(this.config.hideUnannotatedJunctions&&"false"===e.attributes.annotated_junction)return;if(this.config.hideMotifs&&this.config.hideMotifs.includes(e.attributes.motif))return;if(this.config.hideStrand===e.strand)return;if(this.config.minJunctionEndsVisible){let t=0;if(e.start>=s.referenceFrameStart&&e.start<=s.referenceFrameEnd&&(t+=1),e.end>=s.referenceFrameStart&&e.end<=s.referenceFrameEnd&&(t+=1),t<this.config.minJunctionEndsVisible)return}let l,h,d,u;if(e.attributes.uniquely_mapped){if(l=parseInt(e.attributes.uniquely_mapped),l<this.config.minUniquelyMappedReads)return;if(h=parseInt(e.attributes.multi_mapped),d=l+h,d<this.config.minTotalReads)return;if(d>0&&h/d>this.config.maxFractionMultiMappedReads)return;if(e.attributes.maximum_spliced_alignment_overhang&&parseInt(e.attributes.maximum_spliced_alignment_overhang)<this.config.minSplicedAlignmentOverhang)return}if(e.attributes.num_samples_with_this_junction){if(u=parseInt(e.attributes.num_samples_with_this_junction),this.config.minSamplesWithThisJunction&&u<this.config.minSamplesWithThisJunction)return;if(this.config.maxSamplesWithThisJunction&&u>this.config.maxSamplesWithThisJunction)return;if(e.attributes.num_samples_total&&(e.attributes.percent_samples_with_this_junction=100*u/Number(e.attributes.num_samples_total),this.config.minPercentSamplesWithThisJunction&&(e.attributes.percent_samples_with_this_junction<this.config.minPercentSamplesWithThisJunction||e.attributes.percent_samples_with_this_junction>this.config.maxPercentSamplesWithThisJunction)))return}const f=this.margin,p=n,g=f+.5*p;let m=f;const w=f+p-10,b=(o+c)/2,F=(c+a)/2;let v,y,A=1;e.attributes.line_width?A=Number(e.attributes.line_width):(void 0===this.config.thicknessBasedOn||"numUniqueReads"===this.config.thicknessBasedOn?A=l:"numReads"===this.config.thicknessBasedOn?A=d:"numSamplesWithThisJunction"===this.config.thicknessBasedOn&&void 0!==u&&(A=u),A=1+Math.log(A+1)/Math.log(12)),void 0===this.config.bounceHeightBasedOn||"random"===this.config.bounceHeightBasedOn?v=(e.start+e.end)%7:"distance"===this.config.bounceHeightBasedOn?v=6*(e.end-e.start)/(s.referenceFrameEnd-s.referenceFrameStart):"thickness"===this.config.bounceHeightBasedOn&&(v=2*A),m+=p*Math.max(7-v,0)/10,y=e.attributes.color?e.attributes.color:void 0===this.config.colorBy||"numUniqueReads"===this.config.colorBy?l>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"numReads"===this.config.colorBy?d>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"isAnnotatedJunction"===this.config.colorBy?"true"===e.attributes.annotated_junction?"#b0b0ec":"orange":"strand"===this.config.colorBy?"+"===e.strand?"#b0b0ec":"#ecb0b0":"motif"===this.config.colorBy?dy.getColor(e.attributes.motif):"#AAAAAA";let C="";e.attributes.label?C=e.attributes.label.replace(/_/g," "):void 0===this.config.labelWith||"uniqueReadCount"===this.config.labelWith?C=l:"totalReadCount"===this.config.labelWith?C=d:"numSamplesWithThisJunction"===this.config.labelWith?void 0!==u&&(C=u):"percentSamplesWithThisJunction"===this.config.labelWith?void 0!==e.attributes.percent_samples_with_this_junction&&(C=e.attributes.percent_samples_with_this_junction.toFixed(0)+"%"):"motif"===this.config.labelWith&&void 0!==e.attributes.motif&&(C+=e.attributes.motif),"uniqueReadCount"===this.config.labelWithInParen?C+=" ("+l+")":"totalReadCount"===this.config.labelWithInParen?C+=" ("+d+")":"multiMappedReadCount"===this.config.labelWithInParen?h>0&&(C+=" (+"+h+")"):"numSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==u&&(C+=" ("+u+")"):"percentSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==e.attributes.percent_samples_with_this_junction&&(C+=" ("+e.attributes.percent_samples_with_this_junction.toFixed(0)+"%)"):"motif"===this.config.labelWithInParen&&void 0!==e.attributes.motif&&(C+=` ${e.attributes.motif}`),e.isVisible=!0,r.beginPath(),r.moveTo(o,w),r.bezierCurveTo(b,m,F,m,a,w),r.lineWidth=A,r.strokeStyle=y,r.stroke();const _=(e,t,i,n)=>{e.beginPath(),e.moveTo(t,i),e.lineTo(t-n/2,i-n),e.lineTo(t+n/2,i-n),e.lineTo(t,i),e.closePath(),e.fill()};if(e.attributes.left_shape||e.attributes.right_shape){r.fillStyle=y;const t=r.lineWidth>2?10:7;e.attributes.left_shape&&_(r,o,w,t),e.attributes.right_shape&&_(r,a,w,t)}r.fillText(C,c-r.measureText(C).width/2,(7*m+g)/8)}clickedFeatures(e){return super.clickedFeatures(e).filter((function(e){return e.isVisible&&e.attributes}))}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=[];for(let e of t){const t="function"==typeof e.popupData?e.popupData(i):this.extractPopupData(e._f||e,this.getGenomeId());t&&(n.length>0&&n.push("<hr/><hr/>"),Array.prototype.push.apply(n,t))}return n}dispose(){this.trackView=void 0}}const fy=new Map([["ideogram",(e,t)=>new ly(e,t)],["sequence",(e,t)=>new Zd(e,t)],["feature",(e,t)=>new Hd(e,t)],["seg",(e,t)=>new Pf(e,t)],["mut",(e,t)=>new Pf(e,t)],["maf",(e,t)=>new Pf(e,t)],["shoebox",(e,t)=>new Pf(e,t)],["wig",(e,t)=>new ld(e,t)],["merged",(e,t)=>new tf(e,t)],["alignment",(e,t)=>new ew(e,t)],["interaction",(e,t)=>new tw(e,t)],["interact",(e,t)=>new tw(e,t)],["variant",(e,t)=>new Kv(e,t)],["qtl",(e,t)=>new ey(e,t)],["eqtl",(e,t)=>new ey(e,t)],["gwas",(e,t)=>new ny(e,t)],["arc",(e,t)=>new oy(e,t)],["gcnv",(e,t)=>new ry(e,t)],["junction",(e,t)=>new uy(e,t)],["blat",(e,t)=>new Vd(e,t)],["cnvpytor",(e,t)=>new Wv(e,t)]]);class py{constructor(e,t){const i=(new DOMParser).parseFromString(e,"text/xml");this.processRootNode(i,t);const n=i.getElementsByTagName("Resource"),r=i.getElementsByTagName("Track"),s=r&&r.length>0,o=[];this.tracks=o;const a=new Map;Array.from(n).forEach((function(e,t){var i={url:e.getAttribute("path"),indexURL:e.getAttribute("index"),order:t};a.set(i.url,i),s||o.push(i)})),s&&Array.from(r).forEach((function(e){const t=e.getElementsByTagName("Track");if(t&&t.length>0){const i={type:"merged",tracks:[]};gy(e,i),o.push(i),Array.from(t).forEach((function(e){e.processed=!0;const t=e.getAttribute("id"),n=a.get(t);n&&(i.tracks.push(n),gy(e,n),n.autoscale=!1,i.height=n.height)}))}else if(!e.processed){const t=e.getAttribute("id"),i=a.get(t);i&&(o.push(i),gy(e,i))}}))}processRootNode(e,t){const i=e.getElementsByTagName("Session");!i||i.length;const n=i.item(0),r=n.getAttribute("genome"),s=n.getAttribute("locus"),o=n.getAttribute("ucscID");t&&t.hasOwnProperty(r)?this.genome=r:(this.reference={fastaURL:r},o&&(this.reference.id=o)),s&&(this.locus=s)}}function gy(e,t){t.name=e.getAttribute("name");const i=e.getAttribute("color");i&&(t.color="rgb("+i+")");const n=e.getAttribute("altColor");i&&(t.altColor="rgb("+n+")");const r=e.getAttribute("height");r&&(t.height=parseInt(r));const s=e.getAttribute("autoScale");s&&(t.autoscale="true"===s);const o=e.getAttribute("autoscaleGroup");o&&(t.autoscaleGroup=o);const a=e.getAttribute("windowFunction");a&&(t.windowFunction=a);const c=e.getAttribute("visibilityWindow")||e.getAttribute("featureVisibilityWindow");c&&(t.visibilityWindow=c);const l=e.getAttribute("indexed");l&&(t.indexed="true"===l);const h=e.getAttribute("normalize");h&&(t.normalize="true"===h);const d=e.getElementsByTagName("DataRange");if(d.length>0){const e=d.item(0);t.min=Number(e.getAttribute("minimum")),t.max=Number(e.getAttribute("maximum")),t.logScale="LOG"===e.getAttribute("type")}}class my{constructor(e,t,i,n,r){this.genome=e,this.chr=t,this.start=i,this.end=n,this.bpPerPixel=r,this.id=s()}get center(){return(this.start+this.end)/2}get locusSearchString(){return`${this.chr}:${this.start+1}-${this.end}`}extend(e){const t=Math.min(e.start,this.start),i=Math.max(e.end,this.end),n=(i-t)/(this.end-this.start);this.start=t,this.end=i,this.bpPerPixel*=n}calculateEnd(e){return this.start+this.bpPerPixel*e}calculateCenter(e){return this.start+this.bpPerPixel*e/2}calculateBPP(e,t){return(e-this.start)/t}set(e){this.chr=e.chr,this.start=e.start,this.bpPerPixel=e.bpPerPixel}toPixels(e){return e/this.bpPerPixel}toBP(e){return this.bpPerPixel*e}shift(e){this.start+=e,this.end+=e}shiftPixels(e,t,i){const n=this.start,r=e*this.bpPerPixel;return this.start+=r,i&&this.clampStart(t),this.end=this.start+t*this.bpPerPixel,n!==this.start}clampStart(e){const t=this.genome.getChromosome(this.chr).bpStart||0;if(this.start=Math.max(t,this.start),e){const{bpLength:t}=this.genome.getChromosome(this.chr),i=t-e*this.bpPerPixel;this.start>i&&(this.start=i)}}async zoomWithScaleFactor(e,t,i,n){const r=void 0===n?this.start+this.toBP(i/2):n,s=this.start,o=this.bpPerPixel,a=this.getChromosome().bpLength,c=t<1?e.minimumBases()/i:a/i;this.bpPerPixel=t<1?Math.max(this.bpPerPixel*t,c):Math.min(this.bpPerPixel*t,c);const l=this.bpPerPixel*i;this.start=r-.5*l,this.clampStart(i),this.end=this.start+l;(s!==this.start||o!==this.bpPerPixel)&&await e.updateViews(!0)}getChromosome(){return this.genome.getChromosome(this.chr)}getMultiLocusLabelBPLengthOnly(e){const t="&nbsp",i=Math.floor(this.start)+1,n=Math.round(this.start+this.bpPerPixel*e);return`${t}${this.chr}${t}${Ga(n-i)}${t}`}getMultiLocusLabelLocusOnly(e){const t="&nbsp",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e);return`${t}${i}:${n}-${r}${t}`}getMultiLocusLabel(e){const t="&nbsp",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e),s=Math.floor(this.start)+1;return`${t}${i}:${n}-${r}${t}${t}(${Ga(Math.round(this.start+this.bpPerPixel*e)-s)})${t}`}getPresentationLocusComponents(e){if("all"===this.chr)return{chr:this.chr};{const t=Rt(Math.floor(this.start)+1),i=Rt(Math.round(this.start+this.bpPerPixel*e));return{chr:this.chr,start:t,end:i}}}getLocusString(){if("all"===this.chr)return"all";return`${this.genome.getChromosomeDisplayName(this.chr)}:${Rt(Math.floor(this.start)+1)}-${Rt(Math.round(this.end))}`}description(e){console.log(` ${e||""} referenceFrame - ${this.chr} bpp ${this.bpPerPixel.toFixed(3)} start ${Rt(Math.round(this.start))} end ${Rt(Math.round(this.end))} `)}overlaps(e){return this.chr===e.chr&&this.end>=e.start&&e.end>=this.start}}function wy(){return"3.0.3"}const by={},Fy=8;let vy;function yy(e,t){"igv-navbar-text-button"===Ju.currentNavbarButtonClass(e)&&(vy=e.$navigation.get(0).querySelector(".igv-navbar-right-container").getBoundingClientRect().width);const i=function(e,t){const i=e.isMultiLocusWholeGenomeView()||e.referenceFrameList&&mu.isWholeGenomeView(e.referenceFrameList[0].chr);i?e.windowSizePanel.hide():e.windowSizePanel.show();const{x:n,width:r}=e.$navigation.get(0).querySelector(".igv-navbar-left-container").getBoundingClientRect(),s=n+r,{x:o}=e.$navigation.get(0).querySelector(".igv-navbar-right-container").getBoundingClientRect(),a=o-s,c=Ju.currentNavbarButtonClass(e);if("igv-navbar-text-button"===c&&a<Fy)by.navbarButton="igv-navbar-icon-button";else if(vy&&"igv-navbar-icon-button"===c){t-s-vy>Fy&&(by.navbarButton="igv-navbar-text-button")}by.zoomContainer=i?"igv-zoom-widget-hidden":t>860?"igv-zoom-widget":"igv-zoom-widget-900";return by}(e,t);Bt(e.zoomWidget.zoomContainer).removeClass(),Bt(e.zoomWidget.zoomContainer).addClass(i.zoomContainer),e.fireEvent("navbar-resize",[i.navbarButton])}const Ay="Maximum sequence count exceeded";class Cy{constructor(t,i){this.container=e({class:"igv-chromosome-select-widget-container"}),i.appendChild(this.container),this.select=document.createElement("select"),this.select.setAttribute("name","chromosome-select-widget"),this.container.appendChild(this.select),this.select.addEventListener("change",(()=>{this.select.blur(),""!==this.select.value&&Ay!==this.select.value&&t.search(this.select.value)})),this.showAllChromosomes=!1!==t.config.showAllChromosomes}show(){this.container.style.display="flex"}hide(){this.container.style.display="none"}update(e){const t=e.wgChromosomeNames||[];if(this.showAllChromosomes&&e.chromosomeNames.length>1){const i=new Set(t);let n=0;for(let r of e.chromosomeNames){if(1e3==++n){t.push(Ay);break}i.has(r)||t.push(r)}}this.select.innerHTML="",e.showWholeGenomeView()&&t.unshift("all");for(let i of t){const t=document.createElement("option");t.setAttribute("value",i),t.innerText=e.getChromosomeDisplayName(i),this.select.appendChild(t)}}}class _y{constructor(t,i){this.container=e({class:"igv-windowsize-panel-container"}),t.appendChild(this.container),i.on("locuschange",(e=>{this.updatePanel(e)})),this.browser=i}show(){this.container.style.display="block"}hide(){this.container.style.display="none"}updatePanel(e){const t=this.browser.calculateViewportWidth(this.browser.referenceFrameList.length);this.container.innerText=1===e.length?Ga(Math.round(t*e[0].bpPerPixel)):""}}class xy{constructor(t,i){this.browser=i,this.columnContainer=t,this.horizontalGuide=e({class:"igv-cursor-guide-horizontal"}),t.appendChild(this.horizontalGuide),this.verticalGuide=e({class:"igv-cursor-guide-vertical"}),t.appendChild(this.verticalGuide),this.addMouseHandler(i),this.setVisibility(i.config.showCursorGuide)}addMouseHandler(e){this.boundMouseMoveHandler=function(t){t.target.tagName;const{x:i,y:n}=a(t,this.columnContainer);if(this.horizontalGuide.style.top=`${n}px`,"CANVAS"===t.target.tagName){const n=function(e,t){for(;e.parentElement;){if(e.parentElement.classList.contains(t))return e.parentElement;e=e.parentElement}return}(t.target,"igv-viewport");if(n&&e.getRulerTrackView()){this.verticalGuide.style.left=`${i}px`;const r=e.root.querySelectorAll(".igv-column");let s;const o=n.parentElement;for(let e=0;e<r.length;e++)void 0===s&&o===r[e]&&(s=e);if(void 0!==s){const i=e.getRulerTrackView().viewports[s].mouseMove(t);if(i){const{start:e,bp:t,end:n}=i,r=(t-e)/(n-e);this.customMouseHandler&&this.customMouseHandler({start:e,bp:t,end:n,interpolant:r})}}}}}.bind(this),this.columnContainer.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandler(){this.columnContainer.removeEventListener("mousemove",this.boundMouseMoveHandler)}setVisibility(e){!0===e?this.show():this.hide()}show(){this.verticalGuide.style.display="block",this.horizontalGuide.style.display="block"}hide(){if(this.verticalGuide.style.display="none",this.horizontalGuide.style.display="none",this.browser.getRulerTrackView())for(let e of this.browser.getRulerTrackView().viewports)e.$tooltip.hide()}}class ky extends Ju{constructor(e,t){super(e,t,"Crosshairs",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor" stroke="#737373">\n <rect id="Rectangle-Copy-3" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group" transform="translate(5, 9)" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor-hover">\n <rect id="Rectangle-Copy-5" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-Copy-2" transform="translate(5, 9)" stroke="#FFFFFF" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke="#FFFFFF" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>',e.doShowCursorGuide),this.button.addEventListener("mouseenter",(()=>{!1===e.doShowCursorGuide&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===e.doShowCursorGuide&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{e.doShowCursorGuide=!e.doShowCursorGuide,e.setCursorGuideVisibility(e.doShowCursorGuide),this.setState(e.doShowCursorGuide)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(e.config.showCursorTrackingGuideButton)}}class Iy extends Ju{constructor(e,t){super(e,t,"Center Line",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline" stroke="#737373">\n <rect id="Rectangle-Copy-2" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline-hover">\n <rect id="Rectangle-Copy-9" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke="#FFFFFF" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>',e.config.showCenterGuide),this.button.addEventListener("mouseenter",(()=>{!1===e.doShowCenterLine&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===e.doShowCenterLine&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{e.doShowCenterLine=!e.doShowCenterLine,e.setCenterLineVisibility(e.doShowCenterLine),this.setState(e.doShowCenterLine)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(e.config.showCenterGuideButton)}}class Sy extends Ju{constructor(e,t){super(t,e,"Track Labels",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels" fill="#FFFFFF" stroke="#737373">\n <rect id="Rectangle-Copy-27" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" stroke-width="24">\n <path d="M448.444444,87.1189616 L448.444444,322.431462 L166.619398,322.431462 L19.2344421,204.775212 L166.619398,87.1189616 L448.444444,87.1189616 Z M244.028212,163.997434 C232.925565,163.997434 222.874656,168.493347 215.598982,175.760254 C208.318067,183.032394 203.815972,193.079106 203.815972,204.175675 C203.815972,215.272243 208.318067,225.318955 215.598982,232.591095 C222.874656,239.858002 232.925565,244.353915 244.028212,244.353915 C255.130858,244.353915 265.181767,239.858002 272.457442,232.591095 C279.738356,225.318955 284.240451,215.272243 284.240451,204.175675 C284.240451,193.079106 279.738356,183.032394 272.457442,175.760254 C265.181767,168.493347 255.130858,163.997434 244.028212,163.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels-hover" stroke="#737373">\n <rect id="Rectangle-Copy-29" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" fill="#FFFFFF" stroke-width="24">\n <path d="M448.444444,85.1189616 L448.444444,320.431462 L166.619398,320.431462 L19.2344421,202.775212 L166.619398,85.1189616 L448.444444,85.1189616 Z M244.028212,161.997434 C232.925565,161.997434 222.874656,166.493347 215.598982,173.760254 C208.318067,181.032394 203.815972,191.079106 203.815972,202.175675 C203.815972,213.272243 208.318067,223.318955 215.598982,230.591095 C222.874656,237.858002 232.925565,242.353915 244.028212,242.353915 C255.130858,242.353915 265.181767,237.858002 272.457442,230.591095 C279.738356,223.318955 284.240451,213.272243 284.240451,202.175675 C284.240451,191.079106 279.738356,181.032394 272.457442,173.760254 C265.181767,166.493347 255.130858,161.997434 244.028212,161.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>',t.config.showTrackLabels),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowTrackLabels&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowTrackLabels&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowTrackLabels=!t.doShowTrackLabels,t.setTrackLabelVisibility(t.doShowTrackLabels),this.setState(t.doShowTrackLabels)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showTrackLabelButton)}}class Ey extends Ju{constructor(e,t){super(t,e,"Sample Names",'<svg width="90px" height="20px" viewBox="0 0 90 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="89" height="18" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names" stroke="#737373">\n <rect id="Rectangle-Copy-13" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke-width="32"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke-width="32"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke-width="32"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names-hover">\n <rect id="Rectangle-Copy-18" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n </g>\n </g>\n</svg>',t.config.showSampleNames),this.button.addEventListener("mouseenter",(()=>{!1===t.showSampleNames&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.showSampleNames&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)})),!0===t.config.showSampleNameButton?this.show():this.hide()}performClickWithState(e,t){e.showSampleNames=void 0===t?!e.showSampleNames:t;e.columnContainer.querySelector(".igv-sample-name-column").style.display=!1===e.showSampleNames?"none":"flex",this.setState(e.showSampleNames),e.layoutChange()}}class Ny extends Ju{constructor(e,t){super(t,e,"Sample Info",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info">\n <rect id="Rectangle-Copy-6" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-2" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-10" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info-hover">\n <rect id="Rectangle-Copy-14" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-1" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-0" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-15" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <rect id="scrim" fill="#000000" style="mix-blend-mode: hue;" x="8" y="149" width="612" height="306"></rect>\n </g>\n </g>\n</svg>',!1),this.showSampleInfo=!1,this.button.addEventListener("mouseenter",(()=>{!1===this.showSampleInfo&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===this.showSampleInfo&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)}))}performClickWithState(e,t){this.showSampleInfo=void 0===t?!this.showSampleInfo:t;e.columnContainer.querySelector(".igv-sample-info-column").style.display=!1===this.showSampleInfo?"none":"flex",this.setState(this.showSampleInfo),e.layoutChange()}setButtonVisibility(e){this.showSampleInfo=e,this.setState(this.showSampleInfo),!0===this.showSampleInfo?this.show():this.hide()}}let By=23,My=0;const Ry=function(t,i){this.browser=t,this.zoomContainer=e({class:"igv-zoom-widget"}),i.appendChild(this.zoomContainer),this.zoomOutButton=e(),this.zoomContainer.appendChild(this.zoomOutButton),this.zoomOutButton.appendChild(l("minus-circle")),this.zoomOutButton.addEventListener("click",(()=>{t.zoomOut()}));const n=e();this.zoomContainer.appendChild(n),this.slider=document.createElement("input"),this.slider.type="range",this.slider.min="0",this.slider.max=`${By}`,n.appendChild(this.slider),this.slider.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation();const i=t.referenceFrameList[0],{bpLength:n}=i.genome.getChromosome(i.chr),{end:r,start:s}=i,o=r-s,a=n/Math.pow(2,e.target.valueAsNumber);t.zoomWithScaleFactor(a/o)})),this.zoomInButton=e(),this.zoomContainer.appendChild(this.zoomInButton),this.zoomInButton.appendChild(l("plus-circle")),this.zoomInButton.addEventListener("click",(()=>{t.zoomIn()})),t.on("locuschange",(e=>{this.browser.isMultiLocusMode()?this.disable():(this.enable(),this.update(e))}))};Ry.prototype.update=function(e){const t=e[0],{bpLength:i}=t.genome.getChromosome(t.chr),{start:n,end:r}=t;By=Math.ceil(Math.log2(i/this.browser.minimumBases())),this.slider.max=`${By}`;const s=i/(r-n);My=Math.log2(s),this.slider.value=`${Math.round(My)}`},Ry.prototype.enable=function(){this.slider.disabled=!1},Ry.prototype.disable=function(){this.slider.disabled=!0},Ry.prototype.hide=function(){this.zoomContainer.style.display="none"},Ry.prototype.show=function(){this.zoomContainer.style.display="block"},Ry.prototype.hideSlider=function(){this.slider.style.display="none"},Ry.prototype.showSlider=function(){this.slider.style.display="block"};class Dy{constructor(t,i){this.parent=t,this.popover=e({class:"igv-ui-dropdown"}),t.appendChild(this.popover),this.popoverContent=e(),this.popover.appendChild(this.popoverContent),this.popover.style.display="none",this.shim=i}configure(e){if(0===e.length)return;const t=rc(e,this.popover);for(const{object:e}of t)this.popoverContent.appendChild(e)}present(e){this.popover.style.display="block";let{x:t,y:i}=a(e,this.parent);this.popover.style.left=`${t+this.shim.left}px`,this.popover.style.top=`${i+this.shim.top}px`}_present(e){this.popover.style.display="block";let{x:t,y:i,width:n}=a(e,this.parent);t+=this.shim.left,i+=this.shim.top,this.popover.style.top=`${i}px`;const{width:r}=this.popover.getBoundingClientRect(),s=t+r,o=s-n;this.popover.style.left=`${s>n?t-o:t}px`}dismiss(){this.popover.style.display="none"}}class Ty extends Ju{constructor(e,t){super(t,e,"Save Image",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>{for(const e of this.button.querySelectorAll("div"))if("block"===e.style.display)return;this.setState(!1)})),this.dropdown=new Dy(this.button.parentNode,{top:24,left:-88});const i=[{label:"Save as SVG",click:e=>{this.browser.saveSVGtoFile("igvjs.svg"),this.dropdown.dismiss()}},{label:"Save as PNG",click:e=>{this.browser.savePNGtoFile("igvjs.png"),this.dropdown.dismiss()}}];this.dropdown.configure(i),this.button.addEventListener("click",(e=>{let t;if(e.target===this.button)t=!0;else if(e.target.closest("svg")){e.target.closest("div")===this.button&&(t=!0)}!0===t&&("none"===this.dropdown.popover.style.display?this.dropdown.present(e):this.dropdown.dismiss())})),this.setVisibility(t.config.showSVGButton)}navbarResizeHandler(e){this.dropdown.dismiss(),super.navbarResizeHandler(e)}}const Ly=(e,t)=>{const i=0===e?t.nextElementSibling:t.previousElementSibling;t.remove(),i.remove()},zy=t=>{const i=e({class:"igv-column-shim"});Xa(i,t);const n=e({class:"igv-column"});return Xa(n,i),n},Hy=(t,i)=>{for(let n=0;n<i;n++){const r=e({class:"igv-column"});if(Ya(r,t),i>1&&n>0){Ya(e({class:"igv-column-shim"}),r)}}};class Py{constructor(t,i,n){this.browser=t,this.referenceFrame=i,this.column=n,this.container=e({class:"igv-center-line"}),n.appendChild(this.container),t.doShowCenterLine?this.show():this.hide()}repaint(){if(this.referenceFrame){if(1/this.referenceFrame.bpPerPixel>1){const e=Math.floor(this.referenceFrame.toPixels(1));this.container.style.width=`${e}px`,this.container.classList.remove("igv-center-line-thin"),this.container.classList.add("igv-center-line-wide")}else this.container.style.width="1px",this.container.classList.remove("igv-center-line-wide"),this.container.classList.add("igv-center-line-thin")}}show(){this.isVisible=!0,this.container.style.display="block",this.repaint()}hide(){this.isVisible=!1,this.container.style.display="none"}resize(){this.repaint()}}const Oy=function(t,i){this.button=e({class:"igv-navbar-button"}),t.appendChild(this.button),this.button.textContent="circular view",this.button.addEventListener("click",(()=>{i.circularViewVisible=!i.circularViewVisible})),this.browser=i,this.setVisibility(i.config.showCircularViewButton),this.setState(i.circularViewVisible)};Oy.prototype.setVisibility=function(e){!0===e?this.show():this.hide()},Oy.prototype.setState=function(e){!0===e?this.button.classList.add("igv-navbar-button-clicked"):this.button.classList.remove("igv-navbar-button-clicked")},Oy.prototype.show=function(){this.button.style.display="block",this.setState(this.browser.circularViewVisible)},Oy.prototype.hide=function(){this.button.style.display="none"};const Uy=function(t,i,n){const r=e({class:"igv-navbar-button"});t.append(r),r.textContent=n.label,r.addEventListener("click",(()=>n.callback(i)))};class qy{constructor(t,i){this.browser=t,this.container=e({class:"igv-roi-menu"}),i.appendChild(this.container);const n=e();this.container.appendChild(n),u(n,(()=>this.container.style.display="none")),this.body=e(),this.container.appendChild(this.body),this.container.style.display="none"}async present(e,t,i,n,r,s){const o=this.menuItems(e,t,i,n,r,s);this.browser.menuPopup.presentTrackContextMenu(i,o)}menuItems(e,t,i,n,r,s){const o=e.name?[`<b>${e.name}</b><br/>`]:[];return"name"in t&&o.push(`<b>ROI Set: ${t.name}</b>`),o.length>0&&o.push("<hr/>"),t.isUserDefined&&o.push({label:"Set description ...",click:()=>{const t={label:"Description",value:e.name||"",callback:()=>{const t=this.browser.inputDialog.value||"";e.name=t.trim(),this.browser.roiManager.repaintTable()}};this.browser.inputDialog.present(t,i)}}),Za()&&e.end-e.start<1e6&&o.push({label:"Copy reference sequence",click:async()=>{this.container.style.display="none";let t=await this.browser.genome.getSequence(e.chr,e.start,e.end);t||(t="Unknown sequence");try{await navigator.clipboard.writeText(t)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),e.end-e.start<=25e3&&o.push({label:"BLAT reference sequence",click:async()=>{this.container.style.display="none";const{chr:t,start:i,end:n}=e;let r=await this.browser.genome.getSequence(t,i,n);if(r){const e=`blat: ${t}:${i+1}-${n}`,s=`blat: ${t}:${i+1}-${n}`;jd({sequence:r,browser:this.browser,name:e,title:s})}}}),t.isUserDefined&&o.push("<hr/>",{label:"Delete",click:()=>{this.browser.roiManager.deleteRegionWithKey(s.dataset.region,this.browser.columnContainer),this.browser.roiManager.repaintTable()}}),o}dispose(){this.container.innerHTML=""}}class Qy extends Pd{constructor(e){const t={browser:e,parent:e.columnContainer,headerTitle:"Regions of Interest",dismissHandler:()=>e.roiTableControl.buttonHandler(!1),gotoButtonHandler:Qy.gotoButtonHandler};t.columnFormat=Qy.getColumnFormatConfiguration(!0),super(Object.assign({width:"640px"},t))}tableRowDOM(t){const i=e({class:"igv-roi-table-row"}),{setName:n,feature:r}=t;i.dataset.region=$y(r.chr,r.start,r.end);let s=[r.chr,Rt(r.start),Rt(r.end),r.name||"",n];4===this.columnFormat.length&&(s=s.slice(0,4));for(let t=0;t<s.length;t++){const n=e();i.appendChild(n),n.style.width=this.columnFormat[t].width,n.innerText=s[t]}return this.tableRowDOMHelper(i),i}renderTable(e){if(Array.from(this.tableRowContainer.querySelectorAll(".igv-roi-table-row")).forEach((e=>e.remove())),e.length>0){const t=e.sort(((e,t)=>e.feature.chr.localeCompare(t.feature.chr)||e.feature.start-t.feature.start||e.feature.end-t.feature.end));for(let e of t){const t=this.tableRowDOM(e);this.tableRowContainer.appendChild(t)}}}set footerDOM(t){super.footerDOM=t,this.gotoButton.textContent="Go to selected region(s)";const i=e({class:"igv-roi-table-button"});this._footerDOM.appendChild(i),i.id="igv-roi-hide-show-button",i.textContent="Copy Sequence",i.title="One region only of max size 1 mb",this.copySequenceButton=i,Vy(this.copySequenceButton,!1),this.boundCopySequenceButtonHandler=async function(e){e.preventDefault(),e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0){const e=[];for(let i of t){const{locus:t}=Yy(i.dataset.region);e.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");if(this.setTableRowSelectionState(!1),e.length>0){const{chr:t,start:i,end:n}=Jv(e[0],this.browser.isSoftclipped()),r=await this.browser.genome.getSequence(t,i,n);await navigator.clipboard.writeText(r)}}}.bind(this),this.copySequenceButton.addEventListener("click",this.boundCopySequenceButtonHandler);const n=e({class:"igv-roi-table-button"});this._footerDOM.appendChild(n),n.id="igv-roi-hide-show-button",n.textContent="Hide all ROIs",this.toggleROIButton=n,this.boundToggleDisplayButtonHandler=function(e){e.preventDefault(),e.stopPropagation(),this.browser.roiManager.toggleROIs()}.bind(this),this.toggleROIButton.addEventListener("click",this.boundToggleDisplayButtonHandler)}setROIVisibility(e){const t=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let i=0;i<t.length;i++){const n=t[i];!1===e?jy(n,0):n.style.backgroundColor=n.dataset.color}this.toggleROIButton.textContent=!1===e?"Show all ROIs":"Hide all ROIs"}setTableRowSelectionState(e){super.setTableRowSelectionState(e);const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0&&t.length<2){const{locus:e}=Yy(t[0].dataset.region),{chr:i,start:n,end:r}=Jv(e,this.browser.isSoftclipped());Vy(this.copySequenceButton,r-n<1e6)}else Vy(this.copySequenceButton,!1)}dispose(){document.removeEventListener("click",this.boundGotoButtonHandler),document.removeEventListener("click",this.boundCopySequenceButtonHandler),document.removeEventListener("click",this.boundToggleDisplayButtonHandler),this.browser.roiTableControl.buttonHandler(!1),super.dispose()}static getColumnFormatConfiguration(e){return!0===e?[{label:"Chr",width:"20%"},{label:"Start",width:"15%"},{label:"End",width:"15%"},{label:"Description",width:"30%"},{label:"ROI Set",width:"20%"}]:[{label:"Chr",width:"25%"},{label:"Start",width:"20%"},{label:"End",width:"20%"},{label:"Description",width:"35%"}]}static gotoButtonHandler(e){e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected"),i=[];for(let e of t){const{locus:t}=Yy(e.dataset.region);i.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");this.setTableRowSelectionState(!1),i.length>0&&this.browser.search(i.join(" "))}}function Vy(e,t){e.style.pointerEvents=t?"auto":"none",e.style.color=ro(t?"licorice":"silver"),e.style.borderColor=ro(t?"licorice":"silver")}function jy(e,t){const i=window.getComputedStyle(e).backgroundColor.match(/[\d.]+/g);3===i.length&&i.push(1),i[3]=t,e.style.backgroundColor=`rgba(${i.join(", ")})`}class Wy{constructor(e){this.browser=e,this.roiMenu=new qy(e,e.columnContainer),this.roiTable=new Qy(e,e.columnContainer),this.top=0,this.roiSets=[],this.boundLocusChangeHandler=Gy.bind(this),e.on("locuschange",this.boundLocusChangeHandler);this.observer=new MutationObserver((()=>{const t=e.findTracks((e=>new Set(["ideogram","ruler"]).has(e.type))),[i,n]=t.map((e=>e.trackView.viewports[0].$viewport.get(0))).map((e=>function(e){const t=window.getComputedStyle(e),i=parseInt(t.marginTop),n=parseInt(t.marginBottom),{top:r,bottom:s,height:o}=e.getBoundingClientRect();return{top:Math.floor(r)-i,bottom:Math.floor(s)+n,height:Math.floor(o)+i+n}}(e))),r=i?i.height:0,s=n?n.height:0,o=e.columnContainer.querySelectorAll(".igv-roi-region");if(o)for(const e of o)e.style.marginTop=`${r+s+-.5}px`})),this.observer.observe(e.columnContainer,{attributes:!0,childList:!0,subtree:!0})}async reset(){this.roiSets.length>0&&this.browser.roiTableControl.setVisibility(!0);const e=this.roiSets.map((e=>this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})));e.length>0&&await Promise.all(e);const t=await this.getTableRecords();if(this.roiTable.renderTable(t),this.roiSets.length>0){const e=this.roiSets[0].isVisible;this.roiTable.setROIVisibility(e)}}async loadROI(e,t){const i=Array.isArray(e)?e:[e];for(let e of i)!e.name&&e.url&&(e.name=await Wa(e.url)),e.url&&!e.format&&(e.format=await om(e)),this.roiSets.push(new ku(e,t));await this.reset()}clearROIs(){this.roiTable.clearTable();const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();for(let e of this.roiSets)e.dispose();this.roiSets=[]}async getTableRecords(){const e=[];for(let t of this.roiSets){const i=t.name||"",n=await t.getAllFeatures();for(let t of Object.keys(n))for(let r of n[t])e.push({setName:i,feature:r})}return e}presentTable(){this.roiTable.present()}async repaintTable(){const e=await this.getTableRecords();this.roiTable.renderTable(e)}dismissTable(){this.roiTable.dismiss()}roiTableIsVisible(){return this.roiTable.isVisible()}async updateUserDefinedROISet(e){let t=await this.getUserDefinedROISet();void 0===t&&(t=this.initializeUserDefinedROISet()),t.addFeature(e),this.setROITableButtonVisibility(!0),await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:t});const i=await this.getTableRecords();this.roiTable.renderTable(i)}setROITableButtonVisibility(e){this.browser.roiTableControl.setVisibility(e)}toggleROIs(){const e=!this.roiSets[0].isVisible;this.roiTable.setROIVisibility(e);for(const t of this.roiSets)t.isVisible=e}async renderAllROISets(){for(let e of this.roiSets)await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})}async renderROISet({browser:e,pixelTop:t,roiSet:i}){const n=e.columnContainer.querySelectorAll(".igv-column");for(let r=0;r<n.length;r++){let{chr:s,start:o,end:a,bpPerPixel:c}=e.referenceFrameList[r];const l=n[r].querySelectorAll(".igv-roi-region");for(let e of l){const t=e.dataset.region,{chr:i,start:n,end:r}=Yy(t);(i!==s||r<o||n>a)&&e.remove()}const h=await i.getFeatures(s,o,a);if(h)for(let l of h){const h=$y(s,l.start,l.end),{x:d,width:u}=Iu(Math.max(o,l.start),Math.min(a,l.end),o,c),f=n[r].querySelector(Ky(h));if(f)f.style.left=`${d}px`,f.style.width=`${u}px`;else{const s=this.createRegionElement(e.columnContainer,t,d,u,i,h,l);n[r].appendChild(s)}}}}createRegionElement(t,i,n,r,s,o,c){const l=e({class:"igv-roi-region"});l.style.top=`${i}px`,l.style.left=`${n}px`,l.style.width=`${r}px`,l.style.backgroundColor=s.color,l.dataset.color=s.color,l.dataset.region=o;const h=e();return l.appendChild(h),h.style.backgroundColor=s.headerColor,h.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),a(e,t),this.roiMenu.present(c,s,e,this,t,l)})),l}renderSVGContext(e,t,{deltaX:i,deltaY:n}){for(const r of e.querySelectorAll(".igv-roi-region")){const{x:e,y:s,width:o,height:a}=r.getBoundingClientRect();t.fillStyle=r.style.backgroundColor,t.fillRect(e-i,s+n,o,a);const c=r.querySelector("div"),{x:l,y:h,width:d,height:u}=c.getBoundingClientRect();t.fillStyle=c.style.backgroundColor,t.fillRect(l-i,h+n,d,u)}}getUserDefinedROISet(){return this.roiSets.find((e=>!0===e.isUserDefined))}initializeUserDefinedROISet(){const e=new ku({name:"user defined",isUserDefined:!0,features:[]},this.browser.genome);return this.roiSets.push(e),e}async deleteRegionWithKey(e,t){t.querySelectorAll(Ky(e)).forEach((e=>e.remove()));const{feature:i,set:n}=await this.findRegionWithKey(e);n&&n.removeFeature(i);0===(await this.getTableRecords()).length&&(this.browser.roiTableControl.buttonHandler(!1),this.setROITableButtonVisibility(!1))}async findRegionWithKey(e){const{chr:t,start:i,end:n}=Yy(e);for(let e of this.roiSets){const r=await e.getFeatures(t,i,n);for(let s of r)if(s.chr===t&&s.start>=i&&s.end<=n)return{feature:s,set:e}}return{feature:void 0,set:void 0}}toJSON(){return this.roiSets.map((e=>e.toJSON()))}dispose(){this.browser.off("locuschange",this.boundLocusChangeHandler);const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();this.roiMenu&&this.roiMenu.dispose(),this.roiTable&&this.roiTable.dispose();for(let e of this.roiSets)e.dispose();for(let e of Object.keys(this))this[e]=void 0}}function Gy(){this.renderAllROISets()}function $y(e,t,i){return`${e}-${t}-${i}`}function Ky(e){return`[data-region="${e}"]`}function Yy(e){let t=e.split("-"),i=parseInt(t.pop()),n=parseInt(t.pop()),r=t.join("-");return{chr:r,start:n,end:i,locus:`${r}:${n}-${i}`,bedRecord:`${r}\t${n}\t${i}`}}class Xy{constructor(e,t){this.name=e.name,this.featureSource=e.featureSource||Ad(e,t),this.color=e.color||_u}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}draw(e){const{context:t,bpPerPixel:i,bpStart:n,pixelTop:r,pixelHeight:s,pixelWidth:o,features:a}=e;if(!a)return;const c=n+o*i+1;for(let{start:e,end:o}of a){if(o<n)continue;if(e>c)break;const{x:a,width:l}=Iu(e,o,n,i);xo.fillRect(t,a,r,l,s,{fillStyle:this.color})}}}class Zy extends Ju{constructor(e,t){super(t,e,["ROI","Regions of Interest Table"],ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi">\n <rect id="Rectangle-Copy-23" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#737373">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi-hover">\n <rect id="Rectangle-Copy-24" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#FFFFFF">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowROITable&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowROITable&&this.setState(!1)})),this.button.addEventListener("click",(()=>this.buttonHandler(!t.doShowROITable))),this.setVisibility(!1)}buttonHandler(e){this.setState(e),this.browser.setROITableVisibility(e)}}class Jy extends Ju{constructor(e,t,i){super(e,t,"Select Tracks",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select">\n <rect id="backdrop-copy-3" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.32659528" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select-hover">\n <rect id="backdrop-copy-4" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.33" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>',i=!1),this.enableMultiTrackSelection=i,this.button.addEventListener("mouseenter",(e=>{this.setState(!0)})),this.button.addEventListener("mouseleave",(e=>{this.setState(!1)}));this.boundMouseClickHandler=(()=>{this.setMultiTrackSelection(!this.enableMultiTrackSelection)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(!0)}setMultiTrackSelection(e){this.enableMultiTrackSelection=e;for(const e of this.browser.trackViews)!1===mo.has(e.track.type)&&(e.setTrackSelectionState(e.axis,this.enableMultiTrackSelection),this.enableMultiTrackSelection||(e.track.selected=!1));this.setState(this.enableMultiTrackSelection),!1===this.enableMultiTrackSelection&&this.browser.overlayTrackButton.setVisibility(!1)}}class eA{aliasRecordCache=new Map;constructor(e,t,i){(t=t||{}).url=e,this.reader=new Zh(t,i)}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async search(e){if(!this.aliasRecordCache.has(e)){const t=await this.reader.search(e);if(t)for(let e of Object.keys(t))"start"!==e&&"end"!==e&&this.aliasRecordCache.set(t[e],t)}return this.aliasRecordCache.get(e)}async getChromosomeNames(){return await this.reader.loadHeader(),Array.from(this.reader.chrNames)}}class tA{aliasRecordCache=new Map;constructor(e,t,i){this.aliasURL=e,this.config=t,this.genome=i}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async loadAliases(){const e=await Qs.loadString(this.aliasURL,qa(this.config)),t=Dt(e),i=t[0];i.startsWith("#")&&(this.headings=i.substring(1).split("\t").map((e=>e.trim())),this.altNameSets=this.headings.slice(1));const n=this.genome.chromosomeNames?new Set(this.genome.chromosomeNames):new Set;for(let e of t)if(!e.startsWith("#")&&e.length>0){const t=e.split("\t");let i=t.find((e=>n.has(e)));i||(i=t[0]);const r={chr:i};for(let e=0;e<t.length;e++){r[this.headings?this.headings[e]:e]=t[e],this.aliasRecordCache.set(t[e],r)}}}async search(e){return 0===this.aliasRecordCache.size&&await this.loadAliases(),this.aliasRecordCache.get(e)}}class iA{constructor(e,t,i,n){this.start=e,this.end=t,this.name=i,this.stain=0,"acen"===n?this.type="c":(this.type=n.charAt(1),"p"===this.type&&(this.stain=parseInt(n.substring(4))))}}class nA{cytobandMap=new Map;constructor(e,t,i){(t=t||{}).url=e,this.source=new od(t,i)}async getCytobands(e){if(this.cytobandMap.has(e))return this.cytobandMap.get(e);{let t=await this.#_(e);return t||(t=[]),this.cytobandMap.set(e,t),t}}async#_(e){return(await this.source.getFeatures({chr:e})).map((e=>new iA(e.start,e.end,e.name,e.gieStain)))}}class rA{cytobands=new Map;constructor(e,t){this.url=e,this.config=t}async getCytobands(e){return 0===this.cytobands.size&&await this.#x(),this.cytobands.get(e)}async#x(){let e,t;if($a(this.url)){const t=vs(this.url);e="";const i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n])}else e=await Qs.loadString(this.url,qa(this.config));let i=[];const n=Dt(e);for(let e of n){const n=e.split("\t"),r=n[0];if(t||(t=r),r!==t&&(this.cytobands.set(t,i),i=[],t=r),5===n.length){const e=parseInt(n[1]),t=parseInt(n[2]),r=n[3],s=n[4];i.push(new iA(e,t,r,s))}}}async getChromosomeNames(){return 0===this.cytobands.size&&await this.#x(),Array.from(this.cytobands.keys())}async getChromosomes(){0===this.cytobands.size&&await this.#x();const e=[];let t=0;for(let[i,n]of this.cytobands.entries())e.push(new hc(i,t++,n[n.length-1].end));return e}}class sA{aliasRecordCache=new Map;constructor(e,t){this.genomeID=e,this.update(e,t)}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}update(e,t){if(t){const i=[];for(let n of t){if(this.aliasRecordCache.has(n))continue;let t=!1;const r={chr:n};if(i.push(r),n.startsWith("gi|")){const e=sA.getNCBIName(n);r["ncbi-gi-versioned"]=e;const t=e.lastIndexOf(".");if(t>0){const e=e.substring(0,t);r["ncbi-gi"]=e}}else{if(e.startsWith("hg")||e.startsWith("GRCh")||"1kg_ref"===e||"b37"===e)switch(n){case"23":r.ucsc="chrX",t=!0;break;case"24":r.ucsc="chrY",t=!0;break;case"chrX":r.ncbi="23",t=!0;break;case"chrY":r.ncbi="24",t=!0}else if(e.startsWith("mm")||e.startsWith("GRCm")||e.startsWith("rheMac"))switch(n){case"21":r.ucsc="chrX",t=!0;break;case"22":r.ucsc="chrY",t=!0;break;case"chrX":r.ncbi="21",t=!0;break;case"chrY":r.ncbi="22",t=!0}if(t)continue;"chrM"===n?r.ncbi="MT":"MT"===n?r.ucsc="chrM":n.toLowerCase().startsWith("chr")?r.ncbi=n.substring(3):Number.isInteger(Number(n))&&(r.ucsc="chr"+n)}}for(let e of i)for(let t of Object.values(e))this.aliasRecordCache.set(t,e)}}search(e){return this.aliasRecordCache.get(e)}static getNCBIName(e){const t=e.split("\\|");return t[t.length-1]}}class oA{#k;static async createGenome(e,t){const i=new oA(e,t);return await i.init(),i}constructor(e,t){this.config=e,this.browser=t,this.id=e.id||function(e){return void 0!==e.id?e.id:e.fastaURL&&Mt(e.fastaURL)&&!e.fastaURL.startsWith("data:")?e.fastaURL:e.fastaURL&&e.fastaURL.name?e.fastaURL.name:""}(e),this.name=e.name,this.nameSet=e.nameSet}async init(){const e=this.config;if(this.sequence=await Bc(e,this.browser),e.chromSizesURL?this.chromosomes=await async function(e){const t=new Map;let i;if($a(e)){let t=vs(e);i="";for(let e of t)i+=String.fromCharCode(e)}else i=await Qs.load(e,{});const n=vc(i);let r=0;for(let e of n){const i=e.split("\t");if(i.length>1){const e=Number.parseInt(i[1]);t.set(i[0],new hc(i[0],r++,e))}}return t}(e.chromSizesURL):this.chromosomes=this.sequence.chromosomes||new Map,this.chromosomes.size>0&&(this.chromosomeNames=Array.from(this.chromosomes.keys())),e.chromAliasBbURL?(this.chromAlias=new eA(e.chromAliasBbURL,Object.assign({},e),this),this.chromosomeNames||(this.chromosomeNames=await this.chromAlias.getChromosomeNames())):e.aliasURL?this.chromAlias=new tA(e.aliasURL,Object.assign({},e),this):this.chromosomeNames&&(this.chromAlias=new sA(this.id,this.chromosomeNames)),e.cytobandBbURL)this.cytobandSource=new nA(e.cytobandBbURL,Object.assign({},e),this),this.chromosomeNames||(this.chromosomeNames=await this.cytobandSource.getChromosomeNames());else if(e.cytobandURL&&(this.cytobandSource=new rA(e.cytobandURL,Object.assign({},e)),this.chromosomeNames||(this.chromosomeNames=await this.cytobandSource.getChromosomeNames()),0===this.chromosomes.size)){const e=await this.cytobandSource.getChromosomes();for(let t of e)this.chromosomes.set(e.name,e)}if(!1!==e.wholeGenomeView&&this.chromosomes.size>0&&(e.chromosomeOrder?Array.isArray(e.chromosomeOrder)?this.#k=e.chromosomeOrder:this.#k=e.chromosomeOrder.split(",").map((e=>e.trim())):this.#k=function(e){const t=[];let i,n=1;for(let r of e.values()){if(i){if(r.bpLength<i/100)continue;i=((n-1)*i+r.bpLength)/n,t.push(r.name)}else i=r.bpLength,t.push(r.name);n++}return t}(this.chromosomes)),this.wholeGenomeView=!1!==e.wholeGenomeView&&this.#k&&this.chromosomes.size>1,this.wholeGenomeView){const e=this.#k.reduce(((e,t)=>e+this.chromosomes.get(t).bpLength),0);this.chromosomes.set("all",new hc("all",0,e))}}get description(){return this.config.description||`${this.id}\n${this.name}`}get infoURL(){return this.config.infoURL}showWholeGenomeView(){return this.wholeGenomeView}toJSON(){return Object.assign({},this.config,{tracks:void 0})}get initialLocus(){return this.config.locus?this.config.locus:this.getHomeChromosomeName()}getHomeChromosomeName(){return this.showWholeGenomeView()&&this.chromosomes.has("all")?"all":this.chromosomeNames[0]}getChromosomeName(e){return this.chromAlias?this.chromAlias.getChromosomeName(e,this.chromosomes.keys()):e}getChromosomeDisplayName(e){return this.nameSet&&this.chromAlias&&this.chromAlias.getChromosomeAlias(e,this.nameSet)||e}getChromosome(e){return this.chromAlias&&(e=this.chromAlias.getChromosomeName(e)),this.chromosomes.get(e)}async loadChromosome(e){if(this.chromAlias){const t=await this.chromAlias.search(e);t&&(e=t.chr)}if(!this.chromosomes.has(e)){let t;const i=await this.sequence.getSequenceRecord(e);i&&(t=new hc(e,0,i.bpLength)),this.chromosomes.set(e,t)}return this.chromosomes.get(e)}async getAliasRecord(e){if(this.chromAlias)return this.chromAlias.search(e)}async getCytobands(e){if(this.cytobandSource){const t=this.getChromosomeName(e);return await this.cytobandSource.getCytobands(t)}}getChromosomes(){return this.chromosomes}get wgChromosomeNames(){return this.#k?this.#k.slice():void 0}get showChromosomeWidget(){return this.config.showChromosomeWidget}getGenomeCoordinate(e,t){var i=this.getCumulativeOffset(e);if(void 0!==i)return i+t}getChromosomeCoordinate(e){let t;void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=computeCumulativeOffsets.call(this));let i=0;for(let n of this.#k){const r=this.cumulativeOffsets[n];if(r>e){return{chr:t,position:e-i}}t=n,i=r}return{chr:this.#k[this.#k.length-1],position:0}}getCumulativeOffset(e){void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=function(){let e={},t=0;for(let i of this.#k){e[i]=Math.floor(t);t+=this.getChromosome(i).bpLength}return e}.call(this));const t=this.getChromosomeName(e);return this.cumulativeOffsets[t]}getGenomeLength(){if(!this.bpLength){let e=0;for(let t of this.#k){e+=this.chromosomes.get(t).bpLength}this.bpLength=e}return this.bpLength}async getSequence(e,t,i){return e=this.getChromosomeName(e),this.sequence.getSequence(e,t,i)}getSequenceInterval(e,t,i){return"function"==typeof this.sequence.getSequenceInterval?this.sequence.getSequenceInterval(e,t,i):void 0}}class aA{constructor(){this.clear()}clear(){this.phenotypeColors=new Map,this.snps=new Set,this.qtl=null}isEmpty(){return 0===this.phenotypeColors.size&&0===this.snps.size&&null===this.qtl}addSnp(e){e=e.toUpperCase(),this.snps.add(e)}addPhenotype(e){e=e.toUpperCase();const t=this.phenotypeColors.size;if(!this.phenotypeColors.has(e.toUpperCase())){const i=t<cA.length?cA[t]:_s.randomRGB(0,255);this.phenotypeColors.set(e.toUpperCase(),i)}}hasSnp(e){return e&&this.snps.has(e.toUpperCase())}hasPhenotype(e){return e&&this.phenotypeColors.has(e.toUpperCase())}hasQTL(e){return this.qtls.has(e)}colorForGene(e){return e?this.phenotypeColors.get(e.toUpperCase()):"black"}toJSON(){const e={};return this.phenotypeColors.size>0&&(e.phenotypes=Array.from(this.phenotypeColors.keys())),this.snps.size>0&&(e.snps=Array.from(this.snps)),this.qtl&&(e.qtl=this.qtl),e}static fromJSON(e){const t=new aA;if(e.phenotypes)for(let i of e.phenotypes)t.addPhenotype(i);if(e.snps)for(let i of e.snps)t.addSnp(i);return e.qtl&&(t.qtl=e.qtl),t}}const cA=[];cA.push("rgb(228,26,28)"),cA.push("rgb(55,126,184)"),cA.push("rgb(77,175,74)"),cA.push("rgb(166,86,40)"),cA.push("rgb(152,78,163)"),cA.push("rgb(255,127,0)"),cA.push("rgb(247,129,191)"),cA.push("rgb(255,255,51)"),cA.push("rgb(102,194,165)"),cA.push("rgb(252,141,98)"),cA.push("rgb(141, 160, 203)"),cA.push("rgb(231, 138, 195)"),cA.push("rgb(166, 216, 84)"),cA.push("rgb(255, 217, 47)"),cA.push("rgb(229, 196, 148)"),cA.push("rgb( 141, 211, 199)"),cA.push("rgb(255, 255, 179)"),cA.push("rgb(190, 186, 218)"),cA.push("rgb(251, 128, 114)"),cA.push("rgb(128, 177, 211)"),cA.push("rgb(253, 180, 98)"),cA.push("rgb(179, 222, 105)"),cA.push("rgb(252, 205, 229)"),cA.push("rgb(188, 128, 189)"),cA.push("rgb(204, 235, 197)"),cA.push("rgb(255, 237, 111)");class lA{qtlSelections=new aA;constructor(t,i){this.config=t,this.guid=s(),this.namespace=".browser_"+this.guid,this.parent=i;let n=i.shadowRoot;if(!n){n=i.attachShadow({mode:"open"});const e=new CSSStyleSheet;e.replaceSync('.igv-ui-dropdown {\n cursor: default;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2048;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n background-color: white;\n}\n.igv-ui-dropdown > div {\n overflow-y: auto;\n overflow-x: hidden;\n background-color: white;\n}\n.igv-ui-dropdown > div > div {\n padding: 4px;\n width: 100%;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: 1px;\n background-color: white;\n}\n.igv-ui-dropdown > div > div:last-child {\n border-bottom-color: transparent;\n border-bottom-width: 0;\n}\n.igv-ui-dropdown > div > div:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.igv-ui-popover {\n cursor: default;\n position: absolute;\n z-index: 2048;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n background-color: white;\n}\n.igv-ui-popover > div:first-child {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-width: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-popover > div:first-child > div:first-child {\n margin-left: 4px;\n}\n.igv-ui-popover > div:first-child > div:last-child {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-popover > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-popover > div:last-child {\n user-select: text;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 400px;\n max-width: 800px;\n background-color: white;\n border-bottom-width: 0;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-ui-popover > div:last-child > div {\n margin-left: 4px;\n margin-right: 4px;\n min-width: 220px;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.igv-ui-popover > div:last-child > div > span {\n font-weight: bolder;\n}\n.igv-ui-popover > div:last-child hr {\n width: 100%;\n}\n\n.igv-ui-alert-dialog-container {\n box-sizing: content-box;\n position: absolute;\n z-index: 2048;\n top: 50%;\n left: 50%;\n width: 400px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n outline: none;\n font-family: "Open Sans", sans-serif;\n font-size: 15px;\n font-weight: 400;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:first-child {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-alert-dialog-container > div:first-child div:first-child {\n padding-left: 8px;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body {\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n color: #373737;\n width: 100%;\n height: calc(100% - 24px - 64px);\n overflow-y: scroll;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body .igv-ui-alert-dialog-body-copy {\n margin: 16px;\n width: auto;\n height: auto;\n overflow-wrap: break-word;\n word-break: break-word;\n background-color: white;\n border: unset;\n}\n.igv-ui-alert-dialog-container > div:last-child {\n width: 100%;\n margin-bottom: 10px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:last-child div {\n margin: unset;\n width: 40px;\n height: 30px;\n line-height: 30px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n border-color: #2B81AF;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-alert-dialog-container > div:last-child div:hover {\n cursor: pointer;\n border-color: #25597f;\n background-color: #25597f;\n}\n\n.igv-ui-color-swatch {\n position: relative;\n box-sizing: content-box;\n display: flex;\n flex-flow: row;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n border-style: solid;\n border-width: 2px;\n border-color: white;\n border-radius: 4px;\n}\n\n.igv-ui-color-swatch:hover {\n border-color: dimgray;\n}\n\n.igv-ui-colorpicker-menu-close-button {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 32px;\n margin-top: 4px;\n margin-bottom: 4px;\n padding-right: 8px;\n}\n.igv-ui-colorpicker-menu-close-button i.fa {\n display: block;\n margin-left: 4px;\n margin-right: 4px;\n color: #5f5f5f;\n}\n.igv-ui-colorpicker-menu-close-button i.fa:hover,\n.igv-ui-colorpicker-menu-close-button i.fa:focus,\n.igv-ui-colorpicker-menu-close-button i.fa:active {\n cursor: pointer;\n color: #0f0f0f;\n}\n\n.igv-ui-generic-dialog-container {\n box-sizing: content-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 300px;\n height: fit-content;\n padding-bottom: 16px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n z-index: 2048;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input > div {\n width: fit-content;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input[type=range] {\n width: 70%;\n -webkit-appearance: none;\n background: linear-gradient(90deg, white, black);\n outline: none;\n margin: 0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input output {\n display: block;\n height: 100%;\n width: 20%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n padding-top: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div {\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n\n.igv-ui-generic-container {\n box-sizing: content-box;\n position: absolute;\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-container > div:first-child {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-ui-generic-container > div:first-child > div {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-ui-dialog {\n z-index: 2048;\n position: fixed;\n width: fit-content;\n height: fit-content;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n background-color: white;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n}\n.igv-ui-dialog .igv-ui-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-dialog .igv-ui-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-dialog .igv-ui-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-dialog .igv-ui-dialog-one-liner {\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin: 8px;\n overflow-wrap: break-word;\n background-color: white;\n font-weight: bold;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel {\n width: 100%;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div {\n margin: 16px;\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child {\n background-color: #5ea4e0;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child {\n background-color: #c4c4c4;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-ui-panel, .igv-ui-panel-row, .igv-ui-panel-column {\n z-index: 2048;\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-panel-column {\n display: flex;\n flex-direction: column;\n}\n\n.igv-ui-panel-row {\n display: flex;\n flex-direction: row;\n}\n\n.igv-ui-textbox {\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-table {\n background-color: white;\n}\n\n.igv-ui-table thead {\n position: sticky;\n top: 0;\n}\n\n.igv-ui-table th {\n text-align: left;\n}\n\n.igv-ui-table td {\n padding-right: 20px;\n}\n\n.igv-ui-table tr:hover {\n background-color: lightblue;\n}\n\n.igv-ui-center-fixed {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.igv-navbar {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n color: #444;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n line-height: 32px;\n padding-left: 8px;\n padding-right: 8px;\n margin-top: 2px;\n margin-bottom: 6px;\n height: 32px;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: #f3f3f3;\n}\n.igv-navbar .igv-navbar-left-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 32px;\n line-height: 32px;\n}\n.igv-navbar .igv-navbar-left-container .igv-logo {\n width: 34px;\n height: 32px;\n margin-right: 8px;\n}\n.igv-navbar .igv-navbar-left-container .igv-current-genome {\n height: 32px;\n margin-left: 4px;\n margin-right: 4px;\n user-select: none;\n line-height: 32px;\n vertical-align: middle;\n text-align: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n height: 100%;\n width: 125px;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container select {\n display: block;\n cursor: pointer;\n width: 100px;\n height: 75%;\n outline: none;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n margin-left: 8px;\n height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 240px;\n height: 22px;\n line-height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container input.igv-search-input {\n cursor: text;\n width: 85%;\n height: 22px;\n line-height: 22px;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n text-align: left;\n padding-left: 8px;\n margin-right: 8px;\n outline: none;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: white;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container .igv-search-icon-container {\n cursor: pointer;\n height: 16px;\n width: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-windowsize-panel-container {\n margin-left: 4px;\n user-select: none;\n}\n.igv-navbar .igv-navbar-right-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container {\n position: relative;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container-hidden {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget {\n color: #737373;\n font-size: 18px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:nth-child(even) {\n display: block;\n height: fit-content;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget input {\n display: block;\n width: 125px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 {\n color: #737373;\n font-size: 18px;\n height: 32px;\n line-height: 32px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:nth-child(even) {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 input {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-hidden {\n display: none;\n}\n\n.igv-navbar-button {\n display: block;\n box-sizing: unset;\n padding-left: 6px;\n padding-right: 6px;\n height: 18px;\n text-transform: capitalize;\n user-select: none;\n line-height: 18px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 11px;\n font-weight: 200;\n color: #737373;\n background-color: #f3f3f3;\n border-color: #737373;\n border-style: solid;\n border-width: thin;\n border-radius: 6px;\n}\n\n.igv-navbar-button:hover {\n cursor: pointer;\n}\n\n.igv-navbar-button-clicked {\n color: white;\n background-color: #737373;\n}\n\n.igv-navbar-icon-button {\n cursor: pointer;\n position: relative;\n width: 24px;\n height: 24px;\n margin-left: 4px;\n margin-right: 4px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:first-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: -18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:last-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.igv-navbar-text-button {\n cursor: pointer;\n position: relative;\n margin-left: 2px;\n margin-right: 2px;\n border: none;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar-text-button > div:nth-child(2) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 0;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-text-button > div:nth-child(3) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 42px;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n#igv-text-button-label {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-inactive rect {\n stroke: #737373;\n fill: white;\n}\n.igv-navbar-text-button-svg-inactive text {\n fill: #737373;\n}\n.igv-navbar-text-button-svg-inactive tspan {\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-hover rect {\n stroke: #737373;\n fill: #737373;\n}\n.igv-navbar-text-button-svg-hover text {\n fill: white;\n}\n.igv-navbar-text-button-svg-hover tspan {\n dominant-baseline: middle;\n}\n\n#igv-save-svg-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-svg-group text {\n fill: #737373;\n}\n\n#igv-save-svg-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-svg-group:hover text {\n fill: white;\n}\n\n#igv-save-png-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-png-group text {\n fill: #737373;\n}\n\n#igv-save-png-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-png-group:hover text {\n fill: white;\n}\n\n.igv-zoom-in-notice-container {\n z-index: 256;\n position: absolute;\n top: 8px;\n left: 50%;\n transform: translate(-50%, 0%);\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n background-color: white;\n}\n.igv-zoom-in-notice-container > div {\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n width: 100%;\n height: 100%;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: #3f3f3f;\n}\n\n.igv-zoom-in-notice {\n position: absolute;\n top: 10px;\n left: 50%;\n}\n.igv-zoom-in-notice div {\n position: relative;\n left: -50%;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #3f3f3f;\n background-color: rgba(255, 255, 255, 0.51);\n z-index: 64;\n}\n\n.igv-container-spinner {\n position: absolute;\n top: 90%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1024;\n width: 24px;\n height: 24px;\n pointer-events: none;\n color: #737373;\n}\n\n.igv-multi-locus-close-button {\n position: absolute;\n top: 2px;\n right: 0;\n padding-left: 2px;\n padding-right: 2px;\n width: 12px;\n height: 12px;\n color: #666666;\n background-color: white;\n z-index: 1000;\n}\n.igv-multi-locus-close-button > svg {\n vertical-align: top;\n}\n\n.igv-multi-locus-close-button:hover {\n cursor: pointer;\n color: #434343;\n}\n\n.igv-multi-locus-ruler-label {\n z-index: 64;\n position: absolute;\n top: 2px;\n left: 0;\n width: 100%;\n height: 12px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-multi-locus-ruler-label > div {\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n color: rgb(16, 16, 16);\n background-color: white;\n}\n.igv-multi-locus-ruler-label > div {\n cursor: pointer;\n}\n\n.igv-multi-locus-ruler-label-square-dot {\n z-index: 64;\n position: absolute;\n left: 50%;\n top: 5%;\n transform: translate(-50%, 0%);\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-multi-locus-ruler-label-square-dot > div:first-child {\n width: 14px;\n height: 14px;\n}\n.igv-multi-locus-ruler-label-square-dot > div:last-child {\n margin-left: 16px;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: rgb(16, 16, 16);\n}\n\n.igv-ruler-sweeper {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 26px;\n bottom: 0;\n left: 0;\n width: 0;\n z-index: 99999;\n background-color: rgba(68, 134, 247, 0.25);\n}\n\n.igv-ruler-tooltip {\n pointer-events: none;\n z-index: 128;\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 32px;\n background-color: transparent;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ruler-tooltip > div {\n pointer-events: none;\n width: 128px;\n height: auto;\n padding: 1px;\n color: #373737;\n font-size: 10px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n background-color: white;\n border-style: solid;\n border-width: thin;\n border-color: #373737;\n}\n\n.igv-track-label {\n position: absolute;\n left: 8px;\n top: 8px;\n width: auto;\n height: auto;\n max-width: 50%;\n padding-left: 4px;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-color: #444;\n border-radius: 2px;\n border-style: solid;\n border-width: thin;\n background-color: white;\n z-index: 128;\n cursor: pointer;\n}\n\n.igv-track-label:hover,\n.igv-track-label:focus,\n.igv-track-label:active {\n background-color: #e8e8e8;\n}\n\n.igv-track-label-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-top: 4px;\n}\n\n.igv-center-line {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n z-index: 8;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-left-style: dashed;\n border-left-width: thin;\n border-right-style: dashed;\n border-right-width: thin;\n}\n\n.igv-center-line-wide {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(127, 127, 127, 0.51);\n}\n\n.igv-center-line-thin {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(0, 0, 0, 0);\n}\n\n.igv-cursor-guide-horizontal {\n display: none;\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 50%;\n height: 1px;\n z-index: 32;\n margin-left: 50px;\n margin-right: 54px;\n border-top-style: dotted;\n border-top-width: thin;\n border-top-color: rgba(127, 127, 127, 0.76);\n}\n\n.igv-cursor-guide-vertical {\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n width: 1px;\n z-index: 32;\n border-left-style: dotted;\n border-left-width: thin;\n border-left-color: rgba(127, 127, 127, 0.76);\n display: none;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-generic-dialog-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 300px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n z-index: 2048;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-generic-dialog-container .igv-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input div {\n width: 30%;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div {\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-generic-container {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-container div:first-child {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-generic-container div:first-child i {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-menu-popup {\n position: absolute;\n top: 0;\n left: 0;\n width: max-content;\n max-width: 400px;\n z-index: 512;\n cursor: pointer;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background: white;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-end;\n text-align: left;\n}\n.igv-menu-popup > div:not(:first-child) {\n width: 100%;\n}\n.igv-menu-popup > div:not(:first-child) > div {\n background: white;\n}\n.igv-menu-popup > div:not(:first-child) > div.context-menu {\n padding-left: 4px;\n padding-right: 4px;\n}\n.igv-menu-popup > div:not(:first-child) > div:last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-menu-popup > div:not(:first-child) > div:hover {\n background: #efefef;\n}\n\n.igv-menu-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-bottom: 1px;\n padding-top: 1px;\n}\n\n.igv-menu-popup-header {\n position: relative;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-menu-popup-header div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-menu-popup-header div:hover {\n cursor: pointer;\n color: #444;\n}\n\n.igv-menu-popup-check-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 20px;\n margin-right: 4px;\n background-color: transparent;\n}\n.igv-menu-popup-check-container div {\n padding-top: 2px;\n padding-left: 8px;\n}\n.igv-menu-popup-check-container div:first-child {\n position: relative;\n width: 12px;\n height: 12px;\n}\n.igv-menu-popup-check-container div:first-child svg {\n position: absolute;\n width: 12px;\n height: 12px;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-loading-spinner-container {\n z-index: 1024;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 32px;\n height: 32px;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-loading-spinner-container > div {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: 4px solid rgba(128, 128, 128, 0.5);\n border-top-color: rgb(255, 255, 255);\n animation: spin 1s ease-in-out infinite;\n -webkit-animation: spin 1s ease-in-out infinite;\n}\n\n@keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@-webkit-keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.igv-roi-menu {\n position: absolute;\n z-index: 512;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background-color: white;\n width: 192px;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-menu > div:first-child {\n height: 24px;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-roi-menu > div:first-child > div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-roi-menu > div:first-child > div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-menu > div:last-child {\n background-color: white;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: 0;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n text-align: start;\n vertical-align: middle;\n}\n.igv-roi-menu > div:last-child > div {\n height: 24px;\n padding-left: 4px;\n border-bottom-style: solid;\n border-bottom-width: thin;\n border-bottom-color: #7f7f7f;\n}\n.igv-roi-menu > div:last-child > div:not(:first-child):hover {\n cursor: pointer;\n background-color: rgba(127, 127, 127, 0.1);\n}\n.igv-roi-menu > div:last-child div:first-child {\n font-style: italic;\n text-align: center;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.igv-roi-menu > div:last-child > div:last-child {\n border-bottom-width: 0;\n border-bottom-color: transparent;\n}\n\n.igv-roi-placeholder {\n font-style: normal;\n color: rgba(75, 75, 75, 0.6);\n}\n\n.igv-roi-table {\n position: absolute;\n z-index: 1024;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n resize: both;\n overflow: hidden;\n width: min-content;\n max-width: 1600px;\n border-color: #7f7f7f;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 400;\n background-color: white;\n cursor: default;\n}\n.igv-roi-table > div {\n height: 24px;\n font-size: 14px;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n}\n.igv-roi-table > div:first-child {\n border-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-top-width: 0;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-roi-table > div:first-child > div:first-child {\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n margin-left: 4px;\n margin-right: 4px;\n width: calc(100% - 4px - 12px);\n}\n.igv-roi-table > div:first-child > div:last-child {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7f7f7f;\n}\n.igv-roi-table > div:first-child > div:last-child > svg {\n display: block;\n}\n.igv-roi-table > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-table > .igv-roi-table-description {\n padding: 4px;\n margin-left: 4px;\n word-break: break-all;\n overflow-y: auto;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-goto-explainer {\n margin-top: 5px;\n margin-left: 4px;\n color: #7F7F7F;\n font-style: italic;\n height: 24px;\n border-top: solid lightgray;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-column-titles {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n padding-right: 16px;\n background-color: white;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: #7f7f7f;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n overflow: auto;\n height: 360px;\n flex: 1 1 auto;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: transparent;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row-hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.igv-roi-table > div:last-child {\n min-height: 32px;\n height: 32px;\n line-height: 32px;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: transparent;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-width: 0;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n\n.igv-roi-table-row-selected {\n background-color: rgba(0, 0, 0, 0.125);\n}\n\n.igv-roi-table-button {\n cursor: pointer;\n height: 20px;\n user-select: none;\n line-height: 20px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 13px;\n font-weight: 400;\n color: black;\n padding-left: 6px;\n padding-right: 6px;\n background-color: rgb(239, 239, 239);\n border-color: black;\n border-style: solid;\n border-width: thin;\n border-radius: 3px;\n}\n\n.igv-roi-table-button:hover {\n font-weight: 400;\n background-color: rgba(0, 0, 0, 0.13);\n}\n\n.igv-roi-region {\n z-index: 64;\n position: absolute;\n top: 0;\n bottom: 0;\n pointer-events: none;\n overflow: visible;\n margin-top: 66px;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-region > div {\n position: relative;\n width: 100%;\n height: 8px;\n pointer-events: auto;\n}\n\n.igv-roi-menu-row {\n height: 24px;\n padding-left: 8px;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n background-color: white;\n}\n\n.igv-roi-menu-row-edit-description {\n width: -webkit-fill-available;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n background-color: white;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-menu-row-edit-description > label {\n margin-left: 2px;\n margin-bottom: 0;\n display: block;\n width: -webkit-fill-available;\n}\n.igv-roi-menu-row-edit-description > input {\n display: block;\n margin-left: 2px;\n margin-right: 2px;\n margin-bottom: 1px;\n width: -webkit-fill-available;\n}\n\n.igv-container {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-top: 4px;\n user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n min-height: 160px;\n}\n\n.igv-viewport {\n position: relative;\n margin-top: 5px;\n line-height: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.igv-viewport-content {\n position: relative;\n width: 100%;\n}\n.igv-viewport-content > canvas {\n position: relative;\n display: block;\n}\n\n.igv-column-container {\n position: relative;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n width: 100%;\n}\n\n.igv-column-shim {\n width: 1px;\n margin-left: 2px;\n margin-right: 2px;\n background-color: #545453;\n}\n\n.igv-axis-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 50px;\n}\n.igv-axis-column > div {\n position: relative;\n margin-top: 5px;\n width: 100%;\n}\n.igv-axis-column > div > div {\n z-index: 512;\n position: absolute;\n top: 8px;\n left: 8px;\n width: fit-content;\n height: fit-content;\n background-color: transparent;\n display: grid;\n align-items: start;\n justify-items: center;\n}\n.igv-axis-column > div > div > input {\n display: block;\n margin: unset;\n cursor: pointer;\n}\n\n.igv-column {\n position: relative;\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-info-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-name-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-scrollbar-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 14px;\n}\n.igv-scrollbar-column > div {\n position: relative;\n margin-top: 5px;\n width: 14px;\n}\n.igv-scrollbar-column > div > div {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 2px;\n width: 8px;\n border-width: 1px;\n border-style: solid;\n border-color: #c4c4c4;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-scrollbar-column > div > div:hover {\n background-color: #c4c4c4;\n}\n\n.igv-track-drag-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 12px;\n background-color: white;\n}\n.igv-track-drag-column > .igv-track-drag-handle {\n z-index: 512;\n position: relative;\n cursor: pointer;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n.igv-track-drag-column .igv-track-drag-handle-color {\n background-color: #c4c4c4;\n}\n.igv-track-drag-column .igv-track-drag-handle-hover-color {\n background-color: #787878;\n}\n.igv-track-drag-column .igv-track-drag-handle-selected-color {\n background-color: #0963fa;\n}\n.igv-track-drag-column > .igv-track-drag-shim {\n position: relative;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n}\n\n.igv-gear-menu-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 28px;\n}\n.igv-gear-menu-column > div {\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 5px;\n width: 100%;\n background: white;\n}\n.igv-gear-menu-column > div > div {\n position: relative;\n margin-top: 4px;\n width: 16px;\n height: 16px;\n color: #7F7F7F;\n}\n.igv-gear-menu-column > div > div:hover {\n cursor: pointer;\n color: #444;\n}\n\n/*# sourceMappingURL=igv.css.map */\n'),n.adoptedStyleSheets=[e]}if(this.root=e({class:"igv-container"}),n.appendChild(this.root),this.spinner=e({class:"igv-loading-spinner-container"}),this.root.appendChild(this.spinner),this.spinner.appendChild(e()),this.spinner.style.width="64px",this.spinner.style.height="64px",this.stopSpinner(),this.alert=new za(this.root),this.columnContainer=e({class:"igv-column-container"}),this.root.appendChild(this.columnContainer),this.menuPopup=new Xu(this.columnContainer),this.menuUtils=new bo(this),this.initialize(t),this.trackViews=[],this.constants={dragThreshold:3,scrollThreshold:5,defaultColor:"rgb(0,0,150)",doubleClickDelay:t.doubleClickDelay||500},this.eventHandlers={},t.listeners)for(let e of Object.keys(t.listeners))this.on(e,t.listeners[e]);this.on("trackremoved",(()=>{0===this.findTracks((e=>"function"==typeof e.getSamples)).length&&(this.sampleInfoControl.setButtonVisibility(!1),this.sampleNameViewportWidth=void 0,this.showSampleNames=!1,this.sampleNameControl.setState(this.showSampleNames),this.sampleNameControl.hide(),this.layoutChange())})),this.on("didchangecolumnlayout",(()=>{if(yu.length>0){const e=yu.length;for(let t=0;t<e;t++)yu[t].dispose();yu.length=0}})),this.addEventHandlers(),this.sampleInfo=new Uu(this),this.setControls(t),this.roiManager=new Wy(this)}get doShowROITable(){return this.roiManager.roiTableIsVisible()}startSpinner(){this.spinner.style.display="flex"}stopSpinner(){this.spinner.style.display="none"}initialize(e){this.flanking=e.flanking,this.crossDomainProxy=e.crossDomainProxy,this.formats=e.formats,this.trackDefaults=e.trackDefaults,this.nucleotideColors=e.nucleotideColors||Mc;for(let e of Object.keys(this.nucleotideColors))this.nucleotideColors[e.toLowerCase()]=this.nucleotideColors[e];this.doShowTrackLabels=e.showTrackLabels,this.doShowCenterLine=e.showCenterGuide,this.doShowCursorGuide=e.showCursorGuide,this.showSampleNames=e.showSampleNames,this.sampleNameViewportWidth=void 0,e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),e.search&&(this.searchConfig={type:"json",url:e.search.url,coords:void 0===e.search.coords?1:e.search.coords,chromosomeField:e.search.chromosomeField||"chromosome",startField:e.search.startField||"start",endField:e.search.endField||"end",geneField:e.search.geneField||"gene",snpField:e.search.snpField||"snp",resultsField:e.search.resultsField})}setControls(e){const t=this.createStandardControls(e);t.insertBefore(Bt(this.columnContainer)),this.$navigation=t,!1===e.showControls&&t.hide()}createStandardControls(t){const i=Bt("<div>",{class:"igv-navbar"});this.$navigation=i;const n=Bt("<div>",{class:"igv-navbar-left-container"});i.append(n);const r=Bt("<div>",{class:"igv-logo"});n.append(r);const o=Bt('<svg width="690px" height="324px" viewBox="0 0 690 324" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>IGV</title><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="IGV" fill="#666666"><polygon id="Path" points="379.54574 8.00169252 455.581247 8.00169252 515.564813 188.87244 532.884012 253.529506 537.108207 253.529506 554.849825 188.87244 614.833392 8.00169252 689.60164 8.00169252 582.729511 320.722144 486.840288 320.722144"></polygon><path d="M261.482414,323.793286 C207.975678,323.793286 168.339046,310.552102 142.571329,284.069337 C116.803612,257.586572 103.919946,217.158702 103.919946,162.784513 C103.919946,108.410325 117.437235,67.8415913 144.472217,41.0770945 C171.507199,14.3125977 212.903894,0.930550071 268.663545,0.930550071 C283.025879,0.930550071 298.232828,1.84616386 314.284849,3.6774189 C330.33687,5.50867394 344.839793,7.97378798 357.794056,11.072835 L357.794056,68.968378 C339.48912,65.869331 323.578145,63.5450806 310.060654,61.9955571 C296.543163,60.4460336 284.574731,59.6712835 274.154998,59.6712835 C255.850062,59.6712835 240.502308,61.4320792 228.111274,64.9537236 C215.720241,68.4753679 205.793482,74.2507779 198.330701,82.2801269 C190.867919,90.309476 185.587729,100.87425 182.48997,113.974767 C179.392212,127.075284 177.843356,143.345037 177.843356,162.784513 C177.843356,181.942258 179.251407,198.000716 182.067551,210.960367 C184.883695,223.920018 189.671068,234.41436 196.429813,242.443709 C203.188559,250.473058 212.059279,256.178037 223.042241,259.558815 C234.025202,262.939594 247.683295,264.629958 264.01693,264.629958 C268.241146,264.629958 273.098922,264.489094 278.590403,264.207362 C284.081883,263.925631 289.643684,263.50304 295.275972,262.939577 L295.275972,159.826347 L361.595831,159.826347 L361.595831,308.579859 C344.698967,313.087564 327.239137,316.750019 309.215815,319.567334 C291.192494,322.38465 275.281519,323.793286 261.482414,323.793286 L261.482414,323.793286 L261.482414,323.793286 Z" id="Path"></path>;<polygon id="Path" points="0.81355666 5.00169252 73.0472883 5.00169252 73.0472883 317.722144 0.81355666 317.722144"></polygon></g> </g> </svg>');o.css("width","34px"),o.css("height","32px"),r.append(o),this.$current_genome=Bt("<div>",{class:"igv-current-genome"}),n.append(this.$current_genome),this.$current_genome.text("");const a=Bt("<div>",{class:"igv-navbar-genomic-location"});n.append(a),this.chromosomeSelectWidget=new Cy(this,a.get(0)),!1!==t.showChromosomeWidget?this.chromosomeSelectWidget.show():this.chromosomeSelectWidget.hide();const c=Bt("<div>",{class:"igv-locus-size-group"});a.append(c);const h=Bt("<div>",{class:"igv-search-container"});c.append(h),this.$searchInput=Bt("<input>",{class:"igv-search-input",type:"text",placeholder:"Locus Search"}),h.append(this.$searchInput),this.$searchInput[0].addEventListener("keyup",(e=>{e.stopImmediatePropagation()})),this.$searchInput.change((()=>this.doSearch(this.$searchInput.val())));const d=e({class:"igv-search-icon-container"});h.append(Bt(d)),d.appendChild(l("search")),d.addEventListener("click",(()=>this.doSearch(this.$searchInput.val()))),this.windowSizePanel=new _y(c.get(0),this);const u=Bt("<div>",{class:"igv-navbar-right-container"});i.append(u);const f=Bt('<div class="igv-navbar-toggle-button-container">');if(u.append(f),this.$toggle_button_container=f,this.overlayTrackButton=new sf(this,f.get(0)),this.overlayTrackButton.setVisibility(!1),this.multiTrackSelectButton=new Jy(this,f.get(0)),this.cursorGuide=new xy(this.columnContainer,this),this.cursorGuideButton=new ky(this,f.get(0)),this.centerLineButton=new Iy(this,f.get(0)),this.setTrackLabelVisibility(t.showTrackLabels),this.trackLabelControl=new Sy(f.get(0),this),this.roiTableControl=new Zy(f.get(0),this),this.sampleInfoControl=new Ny(f.get(0),this),this.sampleNameControl=new Ey(f.get(0),this),!0===t.showSVGButton&&(this.saveImageControl=new Ty(f.get(0),this)),t.customButtons)for(let e of t.customButtons)new Uy(f.get(0),this,e);return this.zoomWidget=new Ry(this,u.get(0)),!1===t.showNavigation&&this.$navigation.hide(),this.sliderDialog=new Na(this.root),this.sliderDialog.container.id=`igv-slider-dialog-${s()}`,this.inputDialog=new Ba(this.root),this.inputDialog.container.id=`igv-input-dialog-${s()}`,this.dataRangeDialog=new _o(this,Bt(this.root)),this.dataRangeDialog.$container.get(0).id=`igv-data-range-dialog-${s()}`,this.genericColorPicker=new Da({parent:this.columnContainer,width:432}),this.genericColorPicker.container.id=`igv-track-color-picker-${s()}`,i}getSampleNameViewportWidth(){return void 0===this.sampleNameViewportWidth||!1===this.showSampleNames?0:this.sampleNameViewportWidth}getSampleInfoViewportWidth(){return this.getSampleInfoColumnWidth()}isMultiLocusMode(){return this.referenceFrameList&&this.referenceFrameList.length>1}isMultiLocusWholeGenomeView(){if(void 0===this.referenceFrameList||1===this.referenceFrameList.length)return!1;for(let e of this.referenceFrameList)if("all"===e.chr.toLowerCase())return!0;return!1}currentLoci(){const e=e=>`${e.chr}:${e.start+1}-${e.end}`;return void 0===this.referenceFrameList||0===this.referenceFrameList.length?"":1===this.referenceFrameList.length?e(this.referenceFrameList[0]):this.referenceFrameList.map((t=>e(t)))}toSVG(){const{x:e,y:t,width:i,height:n}=this.columnContainer.getBoundingClientRect(),r=new lu({width:i,height:n,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:i,height:n}}),s={deltaX:0,deltaY:-t};for(let e of this.trackViews)e.renderSVGContext(r,s);return s.deltaX=e,this.roiManager.renderSVGContext(this.columnContainer,r,s),r.getSerializedSvg(!0)}saveSVGtoFile(e,t){let i=this.toSVG();if(t){const e=document.createElement("svg");e.innerHTML=i,t.append(e),t.appendChild(e)}const n=e||"igvjs.svg",r=URL.createObjectURL(new Blob([i],{type:"application/octet-stream"}));Pt(n,r),URL.revokeObjectURL(r)}savePNGtoFile(e){const t=this.toSVG(),i=new Blob([t],{type:"image/svg+xml"}),n=URL.createObjectURL(i),r=document.createElement("img");r.addEventListener("load",(()=>{const t=this.columnContainer.getBoundingClientRect(),i=window.devicePixelRatio,s=t.width*i,o=t.height*i,a=document.createElement("canvas");a.width=s,a.height=o;const c=a.getContext("2d");c.scale(i,i),c.drawImage(r,0,0);const l=a.toDataURL("image/png");Pt(e=e||"igvjs.png",l),URL.revokeObjectURL(n)})),r.src=n}async loadSession(e){let t;return this.sampleInfo.initialize(),this.roiSets=[],t=e.url||e.file?await lA.loadSessionFile(e):e,this.loadSessionObject(t)}static async loadSessionFile(e){const t=e.url||e.file;let i;if(e.url&&Mt(e.url)&&(e.url.startsWith("blob:")||e.url.startsWith("data:"))){const t=lA.uncompressSession(e.url);i=JSON.parse(t)}else{let n=e.filename;if(n||(n=e.url?await Wa(e.url):e.file.name),n.endsWith(".xml")){const e=mu.KNOWN_GENOMES,n=await Qs.loadString(t);i=new py(n,e)}else if(n.endsWith("hub.txt")){i={reference:(await du.loadHub(t,e)).getGenomeConfig()}}else{if(!n.endsWith(".json"))throw Error("Unrecognized session file format:"+n);i=await Qs.loadJson(t)}}return mA(i)}async loadSessionObject(e){this.cleanHouseForSession(),this.config=e,e.browsers&&(e=await async function(e){const t=e.browsers[0],i={},n=new Mf({url:t.url});await n.readHeaderAndFooter(),i.sampleNameViewportWidth=20,i.genome="hg38";const r=t.state.split(","),s=n.bpResolutions[Number.parseInt(r[2])],o=Number.parseInt(r[0]),a=Math.floor(Number.parseFloat(r[3])*s),c=a+Math.floor(1700*s);return i.locus=`${n.chromosomes[o].name}:${a}-${c}`,i.tracks=(t.tracks||[]).filter((e=>!("refgene"===e.format||"cellType"===e.name))),i.tracks.push({type:"shoebox",url:t.url,name:t.name,colorScale:t.colorScale,_hicFile:n}),i}(e)),this.sampleInfoControl.setButtonVisibility(!1),this.showSampleNames=e.showSampleNames||!1,this.sampleNameControl.setState(!0===this.showSampleNames),e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),Ka(this.columnContainer,"igv-axis-column"),Ka(this.columnContainer,"igv-sample-info-column"),Ka(this.columnContainer,"igv-sample-name-column"),Ka(this.columnContainer,"igv-scrollbar-column"),Ka(this.columnContainer,"igv-track-drag-column"),Ka(this.columnContainer,"igv-gear-menu-column");const t=e.reference||e.genome;if(!t)return void console.warn("No genome or reference object specified");const i=Mt(t)?await mu.expandReference(this.alert,t):t;if(await this.loadReference(i,i.locus||e.locus),this.centerLineList=this.createCenterLineList(this.columnContainer),!1!==e.showIdeogram){const e=new ly(this);e.id="ideogram";const t=new hf(this,this.columnContainer,e);this.trackViews.push(t)}if(!1!==e.showRuler){const e=new hf(this,this.columnContainer,new Wu(this));this.trackViews.push(e)}e.qtlSelections&&(this.qtlSelections=aA.fromJSON(e.qtlSelections)),this.roiManager.clearROIs(),e.roi?this.roiManager.loadROI(e.roi):await this.roiManager.reset();const n=[];if(e.sampleinfo)for(const t of e.sampleinfo)t.file?n.push(t.file):this.loadSampleInfo(t);const r=i.tracks||[],s=e.tracks?r.concat(e.tracks):r;0===s.filter((e=>"sequence"===e.type&&!e.url&&!e.fastaURL)).length&&s.push({type:"sequence",order:Wd,removable:!1});const o=s.filter((e=>void 0!==e.file)).map((({file:e})=>e)),a=s.filter((e=>void 0!==e.indexFile)).map((({indexFile:e})=>e));a.length>0&&o.push(...a),n.length>0&&o.push(...n),o.length>0&&alert(`Local files cannot be loaded automatically.\nThis session contains references to these local files:\n${o.map((e=>` ${e}`)).join("\n")}`);const c=s.filter((e=>void 0===e.file));let l=1;for(let e of c)void 0===e.order&&(e.order=l++);await this.loadTrackList(c);for(let e of this.trackViews.filter((e=>"ruler"===e.track.type||"ideogram"===e.track.type)))await e.updateViews();return this.trackViews.some((e=>e.track.selected))&&this.multiTrackSelectButton.setMultiTrackSelection(!0),this.updateUIWithReferenceFrameList(),this.updateLocusSearchWidget(),s}cleanHouseForSession(){for(let e of this.trackViews)e.removeDOMFromColumnContainer();this.columnContainer.querySelectorAll(".igv-axis-column, .igv-column-shim, .igv-column, .igv-sample-info-column, .igv-sample-name-column, .igv-scrollbar-column, .igv-track-drag-column, .igv-gear-menu-column").forEach((e=>e.remove())),this.trackViews=[],this.circularView&&this.circularView.clearChords()}async loadReference(e,t){let i;this.removeAllTracks(),this.roiManager.clearROIs(),this.multiTrackSelectButton.setMultiTrackSelection(!1),i=e.gbkURL?await wd(e.gbkURL):await oA.createGenome(e,this);const n=void 0===this.genome||this.genome.id!==i.id;this.genome=i,this.updateNavbarDOMWithGenome(i);let r=t||i.initialLocus;Array.isArray(r)&&(r=r.join(" "));if(!await this.search(r,!0))throw new Error(`Cannot set initial locus ${r}`);if(n){let t;if(e.hubURL){t=(await du.loadHub(e.hubURL)).getGroupedTrackConfigurations()}this.fireEvent("genomechange",[{genome:i,trackConfigurations:t}]),this.circularView&&this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:zm(this.genome)})}}updateNavbarDOMWithGenome(e){let t=e.id&&e.id.length<20?e.id:`${e.id.substring(0,8)}...${e.id.substring(e.id.length-8)}`;this.$current_genome.text(t),this.$current_genome.attr("title",e.description);!1!==this.config.showChromosomeWidget&&!1!==this.genome.showChromosomeWidget&&e.chromosomeNames&&e.chromosomeNames.length>1?(this.chromosomeSelectWidget.update(e),this.chromosomeSelectWidget.show()):this.chromosomeSelectWidget.hide()}async loadGenome(e){let t;e.genarkAccession&&(e.url=hu(e.genarkAccession)),e.url&&(Mt(e.url)&&e.url.endsWith("/hub.txt")?(e.hubURL=e.url,delete e.url):"gbk"===function(e){let t;if(e instanceof File)t=e.name;else{if("string"!=typeof e)throw new Error("Input must be a File object or a URL string");t=e}const i=t.split(".").pop();return i.split("?")[0]}(e.url)&&(e.gbkURL=e.url,delete e.url));if(e.hubURL||e.url&&Mt(e.url)&&e.url.endsWith("/hub.txt")){t=(await du.loadHub(e.hubURL||e.url,e)).getGenomeConfig()}else t=Mt(e)||!(e.url||e.fastaURL||e.twoBitURL||e.gbkURL)?await mu.expandReference(this.alert,e):e;let i;await this.loadReference(t),i=t.gbkURL||"gbk"===t.format?[{name:"Annotations",format:"gbk",url:t.gbkURL}]:t.tracks||[];return 0===i.filter((e=>"sequence"===e.type)).length&&i.push({type:"sequence",order:Wd}),await this.loadTrackList(i),await this.updateViews(),this.genome}async loadTrackHub(e){const t=mA((await du.loadHub(e.url,e)).getGenomeConfig());return this.loadGenome(t)}updateUIWithReferenceFrameList(){const e=this.referenceFrameList;this.isMultiLocusWholeGenomeView()||mu.isWholeGenomeView(e[0].chr),yy(this,this.$navigation.width()),pA(this.trackViews,this.doShowTrackLabels),this.doShowCenterLine&&mu.isWholeGenomeView(e[0].chr)&&this.centerLineButton.boundMouseClickHandler(),this.doShowCursorGuide&&mu.isWholeGenomeView(e[0].chr)&&this.cursorGuideButton.boundMouseClickHandler(),this.setCenterLineAndCenterLineButtonVisibility(mu.isWholeGenomeView(e[0].chr))}setCenterLineAndCenterLineButtonVisibility(e){e?this.centerLineButton.setVisibility(!e):this.centerLineButton.setVisibility(this.config.showCenterGuideButton);for(let t of this.centerLineList)e?this.setCenterLineVisibility(!e):this.setCenterLineVisibility(this.doShowCenterLine)}setTrackLabelVisibility(e){pA(this.trackViews,e)}setROITableVisibility(e){!0===e?this.roiManager.presentTable():this.roiManager.dismissTable()}setCursorGuideVisibility(e){e?this.cursorGuide.show():this.cursorGuide.hide()}setCustomCursorGuideMouseHandler(e){this.cursorGuide.customMouseHandler=e}setCenterLineVisibility(e){for(let t of this.centerLineList)!0===e?(t.show(),t.repaint()):t.hide()}async loadTrackList(e){let t=0;for(let i of e)void 0===i.order&&(i.order=t++);const i=[];for(let t of e)i.push(this._loadTrack(t));const n=await Promise.all(i);return this.trackViews.filter((function(e){return e.track.autoscaleGroup})).length>0&&this.updateViews(),n}async loadTrack(e){e.sync=!1!==e.sync;const t=this._loadTrack(e);return t&&e.autoscaleGroup&&(await t,this.updateViews()),t}async _loadTrack(e){Mt(e)&&(e=JSON.parse(e));try{if(e.hidden){const t=Ad(e,this.genome);return void await t.getFeatures({chr:"1",start:0,end:Number.MAX_SAFE_INTEGER})}const t=await this.createTrack(e);if("sampleinfo"===e.type)return void this.layoutChange();if(void 0===t)return;return this.addTrack(e,t)}catch(t){let i=t.message||t.error||t.toString();const n={401:"Access unauthorized",403:"Access forbidden",404:"Not found"};n.hasOwnProperty(i)&&(i=n[i]),i=`${i} : ${Ht(e.url)?e.url.name:e.url}`;const r=new Error(i);throw console.error(r),r}}async addTrack(e,t){void 0===t.order&&(t.order=this.trackViews.length);const i=new hf(this,this.columnContainer,t);if(this.trackViews.push(i),pA(this.trackViews,this.doShowTrackLabels),"function"==typeof t.postInit)try{i.startSpinner(),await t.postInit()}finally{i.stopSpinner()}return t.autoscaleGroup||(e.sync?await i.updateViews():i.updateViews()),"function"==typeof t.hasSamples&&t.hasSamples()&&(this.sampleInfo.hasAttributes()&&this.sampleInfoControl.setButtonVisibility(!0),!1!==this.config.showSampleNameButton&&this.sampleNameControl.show()),this.reorderTracks(),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),this.multiTrackSelectButton.setMultiTrackSelection(this.multiTrackSelectButton.enableMultiTrackSelection),t}async loadROI(e){return this.roiManager.loadROI(e,this.genome)}clearROIs(){this.roiManager.clearROIs()}async getUserDefinedROIs(){if(this.roiManager){const e=this.roiManager.getUserDefinedROISet();if(void 0===e)return[];const t=await e.getAllFeatures(),i=[];for(let e of Object.values(t))i.push(...e);return i}return[]}getRulerTrackView(){const e=this.trackViews.filter((({track:e})=>"ruler"===e.id));return e.length>0?e[0]:void 0}async createTrack(e){let t=await async function(e){return"function"==typeof e?e():e}
59
- /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(e.url||e.fastaURL);if(Mt(t)&&(t=t.trim()),t)if(e.format)e.format=e.format.toLowerCase();else if(e.fastaURL)e.format="fasta";else if(e.sourceType)"htsget"===e.sourceType&&await Rh.inferFormat(e);else{const t=await om(e);t&&(e.format=t)}e.type&&Pa(e);let i=e.type?e.type.toLowerCase():void 0;if(!i){if(!e.format)throw Error(`Unrecognized track: ${JSON.stringify(e)}`);if("hic"===e.format){const t=new Mf(e);if(await t.readHeaderAndFooter(),!t.chromosomeIndexMap.celltype)throw Error("'.hic' files not supported");i="shoebox",e._hicFile=t}else if(i=Ha(e.format),"bedtype"===i){const t=Ad(e,this.genome);e._featureSource=t;const n=await t.trackType();i=n||"annotation"}e.type=i}if(this.trackDefaults&&i){const t=this.trackDefaults[i];if(t)for(let i in t)t.hasOwnProperty(i)&&void 0===e[i]&&(e[i]=t[i])}const n=function(e,t,i){let n;switch(e){case"annotation":case"genes":case"fusionjuncspan":case"snp":n="feature";break;case"seg":case"maf":case"mut":n="seg";break;case"junctions":case"splicejunctions":n="junction";break;default:n=e}return fy.has(n)?fy.get(n)(t,i):void 0}(i,e,this);if(void 0!==n)return e.roi&&e.roi.length>0&&(n.roiSets=e.roi.map((e=>new Xy(e,this.genome)))),n;this.alert.present(new Error(`Error creating track. Could not determine track type for file: ${e.url||e}`),void 0)}reorderTracks(){this.trackViews.sort((function(e,t){const i=e=>"ideogram"===e.track.id?1:"ruler"===e.track.id?2:3,n=i(e),r=i(t);if(n===r){return(e.track.order||0)-(t.track.order||0)}return n-r}));for(let{axis:e,viewports:t,sampleInfoViewport:i,sampleNameViewport:n,outerScroll:r,dragHandle:s,gearContainer:o}of this.trackViews){e.remove();for(let{$viewport:e}of t)e.detach();i.viewport.remove(),n.viewport.remove(),r.remove(),s.remove(),o.remove()}const e=this.columnContainer.querySelectorAll(".igv-column");for(let{axis:t,viewports:i,sampleInfoViewport:n,sampleNameViewport:r,outerScroll:s,dragHandle:o,gearContainer:a}of this.trackViews){this.columnContainer.querySelector(".igv-axis-column").appendChild(t);for(let t=0;t<e.length;t++){const{$viewport:n}=i[t];e[t].appendChild(n.get(0))}this.columnContainer.querySelector(".igv-sample-info-column").appendChild(n.viewport),this.columnContainer.querySelector(".igv-sample-name-column").appendChild(r.viewport),this.columnContainer.querySelector(".igv-scrollbar-column").appendChild(s),this.columnContainer.querySelector(".igv-track-drag-column").appendChild(o),this.columnContainer.querySelector(".igv-gear-menu-column").appendChild(a)}}getTrackOrder(){return this.trackViews.filter((e=>e.track&&e.track.name)).map((e=>e.track.name))}getSelectedTrackViews(){return this.trackViews.filter((e=>!0===e.track.selected))}removeTrackByName(e){const t=this.trackViews.slice();for(let i of t)e===i.track.name&&this.removeTrack(i.track)}removeTrack(e){for(let t of this.trackViews)if(e===t.track){this._removeTrack(t.track);break}}_removeTrack(e){e.disposed||(this.trackViews.splice(this.trackViews.indexOf(e.trackView),1),this.fireEvent("trackremoved",[e]),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),e.trackView&&e.trackView.dispose())}removeAllTracks(){const e=this.trackViews;this.trackViews=[];for(let t of e)"ruler"!==t.track.id&&"ideogram"!==t.track.id?(this.fireEvent("trackremoved",[t.track]),t.dispose()):this.trackViews.push(t)}get ideogramTrackView(){return this.trackViews[0]}get rulerTrackView(){return this.trackViews[1]}findTracks(e,t){let i="function"==typeof e?t=>e(t.track):i=>t===i.track[e];return this.trackViews.filter(i).map((e=>e.track))}get tracks(){return this.trackViews.map((e=>e.track)).filter((e=>void 0!==e))}setTrackHeight(e){this.trackHeight=e,this.trackViews.forEach((function(t){t.setTrackHeight(e)}))}async visibilityChange(){this.layoutChange()}async layoutChange(){if(this.referenceFrameList.find((e=>e.bpPerPixel<0))){const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel=(t.end-t.start)/e}this.referenceFrameList&&(this.isMultiLocusWholeGenomeView()||mu.isWholeGenomeView(this.referenceFrameList[0].chr),yy(this,this.$navigation.width())),hA.call(this),await this.updateViews()}async updateViews(){const e=this.trackViews;this.updateLocusSearchWidget();for(let e of this.referenceFrameList)e.bpPerPixel<=10&&await this.genome.getSequence(e.chr,e.start,e.start+1);for(let e of this.centerLineList)e.repaint();if(this.dragObject)for(let t of e)await t.updateViews();else{const t={},i=[];for(const n of e)if(n.track.autoscaleGroup){const e=n.track.autoscaleGroup;t[e]||(t[e]=[]),t[e].push(n)}else i.push(n);if(Object.entries(t).length>0)for(const[e,i]of Object.entries(t)){const e=await Promise.all(i.map((e=>e.getInViewFeatures()))),t=Qa(e.flat());for(const e of i)e.track.dataRange=Object.assign({},t),e.track.autoscale=!1;await Promise.all(i.map((e=>e.updateViews())))}await Promise.all(i.map((e=>e.updateViews())))}}repaintViews(){for(let e of this.trackViews)e.repaintViews()}updateLocusSearchWidget(){if(!this.referenceFrameList)return;const e=this.referenceFrameList,t=this.calculateViewportWidth(this.referenceFrameList.length);for(let i of e)i.end=i.start+i.bpPerPixel*t;this.chromosomeSelectWidget&&(this.chromosomeSelectWidget.select.value=1===e.length?this.referenceFrameList[0].chr:"");const i=this.referenceFrameList.map((e=>e.getLocusString())).join(" ");this.$searchInput.val(i),this.fireEvent("locuschange",[this.referenceFrameList])}calculateViewportWidth(e){let{width:t}=this.columnContainer.getBoundingClientRect();return t-=50+this.getSampleInfoViewportWidth()+this.getSampleNameViewportWidth()+14+12+28,t-=5*(e-1),Math.floor(t/e)}minimumBases(){return this.config.minimumBases}zoomIn(){this.zoomWithScaleFactor(.5)}zoomOut(){this.zoomWithScaleFactor(2)}async zoomWithScaleFactor(e,t,i){if(!this.referenceFrameList)return;const n=this.calculateViewportWidth(this.referenceFrameList.length);let r=i?[i]:this.referenceFrameList;for(let i of r)i.zoomWithScaleFactor(this,e,n,t)}async addMultiLocusPanel(e,t,i,n){if(!this.referenceFrameList)return;const r=this.calculateViewportWidth(1+this.referenceFrameList.length),s=this.calculateViewportWidth(this.referenceFrameList.length)/this.calculateViewportWidth(1+this.referenceFrameList.length);for(let e of this.referenceFrameList)e.bpPerPixel*=s;const o=(i-t)/r,a=new my(this.genome,e,t,i,o),c=n?this.referenceFrameList.indexOf(n):this.referenceFrameList.length-1,l=1+c,{$viewport:h}=this.trackViews[0].viewports[c],d=zy(h.get(0).parentElement);if(this.fireEvent("didchangecolumnlayout"),l===this.referenceFrameList.length){this.referenceFrameList.push(a);for(let e of this.trackViews){const t=zu(e,d,a);e.viewports.push(t)}}else{this.referenceFrameList.splice(l,0,a);for(let e of this.trackViews){const t=zu(e,d,a);e.viewports.splice(l,0,t)}}this.centerLineList=this.createCenterLineList(this.columnContainer),hA.call(this),await this.updateViews(!0)}createCenterLineList(e){const t=e.querySelectorAll(".igv-center-line");for(let e=0;e<t.length;e++)t[e].remove();const i=[],n=e.querySelectorAll(".igv-column");for(let e=0;e<n.length;e++)i.push(new Py(this,this.referenceFrameList[e],n[e]));return i}async removeMultiLocusPanel(e){const t=this.referenceFrameList.indexOf(e),{$viewport:i}=this.trackViews[0].viewports[t];Ly(t,i.parent().get(0)),this.fireEvent("didchangecolumnlayout");for(let{viewports:e}of this.trackViews)e[t].dispose(),e.splice(t,1);if(this.referenceFrameList.splice(t,1),1===this.referenceFrameList.length&&this.getRulerTrackView())for(let e of this.getRulerTrackView().viewports)e.dismissLocusLabel();const n=this.calculateViewportWidth(1+this.referenceFrameList.length)/this.calculateViewportWidth(this.referenceFrameList.length);await this.rescaleForMultiLocus(n)}async gotoMultilocusPanel(e){const t=this.referenceFrameList.indexOf(e);this.columnContainer.querySelectorAll(".igv-column").forEach(((e,i)=>{i===t||e.remove()})),this.columnContainer.querySelectorAll(".igv-column-shim").forEach((e=>e.remove()));for(let e of this.trackViews){const i=e.viewports[t];e.viewports.filter(((e,i)=>i!==t)).forEach((e=>e.dispose())),e.viewports=[i]}const i=this.calculateViewportWidth(1);e.bpPerPixel=(e.end-e.start)/i,this.referenceFrameList=[e],this.trackViews.forEach((({viewports:e})=>e.forEach((e=>e.setWidth(i))))),this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}async rescaleForMultiLocus(e){const t=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel*=e;for(let{viewports:e}of this.trackViews)for(let i of e)i.setWidth(t);this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews()}async goto(e,t,i){await this.search(e+":"+t+"-"+i)}async doSearch(e,t){const i=await this.search(e,t);return i||this.alert.present(new Error(`Unrecognized locus: <b> ${e} </b>`)),i}async search(e,t){const i=await async function(e,t){if(void 0===t||""===t.trim())return;const i=t.split(" ");let n=[];const r=async t=>{if("all"===t.trim().toLowerCase()||"*"===t)return e.genome.wholeGenomeView?{chr:"all",start:0,end:e.genome.getChromosome("all").bpLength}:void 0;let i,n;if(t.includes(":")&&(i=Jv(t,e.isSoftclipped()),i&&(n=await e.genome.loadChromosome(i.chr))),!n){i=void 0;const r=await Zv(e,t);r&&(i={chr:r.chr,start:r.start,end:r.end,name:(r.name||t).toUpperCase()}),i||(n=await e.genome.loadChromosome(t),n&&(i={chr:n.name}))}return i&&(n=n||await e.genome.loadChromosome(i.chr),i.chr=n.name,void 0===i.start&&void 0===i.end&&(i.start=0,i.end=n.bpLength)),i};for(let e of i){const t=await r(e);t&&n.push(t)}if(0===n.length){const e=await r(t.replaceAll(" ","+"));e&&n.push(e)}return 0===n.length?void 0:n}(this,e);if(i&&i.length>0){this.referenceFrameList=function(e,t,i,n,r,s){return e.map((e=>{const o=Object.assign({},e);if(i&&o.name&&(o.start=Math.max(0,o.start-i),o.end+=i),!s){const e=t.getChromosome(o.chr);Va(e.bpLength,o,n)}return new my(t,o.chr,o.start,o.end,(o.end-o.start)/r)}))}(i,this.genome,this.flanking,this.minimumBases(),this.calculateViewportWidth(i.length),this.isSoftclipped());for(let e of this.trackViews)e.removeViewportsFromColumnContainer();this.columnContainer.querySelectorAll(".igv-column-shim, .igv-column").forEach((e=>e.remove())),Hy(this.columnContainer.querySelector(".igv-sample-info-column"),this.referenceFrameList.length),this.fireEvent("didchangecolumnlayout");for(let e of this.trackViews)e.createViewports(this,this.columnContainer,this.referenceFrameList);return this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),t||await this.updateViews(),!0}return!1}async loadSampleInfo(e){await this.sampleInfo.loadSampleInfoFile(e.url);for(const{sampleInfoViewport:e}of this.trackViews)e.setWidth(this.getSampleInfoColumnWidth());this.findTracks((e=>"function"==typeof e.getSamples)).length>0&&(this.sampleInfoControl.performClickWithState(this,!0),this.sampleInfoControl.setButtonVisibility(!0));for(const{sampleInfoViewport:e}of this.trackViews)e.repaint()}getSampleInfoColumnWidth(){if(this.sampleInfo.attributeCount){const e=this.findTracks((e=>"function"==typeof e.getSamples)).length>0,t=this.sampleInfo.hasAttributes(),i=this.sampleInfoControl.showSampleInfo;return e&&t&&i?this.sampleInfo.attributeCount*Vu+8:0}return 0}on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)}un(e,t){this.off(e,t)}off(e,t){if(e)if(t){const i=this.eventHandlers[e];if(i&&0!==i.length){const n=i.indexOf(t);-1!==n&&this.eventHandlers[e].splice(n,1)}else console.warn("No handlers to remove for event: "+e)}else this.eventHandlers[e]=[];else this.eventHandlers={}}fireEvent(e,t,i){const n=this.eventHandlers[e];if(void 0===n||0===n.length)return;const r=i||window;return n.map((function(e){return e.apply(r,t)}))[0]}dispose(){this.removeEventHandlers();for(let e of this.trackViews)e.dispose();this.roiManager&&this.roiManager.dispose()}toJSON(){const e={version:"3.0.3"};if(void 0!==this.showSampleNames&&(e.showSampleNames=this.showSampleNames),this.sampleNameViewportWidth&&(e.sampleNameViewportWidth=this.sampleNameViewportWidth),e.reference=this.genome.toJSON(),e.reference.fastaURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.fastaURL.name}.`);if(e.reference.indexURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.indexURL.name}.`);const t=[];let i=this.trackViews[0];for(let{referenceFrame:e}of i.viewports){const i=e.getLocusString();t.push(i)}e.locus=1===t.length?t[0]:t,e.roi=this.roiManager.toJSON(),this.qtlSelections.isEmpty()||(e.qtlSelections=this.qtlSelections.toJSON());const n=[],r=[];for(const{track:e}of this.trackViews)try{let t;"function"==typeof e.getState?t=Hl.localFileInspection(e.getState()):e.config&&(t=Hl.localFileInspection(e.config)),t&&(t.browser&&delete t.browser,t.order=e.order,n.push(t))}catch(t){const i=`Track: ${e.name}: ${t}`;console.error(i),r.push(i)}if(r.length>0){let e=1,t="Errors encountered saving session: </br>";for(let i of r)t+=` (${e++}) ${i.toString()} <br/>`;throw Error(t)}e.tracks=n;const s=[];for(const e of n)for(const t of Object.keys(e))"file"!==t&&"indexFile"!==t||s.push(e[t]);const o=[];if(this.sampleInfo.sampleInfoFiles.length>0){const t=this.sampleInfo.toJSON();t.length>0&&(e.sampleinfo=t);for(const e of this.sampleInfo.sampleInfoFiles){const t=Hl.localFileInspection({url:e});t.file&&o.push(t.file)}o.length>0&&s.push(...o)}return s.length>0&&alert(`This session includes reference(s) to local file(s):\n${s.map((e=>` ${e}`)).join("\n")}\nLocal files cannot be loaded automatically when a saved session is restored.`),e}compressedSession(){return function(e){const t=new Uint8Array(e.length);for(var i=0;i<e.length;i++)t[i]=e.charCodeAt(i);const n=new cs(t),r=String.fromCharCode.apply(null,n);return btoa(r).replace(/\+/g,".").replace(/\//g,"_").replace(/=/g,"-")}(JSON.stringify(this.toJSON()))}sessionURL(){const e=window.location.href.slice(),t=e.indexOf("?");return(t>0?e.substring(0,t):e)+"?sessionURL=blob:"+this.compressedSession()}mouseDownOnViewport(e,t){var i;i=r(e),this.vpMouseDown={viewport:t,lastMouseX:i.x,mouseDownX:i.x,lastMouseY:i.y,mouseDownY:i.y,referenceFrame:t.referenceFrame}}cancelTrackPan(){const e=this.dragObject;this.dragObject=void 0,this.isScrolling=!1,this.vpMouseDown=void 0,e&&e.viewport.referenceFrame.start!==e.start&&(this.updateViews(),this.fireEvent("trackdragend"))}isTrackPanning(){return this.dragObject}isSoftclipped(){return void 0!==this.trackViews.find((e=>!0===e.track.showSoftClips))}startTrackDrag(e){this.dragTrack=e}updateTrackDrag(e){if(e&&this.dragTrack){const t=this.dragTrack,i=this.trackViews.indexOf(e),n=this.trackViews.indexOf(t),r=this.trackViews;r[i]=t,r[n]=e;const s=this.trackViews[i].track.order;this.trackViews[n].track.order=s;const o=r.length;let a=s;if(i<n)for(let e=i+1;e<o;e++){const t=r[e].track;if(!(t.order<=a))break;t.order=Math.min(Number.MAX_SAFE_INTEGER,a+1),a=t.order}else for(let e=i-1;e>0;e--){const t=r[e].track;if(!(t.order>=a))break;t.order=Math.max(-Number.MAX_SAFE_INTEGER,a-1),a=t.order}this.reorderTracks()}}endTrackDrag(){this.dragTrack?(this.dragTrack=void 0,this.fireEvent("trackorderchanged",[this.getTrackOrder()])):this.dragTrack=void 0}addEventHandlers(){this.addWindowResizeHandler(),this.addRootMouseUpHandler(),this.addRootMouseLeaveHandler(),this.addColumnContainerEventHandlers(),this.addKeyboardHandler()}removeEventHandlers(){this.removeWindowResizeHandler(),this.removeRootMouseUpHandler(),this.removeRootMouseLeaveHandler(),this.removeColumnContainerEventHandlers(),this.removeKeyboardHandler()}addWindowResizeHandler(){this.boundWindowResizeHandler=hA.bind(this),window.addEventListener("resize",this.boundWindowResizeHandler)}removeWindowResizeHandler(){window.removeEventListener("resize",this.boundWindowResizeHandler)}addRootMouseUpHandler(){this.boundRootMouseUpHandler=uA.bind(this),this.root.addEventListener("mouseup",this.boundRootMouseUpHandler)}removeRootMouseUpHandler(){this.root.removeEventListener("mouseup",this.boundRootMouseUpHandler)}addRootMouseLeaveHandler(){this.boundRootMouseLeaveHandler=uA.bind(this),this.root.addEventListener("mouseleave",this.boundRootMouseLeaveHandler)}removeRootMouseLeaveHandler(){this.root.removeEventListener("mouseleave",this.boundRootMouseLeaveHandler)}addColumnContainerEventHandlers(){this.boundColumnContainerMouseMoveHandler=dA.bind(this),this.boundColumnContainerTouchMoveHandler=dA.bind(this),this.boundColumnContainerMouseLeaveHandler=uA.bind(this),this.boundColumnContainerMouseUpHandler=uA.bind(this),this.boundColumnContainerTouchEndHandler=uA.bind(this),this.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.addEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.addEventListener("touchend",this.boundColumnContainerTouchEndHandler)}removeColumnContainerEventHandlers(){this.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.removeEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.removeEventListener("touchend",this.boundColumnContainerTouchEndHandler)}addKeyboardHandler(){this.keyUpHandler=fA.bind(this),document.addEventListener("keyup",this.keyUpHandler)}removeKeyboardHandler(){console.log("Remove handler"),document.addEventListener("keyup",this.keyUpHandler)}static uncompressSession(e){let t;if(e.indexOf("/gzip;base64")>0){t=vs(e);let i="";for(let e of t)i+=String.fromCharCode(e);return i}return function(e){e=e.replace(/\./g,"+").replace(/_/g,"/").replace(/-/g,"=");const t=atob(e),i=[];for(let e=0;e<t.length;e++)i.push(t.charCodeAt(e));const n=hs(i);let r="";for(let e of n)r+=String.fromCharCode(e);return r}(e.substring(5))}createCircularView(e,t){var i;return t=!0===t,this.circularView=(i=this,new Nm(e,{onChordClick:(e,t,n)=>{const r=e.data,s=r.mate;function o(e){e.chr=i.genome.getChromosomeName(e.refName);let t=!1;for(let n of i.referenceFrameList){const i=cm.fromLocusString(n.getLocusString());if(i.contains(e)){t=!0;break}if(i.overlaps(e)){n.extend(e),t=!0;break}}if(!t){const t=2e3,n=(e.start+e.end)/2;i.addMultiLocusPanel(e.chr,n-t,n+t)}}o(r),o(s)}})),this.circularViewControl=new Oy(this.$toggle_button_container.get(0),this),this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:zm(this.genome)}),this.circularViewVisible=t,this.circularView}get circularViewVisible(){return void 0!==this.circularView&&this.circularView.visible}set circularViewVisible(e){this.circularView&&(this.circularView.visible=e,this.circularViewControl.setState(e))}}async function hA(){if(!this.referenceFrameList)return;const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList){const i=this.referenceFrameList.indexOf(t),{chr:n,genome:r}=t,{bpLength:s}=r.getChromosome(t.chr),o=t.toBP(e);mu.isWholeGenomeView(n)||o>s?t.bpPerPixel=s/e:t.end=t.start+t.toBP(e);for(let{viewports:t}of this.trackViews)t[i].setWidth(e)}this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}function dA(e){e.preventDefault();const{x:t,y:i}=r(e);if(this.vpMouseDown){const{viewport:e,referenceFrame:n}=this.vpMouseDown,r=Math.abs(t-this.vpMouseDown.mouseDownX)>Math.abs(i-this.vpMouseDown.mouseDownY);if(!this.dragObject&&!this.isScrolling)if(r)this.vpMouseDown.mouseDownX&&Math.abs(t-this.vpMouseDown.mouseDownX)>this.constants.dragThreshold&&(this.dragObject={viewport:e,start:n.start});else if(this.vpMouseDown.mouseDownY&&Math.abs(i-this.vpMouseDown.mouseDownY)>this.constants.scrollThreshold){this.isScrolling=!0;const t=e.$viewport.height(),i=e.trackView.maxViewportContentHeight();this.vpMouseDown.r=t/i}if(this.dragObject){const i=!this.isSoftclipped();let r=this.vpMouseDown.lastMouseX-t;n.shiftPixels(r,e.$viewport.width(),i)&&this.updateViews(),this.fireEvent("trackdrag")}if(this.isScrolling){const t=this.vpMouseDown.r*(this.vpMouseDown.lastMouseY-i);e.trackView.moveScroller(t)}this.vpMouseDown.lastMouseX=t,this.vpMouseDown.lastMouseY=i}}function uA(e){this.cancelTrackPan(),this.endTrackDrag()}async function fA(e){if(!(this.referenceFrameList.length>1||"KeyF"!==e.code&&"KeyB"!==e.code)){const t=this.getSelectedTrackViews();if(t.length>0){const i=t[0].track;if("function"==typeof i.nextFeatureAfter){const t=this.referenceFrameList[0],n=t.viewport?t.viewport.getWidth():this.calculateViewportWidth(this.referenceFrameList.length),r="all"===t.chr.toLowerCase(),s=i.visibilityWindow;if(r||s&&s>0&&t.bpPerPixel*n>s)return;const o="KeyF"===e.code,a=t.chr,c=t.center,l=await i.nextFeatureAfter(a,c,o);if(l){const i=await this.genome.getChromosomeName(l.chr);if(a===i){const i=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,r=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,i-r/2),t.end=i+r/2,t.bpPerPixel=(t.end-t.start)/n}else t.shift(i-c);this.updateViews()}else{t.chr=i;const r=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,i=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,r-i/2),t.end=t.start+i,t.bpPerPixel=(t.end-t.start)/n}else t.start=r-n*t.bpPerPixel/2,t.end=t.start+n*t.bpPerPixel;this.updateViews()}}}}}}function pA(e,t){for(let{viewports:i}of e)for(let e of i)e.$trackLabel&&(0===i.indexOf(e)&&!0===t?e.$trackLabel.show():e.$trackLabel.hide())}let gA=[];function mA(e){return void 0===e.minimumBases&&(e.minimumBases=40),void 0===e.showIdeogram&&(e.showIdeogram=!0),void 0===e.showCircularView&&(e.showCircularView=!1),void 0===e.showCircularViewButton&&(e.showCircularViewButton=!1),void 0===e.showTrackLabelButton&&(e.showTrackLabelButton=!0),void 0===e.showTrackLabels&&(e.showTrackLabels=!0),void 0===e.showCursorTrackingGuideButton&&(e.showCursorTrackingGuideButton=!0),void 0===e.showCursorGuide&&(e.showCursorGuide=e.showCursorTrackingGuide||!1),void 0===e.showCenterGuideButton&&(e.showCenterGuideButton=!0),void 0===e.showCenterGuide&&(e.showCenterGuide=!1),void 0===e.showSampleNames&&(e.showSampleNames=!1),void 0===e.showSVGButton&&(e.showSVGButton=!0),void 0===e.showControls&&(e.showControls=!0),void 0===e.showNavigation&&(e.showNavigation=!0),void 0===e.showRuler&&(e.showRuler=!0),void 0===e.flanking&&(e.flanking=1e3),void 0===e.pairsSupported&&(e.pairsSupported=!0),e.tracks||(e.tracks=[]),e}const wA=Qs.setApiKey;const bA=Qs.oauth;var FA={TrackUtils:Oa,IGVGraphics:xo,MenuUtils:bo,DataRangeDialog:_o,createTrack:async function(e,t){return await lA.prototype.createTrack.call(t,e)},createBrowser:async function(e,t){void 0===t&&(t={}),mu.KNOWN_GENOMES||await mu.initializeGenomes(t),mA(t),t.queryParametersSupported&&function(e){var t,i,n,r,s,o,a,c,l;let h,d,u;if(a=window.location.href,s={},t=a.indexOf("?"),i=a.lastIndexOf("#"),t>=0)for(i<0&&(i=a.length),n=t+1;n<i;)(r=a.indexOf("&",n))<0&&(r=i),2===(o=a.substring(n,r).split("=",2)).length?(c=o[0],l=decodeURIComponent(o[1]),"file"===c?h=l.split(","):"index"===c?d=l.split(","):"name"===c?u=l.split(","):"genome"===c?!l.startsWith("https://")&&!l.startsWith("http://")||l.endsWith(".json")?(e[c]=l,e.reference=void 0):e.reference={fastaURL:l,indexURL:l+".fai"}:("reference"===c&&(e.genome=void 0),e[c]=l),n=r+1):n++;if(h){e.tracks||(e.tracks=[]);for(let t=0;t<h.length;t++){if(h[t].endsWith(".xml")||h[t].endsWith(".json")){e.sessionURL=h[t];break}const i={url:h[t]};d&&d.length>t&&(i.indexURL=d[t]),u&&u.length>t&&(i.name=u[t]),e.tracks.push(i)}}}(t),t.apiKey&&Qs.setApiKey(t.apiKey),t.oauthToken&&Qs.setOauthToken(t.oauthToken),t.clientId&&!Ts()&&await async function(e){if(!google.accounts.oauth2.initTokenClient)throw new Error("Google accounts token client not loaded (https://accounts.google.com/gsi/client)");if(Ts())throw new Error("Google client is already initialized");const t={client_id:e.client_id||e.clientId,scope:e.scope||"https://www.googleapis.com/auth/userinfo.profile",state:e.state||"igv",error:e=>{throw new Error(e.type)},hint:e.hint,hosted_domain:e.hosted_domain},i=google.accounts.oauth2.initTokenClient(t);google.igv={tokenClient:i,apiKey:e.apiKey}}({client_id:t.clientId,apiKey:t.apiKey,scope:"https://www.googleapis.com/auth/userinfo.profile"});const i=new lA(t,e);gA.push(i),i.startSpinner();const n=t.sessionURL||t.session||t.hubURL;return n?await i.loadSession({url:n}):await i.loadSessionObject(t),i.stopSpinner(),yy(i,i.$navigation.width()),i},removeBrowser:function(e){e.dispose(),e.root.remove(),gA=gA.filter((t=>t!==e))},removeAllBrowsers:function(){for(let e of gA)e.dispose(),e.root.remove();gA=[]},visibilityChange:async function(){for(let e of gA)await e.visibilityChange()},setGoogleOauthToken:function(e){return Qs.setOauthToken(e)},setOauthToken:function(e,t){return Qs.setOauthToken(e,t)},oauth:bA,version:wy,setApiKey:wA,TrackBase:Hl,registerTrackClass:function(e,t){fy.set(e,((e,i)=>new t(e,i)))},registerTrackCreatorFunction:function(e,t){fy.set(e,t)},registerFileFormats:function(e,t){Sl[e]={fields:t}},loadSessionFile:lA.loadSessionFile};export{FA as default};
58
+ /*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */(await this.value,await this.shape)}async getValue(e){const t=await this.dtype;return("string"==typeof t||t instanceof String)&&t.startsWith("S")?(await e).map((e=>{let t=e.indexOf("\0");return t>=0?e.substring(0,t):e})):e}};function hv(e){return e.replace(/\/(\/)+/g,"/")}async function dv(e){var t;e.url&&("function"==typeof(t=e.url).slice&&"function"==typeof t.arrayBuffer)&&(e.file=e.url,e.url=void 0);const i=void 0!==e.url;let n=e.reader?e.reader:function(e){if(e.url)return new cw(e);if(e.path)return new NodeLocalFile(e);if(e.file)return new dw(e.file);throw Error("One of 'url', 'path (node only)', or 'file (browser only)' must be specified")}(e);const r=e.fetchSize||2e3,s=e.maxSize||2e5;i&&(n=new lw({file:n,fetchSize:r,maxSize:s}));const o=new uv(n),a=await async function(e){let t;if(e.indexReader)t=e.indexReader;else{if(e.index)return e.index;e.indexURL?t=new cw({url:e.indexURL}):e.indexPath?t=new NodeLocalFile({path:e.indexPath}):e.indexFile&&(t=new dw({file:e.indexFile}))}if(t){const e=await t.read(),i=(new TextDecoder).decode(e);return JSON.parse(i)}return}(e),c=e.indexOffset,l=function(e){if(e.url)return fv(e.url);if(e.path)return fv(e.path);if(e.file)return e.file.name}(e),h=new cv(o,l,{index:a,indexOffset:c});return await h.ready,h}class uv{constructor(e){this.fileReader=e}async slice(e,t){return this.fileReader.read(e,t-e)}}function fv(e){const t=e.lastIndexOf("/");return t>0?e.substring(t+1):e}class pv{constructor(e,t){this.chrom=e,this.signal_bin_size=t;this.signals={raw_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}`,gc_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}_GC`,gc_partition:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_merge`,baf:`snp_likelihood_${this.chrom}_${this.signal_bin_size}_mask`,baf_i1:`snp_i1_${this.chrom}_${this.signal_bin_size}_mask`,Mosaic_segments:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_segments_2d`,Mosaic_calls:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_call_2d`}}}class gv{constructor(e,t=1e5){this.h5_file=e,this.bin_size=t,this.h5_obj=void 0}async fetch(){return this.h5_obj||(this.h5_obj=await dv({url:this.h5_file,fetchSize:1e6,maxSize:2e8})),this.h5_obj}async get_keys(){return(await this.fetch()).keys}async get_rd_signal(e=this.bin_size){let t=await this.fetch();this.h5_obj=t,this.pytor_keys=t.keys;let i=new mv(this.pytor_keys),n=i.get_rd_bins(),r=i.get_snp_bins();this.available_bins=[...new Set(n,r)],this.available_bins.includes(e)||(e=this.available_bins.at(-1));const s=await t.get("rd_chromosomes");await s.dtype;let o=await s.value,a=await this.rd_stat(e);var c=[],l=[],h=[],d=[],u=[],f=[];for(let t of o){let i=new pv(t,e);var p=i.signals.raw_RD;let n=await this.get_chr_signal(t,e,p,a);c=c.concat(n);var g=i.signals.gc_RD;let r=await this.get_chr_signal(t,e,g,a);l=l.concat(r);let s=i.signals.gc_partition,o=await this.get_chr_signal(t,e,s,a);h=h.concat(o);let m=await this.rd_call_combined(t,e,a,i);d=d.concat(m);let w=i.signals.baf_i1,b=await this.get_baf_signals_v2(t,e,w);u=u.concat(b[0]),f=f.concat(b[1])}this.callers=[],0!=d.length&&this.callers.push("ReadDepth"),0!=d.length&&this.callers.push("2D");var m={},w={RD_Raw:c,RD_Raw_gc_coor:l,ReadDepth:h,"2D":d,BAF1:u,BAF2:f};return m[e]=w,m}decode_segments(e){let t=[],i=[];for(let n of e)4294967295==n?(t.push(i),i=[]):i.push(n);return t}async rd_call_combined(e,t,i,n){let r,s=[],o=n.signals.Mosaic_segments;if(this.pytor_keys.includes(o)){const e=await this.h5_obj.get(o);let t=await e.value;r=this.decode_segments(t)}let a=n.signals.Mosaic_calls;if(this.pytor_keys.includes(a)){const n=await this.h5_obj.get(a);let o=await n.to_array();r.forEach(((n,r)=>{n.forEach(((n,a)=>{s.push({chr:e,start:n*t,end:(n+1)*t,value:o[0][r]/i[4]*2})}))}))}return s}async rd_stat(e){let t,i=`rd_stat_${e}_auto`;if(this.pytor_keys.includes(i)){const e=await this.h5_obj.get(i);t=await e.value}return t}async get_chr_signal(e,t,i,n){let r=[];if(this.pytor_keys.includes(i)){const s=await this.h5_obj.get(i);(await s.value).forEach(((i,s)=>{r.push({chr:e,start:s*t,end:(s+1)*t,value:i/n[4]*2})}))}return r}async get_baf_signals(e,t,i,n=-1){let r=[],s=[];if(this.pytor_keys.includes(i)){let o=await this.h5_obj.get(i);(await o.to_array()).forEach(((i,o)=>{let a=Math.max(...i);const c=i.indexOf(a);let l=Math.max(c/200,1-c/200);r.push({chr:e,start:o*t,end:(o+1)*t,value:n*l}),.5!=l&&s.push({chr:e,start:o*t,end:(o+1)*t,value:n*(1-l)})}))}return[r,s]}async get_baf_signals_v2(e,t,i,n=-1){let r=[],s=[];if(this.pytor_keys.includes(i)){let o=await this.h5_obj.get(i);(await o.to_array()).forEach(((i,o)=>{isNaN(i)||(r.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5-i)}),.5!=i&&s.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5+i)}))}))}return[r,s]}}class mv{constructor(e){this.signals=e}get_rd_bins(){let e=[];this.signals.forEach((t=>{let i=t.match(/^his_rd_p_(.*)_(\d+)$/);i&&e.push({chr:i[1],bin_size:i[2]})}));return[...new Set(e.map((e=>Number(e.bin_size))))]}get_snp_bins(){let e=[];this.signals.forEach((t=>{let i=t.match(/^snp_likelihood_(.*)_(\d+)_mask$/);i&&e.push({chr:i[1],bin_size:i[2]})}));return[...new Set(e.map((e=>Number(e.bin_size))))]}}function wv(e){let t=function(e){if(e.length<4)return e;let t,i,n,r,s,o;return t=e.slice().sort(((e,t)=>e-t)),t.length/4%1==0?(i=.5*(t[t.length/4]+t[t.length/4+1]),n=.5*(t[t.length*(3/4)]+t[t.length*(3/4)+1])):(i=t[Math.floor(t.length/4+1)],n=t[Math.ceil(t.length*(3/4)+1)]),r=n-i,s=n+1.5*r,o=i-1.5*r,t.filter((e=>e>=o&&e<=s))}(e);const i=t.length,n=t.reduce(((e,t)=>e+t))/i,r=Math.sqrt(t.map((e=>Math.pow(e-n,2))).reduce(((e,t)=>e+t))/i);return[n,r]}var bv={range_function:function(e,t,i){return Array(Math.ceil((t-e)/i)).fill(e).map(((e,t)=>e+t*i))},getDistParams:wv,linspace:function(e,t,i){if(void 0===i&&(i=Math.max(Math.round(t-e)+1,1)),i<2)return 1===i?[e]:[];var n=Array(i);for(let r=--i;r>=0;r--)n[r]=(r*t+(i-r)*e)/i;return n},GetFit:class{constructor(e){this.allBins=e}getValues(){return Object.values(this.allBins).reduce(((e,t)=>e.concat(t.filter((e=>e.binScore>0)).map((e=>e.binScore)))),[])}getMean(e){return e.reduce((function(e,t){return e+t}))/e.length}fit_data(){return wv(this.getValues())}histogram(e,t){const i=t[1]-t[0],n=[];e.forEach(((e,r)=>{t.forEach(((t,r)=>{if(n[t]||(n[t]={count:0}),t<=e&&e<t+i)return n[t].count++,!1}))}));const r=[];return n.forEach(((e,t)=>{r.push(e.count)})),r}}};function Fv(e,t){return isNaN(e)||isNaN(t)||t<=0?NaN:0===e?.5:.5+.5*(vv(.5*t,.5,1)-vv(.5*t,.5,t/(t+e*e)))*Math.sign(e)}function vv(e,t,i){if(0==i)return 0;if(1==i)return 1;{let n=_v(e+t)-_v(e)-_v(t)+e*Math.log(i)+t*Math.log(1-i);return i<(e+1)/(e+t+2)?Math.exp(n)*yv(e,t,i)/e:1-Math.exp(n)*yv(t,e,1-i)/t}}function yv(e,t,i,n=1e3){let r=1,s=1,o=1,a=e+t,c=e+1,l=e-1,h=1-a*i/c;for(let d=0;d<=n;d++){let n=parseFloat(d+1),u=n+n,f=n*(t-n)*i/((l+u)*(e+u)),p=r+f*s,g=h+f*o;f=-(e+n)*(a+n)*i/((c+u)*(e+u));let m=g+f*h,w=r;if(s=p/m,o=g/m,r=(p+f*r)/m,h=1,Math.abs(r-w)<3e-7*Math.abs(r))return r}}function Av(e){if(0==e||1==e)return 1;return e*Av(e-1)}function Cv(e){let t;var i=[75122.633153,80916.6278952,36308.2951477,8687.24529705,1168.92649479,83.8676043424,2.50662827511],n=0,r=1;if(0==e)t=1e99;else if(e%1==0)t=Av(e-1);else{for(let t=0;t<i.length;t++)n+=i[t]*Math.pow(e,t),r*=e+t;t=n*Math.pow(e+5.5,e+.5)*Math.exp(-(e+5.5))/r}return t}function _v(e){return Math.log(Cv(e))}var xv={TdistributionCDF:Fv,gamma:Cv,t_test_1_sample:function(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-Fv(Math.abs(r),n-1)},t_test_2_samples:function(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-Fv(Math.abs(o),parseInt(a+.5))}};function kv(e){return e.reduce((function(e,t){return e>t?e:t}))}function Iv(e,t,i,n){return t*Math.exp(-1*(e-i)**2/(2*n**2))/Math.sqrt(2*Math.PI)/n}function Sv(e,t,i,n){return Math.exp(-1*(e-i)**2/(t**2+n**2))}function Ev(e,t){let i;try{i=e.reduce(((e,i,n)=>e+Math.min(i,t[n])))}catch{return console.log("Failed to find likelihood overlap: ",e,t),0}return i}function Nv(e,t,i,n){return 0==t&&0==n?{nl:.5*(e+i),ne:0}:{nl:(e*n*n+i*t*t)/(t*t+n*n),ne:Math.sqrt(t*t*n*n/(t*t+n*n))}}function Bv(e,t){let i=parseInt(t*(e.length-1)),n=t*(e.length-1)-i;return i<e.length-1?e[i]*(1-n)+e[i+1]*n:e[i]}function Mv(e){const t=e.length,i=Math.max(...e);let n=e.indexOf(i);n>Math.floor(t/2)&&(n=t-1-n);const r=(t/2-n)/(t+1),s=Math.floor((t/2+n)/2),o=t-1-s;let a=e.slice(s,o+1).reduce(((e,t)=>e+t),0)/e.reduce(((e,t)=>e+t),0);return n===Math.floor(t/2)&&(a=1),{mean:r,p:a}}var Rv=class{constructor(e,t){this.wigFeatures=e,this.binSize=t}get_fit(){var e=new bv.GetFit(this.wigFeatures),[t,i]=e.fit_data();return{globalMean:t,globalStd:i}}async call_2d(e=null,t=null,i="both",n=.1,r=0,s=10,o=0){let a=this.get_fit();this.globalMean=a.globalMean,this.globalStd=a.globalStd;let c=null==e?.05*this.binSize/3e9:e,l=null==t?parseInt(this.binSize/1e4):t,h=[],d=[],u=[],f=[],p=[],g=[];for(const[e,t]of Object.entries(this.wigFeatures)){let e=[],i=[],s=[];t.forEach(((t,n)=>{t.hets_count>4&&t.dp_count>l&&(e.push([n]),i.push(t.binScore),s.push(t.likelihood_score),delete t.likelihood_score)}));let o=[];for(let e=1;e<i.length;e++)o.push(Math.abs(i[e]-i[e-1]));let a=[0];for(let e=1;e<o.length;e++)a.push(Math.min(o[e-1],o[e]));a.push(0);let g=i.map(((e,t)=>Math.sqrt(Math.sqrt(e)**2+this.globalStd**2+Math.pow(a[t]/2,2)))),m=[];for(let t=0;t<e.length-1;t++){let n=0;try{n=Ev(s[t],s[t+1])}catch{console.log("Overlap failed: ",t,s[t],e[t+1],s[t+1])}let r=Sv(i[t],g[t],i[t+1],g[t+1]);m.push(r*n)}for(;m.length>0;){m=m.filter((e=>"number"==typeof e));let t=kv(m);if(isNaN(t)&&console.log("NaN value",m),t<c)break;let n,r,o=m.indexOf(t),a=Nv(i[o],g[o],i[o+1],g[o+1]);try{n=s[o].map(((e,t)=>e*s[o+1][t])),r=n.reduce(((e,t)=>e+t))}catch{console.log(s),console.log("max_overlap:",t,o,m.length),console.log("likelihood: ",o,s[o],s[o+1]),console.log("nlh: ",r)}if(i[o]=a.nl,g[o]=a.ne,s[o]=n.map((function(e){return e/r})),e[o].push(...e[o+1]),i.splice(o+1,1),g.splice(o+1,1),e.splice(o+1,1),s.splice(o+1,1),m.splice(o,1),o<m.length){let e=Sv(i[o],g[o],i[o+1],g[o+1])*Ev(s[o],s[o+1]);m[o]=e}if(o>0){let e=Sv(i[o-1],g[o-1],i[o],g[o])*Ev(s[o-1],s[o]);m[o-1]=e}}let w=-1;for(;;){m=[];for(let t=0;t<i.length;t++)for(let r=t;r<i.length;r++)e[r][0]-e[t].at(-1)<n*(e[t].length+e[r].length)&&m.push(Sv(i[t],g[t],i[r],g[r])*Ev(s[t],s[r]));if(0==m.length)break;let t=kv(m);if(t<c)break;let r=0,o=1;for(;r<e.length-1;){let a=Sv(i[r],g[r],i[o],g[o])*Ev(s[r],s[o]);if(e[o][0]-e[r].at(-1)<n*(e[r].length+e[o].length)&&a==t){let t=Nv(i[r],g[r],i[r+1],g[r+1]);i[r]=t.nl,g[r]=t.ne;let n=s[r].map(((e,t)=>e*s[r+1][t])),a=n.reduce(((e,t)=>e+t));s[r]=n.map((function(e){return e/a})),e[r].push(...e[r+1]),e[r]=e[r].sort(((e,t)=>e-t)),i.splice(o,1),g.splice(o,1),e.splice(o,1),s.splice(o,1),o>=e.length&&(r+=1,o=r+1)}else o+=1,o>=e.length&&(r+=1,o=r+1)}if(w==e.length)break;w=e.length}e.forEach(((e,n)=>{let o=Mv(s[n]);e.length>1&&(e.forEach(((e,s)=>{d.push(t[e]),o.mean<=r&&h.push(t[e]),t[e].segment_score=i[n]})),u.push(i[n]),f.push(g[n]),p.push(s[n]))}))}let m=parseInt(1e3*(1-o));0==m&&(m=1);let w=bv.linspace(o,1,m),b={},F={};for(let e=10;e>-1;e--)for(let t=0;t<e/2+1;t++){let n,r,s=e-t,o=w.map(((t,i)=>1-t+t*e/2)),a=e/2;e>0?(n=.5-t/(t+s),r=w.map(((e,i)=>.5-(1-e+e*t)/(2-2*e+(t+s)*e)))):(n=0,r=w.map(((e,t)=>0*e)));for(let i=0;i<u.length;i++){let c=Iv(a*this.globalMean,1,u[i],f[i])*Bv(p[i],.5+n);i in F?F[i].push([e,t,s,c,1]):F[i]=[e,t,s,c,1];let l=0,h=0,d=0;o.forEach(((e,t)=>{if(!isNaN(r[t])){let n=Iv(e*this.globalMean,1,u[i],f[i])*Bv(p[i],.5+r[t]);l+=n,n>h&&(h=n,d=w[t])}})),i in b?b[i].push([e,t,s,l/w.length,d]):b[i]=[e,t,s,l/w.length,d]}for(let e=0;e<u.length;e++)if("germline"==i)b[e].sort(((e,t)=>e[3]-t[3]));else if(b[e].sort(((e,t)=>e[3]-t[3])),"both"==i&&(F[e].sort(((e,t)=>e[3]-t[3])),F[e][0][3]>b[e][0][3])){let t=b[e].filter((t=>t[0]!=F[e][0][0]&&t[1]<=F[e][0][1]));b[e]=[F[e][0]].push(...t)}for(let e=0;e<u.length;e++)b[e][0][0],b[e][0][0],u[e],this.globalMean,xv.t_test_1_sample(this.globalMean,u[e],f[e],g[e])}return{binScore:this.formatDataStructure(this.wigFeatures,"binScore",this.globalMean),segment_score:this.formatDataStructure(this.wigFeatures,"segment_score",this.globalMean)}}formatDataStructure(e,t,i=1){const n=[];for(const[r,s]of Object.entries(e))s.forEach((e=>{var r={...e};1!=i&&(r.value=e[t]/i*2),n.push(r)}));return n}formatDataStructure_BAF(e,t=-1){const i=[],n=[];for(const[r,s]of Object.entries(this.wigFeatures))s.forEach((r=>{var s={...r},o={...r};let a=r[e];.5!=a&&(o.value=t*(1-a),n.push(o)),s.value=t*a,i.push(s)}));return[i,n]}};const Dv=2871e6;function Tv(e){for(var t=1,i=1,n=1*e,r=1;r<50;r++)t*=r,n+=(i*=-1)*Math.pow(e,2*r+1)/(t*(2*r+1));return 2*n/Math.sqrt(3.14159265358979)}function Lv(e,t,i,n,r){var s=new Pv(i.slice(n,r));return 0==s.std&&(s.std=t>0?t*s.mean/e:1),Ov(e,s.mean,s.std,r-n)/(r-n)}function zv(e,t,i,n,r){var s=new Pv(i.slice(n,r));if(s.mean<e){var o=(s.max-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1+Tv(o)),r-n)}o=(s.min-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1-Tv(o)),r-n)}function Hv(e,t,i,n,r,s,o=1e3){for(var a=Lv(e,t,i,n,r),c=0,l=!1;a>s&!l&c<o;){l=!0,c+=1;var[h,d,u,f]=[1e10,1e10,1e10,1e10];if(n>0&&(h=Lv(e,t,i,n-1,r)),r-n>2)var d=Lv(e,t,i,n+1,r),u=Lv(e,t,i,n,r-1);if(r<i.length)var f=Lv(e,t,i,n,r+1);Math.min[f]<a&&(l=!1,h==Math.min[f]&&(n-=1,a=h),elif(d==Math.min[f]),n+=1,a=d,elif(u==Math.min[f]),r-=1,a=u,elif(f==Math.min[f]),r+=1,a=f)}return a<=s?r:0}class Pv{constructor(e){this.data=e,this.mean=e.reduce(((e,t)=>e+t))/e.length,this.std=Math.sqrt(e.reduce(((e,t)=>(t-this.mean)**2))/e.length)}}function Ov(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-xv.TdistributionCDF(Math.abs(r),n-1)}function Uv(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-xv.TdistributionCDF(Math.abs(o),parseInt(a+.5))}var qv=class{constructor(e,t,i){this.rd=e,this.mean=t,this.std=i,this.bin_bands=[2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128]}get_rd_signal_bandwidth(e){var t=[];return e.forEach(((e,i)=>{var n=0;n=e>this.mean/4?this.mean/(this.std**2*e):4/this.std**2,t.push(n)})),t}meanShiftCaller(e,t=3){var i={};return Object.entries(this.rd).forEach((([e,n])=>{var r=new Array(n.length).fill(!1),s=new Array(n.length);for(let e=0;e<n.length;e++)r[e]||(s[e]=n[e]);this.bin_bands.forEach(((e,i)=>{var o=r.map(((e,t)=>!e)),a=[];Object.entries(n).forEach((([e,t])=>{a.push(t.binScore)}));var c=[0],l=0;for(let e=0;e<r.length;e++)r[e]?l>0&&(c.push(c[c.length-1]+l-1),l=0):l+=1;c.shift();for(let i=0;i<t;i++){var h=this.get_rd_signal_bandwidth(a),d=new Array(a.length).fill(0);for(let t=0;t<a.length;t++)for(let i=t-3*e;i<=t+3*e+1;i++)if(!(i<0||i>=a.length||Math.abs(t-i)>=a.length)){var u=(i-t)*Math.exp(-.5*(i-t)**2/e**2)*Math.exp(-.5*(a[t]-a[i])**2*h[t]);d[t]+=u}for(var f=new Array,p=0;p<d.length-1;p++)d[p]<0&d[p+1]>=0&&f.push(p);f.push(d.length-1),f=f.concat(c).sort(((e,t)=>e-t)),f=Array.from(new Set(f));var g=0;for(p=0;p<f.length;p++){var m=a.slice(g,f[p]+1),w=m.reduce(((e,t)=>e+t))/m.length;a.fill(w,g,f[p]+1),g=f[p]+1}}p=0;for(var b=0;p<s.length;p++)o[p]&&(s[p]=a[b],b++);for(f=new Array,p=0;p<s.length-1;p++){Math.abs(s[p+1]-s[p])>.01&&f.push(p+1)}f.unshift(0),f.push(s.length),r=new Array(this.rd.length).fill(!1);for(p=1;p<f.length;p++){var F=[f[p-1],f[p]],v=[f[p-1],f[p-1]];if(!(p>1))continue;v[0]=f[p-2];var y=[f[p],f[p]];if(!(p<f.length-1))continue;y[1]=f[p+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(A<=1)continue;var x=new Pv(s.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(s[v[0]]/this.mean)*this.std;if(Math.abs(s[v[0]]-s[F[0]])<k)continue;if(k=1.8*Math.sqrt(s[y[0]]/this.mean)*this.std,Math.abs(s[y[0]]-s[F[0]])<k)continue}else{var I=s.slice(v[0],v[1]),S=new Pv(I),E=s.slice(y[0],y[1]),N=new Pv(E);if(Uv(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>.01/Dv*bin_size*(A+C))continue;if(Uv(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>.01/Dv*bin_size*(A+_))continue}if(Ov(this.mean,x.mean,x.std,x.data.length)>.05)continue;let e=a.slice(F[0],F[1]);var B=new Pv(e);r.fill(!0,F[0],F[1]),s.fill(B.mean,F[0],F[1])}})),i[e]=s})),i}call_mean_shift(e=3){for(var t=new Array(this.rd.length).fill(!1),i=new Array(this.rd.length),n=0;n<this.rd.length;n++)t[n]||(i[n]=this.rd[n]);return this.bin_bands.forEach(((n,r)=>{var s=t.map(((e,t)=>!e)),o=[];s.forEach(((e,t)=>{e&&o.push(this.rd[t])}));for(var a=[0],c=0,l=0;l<t.length;l++)t[l]?c>0&&(a.push(a[a.length-1]+c-1),c=0):c+=1;a.shift();for(var h=0;h<e;h++){var d=this.get_rd_signal_bandwidth(o),u=new Array(o.length).fill(0);for(l=0;l<o.length;l++)for(var f=l-3*n;f<=l+3*n+1;f++)if(!(f<0||f>=o.length||Math.abs(l-f)>=o.length)){var p=(f-l)*Math.exp(-.5*(f-l)**2/n**2)*Math.exp(-.5*(o[l]-o[f])**2*d[l]);u[l]+=p}var g=new Array;for(l=0;l<u.length-1;l++)u[l]<0&u[l+1]>=0&&g.push(l);g.push(u.length-1),g=g.concat(a).sort(((e,t)=>e-t)),g=Array.from(new Set(g));var m=0;for(l=0;l<g.length;l++){var w=o.slice(m,g[l]+1),b=w.reduce(((e,t)=>e+t))/w.length;o.fill(b,m,g[l]+1),m=g[l]+1}}for(l=0,f=0;l<i.length;l++)s[l]&&(i[l]=o[f],f++);for(g=new Array,l=0;l<i.length-1;l++){Math.abs(i[l+1]-i[l])>.01&&g.push(l+1)}g.unshift(0),g.push(i.length),t=new Array(this.rd.length).fill(!1);for(l=1;l<g.length;l++){var F=[g[l-1],g[l]],v=[g[l-1],g[l-1]];if(l>1){v[0]=g[l-2];var y=[g[l],g[l]];if(l<g.length-1){y[1]=g[l+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(!(A<=1)){var x=new Pv(i.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(i[v[0]]/this.mean)*this.std;if(Math.abs(i[v[0]]-i[F[0]])<k)continue;if(k=1.8*Math.sqrt(i[y[0]]/this.mean)*this.std,Math.abs(i[y[0]]-i[F[0]])<k)continue}else{var I=i.slice(v[0],v[1]),S=new Pv(I),E=i.slice(y[0],y[1]),N=new Pv(E);if(Uv(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>3.483106931382794e-9*(A+C))continue;if(Uv(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>3.483106931382794e-9*(A+_))continue}if(!(Ov(this.mean,x.mean,x.std,x.data.length)>.05)){var B=new Pv(this.rd.slice(F[0],F[1]));t.fill(!0,F[0],F[1]),i.fill(B.mean,F[0],F[1])}}}}}})),i}cnv_calling(e=1e5){var t=.25*this.mean,i=this.mean-t,n=this.mean+t,r=2971e6,s=this.meanShiftCaller(e),o={},a=[];return Object.entries(s).forEach((([c,l])=>{for(var h=!1;!h;){h=!0;var d=new Array(1).fill(0);for(let e=0;e<l.length-1;e++){Math.abs(l[e+1]-l[e])>.01&&d.push(e+1)}d.push(l.length);for(let e=0;e<d.length-2;e++){var u=Math.abs(l[d[e]]-l[d[e+1]]);if(u<t){var f=u+1,p=u+1;if(e>0&&(f=Math.abs(l[d[e]]-l[d[e-1]])),e<d.length-3&&(p=Math.abs(s[d[e+1]]-l[d[e+2]])),u<f&&u<p){h=!1;var g=new Pv(l.slice(d[e],d[e+2]));l.fill(g.mean,d[e],d[e+2]),d.splice(e+1,e+1)}}}}var m=[];Object.entries(this.rd[c]).forEach((([e,t])=>{m.push(t.binScore)}));for(var w,b=new Array(l.length).fill(""),F=0,v=.05*e/r;F<l.length;){for(var y=F,A=F;F<l.length&l[F]<i;)F+=1;if((_=F)>A+1){var C=Hv(this.mean,this.std,m,A,_,v);if(C){var _=C;b.fill("D",A,_)}}for(A=F;F<l.length&l[F]>n;)F+=1;(_=F)>A+1&&(C=Hv(this.mean,this.std,m,A,_,v))&&(_=C,b.fill("A",A,_)),F==y&&(F+=1)}for(F=0;F<l.length;){for(;F<l.length&""!=b[F];)F+=1;for(A=F;F<l.length&l[F]<i;)F+=1;(_=F)>A+1&&(zv(this.mean,this.std,m,A,_)<1682935038707506e-26&&b.fill(["d"]*(_-A),A,_),F-=1),F+=1}(F=0)<l.length&&(w=b[F]),A=0;for(var x=[...m];F<l.length;){for(;b[F]==w&&!((F+=1)>=b.length););if(F>A){var k=new Pv(x.slice(A,F));x.fill(k.mean,A,F)}F<l.length&&(w=b[F]),A=F}for(o[c]=x,F=0;F<l.length;){if(""==(w=b[F])){F+=1;continue}for(A=F;F<l.length&w==b[F];)F+=1;let t,i=new Pv(x.slice(A,F)).mean/this.mean;t="D"==w?"deletion":"duplication";let n={chr:c,start:e*A+1,end:e*F,size:e*(F-A+1),value:2*i,event_type:t};a.push(n)}})),[o,a]}};class Qv{constructor(e,t){this.allVariants=e,this.rowBinSize=1e4,this.binSize=t,this.binFactor=parseInt(t/this.rowBinSize)}async read_rd_baf(e="ReadDepth"){var t={};for(let e=this.allVariants.length-1;e>=0;e--){var i;let n=this.allVariants[e];this.allVariants.splice(e,1);let r=n.chr;i=Math.max(Math.floor(n.start/this.rowBinSize),0),t[r]||(t[r]=[]),t[r][i]||(t[r][i]={chr:r,start:i*this.rowBinSize,end:(i+1)*this.rowBinSize,dp_sum_score:0,dp_count:0,hets_count:0,hets:[]});const s=Object.values(n.calls);if(1!==s.length)throw Error(`Unexpected number of genotypes: ${s.length}. CNVPytor expects 1 and only 1 genotype`);const o=s[0],a=o.info.DP;a&&(t[r][i].dp_sum_score+=Number.parseInt(a),t[r][i].dp_count++);let c=o.info.AD.split(","),l=o.genotype;if(0==l[0]&&1==l[1]||1==l[0]&&0==l[1]){t[r][i].hets_count++;let e=parseInt(c[0]),n=parseInt(c[1]);t[r][i].hets.push({ref:e,alt:n})}}this.chromosomes=Object.keys(t);var n,r=this.adjust_bin_size(t);if("ReadDepth"==e){n=new jv(r,this.binSize).ReadDepth_caller();var s=this.formatDataStructure_BAF(r,"max_likelihood")}else if("2D"==e){let e=new Rv(r,this.binSize),t=await e.call_2d();n=[t.binScore,[],t.segment_score];s=e.formatDataStructure_BAF("max_likelihood",-1)}return[n,s]}formatDataStructure(e,t,i=1){const n=[];for(const[s,o]of Object.entries(e))for(let e of o){var r={...e};1!=i&&(r.value=e[t]/i*2),n.push(r)}return n}format_BAF_likelihood(e){const t=[];for(const[n,r]of Object.entries(e))for(let e of r){var i={...e};.5!=e.value&&(i.value=1-e.value,t.push(i))}return t}get_max_min_score(e){if(e.likelihood_score.length>0){const t=Math.max(...e.likelihood_score),i=e.likelihood_score.indexOf(t);e.value=Math.max(i/100,1-i/100),e.min_score=Math.min(i/100,1-i/100)}else e.score=0;return e}async getAllbins(){const e=await this.computeDepthFeatures();return new bv.GetFit(e).fit_data(),e}formatDataStructure_BAF(e,t,i=-1){const n=[],r=[];for(const[a,c]of Object.entries(e))for(let e of c){var s={...e},o={...e};let a=e[t];.5!=a&&(o.value=i*(1-a),r.push(o)),s.value=i*a,n.push(s)}return[n,r]}adjust_bin_size(e){var t={};for(let r of this.chromosomes){t[r]||(t[r]=[]);for(let s=0;s<e[r].length/this.binFactor;s++){const o=s;t[r][s]||(t[r][s]={chr:r,start:o*this.binSize,end:(o+1)*this.binSize,dp_count:0,hets_count:0,binScore:0,likelihood_score:[],dp_sum_score:0});for(var i=s*this.binFactor;i<this.binFactor*s+this.binFactor;i++)if(e[r][i]&&(t[r][s].dp_sum_score+=e[r][i].dp_sum_score,t[r][s].dp_count+=e[r][i].dp_count,t[r][s].hets_count+=e[r][i].hets_count,0!=e[r][i].hets.length))for(let o of e[r][i].hets)if(0==t[r][s].likelihood_score.length)t[r][s].likelihood_score=bv.linspace(0,1,100).map(((e,t)=>Vv(o.ref,o.alt,e)));else{var n=0;t[r][s].likelihood_score=bv.linspace(0,1,100).map(((e,i)=>{var a=t[r][s].likelihood_score[i]*Vv(o.ref,o.alt,e);return n+=a,a})),t[r][s].likelihood_score=bv.linspace(0,1,100).map(((e,i)=>t[r][s].likelihood_score[i]/n))}t[r][s].binScore=100*parseInt(t[r][s].dp_sum_score/t[r][s].dp_count);const a=this.get_max_min_score(t[r][s]);t[r][s].max_likelihood=a.value}}return t}}function Vv(e,t,i,n=!0){return Math.pow(i,e)*Math.pow(1-i,t)+Math.pow(i,t)*Math.pow(1-i,e)}class jv{constructor(e,t){this.wigFeatures=e,this.binSize=t}ReadDepth_caller(){var e=new bv.GetFit(this.wigFeatures),[t,i]=e.fit_data(),n=new qv(this.wigFeatures,t,i),r=n.meanShiftCaller(this.binSize),s=n.cnv_calling();return Object.entries(this.wigFeatures).forEach((([e,t])=>{t.forEach(((t,i)=>{t.partition_level=parseInt(r[e][i]),t.partition_call=parseInt(s[0][e][i])}))})),[this.formatDataStructure("binScore",t),this.formatDataStructure("partition_level",t),this.formatDataStructure("partition_call",t),s[1]]}formatDataStructure(e,t=1){const i=[];for(const[r,s]of Object.entries(this.wigFeatures))for(let r of s){var n={...r};1!=t&&(n.value=r[e]/t*2),i.push(n)}return i}}class Wv extends Hl{static DEFAULT_TRACK_HEIGHT=250;constructor(e,t){super(e,t)}init(e){this.featureType="numeric",this.type="cnvpytor",e.max||(this.defaultScale=!0,this.autoscale=!1),e.height||(e.height=Wv.DEFAULT_TRACK_HEIGHT),this.type="cnvpytor",this.graphType=e.graphType||"points",this.bin_size=e.bin_size||1e5,this.signal_name=e.signal_name||"rd_snp",this.cnv_caller=e.cnv_caller||"2D",this.colors=e.colors||["gray","black","green","blue"],super.init(e)}get supportsWholeGenome(){return!0}get_signals(){let e=[];return"rd_snp"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller,"BAF1","BAF2"]:"rd"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller]:"snp"==this.signal_name?e=["BAF1","BAF2"]:"cnh"==this.signal_name&&(e=[this.cnv_caller]),e}get_signal_colors(){return[{singal_name:"RD_Raw",color:this.colors[0]},{singal_name:"RD_Raw_gc_coor",color:this.colors[1]},{singal_name:"ReadDepth",color:this.colors[2]},{singal_name:"2D",color:this.colors[2]},{singal_name:"BAF1",color:this.colors[3]},{singal_name:"BAF2",color:this.colors[3]}]}async postInit(){if("vcf"==this.config.format){let e;this.featureSource?e=Object.values(this.featureSource.getAllFeatures()).flat():(this.featureSource=this.featureSource||Ad(this.config,this.browser.genome),this.header=await this.getHeader(),e=this.featureSource.reader.features);const t=new Qv(e,this.bin_size);let i,n,r;this.wigFeatures_obj={},this.wigFeatures_obj[this.bin_size]={},"2D"==this.cnv_caller?(r=await t.read_rd_baf("2D"),i=r[0],n=r[1],this.wigFeatures_obj[this.bin_size]["2D"]=i[2],this.available_callers=["2D"]):(r=await t.read_rd_baf(),i=r[0],n=r[1],this.wigFeatures_obj[this.bin_size].ReadDepth=i[2],this.available_callers=["ReadDepth"]),this.wigFeatures_obj[this.bin_size].RD_Raw=i[0],this.wigFeatures_obj[this.bin_size].RD_Raw_gc_coor=i[1],this.wigFeatures_obj[this.bin_size].BAF1=n[0],this.wigFeatures_obj[this.bin_size].BAF2=n[1],this.available_bins=[this.bin_size],this.set_available_callers()}else this.cnvpytor_obj=new gv(this.config.url,this.bin_size),this.wigFeatures_obj=await this.cnvpytor_obj.get_rd_signal(this.bin_size),this.available_bins=this.cnvpytor_obj.available_bins,this.available_callers=this.cnvpytor_obj.callers,this.set_available_callers();this.tracks=[];const e=[];this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(let t in this.wigFeatures_obj)for(const[i,n]of Object.entries(this.wigFeatures_obj[t]))if(this.signals.includes(i)){let t={type:"wig"};t.features=n,t.name=i,t.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(t);r?(r.isMergedTrack=!0,r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+t),"function"==typeof r.postInit&&e.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(e)}set_available_callers(){this.available_callers.includes(this.cnv_caller)||(this.available_callers.length>0?this.cnv_caller=this.available_callers[0]:this.cnv_caller=null)}async getHeader(){if(!this.header){if("function"==typeof this.featureSource.getHeader){const e=await this.featureSource.getHeader();e&&(this.callSets=e.callSets||[]),this.header=e}this.sampleKeys=this.callSets?this.callSets.map((e=>e.sample)):[],this.sampleNames=this.sampleKeys}return this.header}get height(){return this._height}set height(e){if(this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}menuItemList(){let e=[];void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e=e.concat(this.numericDataMenuItems()),e.push("<hr/>"),e.push("Bin Sizes");for(let t of this.available_bins){const i=Dl(t,t===this.bin_size);e.push({object:Bt(i),click:async function(){this.bin_size=t,this.trackView.startSpinner(),await this.recreate_tracks(t),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}})}e.push("<hr/>"),e.push("Signal Type");let t={rd_snp:"RD and BAF Likelihood",rd:"RD Signal",snp:"BAF Likelihood"};for(let i in t){const n=Dl(t[i],i===this.signal_name);e.push({object:Bt(n),click:async function(){this.signal_name=i,await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}})}e.push("<hr/>"),e.push("CNV caller");for(let t of this.available_callers){const i=Dl(t,t===this.cnv_caller);e.push({object:Bt(i),click:async function(){this.cnv_caller=t,this.trackView.startSpinner(),await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}})}if(this.variantState){e.push("<hr/>");for(let t of this.available_callers)e.push({label:"Convert to variant track",click:()=>{this.convertToVariant()}})}return e}async recreate_tracks(e){this.tracks=[];const t=[];e in this.wigFeatures_obj||(this.wigFeatures_obj={...this.wigFeatures_obj,...await this.cnvpytor_obj.get_rd_signal(e)}),this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(const[i,n]of Object.entries(this.wigFeatures_obj[e]))if(this.signals.includes(i)){let e={type:"wig"};e.features=n,e.name=i,e.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(e);r?(r.isMergedTrack=!0,r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+e),"function"==typeof r.postInit&&t.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(t)}async getFeatures(e,t,i,n){if(this.tracks){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n)));return Promise.all(r)}}getScaleFactor(e,t,i,n){return n?i/(Math.log10(t+1)-(e<=0?0:Math.log10(e+1))):i/(t-e)}computeYPixelValue(e,t){return(this.flipAxis?e-this.dataRange.min:this.dataRange.max-e)*t}computeYPixelValueInLogScale(e,t){let i=this.dataRange.max,n=this.dataRange.min;return i<=0?0:(n<=-1&&(n=0),n=n<=0?0:Math.log10(n+1),i=Math.log10(i+1),e=Math.log10(e+1),(this.flipAxis?e-n:i-e)*t)}draw(e){const t=e.features;if(!t)return;if(this.defaultScale&&("rd_snp"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||5}:"rd"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||0,max:this.config.max||this.dataRange.max||5}:"snp"==this.signal_name&&(this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||0})),this.autoscale&&(this.dataRange=function(e,t){let i=0,n=-Number.MAX_VALUE;for(let e of t)for(let t of e)void 0===t.value||Number.isNaN(t.value)||(i=Math.min(i,t.value),n=Math.max(n,t.value));return{min:i,max:n}}(e.referenceFrame.chr,t)),this.tracks)for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t[i],this.tracks[i].dataRange=this.dataRange,this.tracks[i].flipAxis=this.flipAxis,this.tracks[i].logScale=this.logScale,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}const i=this.getScaleFactor(this.dataRange.min,this.dataRange.max,e.pixelHeight,this.logScale),n=e=>this.logScale?this.computeYPixelValueInLogScale(e,i):this.computeYPixelValue(e,i);if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=n(t.y),r={strokeStyle:t.color,strokeWidth:1};t.dotted?xo.dashedLine(e.context,0,i,e.pixelWidth,i,5,r):xo.strokeLine(e.context,0,i,e.pixelWidth,i,r)}let r=n(2);xo.dashedLine(e.context,0,r,e.pixelWidth,r,5,{strokeStyle:"lightgray",strokeWidth:.5})}paintAxis(e,t,i){var n,r,s,o,a,c,l,h={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};if(void 0===this.dataRange||void 0===this.dataRange.max||void 0===this.dataRange.min)return;let d=void 0!==this.flipAxis&&this.flipAxis;function u(e){return e<0?Math.abs(e):0===e?"0":Math.abs(e)>=10||e%1==0?e.toFixed():Math.abs(e)>=1?e.toFixed(1):e.toFixed(2)}xo.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"}),n=(l=.95*t)-8,a={x:r=l,y:s=o=.01*i},xo.strokeLine(e,n,s,r,o,h),xo.fillText(e,u(d?this.dataRange.min:this.dataRange.max),n+4,s+12,h),c={x:r,y:s=o=.99*i},xo.strokeLine(e,n,s,r,o,h),xo.fillText(e,u(d?this.dataRange.max:this.dataRange.min),n+4,s-4,h),xo.strokeLine(e,a.x,a.y,c.x,c.y,h);const f=this.getScaleFactor(this.dataRange.min,this.dataRange.max,i,this.logScale),p=e=>this.logScale?this.computeYPixelValueInLogScale(e,f):this.computeYPixelValue(e,f),g=Math.ceil((this.dataRange.max-this.dataRange.min)/10);for(let t=Math.ceil(this.dataRange.min+1);t<Math.round(this.dataRange.max-.4);t+=g){const i=p(t);xo.strokeLine(e,45,i,50,i,h),xo.fillText(e,u(d?this.dataRange.max-t:t),44,i+4,h)}}popupData(e,t){const i=t||e.viewport.cachedFeatures;if(i&&i.length===this.tracks.length){const t=[];for(let n=0;n<this.tracks.length;n++){n>0&&t.push("<hr/>"),t.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${this.tracks[n].name}</div>`);const r=this.tracks[n].popupData(e,i[n]);t.push(...r)}return t}}async convertToVariant(){this.variantState&&(Object.setPrototypeOf(this,Kv.prototype),this.init(this.variantState),await this.postInit(),this.trackView.clearCachedFeatures(),this.variantState.trackHeight&&this.trackView.setTrackHeight(this.variantState.trackHeight),this.trackView.checkContentHeight(),this.trackView.updateViews(),delete this.variantState)}}const Gv=Mt,$v=10;class Kv extends Hl{static defaults={displayMode:"EXPANDED",sortDirection:"ASC",showGenotypes:!0,expandedVariantHeight:10,squishedVariantHeight:2,squishedCallHeight:1,expandedCallHeight:10,expandedVGap:2,squishedVGap:1,expandedGroupGap:10,squishedGroupGap:5,featureHeight:14,noGenotypeColor:"rgb(200,180,180)",noCallColor:"rgb(225, 225, 225)",nonRefColor:"rgb(200, 200, 215)",mixedColor:"rgb(200, 220, 200)",homrefColor:"rgb(200, 200, 200)",homvarColor:"rgb(17,248,254)",hetvarColor:"rgb(34,12,253)",refColor:"rgb(0,0,220)",altColor:"rgb(255,0,0)",visibilityWindow:void 0,labelDisplayMode:void 0,type:"variant"};_sortDirections=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),e.variantHeight&&(this.expandedVariantHeight=e.variantHeight),this.featureSource=Ad(e,this.browser.genome),this.colorTables=new Map,e.colorTable){const t=e.colorBy||"*";this.colorTables.set(t,new ao(e.colorTable))}if(this.strokecolor=e.strokecolor,this._context_hook=e.context_hook,e.color&&(this.colorBy=void 0),this.nVariantRows=1,e.samples)for(let t of e.samples)this.sampleKeys=e.samples;e.sort&&(this.initialSort=e.sort),this._colorByItems=new Map([["none","None"]])}async postInit(){if(this.header=await this.getHeader(),this.header.INFO){const e=new Set(Object.keys(this.header.INFO));this.config.colorBy?this.colorBy=this.config.colorBy:!this.config.color&&e.has("AF")&&(this.colorBy="AF"),e.has("AF")&&this._colorByItems.set("AF","Allele frequency"),e.has("VT")&&this._colorByItems.set("VT","Variant Type"),e.has("SVTYPE")&&this._colorByItems.set("SVTYPE","SV Type")}if(this.config.colorBy&&!this._colorByItems.has(this.config.colorBy)&&this._colorByItems.set(this.config.colorBy,this.config.colorBy),!this.disposed){if(this.header&&!this.sampleKeys&&(this.sampleKeys=this.header.sampleNameMap?Array.from(this.header.sampleNameMap.keys()):[]),void 0===this.visibilityWindow&&!1!==this.config.indexed){const e=Ht(this.config.url)?this.config.url.name:this.config.url;Gv(e)&&e.toLowerCase().includes("gnomad")?this.visibilityWindow=1e3:"function"==typeof this.featureSource.defaultVisibilityWindow?this.visibilityWindow=await this.featureSource.defaultVisibilityWindow():this.visibilityWindow=1e6}return this}}get supportsWholeGenome(){return!this.config.indexURL||!0===this.config.supportsWholeGenome}get color(){return this._color||"rgb(0,0,150)"}set color(e){this._color=e,e&&(this.colorBy=void 0)}async getHeader(){return this.header||"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader()),this.header}getSampleCount(){return this.sampleKeys?this.sampleKeys.length:0}async getFeatures(e,t,i,n){void 0===this.header&&(this.header=await this.getHeader());const r=await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:this.visibilityWindow});if(this.initialSort){const e=this.initialSort;if(void 0===e.option||"GENOTYPE"===e.option.toUpperCase())this.sortSamplesByGenotype(e,r);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="ASC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return r}hasSamples(){return this.getSampleCount()>0}getSamples(){const e="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=t*(("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight)+e),r=$v+t*(i+e);return{names:this.sampleKeys,yOffset:r,height:n}}computePixelHeight(e){if(!e||0===e.length)return $v;const t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,n="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,r="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s=!1===this.showGenotypes?0:this.getSampleCount()*t;return $v+t*(n+i)+i+(s+1)*(r+i)}variantRowCount(e){this.nVariantRows=e}draw({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n,bpStart:r,pixelTop:s,features:o}){xo.fillRect(e,0,s,t,i,{fillStyle:"rgb(255, 255, 255)"});const a="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,c="COLLAPSED"===this.displayMode?1:this.nVariantRows,l="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight;this.variantBandHeight=$v+c*(l+a);let h=this.sampleColumns;const d=this.hasSamples();if(h&&d&&!1!==this.showGenotypes&&xo.strokeLine(e,0,this.variantBandHeight,t,this.variantBandHeight,{strokeStyle:"rgb(224,224,224) "}),o){const i="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,a=r+t*n+1;for(let t of o){if(t.end<r)continue;if(t.start>a)break;const o="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,c=$v+("COLLAPSED"===this.displayMode?0:t.row*(o+s)),l=o;let h=(t.start-r)/n,u=(t.end-r)/n,f=Math.max(1,u-h);f<3?(f=3,h-=1):f>5&&(h+=1,f-=2);const p=t._f||t;let g;try{g=p.alleleFreq()}catch(e){console.log(e)}if("AF"===this.colorBy&&g){const t=Math.min(1,g)*l,i=l-t;e.fillStyle=p.isFiltered()?this.refColorFiltered:this.refColor,e.fillRect(h,c,f,i),e.fillStyle=p.isFiltered()?this.altColorFiltered:this.altColor,e.fillRect(h,c+i,f,t)}else e.fillStyle=this.getColorForFeature(p),e.fillRect(h,c,f,l);let m=this.getVariantStrokecolor(p);if(m&&(e.strokeStyle=m,e.strokeRect(h,c,f,l)),this.callContextHook(p,e,h,c,f,l),d&&!1!==this.showGenotypes){const t="COLLAPSED"===this.displayMode?1:this.nVariantRows;this.sampleYOffset=this.variantBandHeight+s,this.sampleHeight=t*(i+s);let n=0;for(let t of this.sampleKeys){const r=this.header.sampleNameMap.get(t),o=p.calls[r];if(o){const t="COLLAPSED"===this.displayMode?0:p.row,r=this.sampleYOffset+n*this.sampleHeight+t*(i+s);let a=!0,c=!0,l=!1;if(o.genotype)for(let e of o.genotype){if("."===e){l=!0;break}0!==e&&(c=!1),0===e&&(a=!1)}o.genotype?e.fillStyle=l?this.noCallColor:c?this.homrefColor:a?this.homvarColor:this.hetvarColor:e.fillStyle=this.noGenotypeColor,e.fillRect(h,r,f,i)}n++}}}}else console.log("No feature list")}get refColorFiltered(){return this._refColorFiltered||(this._refColorFiltered=_s.addAlpha(this.refColor,.2)),this._refColorFiltered}get altColorFiltered(){return this._altColorFiltered||(this._altColorFiltered=_s.addAlpha(this.altColor,.2)),this._altColorFiltered}getColorForFeature(e){const t=e._f||e;let i;if(this.colorBy&&"none"!==this.colorBy){const e=t.getAttributeValue(this.colorBy);i=void 0!==e?this.getVariantColorTable(this.colorBy).getColor(e):"gray"}else i=this.color?"function"==typeof this.color?this.color(e):this.color:"NONVARIANT"===t.type?this.nonRefColor:"MIXED"===t.type?this.mixedColor:this.color;return t.isFiltered()&&(i=_s.addAlpha(i,.2)),i}getVariantStrokecolor(e){const t=e._f||e;let i;return i=this.strokecolor?"function"==typeof this.strokecolor?this.strokecolor(t):this.strokecolor:void 0,i}callContextHook(e,t,i,n,r,s){if(this._context_hook&&"function"==typeof this._context_hook){const o=e._f||e;t.save(),this._context_hook(o,t,i,n,r,s),t.restore()}}clickedFeatures(e){let t=super.clickedFeatures(e);const i="EXPANDED"===this.displayMode?this.expandedVGap:this.squishedVGap,n=i+("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight),r=e.y;if(r<=this.variantBandHeight){const e="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=Math.floor((r-$v)/(e+i));"COLLAPSED"!==this.displayMode&&(t=t.filter((e=>e.row===n)))}else if(this.sampleKeys){const e=r-this.variantBandHeight,i=Math.floor(e/this.sampleHeight);if(i>=0&&i<this.sampleKeys.length){const r=Math.floor((e-i*this.sampleHeight)/n),s="COLLAPSED"===this.displayMode?t:t.filter((e=>e.row===r)),o=this.sampleKeys[i],a=this.header.sampleNameMap.get(o);t=s.map((e=>{const t=e.calls[a];return t.genotypeString=function(e,t){if(e.genotype){let i="";if("."===t.alternateBases)i="No Call";else{const n=t.alternateBases.split(",");for(let r of e.genotype)if(i.length>0&&(i+=" | "),"."===r)i+=".";else if(0===r)i+=t.referenceBases;else{i+=n[r-1].replace("<","&lt;")}}return i}}(t,e),t}))}}return t}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=this.browser.genome.id;let r=[];for(let e of t){const t=e._f||e;if(r.length>0&&r.push({html:'<hr style="border-top-width:2px ;border-color: #c9c3ba" />'}),"function"==typeof t.popupData){const e=t.popupData(i,n);Array.prototype.push.apply(r,e)}}return r}menuItemList(){const e=[];if(this.header.INFO&&this.header.INFO){const t=this._colorByItems;e.push("<hr/>");const i=Bt('<div class="igv-track-menu-category igv-track-menu-border-top">');i.text("Color by:"),e.push({name:void 0,object:i,click:void 0,init:void 0});for(let n of t.keys()){const r=this.colorBy===n;e.push(this.colorByCB({key:n,label:t.get(n)},r))}e.push(this.colorByCB({key:"info",label:"Info field..."}))}if(!0===Hf(this.browser.sampleInfo,this.sampleKeys)){e.push("<hr/>"),e.push("Sort by attribute:");for(const s of this.browser.sampleInfo.attributeNames)if(this.sampleKeys.some((e=>{const t=this.browser.sampleInfo.getAttributes(e);return t&&t[s]}))){const o=Bt("<div>");function a(){const e=this._sortDirections.get(s)||1;this.sortByAttribute(s,e),this.config.sort={option:"ATTRIBUTE",attribute:s,direction:e>0?"ASC":"DESC"},this._sortDirections.set(s,-1*e)}o.html(`&nbsp;&nbsp;${s.split(Uu.emptySpaceReplacement).join(" ")}`),e.push({object:o,click:a})}}e.push("<hr/>"),this.getSampleCount()>0&&(e.push({object:Bt('<div class="igv-track-menu-border-top">')}),e.push({object:Bt(Dl("Show Genotypes",this.showGenotypes)),click:function(){this.showGenotypes=!this.showGenotypes,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.browser.sampleNameControl.performClickWithState(this.browser,this.showGenotypes),this.browser.sampleInfoControl.performClickWithState(this.browser,this.showGenotypes)}})),e.push({object:Bt('<div class="igv-track-menu-border-top">')});for(let c of["COLLAPSED","SQUISHED","EXPANDED"]){e.push({object:Bt(Dl({COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"}[c],c===this.displayMode)),click:function(){this.displayMode=c,this.trackView.checkContentHeight(),this.trackView.repaintViews()}})}return this.browser.circularView&&(e.push("<hr>"),e.push({label:"Add SVs to circular view",click:function(){for(let e of this.trackView.viewports)this.sendChordsForViewport(e)}})),this.canCovertToPytor()&&(e.push("<hr>"),e.push({label:"Convert to CNVpytor track",click:function(){this.convertToPytor()}})),e}contextMenuItemList(e){const t=[];if(this.hasSamples()&&this.showGenotypes){const i=e.viewport.referenceFrame,n=e.genomicLocation,r=i.toBP(2.5),s=this._sortDirections.get("genotype")||1;this._sortDirections.set("genotype",-1*s),t.push({label:"Sort by genotype",click:t=>{const i={direction:s,option:"genotype",chr:e.viewport.referenceFrame.chr,start:Math.floor(n-r),end:Math.ceil(n+r)},o=e.viewport.cachedFeatures;this.sortSamplesByGenotype(i,o),this.config.sort=i}}),t.push("<hr/>")}if(this.browser.circularView){const i=e.viewport;t.push({label:"Add SVs to Circular View",click:()=>{this.sendChordsForViewport(i)}}),t.push("<hr/>")}return t}async sortSamplesByGenotype({chr:e,position:t,start:i,end:n,direction:r},s){if(void 0===i&&(i=t-1),void 0===n&&(n=t),s||(s=await this.featureSource.getFeatures({chr:e,start:i,end:n})),!s)return;const o=new Map,a="ASC"===r?1:-1;for(let e of s)if(!(e.end<i)){if(e.start>n)break;for(let t of e.calls){const e=t.sample,i=t.zygosityScore();o.set(e,o.has(e)?o.get(e)+i:i)}}this.sampleKeys.sort((function(e,t){let i=o.get(e)||0,n=o.get(t)||0;return a*(i-n)})),this.trackView.repaintViews()}sortByAttribute(e,t){this.config.sort={option:"ATTRIBUTE",attribute:e,direction:1===t?"ASC":"DESC"},this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}sendChordsForViewport(e){const t=e.referenceFrame;let i;if("all"===t.chr){const e=this.featureSource.getAllFeatures(),t=Object.keys(e).map((t=>e[t]));i=[].concat(...t)}else i=this.featureSource.featureCache.queryFeatures(t.chr,t.start,t.end);Hm(i.filter((e=>{const t=e._f||e;return t.info&&t.info.CHR2&&t.info.END&&(t.info.CHR2!==t.chr||Math.abs(Number.parseInt(t.info.END)-t.pos)>1e6)})).map((e=>{const t=e._f||e,i=Number.parseInt(t.info.END),n=i-100,r=i+100;return{uniqueId:`${t.chr}:${t.start}-${t.end}_${t.info.CHR2}:${t.info.END}`,refName:Lm(t.chr),start:t.start,end:t.end,mate:{refName:Lm(t.info.CHR2),start:n,end:r}}})),this,t,.5)}colorByCB(e,t){const i=Bt(Dl(e.label,t));if("info"!==e.key){function n(){const t="none"===e.key?void 0:e.key;this.colorBy=t,this.config.colorBy=t,this.trackView.repaintViews()}return{name:void 0,object:i,click:n,init:void 0}}{function r(e){this.browser.inputDialog.present({label:"Info field",value:"",callback:e=>{e?(this.colorBy=e,this._colorByItems.set(e,e)):this.colorBy=void 0,this.trackView.repaintViews()}},e)}return{name:void 0,object:i,dialog:r,init:void 0}}}getState(){const e=super.getState();return this.color&&"function"!=typeof this.color&&(e.color=this.color),e}getVariantColorTable(e){if(this.colorTables.has(e))return this.colorTables.get(e);if(this.colorTables.has("*"))return this.colorTables.get("*");{let t;if("SVTYPE"===e)t=Yv;else t=new oo("Set1");return this.colorTables.set(e,t),t}}paintAxis(){}canCovertToPytor(){return!this.config.indexURL&&(!!this.header&&(1===Object.keys(this.sampleKeys).length&&this.header.FORMAT&&this.header.FORMAT.AD&&this.header.FORMAT.DP))}async convertToPytor(){this.variantState={...this.config,...this.getState()},this.variantState.trackHeight=this.height,this.trackView.startSpinner(),setTimeout((async()=>{try{const e=Object.assign({},this.config);Object.setPrototypeOf(this,Wv.prototype),this.init(e),await this.postInit(),this.trackView.clearCachedFeatures(),this.trackView.setTrackHeight(this.config.height||Wv.DEFAULT_TRACK_HEIGHT),this.trackView.checkContentHeight(),this.trackView.updateViews()}finally{this.trackView.stopSpinner()}}),100)}}const Yv=new ao({DEL:"#ff2101",INS:"#001888",DUP:"#028401",INV:"#008688",CNV:"#8931ff",BND:"#891100","*":"#002eff"}),Xv={timeout:5e3,type:"plain",url:"https://igv.org/genomes/locus.php?genome=$GENOME$&name=$FEATURE$",coords:0};async function Zv(e,t){const i=e.searchConfig||Xv;let n;const r=e.tracks.filter((e=>e.searchable));for(let e of r){const i=await e.search(t);if(i)return i}if(e.config&&!1!==e.config.search)try{return n=await async function(e,t,i){let n=i.url.replace("$FEATURE$",t.toUpperCase());n.indexOf("$GENOME$")>-1&&(n=n.replace("$GENOME$",e.genome.id?e.genome.id:"hg19"));const r=i.timeout?{timeout:i.timeout}:void 0,s=await Qs.loadString(n,r);return function(e,t,i){let n;n="plain"===i.type?function(e,t){const i=[],n=Dt(t);for(let t of n){const n=t.split("\t");if(n.length>=3){const t=n[1].split(":"),r=t[1].split("-");i.push({chromosome:e.genome.getChromosomeName(t[0].trim()),start:parseInt(r[0].replace(/,/g,"")),end:parseInt(r[1].replace(/,/g,"")),name:n[0].toUpperCase()})}}return i}(e,t):JSON.parse(t);i.resultsField&&(n=n[i.resultsField]);if(n&&0!==n.length){const e=i.chromosomeField||"chromosome",t=i.startField||"start",r=i.endField||"end",s=i.coords||1;let o;o=Array.isArray(n)?n[0]:n,o.hasOwnProperty(e)&&o.hasOwnProperty(t)||console.error("Search service results must include chromosome and start fields: "+o);const a=o[e];let c=o[t]-s,l=o[r];void 0===l&&(l=c+1);const h={chr:a,start:c,end:l};if(!o.type||o.type,i.geneField&&i.snpField){const e=o[i.geneField]||o[i.snpField];e&&(h.name=e.toUpperCase())}return h}return}(e,s,i)}(e,t,i),n}catch(e){console.log("Search service not available "+e)}}function Jv(e,t=!1){const i=e.split("\t");if(i.length>2)try{const e=i[0],t=parseInt(i[1].replace(/,/g,""),10)-1,n=parseInt(i[2].replace(/,/g,""),10);if(!isNaN(t)&&!isNaN(n))return{chr:e,start:t,end:n}}catch(e){}const n=e.split(":"),r={chr:n[0]};if(n.length>1){let e,i=n[1].split("-");if(i.length>2){if(!n[1].startsWith("-"))return;{const e=n[1].indexOf("-",1);if(e>0){i=[n[1].substring(0,e),n[1].substring(e+1)]}}}if(e=i[0].replace(/,/g,""),isNaN(e))return;if(r.start=parseInt(e,10)-1,r.end=r.start+1,1===i.length&&(r.start-=20,r.end+=20),2===i.length){if(e=i[1].replace(/,/g,""),isNaN(e))return;if(r.end=parseInt(e,10),r.start<0&&!t){const e=-extent.start;r.start+=e,r.end+=e}}}return r}class ey extends Hl{constructor(e,t){super(e,t)}init(e){super.init(e),this.type="qtl",this.name=e.name;const t=e.minLogP||e.min,i=e.maxLogP||e.max;this.dataRange={min:void 0!==t?t:3.5,max:i||25},this.autoscale=!i||e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||2,this.height=e.height||100,this.disableButtons=e.disableButtons,this.featureSource=Ad(e,this.browser.genome)}paintAxis(e,t,i){const n=(this.dataRange.max-this.dataRange.min)/i,r={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};xo.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});const s=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let o=4;o<=this.dataRange.max;o+=s){const s=.85*t,a=s-5,c=s,l=i-(o-this.dataRange.min)/n;xo.strokeLine(e,a,l,c,l,r),l>8&&xo.fillText(e,o,a-1,l+2,r)}r.textAlign="center",xo.fillText(e,"-log10(pvalue)",t/4,i/2,r,{rotate:{angle:-90}})}async getFeatures(e,t,i){const n=this.visibilityWindow;return await this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const{context:t,referenceFrame:i,pixelWidth:n,pixelHeight:r}=e;this.background&&xo.fillRect(t,0,0,n,r,{fillStyle:this.background}),xo.strokeLine(t,0,r-1,n,r-1,{strokeStyle:this.divider}),i.feature&&i.feature.match(/RS[0-9]+/);const s=i=>{const s=i?2*this.dotSize:this.dotSize,o=e.bpStart,a=(this.dataRange.max-this.dataRange.min)/r;for(let d of e.features){const u=(d.start-o+.5)/e.bpPerPixel;if(u<0)continue;if(u>n)break;const f=d.phenotype;let p;if(this.browser.qtlSelections.qtl?(l=this.browser.qtlSelections.qtl,h=d,p=l.chr===h.chr&&l.start===h.start&&l.pValue===h.pValue):p=this.browser.qtlSelections.snps.size>0?this.browser.qtlSelections.hasSnp(d.snp)&&this.browser.qtlSelections.hasPhenotype(f):this.browser.qtlSelections.hasPhenotype(f),!i||p){var c=-Math.log(d.pValue)/Math.LN10;if(c>=this.dataRange.min){let e;c>this.dataRange.max?(c=this.dataRange.max,e=!0):e=!1;const n=Math.max(0+s,r-Math.round((c-this.dataRange.min)/a));let o;d.px=u,d.py=n,d.radius=s,i&&p?(o=this.browser.qtlSelections.colorForGene(f),xo.setProperties(t,{fillStyle:o,strokeStyle:"black"})):(o=e?"rgb(150, 150, 150)":"rgb(180, 180, 180)",xo.setProperties(t,{fillStyle:o,strokeStyle:o})),xo.fillCircle(t,u,n,s),xo.strokeCircle(t,u,n,s)}}}var l,h};s(!1),s(!0)}popupData(e,t){if(void 0===t&&(t=e.viewport.cachedFeatures),!t||0===t.length)return[];const i=this.name,n=[];for(let r of this._clickedFeatures(e,t))n.length>0&&n.push("<hr/>"),"function"==typeof r.popupData?n.push(...r.popupData(e)):n.push({name:"snp id",value:r.snp},{name:"gene id",value:r.gencodeId},{name:"gene name",value:r.geneSymbol},{name:"p value",value:r.pValue},{name:"tissue",value:i});return n}_clickedFeatures(e,t){const i=(e,t)=>Math.sqrt((e.px-t.canvasX)*(e.px-t.canvasX)+(e.py-t.canvasY)*(e.py-t.canvasY)),n=t.filter((t=>i(t,e)<6));if(n.length>1){n.sort(((t,n)=>i(t,e)-i(n,e)));const t=i(n[0],e);return n.filter((n=>i(n,e)<=t))}return n}contextMenuItemList(e){const t=[],i=e.viewport.cachedFeatures;if(i){const n=this._clickedFeatures(e,i);n.length>0&&(t.push({label:"Highlight associated features",click:async()=>{this.browser.qtlSelections.clear();for(let e of n)this.browser.qtlSelections.qtl=e,this.browser.qtlSelections.addPhenotype(e.phenotype);this.browser.repaintViews()}}),t.push("<hr>"))}return t}menuItemList(){const e=[];return e.push(...this.numericDataMenuItems()),e.push("<hr/>"),e.push({label:"Search for...",dialog:function(e){this.browser.inputDialog.present({label:"Search for snp or phenotype",value:"",callback:async e=>{if(e){e=e.trim().toUpperCase();const t=t=>((t.phenotype&&t.phenotype.toUpperCase())===e||t.snp&&t.snp.toUpperCase()===e)&&-Math.log(t.pValue)/Math.LN10>this.dataRange.min;let i,n,r,s=await this.featureSource.findFeatures(t);if(0==s.length){await this.browser.search(e)&&(s=await this.featureSource.findFeatures(t))}if(s.length>0){this.browser.qtlSelections.clear();const t=new Set;i=s[0].chr,n=s[0].start,r=s[0].end;for(let o of s)o.snp&&o.snp.toUpperCase()===e&&this.browser.qtlSelections.addSnp(o.snp),this.browser.qtlSelections.addPhenotype(o.phenotype),t.add(o.phenotype),o.chr===i&&(n=Math.min(n,o.start),r=Math.max(r,o.end));const o=this.browser.genome.getChromosomeName(i);for(let e of t){const t=await Zv(this.browser,e);t&&o===this.browser.genome.getChromosomeName(t.chr)&&(n=Math.min(n,t.start),r=Math.max(r,t.end))}const a=Math.floor(.1*(r-n));n=Math.max(0,n-a),r+=a,await this.browser.search(`${i}:${n}-${r}`)}}}},e)}}),e}doAutoscale(e){let t=this.config.max||25;if(e.length>0){const i=e.map((e=>-Math.log(e.pValue)/Math.LN10));i.sort(((e,t)=>e-t));t=i[Math.floor(i.length*(this.autoscalePercentile/100))]}return this.dataRange.max=Math.max(t,10),this.dataRange}}const ty={X:"rgb(204, 153, 0)",Y:"rgb(153, 204, 0)",Un:"darkGray)",1:"rgb(80, 80, 255)",2:"rgb(206, 61, 50)","2a":"rgb(210, 65, 55)","2b":"rgb(215, 70, 60)",3:"rgb(116, 155, 88)",4:"rgb(240, 230, 133)",5:"rgb(70, 105, 131)",6:"rgb(186, 99, 56)",7:"rgb(93, 177, 221)",8:"rgb(128, 34, 104)",9:"rgb(107, 215, 107)",10:"rgb(213, 149, 167)",11:"rgb(146, 72, 34)",12:"rgb(131, 123, 141)",13:"rgb(199, 81, 39)",14:"rgb(213, 143, 92)",15:"rgb(122, 101, 165)",16:"rgb(228, 175, 105)",17:"rgb(59, 27, 83)",18:"rgb(205, 222, 183)",19:"rgb(97, 42, 121)",20:"rgb(174, 31, 99)",21:"rgb(231, 199, 111)",22:"rgb(90, 101, 94)",23:"rgb(204, 153, 0)",24:"rgb(153, 204, 0)",25:"rgb(51, 204, 0)",26:"rgb(0, 204, 51)",27:"rgb(0, 204, 153)",28:"rgb(0, 153, 204)",29:"rgb(10, 71, 255)",30:"rgb(71, 117, 255)",31:"rgb(255, 194, 10)",32:"rgb(255, 209, 71)",33:"rgb(153, 0, 51)",34:"rgb(153, 26, 0)",35:"rgb(153, 102, 0)",36:"rgb(128, 153, 0)",37:"rgb(51, 153, 0)",38:"rgb(0, 153, 26)",39:"rgb(0, 153, 102)",40:"rgb(0, 128, 153)",41:"rgb(0, 51, 153)",42:"rgb(26, 0, 153)",43:"rgb(102, 0, 153)",44:"rgb(153, 0, 128)",45:"rgb(214, 0, 71)",46:"rgb(255, 20, 99)",47:"rgb(0, 214, 143)",48:"rgb(20, 255, 177)"};for(let MA of Object.keys(ty)){ty["chr"+MA]=ty[MA]}for(let RA=1;RA<=48;RA++){if(10===RA)continue;const DA=iy(RA);ty[DA]=ty[RA.toString()]}function iy(e){if(!+e)return!1;for(var t=String(+e).split(""),i=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],n="",r=3;r--;)n=(i[+t.pop()+10*r]||"")+n;return Array(+t.join("")+1).join("M")+n}class ny extends Hl{constructor(e,t){super(e,t)}init(e){super.init(e),this.useChrColors=void 0===e.useChrColors||e.useChrColors,this.trait=e.trait,this.posteriorProbability=e.posteriorProbability,this.valueProperty="bed"===e.format?"score":"value",this.height=e.height||100,this.autoscale=e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||3,this.popoverWindow=void 0===e.popoverWindow?1e8:e.popoverWindow,this.useChrColors?this.colorScale=new ao(e.colorTable||ty):e.color?this.colorScale=new ff(e.color):this.colorScale=new df(e.colorScale||{thresholds:[5e-8,5e-4,.5],colors:["rgb(255,50,50)","rgb(251,100,100)","rgb(251,170,170)","rgb(227,238,249)"]}),this.featureSource=Ad(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),this.autoscale||(this.posteriorProbability?this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?1:this.config.max}:this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?25:this.config.max}),this}get supportsWholeGenome(){return!0}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.features,i=e.context,n=e.pixelWidth,r=e.pixelHeight;if(this.background&&xo.fillRect(i,0,0,n,r,{fillStyle:this.background}),xo.strokeLine(i,0,r-1,n,r-1,{strokeStyle:this.divider}),t){const s=e.bpPerPixel,o=e.bpStart,a=o+n*s+1;for(let e of t){const t=e.start;if(t<o)continue;if(t>a)break;let n;if(this.posteriorProbability)n=e[this.valueProperty];else{const t=e[this.valueProperty];if(!t)continue;n=-Math.log10(t)}const c=this.useChrColors?e._f?e._f.chr:e.chr:n,l=this.colorScale.getColor(c),h=(this.dataRange.max-this.dataRange.min)/r,d=Math.round((t-o)/s),u=Math.max(this.dotSize,r-Math.round((n-this.dataRange.min)/h));l&&xo.setProperties(i,{fillStyle:l,strokeStyle:"black"}),xo.fillCircle(i,d,u,this.dotSize),e.px=d,e.py=u}}}paintAxis(e,t,i){xo.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});var n={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};const r=(this.dataRange.max-this.dataRange.min)/i;if(this.posteriorProbability){const t=.1;for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);xo.strokeLine(e,45,t-2,50,t-2,n),xo.fillText(e,s.toFixed(1),44,t+2,n)}}else{const t=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);xo.strokeLine(e,45,t,50,t,n),xo.fillText(e,Math.floor(s),44,t+4,n)}}n.textAlign="center",this.posteriorProbability?xo.fillText(e,"PPA",t/2,i/2,n,{rotate:{angle:-90}}):xo.fillText(e,"-log10(pvalue)",t/2,i/2,n,{rotate:{angle:-90}})}popupData(e,t){void 0===t&&(t=e.viewport.cachedFeatures);let i=[];const n=e.viewport.trackView.track;if(t){let r=0;for(let s of t){const t=Math.abs(e.canvasX-s.px),o=Math.abs(e.canvasY-s.py);if(t<this.dotSize&&o<this.dotSize){if(r>0&&i.push("<HR/>"),5==r){i.push("...");break}if(s=s._f||s,"function"==typeof s.popupData)i=i.concat(s.popupData());else{const e=s[this.valueProperty],t=s.chr,r=Rt(s.start+1);i.push({name:"chromosome",value:t}),i.push({name:"position",value:r}),i.push({name:"name",value:s.name}),n.posteriorProbability?i.push({name:"posterior probability",value:e}):i.push({name:"pValue",value:e})}r++}}}return i}menuItemList(){return this.numericDataMenuItems()}doAutoscale(e){if(e.length>0){const t=this.valueProperty,i=this.posteriorProbability,n=e.map((function(e){const n=e[t];return{value:i?n:-Math.log(n)/Math.LN10}}));this.dataRange=Qa(n)}else this.posteriorProbability?this.dataRange={min:this.config.min||0,max:this.config.max||1}:this.dataRange={min:this.config.max||25,max:this.config.min||0};return this.dataRange}}class ry extends Hl{constructor(e,t){super(e,t)}init(e){super.init(e),this.autoscale=e.autoscale||void 0===e.max,this.dataRange={min:e.min||0,max:e.max},this.windowFunction=e.windowFunction||"mean",this.paintAxis=cd,this.graphType=e.graphType||"bar",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=Ad(this.config,this.browser.genome),this.visibilityWindow=-1,this.featureSource.visibilityWindow=this.visibilityWindow}async postInit(){if("function"==typeof this.featureSource.getHeader){if(this.header=await this.featureSource.getHeader(),this.disposed)return;if(this.sampleKeys=this.header.columnNames.slice(3),this.setTrackProperties(this.header),this.header.hasOwnProperty("clickToHighlight")){let e=this.header.clickToHighlight;this.config.clickToHighlight=e,this.config.samplesClickedToHighlight={}}if(this.header.hasOwnProperty("highlight")){this.config.highlightSamples={};let e=this.header.highlight;Array.isArray(e)||(e=[e]);for(let t of e){const e=t.split(";");2===e.length&&(this.config.highlightSamples[e[0]]=e[1])}}}}menuItemList(){return this.numericDataMenuItems()}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:0,end:Number.MAX_SAFE_INTEGER,visibilityWindow:this.visibilityWindow});let r,s;for(let e=1;e<n.length-1;e++)if(void 0===r&&n[e].end>t&&(r=e-1),void 0===s&&n[e].start>i){s=e+1;break}return void 0===r&&(r=0),void 0===s&&(s=n.length),n.slice(r,s)}draw(e){const{features:t,context:i,bpPerPixel:n,bpStart:r,pixelWidth:s,pixelHeight:o}=e,a=e=>(this.dataRange.max-e)/(this.dataRange.max-this.dataRange.min)*o,c=function(e){let t=Math.floor((e-r)/n);return isNaN(t)&&console.warn("isNaN(x). feature start "+Rt(e)+" bp start "+Rt(r)),t};if(t&&t.length>0&&(void 0===this.dataRange.min&&(this.dataRange.min=0),this.dataRange.max>this.dataRange.min)){const e=this.config.highlightSamples,n=this.config.onlyHandleClicksForHighlightedSamples,r=this.config.clickToHighlight;let s=-1,o={},l=[],h=[];this.clickDetectorCache={};for(let d of t){const t=c(d.start),u=c(d.end),f=s>=0?c(s):t;if(!isNaN(t)&&!isNaN(u)){this.clickDetectorCache[t]=[],this.clickDetectorCache[u]=[];for(let s=0;s<d.values.length;s++){const c=this.sampleKeys[s],p=d.values[s],g=a(p);if(t-f>=1){const s=o[c],h=a(s),d=e&&e[c];d?l.push([f,h,t,g,d]):r&&c in this.config.samplesClickedToHighlight?l.push([f,h,t,g,this.config.samplesClickedToHighlight[c]]):xo.strokeLine(i,f,h,t,g,{strokeStyle:"#D9D9D9"}),n&&!(c in e)||this.clickDetectorCache[t].push([f,h,t,g,c,d||"gray"])}if(u-t>=1){const s=e&&e[c];s?h.push([t,g,u,g,s]):r&&c in this.config.samplesClickedToHighlight?h.push([t,g,u,g,this.config.samplesClickedToHighlight[c]]):xo.strokeLine(i,t,g,u,g,{strokeStyle:"gray"}),n&&!(c in e)||this.clickDetectorCache[u].push([t,g,u,g,c,s||"gray"])}o[c]=p}s=d.end}}for(let e of l)xo.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:1.3});for(let e of h)xo.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:2})}(e=>{if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=a(t.y),n={strokeStyle:t.color,strokeWidth:2};t.dotted?xo.dashedLine(e.context,0,i,e.pixelWidth,i,5,n):xo.strokeLine(e.context,0,i,e.pixelWidth,i,n)}})(e)}doAutoscale(e){let t,i;return e.length>0?(t=Number.MAX_VALUE,i=-Number.MAX_VALUE,e.forEach((function(e){t=Math.min(t,...e.values),i=Math.max(i,...e.values)})),t-=.01,i+=.01):(t=0,i=100),{min:t,max:i}}clickedFeatures(e){const t=e.canvasX,i=e.canvasY;let n=null;for(n of Object.keys(this.clickDetectorCache))if(n=parseInt(n),n>=t)break;if(n){let e=Number.MAX_VALUE,o=[];const a=this.clickDetectorCache[n];for(let n of a){const r=n[0],s=n[2];if(t<r||t>s)return[];const a=n[1],c=n[3];if(i<Math.min(a,c)-10||i>Math.max(a,c)+10)continue;const l=sy(t,i,r,a,s,c);l<e&&(o=[{name:n[4],color:n[5]}],e=l)}if(e<5){if(this.config.clickToHighlight){if(o[0].name in this.config.samplesClickedToHighlight)delete this.config.samplesClickedToHighlight[o[0].name];else if("any"===this.config.clickToHighlight){var r=["red","darkblue","green","teal","olivedrab","orange","maroon","purple","blue","gold"],s=r[Math.floor(Math.random()*(r.length+1))];this.config.samplesClickedToHighlight[o[0].name]=s}else this.config.samplesClickedToHighlight[o[0].name]=this.config.clickToHighlight;this.trackView.repaintViews()}return o}}return[]}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];return t.forEach((function(e){for(let t of Object.keys(e))Ua(e[t])&&i.push({name:t,value:e[t]})})),i}get supportsWholeGenome(){return!1}}function sy(e,t,i,n,r,s){const o=r-i,a=s-n,c=Math.abs(o*(n-t)-(i-e)*a),l=Math.sqrt(o*o+a*a);return l>0?c/l:0}class oy extends Hl{static defaults={height:300,theta:Math.PI/2,arcOrientation:"UP"};constructor(e,t){super(e,t),!1===e.arcOrientation?this.arcOrientation="DOWN":!0===e.arcOrientation?this.arcOrientation="UP":e.arcOrientation?this.arcOrientation=e.arcOrientation.toUpperCase():this.arcOrientation="UP","bp"===e.format?this.featureSource=new cy(e,t.genome):this.featureSource=new ud(e,t.genome)}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.context,i=Math.PI/2,n=e.pixelWidth,r=e.pixelHeight;e.viewportWidth;const s=e.bpPerPixel,o=e.bpStart,a=s,c="UP"===this.arcOrientation;xo.fillRect(t,0,e.pixelTop,n,r,{fillStyle:"rgb(255, 255, 255)"});const l=e.features;if(l){ay(l,1);for(let e of l)if(e.startLeft){let n=Math.round((e.startLeft-o)/a),r=Math.round((e.startRight-o)/a),s=Math.round((e.endLeft-o)/a),l=Math.round((e.endRight-o)/a);t.fillStyle=e.color,t.strokeStyle=e.color,t.beginPath();let h=(n+l)/2,d=(l-n)/2,u=this.height,f=Math.PI+(Math.PI/2-i),p=2*Math.PI-(Math.PI/2-i);c?(t.arc(h,u,d,f,p),t.lineTo(s,u)):(u=0,t.arc(h,u,d,p,f),t.lineTo(l,u));const g=(r+s)/2,m=(s-r)/2,w=u;c?(t.arc(g,w,m,p,f,!0),t.lineTo(n,w)):(t.arc(g,w,m,f,p,!0),t.lineTo(s,w)),t.stroke(),t.fill(),e.drawState={x1:h,y1:u,r1:d,x2:g,y2:w,r2:m,sa:f,ea:p}}else{let n=Math.round((e.start-o)/a),r=Math.round((e.end-o)/a);t.strokeStyle=e.color,t.beginPath();let s=(n+r)/2,l=(r-n)/2,h=this.height,d=Math.PI+(Math.PI/2-i),u=2*Math.PI-(Math.PI/2-i);c?t.arc(s,h,l,d,u):(h=0,t.arc(s,h,l,u,d)),t.stroke(),e.drawState={x1:s,y1:h,r1:l,sa:d,ea:u}}}}clickedFeatures(e){const t=super.clickedFeatures(e),i=[];ay(t,-1);for(let n of t){const t=n.drawState,r=e.canvasX-t.x1,s=e.canvasY-t.y1,o=Math.sqrt(r*r+s*s),a=t.r1+3;let c,l;if(void 0===t.x2)c=o,l=t.r1-3;else{const i=e.canvasX-t.x2,n=e.canvasY-t.y2;c=Math.sqrt(i*i+n*n),l=t.r2-3}if(o<a&&c>l){i.push(n);break}}return i}popupData(e,t){if(void 0===t&&(t=this.clickedFeatures(e)),t&&t.length>0)return this.extractPopupData(t[0],this.getGenomeId())}menuItemList(){return[{name:"Toggle arc direction",click:function(){this.arcOrientation="UP"===this.arcOrientation?"DOWN":"UP",this.trackView.repaintViews()}}]}}function ay(e,t){e.sort((function(e,i){const n=void 0===e.score?-Number.MAX_VALUE:e.score,r=void 0===i.score?-Number.MAX_VALUE:i.score;return(void 0===t?1:t)*(n-r)}))}class cy{constructor(e,t){this.config=e,this.genome=t}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){const s=this.genome;if(this.featureCache)return this.featureCache.queryFeatures(e,t,i);{const n=qa(this.config),r=await Qs.loadByteArray(this.config.url,n);return this.featureCache=new Zs(function(e){if(!e)return null;const t=mh(e);let i,n=!0;const r=[],s=[],o=[];for(;void 0!==(i=t.nextLine());){const e=i.split("\t");if(n&&i.startsWith("color:")){const t="rgb("+e[1]+","+e[2]+","+e[3]+")";r.push(t),e.length>4&&s.push(e[4])}else{n=!1;const t=e[0],i=Number.parseInt(e[1])-1,c=Number.parseInt(e[2])-1,l=Number.parseInt(e[3]),h=Number.parseInt(e[4]);var a=Number.parseInt(e[5]);const d=r[a];let u;u=i<=h?{chr:t,startLeft:Math.min(i,c),startRight:Math.max(i,c),endLeft:Math.min(l,h),endRight:Math.max(l,h),color:d,score:a}:{chr:t,startLeft:Math.min(l,h),startRight:Math.max(l,h),endLeft:Math.min(i,c),endRight:Math.max(i,c),color:d,score:a},u.start=u.startLeft,u.end=u.endRight,s.length>a&&(u.description=s[a]),o.push(u)}}return o}(r),s),this.featureCache.queryFeatures(e,t,i)}}}class ly{constructor(e){this.browser=e,this.type="ideogram",this.height=16,this.order=Number.MIN_SAFE_INTEGER,this.disableButtons=!0,this.ignoreTrackMenu=!0}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,features:r}){const s=t.chr,o=t.genome.getChromosome(s);if(void 0===o||i<=0||n<=0||"all"===s.toLowerCase())return;!function({ctx:e,chr:t,referenceFrame:i,genome:n,width:r,height:s,stainColors:o,features:a}){const c=1,l=.5*c,h=0;if(void 0===n)return;xo.fillRect(e,0,0,r,s,{fillStyle:_s.greyScale(255)});const d=a;if(d){const t=h+s/2,i=[],n=[];if(0===d.length)return;const a=r/d[d.length-1].end;e.beginPath(),xo.roundRect(e,l,l+h,r-2*l,s-2*l,(s-2*l)/2,0,1),e.clip();for(let r=0;r<d.length;r++){const l=d[r],u=a*l.start,f=a*l.end;"c"===l.type?("p"===l.name.charAt(0)?(i[0]=u,n[0]=s+h,i[1]=u,n[1]=h,i[2]=f,n[2]=t):(i[0]=f,n[0]=s+h,i[1]=f,n[1]=h,i[2]=u,n[2]=t),e.fillStyle="rgb(150, 0, 0)",e.strokeStyle="rgb(150, 0, 0)",xo.polygon(e,i,n,1,0)):(e.fillStyle=hy(o,l),xo.fillRect(e,u,c+h,f-u,s-2*c))}}e.strokeStyle=_s.greyScale(41),xo.roundRect(e,l,l+h,r-2*l,s-2*l,(s-2*l)/2,0,1)}({ctx:e,features:r,chr:s,referenceFrame:t,genome:t.genome,width:i,height:n,stainColors:[]});const a=Math.round(t.bpPerPixel*i),c=t.start;let l=o.bpLength;const h=t.genome.getCytobands(s);if(h&&h.length>0&&h[h.length-1].end&&(l=Math.max(l,h[h.length-1].end),o.bpLength=l),a<l){const t=a/l,r=c/l;let s=Math.floor(r*i),o=Math.floor(t*i);s=Math.max(0,s),s=Math.min(i-o,s),e.save(),e.strokeStyle="red",e.lineWidth=o<2?1:2;const h=s+e.lineWidth/2;o=o<2?1:o-e.lineWidth;const d=e.lineWidth/2,u=n-e.lineWidth;e.strokeRect(h,d,o,u),e.restore()}}dispose(){this.trackView=void 0}}function hy(e,t){if("c"===t.type)return"rgb(150, 10, 10)";var i=t.stain,n=230;"p"===t.type&&(n=Math.floor(230-i/100*230));var r=e[n];return r||(r="rgb("+n+","+n+","+n+")",e[n]=r),r}let dy=new oo("Dark2");["GT/AG","CT/AC","GC/AG","CT/GC","AT/AC","GT/AT","non-canonical"].forEach((e=>{dy.getColor(e)}));class uy extends Hl{static defaults={margin:10,colorByNumReadsThreshold:5,height:100};constructor(e,t){super(e,t)}init(e){super.init(e),this.type=e.type||"junctions",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=e.featureSource?e.featureSource:Ad(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow()),this}get supportsWholeGenome(){return!1}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}computePixelHeight(e){return this.height}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=e.pixelHeight,a=r+s*n+1;if(this.isMergedTrack||xo.fillRect(i,0,e.pixelTop,s,o,{fillStyle:"rgb(255, 255, 255)"}),t){const s={};s.referenceFrame=e.viewport.referenceFrame,s.referenceFrameStart=s.referenceFrame.start,s.referenceFrameEnd=s.referenceFrameStart+s.referenceFrame.toBP(e.viewport.getWidth()),s.featureZoomOutTracker={};for(let e of t)if(!(e.end<r)){if(e.start>a)break;this.renderJunction(e,r,n,o,i,s)}}else console.log("No feature list")}renderJunction(e,t,i,n,r,s){e.isVisible=!1;const o=Math.round((e.start-t)/i),a=Math.round((e.end-t)/i),c=(o+a)/2;if(a-o<=3){if(c in s.featureZoomOutTracker)return;s.featureZoomOutTracker[c]=!0}if(this.config.hideAnnotatedJunctions&&"true"===e.attributes.annotated_junction)return;if(this.config.hideUnannotatedJunctions&&"false"===e.attributes.annotated_junction)return;if(this.config.hideMotifs&&this.config.hideMotifs.includes(e.attributes.motif))return;if(this.config.hideStrand===e.strand)return;if(this.config.minJunctionEndsVisible){let t=0;if(e.start>=s.referenceFrameStart&&e.start<=s.referenceFrameEnd&&(t+=1),e.end>=s.referenceFrameStart&&e.end<=s.referenceFrameEnd&&(t+=1),t<this.config.minJunctionEndsVisible)return}let l,h,d,u;if(e.attributes.uniquely_mapped){if(l=parseInt(e.attributes.uniquely_mapped),l<this.config.minUniquelyMappedReads)return;if(h=parseInt(e.attributes.multi_mapped),d=l+h,d<this.config.minTotalReads)return;if(d>0&&h/d>this.config.maxFractionMultiMappedReads)return;if(e.attributes.maximum_spliced_alignment_overhang&&parseInt(e.attributes.maximum_spliced_alignment_overhang)<this.config.minSplicedAlignmentOverhang)return}if(e.attributes.num_samples_with_this_junction){if(u=parseInt(e.attributes.num_samples_with_this_junction),this.config.minSamplesWithThisJunction&&u<this.config.minSamplesWithThisJunction)return;if(this.config.maxSamplesWithThisJunction&&u>this.config.maxSamplesWithThisJunction)return;if(e.attributes.num_samples_total&&(e.attributes.percent_samples_with_this_junction=100*u/Number(e.attributes.num_samples_total),this.config.minPercentSamplesWithThisJunction&&(e.attributes.percent_samples_with_this_junction<this.config.minPercentSamplesWithThisJunction||e.attributes.percent_samples_with_this_junction>this.config.maxPercentSamplesWithThisJunction)))return}const f=this.margin,p=n,g=f+.5*p;let m=f;const w=f+p-10,b=(o+c)/2,F=(c+a)/2;let v,y,A=1;e.attributes.line_width?A=Number(e.attributes.line_width):(void 0===this.config.thicknessBasedOn||"numUniqueReads"===this.config.thicknessBasedOn?A=l:"numReads"===this.config.thicknessBasedOn?A=d:"numSamplesWithThisJunction"===this.config.thicknessBasedOn&&void 0!==u&&(A=u),A=1+Math.log(A+1)/Math.log(12)),void 0===this.config.bounceHeightBasedOn||"random"===this.config.bounceHeightBasedOn?v=(e.start+e.end)%7:"distance"===this.config.bounceHeightBasedOn?v=6*(e.end-e.start)/(s.referenceFrameEnd-s.referenceFrameStart):"thickness"===this.config.bounceHeightBasedOn&&(v=2*A),m+=p*Math.max(7-v,0)/10,y=e.attributes.color?e.attributes.color:void 0===this.config.colorBy||"numUniqueReads"===this.config.colorBy?l>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"numReads"===this.config.colorBy?d>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"isAnnotatedJunction"===this.config.colorBy?"true"===e.attributes.annotated_junction?"#b0b0ec":"orange":"strand"===this.config.colorBy?"+"===e.strand?"#b0b0ec":"#ecb0b0":"motif"===this.config.colorBy?dy.getColor(e.attributes.motif):"#AAAAAA";let C="";e.attributes.label?C=e.attributes.label.replace(/_/g," "):void 0===this.config.labelWith||"uniqueReadCount"===this.config.labelWith?C=l:"totalReadCount"===this.config.labelWith?C=d:"numSamplesWithThisJunction"===this.config.labelWith?void 0!==u&&(C=u):"percentSamplesWithThisJunction"===this.config.labelWith?void 0!==e.attributes.percent_samples_with_this_junction&&(C=e.attributes.percent_samples_with_this_junction.toFixed(0)+"%"):"motif"===this.config.labelWith&&void 0!==e.attributes.motif&&(C+=e.attributes.motif),"uniqueReadCount"===this.config.labelWithInParen?C+=" ("+l+")":"totalReadCount"===this.config.labelWithInParen?C+=" ("+d+")":"multiMappedReadCount"===this.config.labelWithInParen?h>0&&(C+=" (+"+h+")"):"numSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==u&&(C+=" ("+u+")"):"percentSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==e.attributes.percent_samples_with_this_junction&&(C+=" ("+e.attributes.percent_samples_with_this_junction.toFixed(0)+"%)"):"motif"===this.config.labelWithInParen&&void 0!==e.attributes.motif&&(C+=` ${e.attributes.motif}`),e.isVisible=!0,r.beginPath(),r.moveTo(o,w),r.bezierCurveTo(b,m,F,m,a,w),r.lineWidth=A,r.strokeStyle=y,r.stroke();const _=(e,t,i,n)=>{e.beginPath(),e.moveTo(t,i),e.lineTo(t-n/2,i-n),e.lineTo(t+n/2,i-n),e.lineTo(t,i),e.closePath(),e.fill()};if(e.attributes.left_shape||e.attributes.right_shape){r.fillStyle=y;const t=r.lineWidth>2?10:7;e.attributes.left_shape&&_(r,o,w,t),e.attributes.right_shape&&_(r,a,w,t)}r.fillText(C,c-r.measureText(C).width/2,(7*m+g)/8)}clickedFeatures(e){return super.clickedFeatures(e).filter((function(e){return e.isVisible&&e.attributes}))}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=[];for(let e of t){const t="function"==typeof e.popupData?e.popupData(i):this.extractPopupData(e._f||e,this.getGenomeId());t&&(n.length>0&&n.push("<hr/><hr/>"),Array.prototype.push.apply(n,t))}return n}dispose(){this.trackView=void 0}}const fy=new Map([["ideogram",(e,t)=>new ly(e,t)],["sequence",(e,t)=>new Zd(e,t)],["feature",(e,t)=>new Hd(e,t)],["seg",(e,t)=>new Pf(e,t)],["mut",(e,t)=>new Pf(e,t)],["maf",(e,t)=>new Pf(e,t)],["shoebox",(e,t)=>new Pf(e,t)],["wig",(e,t)=>new ld(e,t)],["merged",(e,t)=>new tf(e,t)],["alignment",(e,t)=>new ew(e,t)],["interaction",(e,t)=>new tw(e,t)],["interact",(e,t)=>new tw(e,t)],["variant",(e,t)=>new Kv(e,t)],["qtl",(e,t)=>new ey(e,t)],["eqtl",(e,t)=>new ey(e,t)],["gwas",(e,t)=>new ny(e,t)],["arc",(e,t)=>new oy(e,t)],["gcnv",(e,t)=>new ry(e,t)],["junction",(e,t)=>new uy(e,t)],["blat",(e,t)=>new Vd(e,t)],["cnvpytor",(e,t)=>new Wv(e,t)]]);class py{constructor(e,t){const i=(new DOMParser).parseFromString(e,"text/xml");this.processRootNode(i,t);const n=i.getElementsByTagName("Resource"),r=i.getElementsByTagName("Track"),s=r&&r.length>0,o=[];this.tracks=o;const a=new Map;Array.from(n).forEach((function(e,t){var i={url:e.getAttribute("path"),indexURL:e.getAttribute("index"),order:t};a.set(i.url,i),s||o.push(i)})),s&&Array.from(r).forEach((function(e){const t=e.getElementsByTagName("Track");if(t&&t.length>0){const i={type:"merged",tracks:[]};gy(e,i),o.push(i),Array.from(t).forEach((function(e){e.processed=!0;const t=e.getAttribute("id"),n=a.get(t);n&&(i.tracks.push(n),gy(e,n),n.autoscale=!1,i.height=n.height)}))}else if(!e.processed){const t=e.getAttribute("id"),i=a.get(t);i&&(o.push(i),gy(e,i))}}))}processRootNode(e,t){const i=e.getElementsByTagName("Session");!i||i.length;const n=i.item(0),r=n.getAttribute("genome"),s=n.getAttribute("locus"),o=n.getAttribute("ucscID");t&&t.hasOwnProperty(r)?this.genome=r:(this.reference={fastaURL:r},o&&(this.reference.id=o)),s&&(this.locus=s)}}function gy(e,t){t.name=e.getAttribute("name");const i=e.getAttribute("color");i&&(t.color="rgb("+i+")");const n=e.getAttribute("altColor");i&&(t.altColor="rgb("+n+")");const r=e.getAttribute("height");r&&(t.height=parseInt(r));const s=e.getAttribute("autoScale");s&&(t.autoscale="true"===s);const o=e.getAttribute("autoscaleGroup");o&&(t.autoscaleGroup=o);const a=e.getAttribute("windowFunction");a&&(t.windowFunction=a);const c=e.getAttribute("visibilityWindow")||e.getAttribute("featureVisibilityWindow");c&&(t.visibilityWindow=c);const l=e.getAttribute("indexed");l&&(t.indexed="true"===l);const h=e.getAttribute("normalize");h&&(t.normalize="true"===h);const d=e.getElementsByTagName("DataRange");if(d.length>0){const e=d.item(0);t.min=Number(e.getAttribute("minimum")),t.max=Number(e.getAttribute("maximum")),t.logScale="LOG"===e.getAttribute("type")}}class my{constructor(e,t,i,n,r){this.genome=e,this.chr=t,this.start=i,this.end=n,this.bpPerPixel=r,this.id=s()}get center(){return(this.start+this.end)/2}get locusSearchString(){return`${this.chr}:${this.start+1}-${this.end}`}extend(e){const t=Math.min(e.start,this.start),i=Math.max(e.end,this.end),n=(i-t)/(this.end-this.start);this.start=t,this.end=i,this.bpPerPixel*=n}calculateEnd(e){return this.start+this.bpPerPixel*e}calculateCenter(e){return this.start+this.bpPerPixel*e/2}calculateBPP(e,t){return(e-this.start)/t}set(e){this.chr=e.chr,this.start=e.start,this.bpPerPixel=e.bpPerPixel}toPixels(e){return e/this.bpPerPixel}toBP(e){return this.bpPerPixel*e}shift(e){this.start+=e,this.end+=e}shiftPixels(e,t,i){const n=this.start,r=e*this.bpPerPixel;return this.start+=r,i&&this.clampStart(t),this.end=this.start+t*this.bpPerPixel,n!==this.start}clampStart(e){const t=this.genome.getChromosome(this.chr).bpStart||0;if(this.start=Math.max(t,this.start),e){const{bpLength:t}=this.genome.getChromosome(this.chr),i=t-e*this.bpPerPixel;this.start>i&&(this.start=i)}}async zoomWithScaleFactor(e,t,i,n){const r=void 0===n?this.start+this.toBP(i/2):n,s=this.start,o=this.bpPerPixel,a=this.getChromosome().bpLength,c=t<1?e.minimumBases()/i:a/i;this.bpPerPixel=t<1?Math.max(this.bpPerPixel*t,c):Math.min(this.bpPerPixel*t,c);const l=this.bpPerPixel*i;this.start=r-.5*l,this.clampStart(i),this.end=this.start+l;(s!==this.start||o!==this.bpPerPixel)&&await e.updateViews(!0)}getChromosome(){return this.genome.getChromosome(this.chr)}getMultiLocusLabelBPLengthOnly(e){const t="&nbsp",i=Math.floor(this.start)+1,n=Math.round(this.start+this.bpPerPixel*e);return`${t}${this.chr}${t}${Ga(n-i)}${t}`}getMultiLocusLabelLocusOnly(e){const t="&nbsp",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e);return`${t}${i}:${n}-${r}${t}`}getMultiLocusLabel(e){const t="&nbsp",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e),s=Math.floor(this.start)+1;return`${t}${i}:${n}-${r}${t}${t}(${Ga(Math.round(this.start+this.bpPerPixel*e)-s)})${t}`}getPresentationLocusComponents(e){if("all"===this.chr)return{chr:this.chr};{const t=Rt(Math.floor(this.start)+1),i=Rt(Math.round(this.start+this.bpPerPixel*e));return{chr:this.chr,start:t,end:i}}}getLocusString(){if("all"===this.chr)return"all";return`${this.genome.getChromosomeDisplayName(this.chr)}:${Rt(Math.floor(this.start)+1)}-${Rt(Math.round(this.end))}`}description(e){console.log(` ${e||""} referenceFrame - ${this.chr} bpp ${this.bpPerPixel.toFixed(3)} start ${Rt(Math.round(this.start))} end ${Rt(Math.round(this.end))} `)}overlaps(e){return this.chr===e.chr&&this.end>=e.start&&e.end>=this.start}}function wy(){return"3.0.5"}const by={},Fy=8;let vy;function yy(e,t){"igv-navbar-text-button"===Ju.currentNavbarButtonClass(e)&&(vy=e.$navigation.get(0).querySelector(".igv-navbar-right-container").getBoundingClientRect().width);const i=function(e,t){const i=e.isMultiLocusWholeGenomeView()||e.referenceFrameList&&mu.isWholeGenomeView(e.referenceFrameList[0].chr);i?e.windowSizePanel.hide():e.windowSizePanel.show();const{x:n,width:r}=e.$navigation.get(0).querySelector(".igv-navbar-left-container").getBoundingClientRect(),s=n+r,{x:o}=e.$navigation.get(0).querySelector(".igv-navbar-right-container").getBoundingClientRect(),a=o-s,c=Ju.currentNavbarButtonClass(e);if("igv-navbar-text-button"===c&&a<Fy)by.navbarButton="igv-navbar-icon-button";else if(vy&&"igv-navbar-icon-button"===c){t-s-vy>Fy&&(by.navbarButton="igv-navbar-text-button")}by.zoomContainer=i?"igv-zoom-widget-hidden":t>860?"igv-zoom-widget":"igv-zoom-widget-900";return by}(e,t);Bt(e.zoomWidget.zoomContainer).removeClass(),Bt(e.zoomWidget.zoomContainer).addClass(i.zoomContainer),e.fireEvent("navbar-resize",[i.navbarButton])}const Ay="Maximum sequence count exceeded";class Cy{constructor(t,i){this.container=e({class:"igv-chromosome-select-widget-container"}),i.appendChild(this.container),this.select=document.createElement("select"),this.select.setAttribute("name","chromosome-select-widget"),this.container.appendChild(this.select),this.select.addEventListener("change",(()=>{this.select.blur(),""!==this.select.value&&Ay!==this.select.value&&t.search(this.select.value)})),this.showAllChromosomes=!1!==t.config.showAllChromosomes}show(){this.container.style.display="flex"}hide(){this.container.style.display="none"}update(e){const t=e.wgChromosomeNames||[];if(this.showAllChromosomes&&e.chromosomeNames.length>1){const i=new Set(t);let n=0;for(let r of e.chromosomeNames){if(1e3==++n){t.push(Ay);break}i.has(r)||t.push(r)}}this.select.innerHTML="",e.showWholeGenomeView()&&t.unshift("all");for(let i of t){const t=document.createElement("option");t.setAttribute("value",i),t.innerText=e.getChromosomeDisplayName(i),this.select.appendChild(t)}}}class _y{constructor(t,i){this.container=e({class:"igv-windowsize-panel-container"}),t.appendChild(this.container),i.on("locuschange",(e=>{this.updatePanel(e)})),this.browser=i}show(){this.container.style.display="block"}hide(){this.container.style.display="none"}updatePanel(e){const t=this.browser.calculateViewportWidth(this.browser.referenceFrameList.length);this.container.innerText=1===e.length?Ga(Math.round(t*e[0].bpPerPixel)):""}}class xy{constructor(t,i){this.browser=i,this.columnContainer=t,this.horizontalGuide=e({class:"igv-cursor-guide-horizontal"}),t.appendChild(this.horizontalGuide),this.verticalGuide=e({class:"igv-cursor-guide-vertical"}),t.appendChild(this.verticalGuide),this.addMouseHandler(i),this.setVisibility(i.config.showCursorGuide)}addMouseHandler(e){this.boundMouseMoveHandler=function(t){t.target.tagName;const{x:i,y:n}=a(t,this.columnContainer);if(this.horizontalGuide.style.top=`${n}px`,"CANVAS"===t.target.tagName){const n=function(e,t){for(;e.parentElement;){if(e.parentElement.classList.contains(t))return e.parentElement;e=e.parentElement}return}(t.target,"igv-viewport");if(n&&e.getRulerTrackView()){this.verticalGuide.style.left=`${i}px`;const r=e.root.querySelectorAll(".igv-column");let s;const o=n.parentElement;for(let e=0;e<r.length;e++)void 0===s&&o===r[e]&&(s=e);if(void 0!==s){const i=e.getRulerTrackView().viewports[s].mouseMove(t);if(i){const{start:e,bp:t,end:n}=i,r=(t-e)/(n-e);this.customMouseHandler&&this.customMouseHandler({start:e,bp:t,end:n,interpolant:r})}}}}}.bind(this),this.columnContainer.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandler(){this.columnContainer.removeEventListener("mousemove",this.boundMouseMoveHandler)}setVisibility(e){!0===e?this.show():this.hide()}show(){this.verticalGuide.style.display="block",this.horizontalGuide.style.display="block"}hide(){if(this.verticalGuide.style.display="none",this.horizontalGuide.style.display="none",this.browser.getRulerTrackView())for(let e of this.browser.getRulerTrackView().viewports)e.$tooltip.hide()}}class ky extends Ju{constructor(e,t){super(e,t,"Crosshairs",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor" stroke="#737373">\n <rect id="Rectangle-Copy-3" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group" transform="translate(5, 9)" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor-hover">\n <rect id="Rectangle-Copy-5" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-Copy-2" transform="translate(5, 9)" stroke="#FFFFFF" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke="#FFFFFF" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>',e.doShowCursorGuide),this.button.addEventListener("mouseenter",(()=>{!1===e.doShowCursorGuide&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===e.doShowCursorGuide&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{e.doShowCursorGuide=!e.doShowCursorGuide,e.setCursorGuideVisibility(e.doShowCursorGuide),this.setState(e.doShowCursorGuide)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(e.config.showCursorTrackingGuideButton)}}class Iy extends Ju{constructor(e,t){super(e,t,"Center Line",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline" stroke="#737373">\n <rect id="Rectangle-Copy-2" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline-hover">\n <rect id="Rectangle-Copy-9" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke="#FFFFFF" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>',e.config.showCenterGuide),this.button.addEventListener("mouseenter",(()=>{!1===e.doShowCenterLine&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===e.doShowCenterLine&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{e.doShowCenterLine=!e.doShowCenterLine,e.setCenterLineVisibility(e.doShowCenterLine),this.setState(e.doShowCenterLine)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(e.config.showCenterGuideButton)}}class Sy extends Ju{constructor(e,t){super(t,e,"Track Labels",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels" fill="#FFFFFF" stroke="#737373">\n <rect id="Rectangle-Copy-27" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" stroke-width="24">\n <path d="M448.444444,87.1189616 L448.444444,322.431462 L166.619398,322.431462 L19.2344421,204.775212 L166.619398,87.1189616 L448.444444,87.1189616 Z M244.028212,163.997434 C232.925565,163.997434 222.874656,168.493347 215.598982,175.760254 C208.318067,183.032394 203.815972,193.079106 203.815972,204.175675 C203.815972,215.272243 208.318067,225.318955 215.598982,232.591095 C222.874656,239.858002 232.925565,244.353915 244.028212,244.353915 C255.130858,244.353915 265.181767,239.858002 272.457442,232.591095 C279.738356,225.318955 284.240451,215.272243 284.240451,204.175675 C284.240451,193.079106 279.738356,183.032394 272.457442,175.760254 C265.181767,168.493347 255.130858,163.997434 244.028212,163.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels-hover" stroke="#737373">\n <rect id="Rectangle-Copy-29" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" fill="#FFFFFF" stroke-width="24">\n <path d="M448.444444,85.1189616 L448.444444,320.431462 L166.619398,320.431462 L19.2344421,202.775212 L166.619398,85.1189616 L448.444444,85.1189616 Z M244.028212,161.997434 C232.925565,161.997434 222.874656,166.493347 215.598982,173.760254 C208.318067,181.032394 203.815972,191.079106 203.815972,202.175675 C203.815972,213.272243 208.318067,223.318955 215.598982,230.591095 C222.874656,237.858002 232.925565,242.353915 244.028212,242.353915 C255.130858,242.353915 265.181767,237.858002 272.457442,230.591095 C279.738356,223.318955 284.240451,213.272243 284.240451,202.175675 C284.240451,191.079106 279.738356,181.032394 272.457442,173.760254 C265.181767,166.493347 255.130858,161.997434 244.028212,161.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>',t.config.showTrackLabels),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowTrackLabels&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowTrackLabels&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowTrackLabels=!t.doShowTrackLabels,t.setTrackLabelVisibility(t.doShowTrackLabels),this.setState(t.doShowTrackLabels)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showTrackLabelButton)}}class Ey extends Ju{constructor(e,t){super(t,e,"Sample Names",'<svg width="90px" height="20px" viewBox="0 0 90 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="89" height="18" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names" stroke="#737373">\n <rect id="Rectangle-Copy-13" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke-width="32"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke-width="32"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke-width="32"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names-hover">\n <rect id="Rectangle-Copy-18" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n </g>\n </g>\n</svg>',t.config.showSampleNames),this.button.addEventListener("mouseenter",(()=>{!1===t.showSampleNames&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.showSampleNames&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)})),!0===t.config.showSampleNameButton?this.show():this.hide()}performClickWithState(e,t){e.showSampleNames=void 0===t?!e.showSampleNames:t;e.columnContainer.querySelector(".igv-sample-name-column").style.display=!1===e.showSampleNames?"none":"flex",this.setState(e.showSampleNames),e.layoutChange()}}class Ny extends Ju{constructor(e,t){super(t,e,"Sample Info",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info">\n <rect id="Rectangle-Copy-6" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-2" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-10" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info-hover">\n <rect id="Rectangle-Copy-14" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-1" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-0" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-15" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <rect id="scrim" fill="#000000" style="mix-blend-mode: hue;" x="8" y="149" width="612" height="306"></rect>\n </g>\n </g>\n</svg>',!1),this.showSampleInfo=!1,this.button.addEventListener("mouseenter",(()=>{!1===this.showSampleInfo&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===this.showSampleInfo&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)}))}performClickWithState(e,t){this.showSampleInfo=void 0===t?!this.showSampleInfo:t;e.columnContainer.querySelector(".igv-sample-info-column").style.display=!1===this.showSampleInfo?"none":"flex",this.setState(this.showSampleInfo),e.layoutChange()}setButtonVisibility(e){this.showSampleInfo=e,this.setState(this.showSampleInfo),!0===this.showSampleInfo?this.show():this.hide()}}let By=23,My=0;const Ry=function(t,i){this.browser=t,this.zoomContainer=e({class:"igv-zoom-widget"}),i.appendChild(this.zoomContainer),this.zoomOutButton=e(),this.zoomContainer.appendChild(this.zoomOutButton),this.zoomOutButton.appendChild(l("minus-circle")),this.zoomOutButton.addEventListener("click",(()=>{t.zoomOut()}));const n=e();this.zoomContainer.appendChild(n),this.slider=document.createElement("input"),this.slider.type="range",this.slider.min="0",this.slider.max=`${By}`,n.appendChild(this.slider),this.slider.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation();const i=t.referenceFrameList[0],{bpLength:n}=i.genome.getChromosome(i.chr),{end:r,start:s}=i,o=r-s,a=n/Math.pow(2,e.target.valueAsNumber);t.zoomWithScaleFactor(a/o)})),this.zoomInButton=e(),this.zoomContainer.appendChild(this.zoomInButton),this.zoomInButton.appendChild(l("plus-circle")),this.zoomInButton.addEventListener("click",(()=>{t.zoomIn()})),t.on("locuschange",(e=>{this.browser.isMultiLocusMode()?this.disable():(this.enable(),this.update(e))}))};Ry.prototype.update=function(e){const t=e[0],{bpLength:i}=t.genome.getChromosome(t.chr),{start:n,end:r}=t;By=Math.ceil(Math.log2(i/this.browser.minimumBases())),this.slider.max=`${By}`;const s=i/(r-n);My=Math.log2(s),this.slider.value=`${Math.round(My)}`},Ry.prototype.enable=function(){this.slider.disabled=!1},Ry.prototype.disable=function(){this.slider.disabled=!0},Ry.prototype.hide=function(){this.zoomContainer.style.display="none"},Ry.prototype.show=function(){this.zoomContainer.style.display="block"},Ry.prototype.hideSlider=function(){this.slider.style.display="none"},Ry.prototype.showSlider=function(){this.slider.style.display="block"};class Dy{constructor(t,i){this.parent=t,this.popover=e({class:"igv-ui-dropdown"}),t.appendChild(this.popover),this.popoverContent=e(),this.popover.appendChild(this.popoverContent),this.popover.style.display="none",this.shim=i}configure(e){if(0===e.length)return;const t=rc(e,this.popover);for(const{object:e}of t)this.popoverContent.appendChild(e)}present(e){this.popover.style.display="block";let{x:t,y:i}=a(e,this.parent);this.popover.style.left=`${t+this.shim.left}px`,this.popover.style.top=`${i+this.shim.top}px`}_present(e){this.popover.style.display="block";let{x:t,y:i,width:n}=a(e,this.parent);t+=this.shim.left,i+=this.shim.top,this.popover.style.top=`${i}px`;const{width:r}=this.popover.getBoundingClientRect(),s=t+r,o=s-n;this.popover.style.left=`${s>n?t-o:t}px`}dismiss(){this.popover.style.display="none"}}class Ty extends Ju{constructor(e,t){super(t,e,"Save Image",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>{for(const e of this.button.querySelectorAll("div"))if("block"===e.style.display)return;this.setState(!1)})),this.dropdown=new Dy(this.button.parentNode,{top:24,left:-88});const i=[{label:"Save as SVG",click:e=>{this.browser.saveSVGtoFile("igvjs.svg"),this.dropdown.dismiss()}},{label:"Save as PNG",click:e=>{this.browser.savePNGtoFile("igvjs.png"),this.dropdown.dismiss()}}];this.dropdown.configure(i),this.button.addEventListener("click",(e=>{let t;if(e.target===this.button)t=!0;else if(e.target.closest("svg")){e.target.closest("div")===this.button&&(t=!0)}!0===t&&("none"===this.dropdown.popover.style.display?this.dropdown.present(e):this.dropdown.dismiss())})),this.setVisibility(t.config.showSVGButton)}navbarResizeHandler(e){this.dropdown.dismiss(),super.navbarResizeHandler(e)}}const Ly=(e,t)=>{const i=0===e?t.nextElementSibling:t.previousElementSibling;t.remove(),i.remove()},zy=t=>{const i=e({class:"igv-column-shim"});Xa(i,t);const n=e({class:"igv-column"});return Xa(n,i),n},Hy=(t,i)=>{for(let n=0;n<i;n++){const r=e({class:"igv-column"});if(Ya(r,t),i>1&&n>0){Ya(e({class:"igv-column-shim"}),r)}}};class Py{constructor(t,i,n){this.browser=t,this.referenceFrame=i,this.column=n,this.container=e({class:"igv-center-line"}),n.appendChild(this.container),t.doShowCenterLine?this.show():this.hide()}repaint(){if(this.referenceFrame){if(1/this.referenceFrame.bpPerPixel>1){const e=Math.floor(this.referenceFrame.toPixels(1));this.container.style.width=`${e}px`,this.container.classList.remove("igv-center-line-thin"),this.container.classList.add("igv-center-line-wide")}else this.container.style.width="1px",this.container.classList.remove("igv-center-line-wide"),this.container.classList.add("igv-center-line-thin")}}show(){this.isVisible=!0,this.container.style.display="block",this.repaint()}hide(){this.isVisible=!1,this.container.style.display="none"}resize(){this.repaint()}}const Oy=function(t,i){this.button=e({class:"igv-navbar-button"}),t.appendChild(this.button),this.button.textContent="circular view",this.button.addEventListener("click",(()=>{i.circularViewVisible=!i.circularViewVisible})),this.browser=i,this.setVisibility(i.config.showCircularViewButton),this.setState(i.circularViewVisible)};Oy.prototype.setVisibility=function(e){!0===e?this.show():this.hide()},Oy.prototype.setState=function(e){!0===e?this.button.classList.add("igv-navbar-button-clicked"):this.button.classList.remove("igv-navbar-button-clicked")},Oy.prototype.show=function(){this.button.style.display="block",this.setState(this.browser.circularViewVisible)},Oy.prototype.hide=function(){this.button.style.display="none"};const Uy=function(t,i,n){const r=e({class:"igv-navbar-button"});t.append(r),r.textContent=n.label,r.addEventListener("click",(()=>n.callback(i)))};class qy{constructor(t,i){this.browser=t,this.container=e({class:"igv-roi-menu"}),i.appendChild(this.container);const n=e();this.container.appendChild(n),u(n,(()=>this.container.style.display="none")),this.body=e(),this.container.appendChild(this.body),this.container.style.display="none"}async present(e,t,i,n,r,s){const o=this.menuItems(e,t,i,n,r,s);this.browser.menuPopup.presentTrackContextMenu(i,o)}menuItems(e,t,i,n,r,s){const o=e.name?[`<b>${e.name}</b><br/>`]:[];return"name"in t&&o.push(`<b>ROI Set: ${t.name}</b>`),o.length>0&&o.push("<hr/>"),t.isUserDefined&&o.push({label:"Set description ...",click:()=>{const t={label:"Description",value:e.name||"",callback:()=>{const t=this.browser.inputDialog.value||"";e.name=t.trim(),this.browser.roiManager.repaintTable()}};this.browser.inputDialog.present(t,i)}}),Za()&&e.end-e.start<1e6&&o.push({label:"Copy reference sequence",click:async()=>{this.container.style.display="none";let t=await this.browser.genome.getSequence(e.chr,e.start,e.end);t||(t="Unknown sequence");try{await navigator.clipboard.writeText(t)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),e.end-e.start<=25e3&&o.push({label:"BLAT reference sequence",click:async()=>{this.container.style.display="none";const{chr:t,start:i,end:n}=e;let r=await this.browser.genome.getSequence(t,i,n);if(r){const e=`blat: ${t}:${i+1}-${n}`,s=`blat: ${t}:${i+1}-${n}`;jd({sequence:r,browser:this.browser,name:e,title:s})}}}),t.isUserDefined&&o.push("<hr/>",{label:"Delete",click:async()=>{t.removeFeature(e);const i=await t.getAllFeatures();0===Object.keys(i).length&&n.deleteUserDefinedROISet(),n.deleteRegionWithKey(s.dataset.region,r),n.repaintTable()}}),o}dispose(){this.container.innerHTML=""}}class Qy extends Pd{constructor(e){const t={browser:e,parent:e.columnContainer,headerTitle:"Regions of Interest",dismissHandler:()=>e.roiTableControl.buttonHandler(!1),gotoButtonHandler:Qy.gotoButtonHandler};t.columnFormat=Qy.getColumnFormatConfiguration(!0),super(Object.assign({width:"640px"},t))}tableRowDOM(t){const i=e({class:"igv-roi-table-row"}),{setName:n,feature:r}=t;i.dataset.region=$y(r.chr,r.start,r.end);let s=[r.chr,Rt(r.start),Rt(r.end),r.name||"",n];4===this.columnFormat.length&&(s=s.slice(0,4));for(let t=0;t<s.length;t++){const n=e();i.appendChild(n),n.style.width=this.columnFormat[t].width,n.innerText=s[t]}return this.tableRowDOMHelper(i),i}renderTable(e){if(Array.from(this.tableRowContainer.querySelectorAll(".igv-roi-table-row")).forEach((e=>e.remove())),e.length>0){const t=e.sort(((e,t)=>e.feature.chr.localeCompare(t.feature.chr)||e.feature.start-t.feature.start||e.feature.end-t.feature.end));for(let e of t){const t=this.tableRowDOM(e);this.tableRowContainer.appendChild(t)}}}set footerDOM(t){super.footerDOM=t,this.gotoButton.textContent="Go to selected region(s)";const i=e({class:"igv-roi-table-button"});this._footerDOM.appendChild(i),i.id="igv-roi-hide-show-button",i.textContent="Copy Sequence",i.title="One region only of max size 1 mb",this.copySequenceButton=i,Vy(this.copySequenceButton,!1),this.boundCopySequenceButtonHandler=async function(e){e.preventDefault(),e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0){const e=[];for(let i of t){const{locus:t}=Yy(i.dataset.region);e.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");if(this.setTableRowSelectionState(!1),e.length>0){const{chr:t,start:i,end:n}=Jv(e[0],this.browser.isSoftclipped()),r=await this.browser.genome.getSequence(t,i,n);await navigator.clipboard.writeText(r)}}}.bind(this),this.copySequenceButton.addEventListener("click",this.boundCopySequenceButtonHandler);const n=e({class:"igv-roi-table-button"});this._footerDOM.appendChild(n),n.id="igv-roi-hide-show-button",n.textContent="Hide all ROIs",this.toggleROIButton=n,this.boundToggleDisplayButtonHandler=function(e){e.preventDefault(),e.stopPropagation(),this.browser.roiManager.toggleROIs()}.bind(this),this.toggleROIButton.addEventListener("click",this.boundToggleDisplayButtonHandler)}setROIVisibility(e){const t=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let i=0;i<t.length;i++){const n=t[i];!1===e?jy(n,0):n.style.backgroundColor=n.dataset.color}this.toggleROIButton.textContent=!1===e?"Show all ROIs":"Hide all ROIs"}setTableRowSelectionState(e){super.setTableRowSelectionState(e);const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0&&t.length<2){const{locus:e}=Yy(t[0].dataset.region),{chr:i,start:n,end:r}=Jv(e,this.browser.isSoftclipped());Vy(this.copySequenceButton,r-n<1e6)}else Vy(this.copySequenceButton,!1)}dispose(){document.removeEventListener("click",this.boundGotoButtonHandler),document.removeEventListener("click",this.boundCopySequenceButtonHandler),document.removeEventListener("click",this.boundToggleDisplayButtonHandler),this.browser.roiTableControl.buttonHandler(!1),super.dispose()}static getColumnFormatConfiguration(e){return!0===e?[{label:"Chr",width:"20%"},{label:"Start",width:"15%"},{label:"End",width:"15%"},{label:"Description",width:"30%"},{label:"ROI Set",width:"20%"}]:[{label:"Chr",width:"25%"},{label:"Start",width:"20%"},{label:"End",width:"20%"},{label:"Description",width:"35%"}]}static gotoButtonHandler(e){e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected"),i=[];for(let e of t){const{locus:t}=Yy(e.dataset.region);i.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");this.setTableRowSelectionState(!1),i.length>0&&this.browser.search(i.join(" "))}}function Vy(e,t){e.style.pointerEvents=t?"auto":"none",e.style.color=ro(t?"licorice":"silver"),e.style.borderColor=ro(t?"licorice":"silver")}function jy(e,t){const i=window.getComputedStyle(e).backgroundColor.match(/[\d.]+/g);3===i.length&&i.push(1),i[3]=t,e.style.backgroundColor=`rgba(${i.join(", ")})`}class Wy{constructor(e){this.browser=e,this.roiMenu=new qy(e,e.columnContainer),this.roiTable=new Qy(e,e.columnContainer),this.top=0,this.roiSets=[],this.boundLocusChangeHandler=Gy.bind(this),e.on("locuschange",this.boundLocusChangeHandler);this.observer=new MutationObserver((()=>{const t=e.findTracks((e=>new Set(["ideogram","ruler"]).has(e.type))),[i,n]=t.map((e=>e.trackView.viewports[0].$viewport.get(0))).map((e=>function(e){const t=window.getComputedStyle(e),i=parseInt(t.marginTop),n=parseInt(t.marginBottom),{top:r,bottom:s,height:o}=e.getBoundingClientRect();return{top:Math.floor(r)-i,bottom:Math.floor(s)+n,height:Math.floor(o)+i+n}}(e))),r=i?i.height:0,s=n?n.height:0,o=e.columnContainer.querySelectorAll(".igv-roi-region");if(o)for(const e of o)e.style.marginTop=`${r+s+-.5}px`})),this.observer.observe(e.columnContainer,{attributes:!0,childList:!0,subtree:!0})}async reset(){this.roiSets.length>0&&this.browser.roiTableControl.setVisibility(!0);const e=this.roiSets.map((e=>this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})));e.length>0&&await Promise.all(e);const t=await this.getTableRecords();if(this.roiTable.renderTable(t),this.roiSets.length>0){const e=this.roiSets[0].isVisible;this.roiTable.setROIVisibility(e)}}async loadROI(e,t){const i=Array.isArray(e)?e:[e];for(let e of i)!e.name&&e.url&&(e.name=await Wa(e.url)),e.url&&!e.format&&(e.format=await om(e)),this.roiSets.push(new ku(e,t));await this.reset()}clearROIs(){this.roiTable.clearTable();const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();for(let e of this.roiSets)e.dispose();this.roiSets=[]}async getTableRecords(){const e=[];for(let t of this.roiSets){const i=t.name||"",n=await t.getAllFeatures();for(let t of Object.keys(n))for(let r of n[t])e.push({setName:i,feature:r})}return e}presentTable(){this.roiTable.present()}async repaintTable(){const e=await this.getTableRecords();this.roiTable.renderTable(e)}dismissTable(){this.roiTable.dismiss()}roiTableIsVisible(){return this.roiTable.isVisible()}async updateUserDefinedROISet(e){let t=await this.getUserDefinedROISet();void 0===t&&(t=this.initializeUserDefinedROISet()),t.addFeature(e),this.setROITableButtonVisibility(!0),await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:t});const i=await this.getTableRecords();this.roiTable.renderTable(i)}setROITableButtonVisibility(e){this.browser.roiTableControl.setVisibility(e)}toggleROIs(){const e=!this.roiSets[0].isVisible;this.roiTable.setROIVisibility(e);for(const t of this.roiSets)t.isVisible=e}async renderAllROISets(){for(let e of this.roiSets)await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})}async renderROISet({browser:e,pixelTop:t,roiSet:i}){const n=e.columnContainer.querySelectorAll(".igv-column");for(let r=0;r<n.length;r++){let{chr:s,start:o,end:a,bpPerPixel:c}=e.referenceFrameList[r];const l=n[r].querySelectorAll(".igv-roi-region");for(let e of l){const t=e.dataset.region,{chr:i,start:n,end:r}=Yy(t);(i!==s||r<o||n>a)&&e.remove()}const h=await i.getFeatures(s,o,a);if(h)for(let l of h){const h=$y(s,l.start,l.end),{x:d,width:u}=Iu(Math.max(o,l.start),Math.min(a,l.end),o,c),f=n[r].querySelector(Ky(h));if(f)f.style.left=`${d}px`,f.style.width=`${u}px`;else{const s=this.createRegionElement(e.columnContainer,t,d,u,i,h,l);n[r].appendChild(s)}}}}createRegionElement(t,i,n,r,s,o,c){const l=e({class:"igv-roi-region"});l.style.top=`${i}px`,l.style.left=`${n}px`,l.style.width=`${r}px`,l.style.backgroundColor=s.color,l.dataset.color=s.color,l.dataset.region=o;const h=e();return l.appendChild(h),h.style.backgroundColor=s.headerColor,h.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),a(e,t),this.roiMenu.present(c,s,e,this,t,l)})),l}renderSVGContext(e,t,{deltaX:i,deltaY:n}){for(const r of e.querySelectorAll(".igv-roi-region")){const{x:e,y:s,width:o,height:a}=r.getBoundingClientRect();t.fillStyle=r.style.backgroundColor,t.fillRect(e-i,s+n,o,a);const c=r.querySelector("div"),{x:l,y:h,width:d,height:u}=c.getBoundingClientRect();t.fillStyle=c.style.backgroundColor,t.fillRect(l-i,h+n,d,u)}}getUserDefinedROISet(){return this.roiSets.find((e=>!0===e.isUserDefined))}deleteUserDefinedROISet(){this.roiSets=this.roiSets.filter((e=>!0!==e.isUserDefined))}initializeUserDefinedROISet(){const e=new ku({name:"user defined",isUserDefined:!0,features:[]},this.browser.genome);return this.roiSets.push(e),e}async deleteRegionWithKey(e,t){t.querySelectorAll(Ky(e)).forEach((e=>e.remove()));0===(await this.getTableRecords()).length&&(this.browser.roiTableControl.buttonHandler(!1),this.setROITableButtonVisibility(!1))}toJSON(){return this.roiSets.map((e=>e.toJSON()))}dispose(){this.browser.off("locuschange",this.boundLocusChangeHandler);const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();this.roiMenu&&this.roiMenu.dispose(),this.roiTable&&this.roiTable.dispose();for(let e of this.roiSets)e.dispose();for(let e of Object.keys(this))this[e]=void 0}}function Gy(){this.renderAllROISets()}function $y(e,t,i){return`${e}-${t}-${i}`}function Ky(e){return`[data-region="${e}"]`}function Yy(e){let t=e.split("-"),i=parseInt(t.pop()),n=parseInt(t.pop()),r=t.join("-");return{chr:r,start:n,end:i,locus:`${r}:${n}-${i}`,bedRecord:`${r}\t${n}\t${i}`}}class Xy{constructor(e,t){this.name=e.name,this.featureSource=e.featureSource||Ad(e,t),this.color=e.color||_u}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}draw(e){const{context:t,bpPerPixel:i,bpStart:n,pixelTop:r,pixelHeight:s,pixelWidth:o,features:a}=e;if(!a)return;const c=n+o*i+1;for(let{start:e,end:o}of a){if(o<n)continue;if(e>c)break;const{x:a,width:l}=Iu(e,o,n,i);xo.fillRect(t,a,r,l,s,{fillStyle:this.color})}}}class Zy extends Ju{constructor(e,t){super(t,e,["ROI","Regions of Interest Table"],ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi">\n <rect id="Rectangle-Copy-23" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#737373">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi-hover">\n <rect id="Rectangle-Copy-24" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#FFFFFF">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowROITable&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowROITable&&this.setState(!1)})),this.button.addEventListener("click",(()=>this.buttonHandler(!t.doShowROITable))),this.setVisibility(!1)}buttonHandler(e){this.setState(e),this.browser.setROITableVisibility(e)}}class Jy extends Ju{constructor(e,t,i){super(e,t,"Select Tracks",ef,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select">\n <rect id="backdrop-copy-3" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.32659528" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select-hover">\n <rect id="backdrop-copy-4" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.33" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>',i=!1),this.enableMultiTrackSelection=i,this.button.addEventListener("mouseenter",(e=>{this.setState(!0)})),this.button.addEventListener("mouseleave",(e=>{this.setState(!1)}));this.boundMouseClickHandler=(()=>{this.setMultiTrackSelection(!this.enableMultiTrackSelection)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(!0)}setMultiTrackSelection(e){this.enableMultiTrackSelection=e;for(const e of this.browser.trackViews)!1===mo.has(e.track.type)&&(e.setTrackSelectionState(e.axis,this.enableMultiTrackSelection),this.enableMultiTrackSelection||(e.track.selected=!1));this.setState(this.enableMultiTrackSelection),!1===this.enableMultiTrackSelection&&this.browser.overlayTrackButton.setVisibility(!1)}}class eA{aliasRecordCache=new Map;constructor(e,t,i){(t=t||{}).url=e,this.reader=new Zh(t,i)}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async search(e){if(!this.aliasRecordCache.has(e)){const t=await this.reader.search(e);if(t)for(let e of Object.keys(t))"start"!==e&&"end"!==e&&this.aliasRecordCache.set(t[e],t)}return this.aliasRecordCache.get(e)}async getChromosomeNames(){return await this.reader.loadHeader(),Array.from(this.reader.chrNames)}}class tA{aliasRecordCache=new Map;constructor(e,t,i){this.aliasURL=e,this.config=t,this.genome=i}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async loadAliases(){const e=await Qs.loadString(this.aliasURL,qa(this.config)),t=Dt(e),i=t[0];i.startsWith("#")&&(this.headings=i.substring(1).split("\t").map((e=>e.trim())),this.altNameSets=this.headings.slice(1));const n=this.genome.chromosomeNames?new Set(this.genome.chromosomeNames):new Set;for(let e of t)if(!e.startsWith("#")&&e.length>0){const t=e.split("\t");let i=t.find((e=>n.has(e)));i||(i=t[0]);const r={chr:i};for(let e=0;e<t.length;e++){r[this.headings?this.headings[e]:e]=t[e],this.aliasRecordCache.set(t[e],r)}}}async search(e){return 0===this.aliasRecordCache.size&&await this.loadAliases(),this.aliasRecordCache.get(e)}}class iA{constructor(e,t,i,n){this.start=e,this.end=t,this.name=i,this.stain=0,"acen"===n?this.type="c":(this.type=n.charAt(1),"p"===this.type&&(this.stain=parseInt(n.substring(4))))}}class nA{cytobandMap=new Map;constructor(e,t,i){(t=t||{}).url=e,this.source=new od(t,i)}async getCytobands(e){if(this.cytobandMap.has(e))return this.cytobandMap.get(e);{let t=await this.#_(e);return t||(t=[]),this.cytobandMap.set(e,t),t}}async#_(e){return(await this.source.getFeatures({chr:e})).map((e=>new iA(e.start,e.end,e.name,e.gieStain)))}}class rA{cytobands=new Map;constructor(e,t){this.url=e,this.config=t}async getCytobands(e){return 0===this.cytobands.size&&await this.#x(),this.cytobands.get(e)}async#x(){let e,t;if($a(this.url)){const t=vs(this.url);e="";const i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n])}else e=await Qs.loadString(this.url,qa(this.config));let i=[];const n=Dt(e);for(let e of n){const n=e.split("\t"),r=n[0];if(t||(t=r),r!==t&&(this.cytobands.set(t,i),i=[],t=r),5===n.length){const e=parseInt(n[1]),t=parseInt(n[2]),r=n[3],s=n[4];i.push(new iA(e,t,r,s))}}}async getChromosomeNames(){return 0===this.cytobands.size&&await this.#x(),Array.from(this.cytobands.keys())}async getChromosomes(){0===this.cytobands.size&&await this.#x();const e=[];let t=0;for(let[i,n]of this.cytobands.entries())e.push(new hc(i,t++,n[n.length-1].end));return e}}class sA{aliasRecordCache=new Map;constructor(e,t){this.genomeID=e,this.update(e,t)}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}update(e,t){if(t){const i=[];for(let n of t){if(this.aliasRecordCache.has(n))continue;let t=!1;const r={chr:n};if(i.push(r),n.startsWith("gi|")){const e=sA.getNCBIName(n);r["ncbi-gi-versioned"]=e;const t=e.lastIndexOf(".");if(t>0){const e=e.substring(0,t);r["ncbi-gi"]=e}}else{if(e.startsWith("hg")||e.startsWith("GRCh")||"1kg_ref"===e||"b37"===e)switch(n){case"23":r.ucsc="chrX",t=!0;break;case"24":r.ucsc="chrY",t=!0;break;case"chrX":r.ncbi="23",t=!0;break;case"chrY":r.ncbi="24",t=!0}else if(e.startsWith("mm")||e.startsWith("GRCm")||e.startsWith("rheMac"))switch(n){case"21":r.ucsc="chrX",t=!0;break;case"22":r.ucsc="chrY",t=!0;break;case"chrX":r.ncbi="21",t=!0;break;case"chrY":r.ncbi="22",t=!0}if(t)continue;"chrM"===n?r.ncbi="MT":"MT"===n?r.ucsc="chrM":n.toLowerCase().startsWith("chr")?r.ncbi=n.substring(3):Number.isInteger(Number(n))&&(r.ucsc="chr"+n)}}for(let e of i)for(let t of Object.values(e))this.aliasRecordCache.set(t,e)}}search(e){return this.aliasRecordCache.get(e)}static getNCBIName(e){const t=e.split("\\|");return t[t.length-1]}}class oA{#k;static async createGenome(e,t){const i=new oA(e,t);return await i.init(),i}constructor(e,t){this.config=e,this.browser=t,this.id=e.id||function(e){return void 0!==e.id?e.id:e.fastaURL&&Mt(e.fastaURL)&&!e.fastaURL.startsWith("data:")?e.fastaURL:e.fastaURL&&e.fastaURL.name?e.fastaURL.name:""}(e),this.name=e.name,this.nameSet=e.nameSet}async init(){const e=this.config;if(this.sequence=await Bc(e,this.browser),e.chromSizesURL?this.chromosomes=await async function(e){const t=new Map;let i;if($a(e)){let t=vs(e);i="";for(let e of t)i+=String.fromCharCode(e)}else i=await Qs.load(e,{});const n=vc(i);let r=0;for(let e of n){const i=e.split("\t");if(i.length>1){const e=Number.parseInt(i[1]);t.set(i[0],new hc(i[0],r++,e))}}return t}(e.chromSizesURL):this.chromosomes=this.sequence.chromosomes||new Map,this.chromosomes.size>0&&(this.chromosomeNames=Array.from(this.chromosomes.keys())),e.chromAliasBbURL?(this.chromAlias=new eA(e.chromAliasBbURL,Object.assign({},e),this),this.chromosomeNames||(this.chromosomeNames=await this.chromAlias.getChromosomeNames())):e.aliasURL?this.chromAlias=new tA(e.aliasURL,Object.assign({},e),this):this.chromosomeNames&&(this.chromAlias=new sA(this.id,this.chromosomeNames)),e.cytobandBbURL)this.cytobandSource=new nA(e.cytobandBbURL,Object.assign({},e),this),this.chromosomeNames||(this.chromosomeNames=await this.cytobandSource.getChromosomeNames());else if(e.cytobandURL&&(this.cytobandSource=new rA(e.cytobandURL,Object.assign({},e)),this.chromosomeNames||(this.chromosomeNames=await this.cytobandSource.getChromosomeNames()),0===this.chromosomes.size)){const e=await this.cytobandSource.getChromosomes();for(let t of e)this.chromosomes.set(e.name,e)}if(!1!==e.wholeGenomeView&&this.chromosomes.size>0&&(e.chromosomeOrder?Array.isArray(e.chromosomeOrder)?this.#k=e.chromosomeOrder:this.#k=e.chromosomeOrder.split(",").map((e=>e.trim())):this.#k=function(e){const t=[];let i,n=1;for(let r of e.values()){if(i){if(r.bpLength<i/100)continue;i=((n-1)*i+r.bpLength)/n,t.push(r.name)}else i=r.bpLength,t.push(r.name);n++}return t}(this.chromosomes)),this.wholeGenomeView=!1!==e.wholeGenomeView&&this.#k&&this.chromosomes.size>1,this.wholeGenomeView){const e=this.#k.reduce(((e,t)=>e+this.chromosomes.get(t).bpLength),0);this.chromosomes.set("all",new hc("all",0,e))}}get description(){return this.config.description||`${this.id}\n${this.name}`}get infoURL(){return this.config.infoURL}showWholeGenomeView(){return this.wholeGenomeView}toJSON(){return Object.assign({},this.config,{tracks:void 0})}get initialLocus(){return this.config.locus?this.config.locus:this.getHomeChromosomeName()}getHomeChromosomeName(){return this.showWholeGenomeView()&&this.chromosomes.has("all")?"all":this.chromosomeNames[0]}getChromosomeName(e){return this.chromAlias?this.chromAlias.getChromosomeName(e,this.chromosomes.keys()):e}getChromosomeDisplayName(e){return this.nameSet&&this.chromAlias&&this.chromAlias.getChromosomeAlias(e,this.nameSet)||e}getChromosome(e){return this.chromAlias&&(e=this.chromAlias.getChromosomeName(e)),this.chromosomes.get(e)}async loadChromosome(e){if(this.chromAlias){const t=await this.chromAlias.search(e);t&&(e=t.chr)}if(!this.chromosomes.has(e)){let t;const i=await this.sequence.getSequenceRecord(e);i&&(t=new hc(e,0,i.bpLength)),this.chromosomes.set(e,t)}return this.chromosomes.get(e)}async getAliasRecord(e){if(this.chromAlias)return this.chromAlias.search(e)}async getCytobands(e){if(this.cytobandSource){const t=this.getChromosomeName(e);return await this.cytobandSource.getCytobands(t)}}getChromosomes(){return this.chromosomes}get wgChromosomeNames(){return this.#k?this.#k.slice():void 0}get showChromosomeWidget(){return this.config.showChromosomeWidget}getGenomeCoordinate(e,t){var i=this.getCumulativeOffset(e);if(void 0!==i)return i+t}getChromosomeCoordinate(e){let t;void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=computeCumulativeOffsets.call(this));let i=0;for(let n of this.#k){const r=this.cumulativeOffsets[n];if(r>e){return{chr:t,position:e-i}}t=n,i=r}return{chr:this.#k[this.#k.length-1],position:0}}getCumulativeOffset(e){void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=function(){let e={},t=0;for(let i of this.#k){e[i]=Math.floor(t);t+=this.getChromosome(i).bpLength}return e}.call(this));const t=this.getChromosomeName(e);return this.cumulativeOffsets[t]}getGenomeLength(){if(!this.bpLength){let e=0;for(let t of this.#k){e+=this.chromosomes.get(t).bpLength}this.bpLength=e}return this.bpLength}async getSequence(e,t,i){return e=this.getChromosomeName(e),this.sequence.getSequence(e,t,i)}getSequenceInterval(e,t,i){return"function"==typeof this.sequence.getSequenceInterval?this.sequence.getSequenceInterval(e,t,i):void 0}}class aA{constructor(){this.clear()}clear(){this.phenotypeColors=new Map,this.snps=new Set,this.qtl=null}isEmpty(){return 0===this.phenotypeColors.size&&0===this.snps.size&&null===this.qtl}addSnp(e){e=e.toUpperCase(),this.snps.add(e)}addPhenotype(e){e=e.toUpperCase();const t=this.phenotypeColors.size;if(!this.phenotypeColors.has(e.toUpperCase())){const i=t<cA.length?cA[t]:_s.randomRGB(0,255);this.phenotypeColors.set(e.toUpperCase(),i)}}hasSnp(e){return e&&this.snps.has(e.toUpperCase())}hasPhenotype(e){return e&&this.phenotypeColors.has(e.toUpperCase())}hasQTL(e){return this.qtls.has(e)}colorForGene(e){return e?this.phenotypeColors.get(e.toUpperCase()):"black"}toJSON(){const e={};return this.phenotypeColors.size>0&&(e.phenotypes=Array.from(this.phenotypeColors.keys())),this.snps.size>0&&(e.snps=Array.from(this.snps)),this.qtl&&(e.qtl=this.qtl),e}static fromJSON(e){const t=new aA;if(e.phenotypes)for(let i of e.phenotypes)t.addPhenotype(i);if(e.snps)for(let i of e.snps)t.addSnp(i);return e.qtl&&(t.qtl=e.qtl),t}}const cA=[];cA.push("rgb(228,26,28)"),cA.push("rgb(55,126,184)"),cA.push("rgb(77,175,74)"),cA.push("rgb(166,86,40)"),cA.push("rgb(152,78,163)"),cA.push("rgb(255,127,0)"),cA.push("rgb(247,129,191)"),cA.push("rgb(255,255,51)"),cA.push("rgb(102,194,165)"),cA.push("rgb(252,141,98)"),cA.push("rgb(141, 160, 203)"),cA.push("rgb(231, 138, 195)"),cA.push("rgb(166, 216, 84)"),cA.push("rgb(255, 217, 47)"),cA.push("rgb(229, 196, 148)"),cA.push("rgb( 141, 211, 199)"),cA.push("rgb(255, 255, 179)"),cA.push("rgb(190, 186, 218)"),cA.push("rgb(251, 128, 114)"),cA.push("rgb(128, 177, 211)"),cA.push("rgb(253, 180, 98)"),cA.push("rgb(179, 222, 105)"),cA.push("rgb(252, 205, 229)"),cA.push("rgb(188, 128, 189)"),cA.push("rgb(204, 235, 197)"),cA.push("rgb(255, 237, 111)");class lA{qtlSelections=new aA;constructor(t,i){this.config=t,this.guid=s(),this.namespace=".browser_"+this.guid,this.parent=i;let n=i.shadowRoot;if(!n){n=i.attachShadow({mode:"open"});const e=new CSSStyleSheet;e.replaceSync('.igv-ui-dropdown {\n cursor: default;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2048;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n background-color: white;\n}\n.igv-ui-dropdown > div {\n overflow-y: auto;\n overflow-x: hidden;\n background-color: white;\n}\n.igv-ui-dropdown > div > div {\n padding: 4px;\n width: 100%;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: 1px;\n background-color: white;\n}\n.igv-ui-dropdown > div > div:last-child {\n border-bottom-color: transparent;\n border-bottom-width: 0;\n}\n.igv-ui-dropdown > div > div:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.igv-ui-popover {\n cursor: default;\n position: absolute;\n z-index: 2048;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n background-color: white;\n}\n.igv-ui-popover > div:first-child {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-width: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-popover > div:first-child > div:first-child {\n margin-left: 4px;\n}\n.igv-ui-popover > div:first-child > div:last-child {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-popover > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-popover > div:last-child {\n user-select: text;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 400px;\n max-width: 800px;\n background-color: white;\n border-bottom-width: 0;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-ui-popover > div:last-child > div {\n margin-left: 4px;\n margin-right: 4px;\n min-width: 220px;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.igv-ui-popover > div:last-child > div > span {\n font-weight: bolder;\n}\n.igv-ui-popover > div:last-child hr {\n width: 100%;\n}\n\n.igv-ui-alert-dialog-container {\n box-sizing: content-box;\n position: absolute;\n z-index: 2048;\n top: 50%;\n left: 50%;\n width: 400px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n outline: none;\n font-family: "Open Sans", sans-serif;\n font-size: 15px;\n font-weight: 400;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:first-child {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-alert-dialog-container > div:first-child div:first-child {\n padding-left: 8px;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body {\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n color: #373737;\n width: 100%;\n height: calc(100% - 24px - 64px);\n overflow-y: scroll;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body .igv-ui-alert-dialog-body-copy {\n margin: 16px;\n width: auto;\n height: auto;\n overflow-wrap: break-word;\n word-break: break-word;\n background-color: white;\n border: unset;\n}\n.igv-ui-alert-dialog-container > div:last-child {\n width: 100%;\n margin-bottom: 10px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:last-child div {\n margin: unset;\n width: 40px;\n height: 30px;\n line-height: 30px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n border-color: #2B81AF;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-alert-dialog-container > div:last-child div:hover {\n cursor: pointer;\n border-color: #25597f;\n background-color: #25597f;\n}\n\n.igv-ui-color-swatch {\n position: relative;\n box-sizing: content-box;\n display: flex;\n flex-flow: row;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n border-style: solid;\n border-width: 2px;\n border-color: white;\n border-radius: 4px;\n}\n\n.igv-ui-color-swatch:hover {\n border-color: dimgray;\n}\n\n.igv-ui-colorpicker-menu-close-button {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 32px;\n margin-top: 4px;\n margin-bottom: 4px;\n padding-right: 8px;\n}\n.igv-ui-colorpicker-menu-close-button i.fa {\n display: block;\n margin-left: 4px;\n margin-right: 4px;\n color: #5f5f5f;\n}\n.igv-ui-colorpicker-menu-close-button i.fa:hover,\n.igv-ui-colorpicker-menu-close-button i.fa:focus,\n.igv-ui-colorpicker-menu-close-button i.fa:active {\n cursor: pointer;\n color: #0f0f0f;\n}\n\n.igv-ui-generic-dialog-container {\n box-sizing: content-box;\n position: fixed;\n top: 0;\n left: 0;\n width: 300px;\n height: fit-content;\n padding-bottom: 16px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n z-index: 2048;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input > div {\n width: fit-content;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input[type=range] {\n width: 70%;\n -webkit-appearance: none;\n background: linear-gradient(90deg, white, black);\n outline: none;\n margin: 0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input output {\n display: block;\n height: 100%;\n width: 20%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n padding-top: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div {\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n\n.igv-ui-generic-container {\n box-sizing: content-box;\n position: absolute;\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-container > div:first-child {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-ui-generic-container > div:first-child > div {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-ui-dialog {\n z-index: 2048;\n position: fixed;\n width: fit-content;\n height: fit-content;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n background-color: white;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n}\n.igv-ui-dialog .igv-ui-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-dialog .igv-ui-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-dialog .igv-ui-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-dialog .igv-ui-dialog-one-liner {\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin: 8px;\n overflow-wrap: break-word;\n background-color: white;\n font-weight: bold;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel {\n width: 100%;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div {\n margin: 16px;\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child {\n background-color: #5ea4e0;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child {\n background-color: #c4c4c4;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-ui-panel, .igv-ui-panel-row, .igv-ui-panel-column {\n z-index: 2048;\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-panel-column {\n display: flex;\n flex-direction: column;\n}\n\n.igv-ui-panel-row {\n display: flex;\n flex-direction: row;\n}\n\n.igv-ui-textbox {\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-table {\n background-color: white;\n}\n\n.igv-ui-table thead {\n position: sticky;\n top: 0;\n}\n\n.igv-ui-table th {\n text-align: left;\n}\n\n.igv-ui-table td {\n padding-right: 20px;\n}\n\n.igv-ui-table tr:hover {\n background-color: lightblue;\n}\n\n.igv-ui-center-fixed {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.igv-navbar {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n color: #444;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n line-height: 32px;\n padding-left: 8px;\n padding-right: 8px;\n margin-top: 2px;\n margin-bottom: 6px;\n height: 32px;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: #f3f3f3;\n}\n.igv-navbar .igv-navbar-left-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 32px;\n line-height: 32px;\n}\n.igv-navbar .igv-navbar-left-container .igv-logo {\n width: 34px;\n height: 32px;\n margin-right: 8px;\n}\n.igv-navbar .igv-navbar-left-container .igv-current-genome {\n height: 32px;\n margin-left: 4px;\n margin-right: 4px;\n user-select: none;\n line-height: 32px;\n vertical-align: middle;\n text-align: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n height: 100%;\n width: 125px;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container select {\n display: block;\n cursor: pointer;\n width: 100px;\n height: 75%;\n outline: none;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n margin-left: 8px;\n height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 240px;\n height: 22px;\n line-height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container input.igv-search-input {\n cursor: text;\n width: 85%;\n height: 22px;\n line-height: 22px;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n text-align: left;\n padding-left: 8px;\n margin-right: 8px;\n outline: none;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: white;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container .igv-search-icon-container {\n cursor: pointer;\n height: 16px;\n width: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-windowsize-panel-container {\n margin-left: 4px;\n user-select: none;\n}\n.igv-navbar .igv-navbar-right-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container {\n position: relative;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container-hidden {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget {\n color: #737373;\n font-size: 18px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:nth-child(even) {\n display: block;\n height: fit-content;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget input {\n display: block;\n width: 125px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 {\n color: #737373;\n font-size: 18px;\n height: 32px;\n line-height: 32px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:nth-child(even) {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 input {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-hidden {\n display: none;\n}\n\n.igv-navbar-button {\n display: block;\n box-sizing: unset;\n padding-left: 6px;\n padding-right: 6px;\n height: 18px;\n text-transform: capitalize;\n user-select: none;\n line-height: 18px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 11px;\n font-weight: 200;\n color: #737373;\n background-color: #f3f3f3;\n border-color: #737373;\n border-style: solid;\n border-width: thin;\n border-radius: 6px;\n}\n\n.igv-navbar-button:hover {\n cursor: pointer;\n}\n\n.igv-navbar-button-clicked {\n color: white;\n background-color: #737373;\n}\n\n.igv-navbar-icon-button {\n cursor: pointer;\n position: relative;\n width: 24px;\n height: 24px;\n margin-left: 4px;\n margin-right: 4px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:first-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: -18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:last-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.igv-navbar-text-button {\n cursor: pointer;\n position: relative;\n margin-left: 2px;\n margin-right: 2px;\n border: none;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar-text-button > div:nth-child(2) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 0;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-text-button > div:nth-child(3) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 42px;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n#igv-text-button-label {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-inactive rect {\n stroke: #737373;\n fill: white;\n}\n.igv-navbar-text-button-svg-inactive text {\n fill: #737373;\n}\n.igv-navbar-text-button-svg-inactive tspan {\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-hover rect {\n stroke: #737373;\n fill: #737373;\n}\n.igv-navbar-text-button-svg-hover text {\n fill: white;\n}\n.igv-navbar-text-button-svg-hover tspan {\n dominant-baseline: middle;\n}\n\n#igv-save-svg-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-svg-group text {\n fill: #737373;\n}\n\n#igv-save-svg-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-svg-group:hover text {\n fill: white;\n}\n\n#igv-save-png-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-png-group text {\n fill: #737373;\n}\n\n#igv-save-png-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-png-group:hover text {\n fill: white;\n}\n\n.igv-zoom-in-notice-container {\n z-index: 256;\n position: absolute;\n top: 8px;\n left: 50%;\n transform: translate(-50%, 0%);\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n background-color: white;\n}\n.igv-zoom-in-notice-container > div {\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n width: 100%;\n height: 100%;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: #3f3f3f;\n}\n\n.igv-zoom-in-notice {\n position: absolute;\n top: 10px;\n left: 50%;\n}\n.igv-zoom-in-notice div {\n position: relative;\n left: -50%;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #3f3f3f;\n background-color: rgba(255, 255, 255, 0.51);\n z-index: 64;\n}\n\n.igv-container-spinner {\n position: absolute;\n top: 90%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1024;\n width: 24px;\n height: 24px;\n pointer-events: none;\n color: #737373;\n}\n\n.igv-multi-locus-close-button {\n position: absolute;\n top: 2px;\n right: 0;\n padding-left: 2px;\n padding-right: 2px;\n width: 12px;\n height: 12px;\n color: #666666;\n background-color: white;\n z-index: 1000;\n}\n.igv-multi-locus-close-button > svg {\n vertical-align: top;\n}\n\n.igv-multi-locus-close-button:hover {\n cursor: pointer;\n color: #434343;\n}\n\n.igv-multi-locus-ruler-label {\n z-index: 64;\n position: absolute;\n top: 2px;\n left: 0;\n width: 100%;\n height: 12px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-multi-locus-ruler-label > div {\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n color: rgb(16, 16, 16);\n background-color: white;\n}\n.igv-multi-locus-ruler-label > div {\n cursor: pointer;\n}\n\n.igv-multi-locus-ruler-label-square-dot {\n z-index: 64;\n position: absolute;\n left: 50%;\n top: 5%;\n transform: translate(-50%, 0%);\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-multi-locus-ruler-label-square-dot > div:first-child {\n width: 14px;\n height: 14px;\n}\n.igv-multi-locus-ruler-label-square-dot > div:last-child {\n margin-left: 16px;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: rgb(16, 16, 16);\n}\n\n.igv-ruler-sweeper {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 26px;\n bottom: 0;\n left: 0;\n width: 0;\n z-index: 99999;\n background-color: rgba(68, 134, 247, 0.25);\n}\n\n.igv-ruler-tooltip {\n pointer-events: none;\n z-index: 128;\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 32px;\n background-color: transparent;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ruler-tooltip > div {\n pointer-events: none;\n width: 128px;\n height: auto;\n padding: 1px;\n color: #373737;\n font-size: 10px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n background-color: white;\n border-style: solid;\n border-width: thin;\n border-color: #373737;\n}\n\n.igv-track-label {\n position: absolute;\n left: 8px;\n top: 8px;\n width: auto;\n height: auto;\n max-width: 50%;\n padding-left: 4px;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-color: #444;\n border-radius: 2px;\n border-style: solid;\n border-width: thin;\n background-color: white;\n z-index: 128;\n cursor: pointer;\n}\n\n.igv-track-label:hover,\n.igv-track-label:focus,\n.igv-track-label:active {\n background-color: #e8e8e8;\n}\n\n.igv-track-label-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-top: 4px;\n}\n\n.igv-center-line {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n z-index: 8;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-left-style: dashed;\n border-left-width: thin;\n border-right-style: dashed;\n border-right-width: thin;\n}\n\n.igv-center-line-wide {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(127, 127, 127, 0.51);\n}\n\n.igv-center-line-thin {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(0, 0, 0, 0);\n}\n\n.igv-cursor-guide-horizontal {\n display: none;\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 50%;\n height: 1px;\n z-index: 32;\n margin-left: 50px;\n margin-right: 54px;\n border-top-style: dotted;\n border-top-width: thin;\n border-top-color: rgba(127, 127, 127, 0.76);\n}\n\n.igv-cursor-guide-vertical {\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n width: 1px;\n z-index: 32;\n border-left-style: dotted;\n border-left-width: thin;\n border-left-color: rgba(127, 127, 127, 0.76);\n display: none;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-generic-dialog-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 300px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n z-index: 2048;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-generic-dialog-container .igv-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input div {\n width: 30%;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div {\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-generic-container {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-container div:first-child {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-generic-container div:first-child i {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-menu-popup {\n position: absolute;\n top: 0;\n left: 0;\n width: max-content;\n max-width: 400px;\n z-index: 512;\n cursor: pointer;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background: white;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-end;\n text-align: left;\n}\n.igv-menu-popup > div:not(:first-child) {\n width: 100%;\n}\n.igv-menu-popup > div:not(:first-child) > div {\n background: white;\n}\n.igv-menu-popup > div:not(:first-child) > div.context-menu {\n padding-left: 4px;\n padding-right: 4px;\n}\n.igv-menu-popup > div:not(:first-child) > div:last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-menu-popup > div:not(:first-child) > div:hover {\n background: #efefef;\n}\n\n.igv-menu-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-bottom: 1px;\n padding-top: 1px;\n}\n\n.igv-menu-popup-header {\n position: relative;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-menu-popup-header div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-menu-popup-header div:hover {\n cursor: pointer;\n color: #444;\n}\n\n.igv-menu-popup-check-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 20px;\n margin-right: 4px;\n background-color: transparent;\n}\n.igv-menu-popup-check-container div {\n padding-top: 2px;\n padding-left: 8px;\n}\n.igv-menu-popup-check-container div:first-child {\n position: relative;\n width: 12px;\n height: 12px;\n}\n.igv-menu-popup-check-container div:first-child svg {\n position: absolute;\n width: 12px;\n height: 12px;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-loading-spinner-container {\n z-index: 1024;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 32px;\n height: 32px;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-loading-spinner-container > div {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: 4px solid rgba(128, 128, 128, 0.5);\n border-top-color: rgb(255, 255, 255);\n animation: spin 1s ease-in-out infinite;\n -webkit-animation: spin 1s ease-in-out infinite;\n}\n\n@keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@-webkit-keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.igv-roi-menu {\n position: absolute;\n z-index: 512;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background-color: white;\n width: 192px;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-menu > div:first-child {\n height: 24px;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-roi-menu > div:first-child > div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-roi-menu > div:first-child > div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-menu > div:last-child {\n background-color: white;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: 0;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n text-align: start;\n vertical-align: middle;\n}\n.igv-roi-menu > div:last-child > div {\n height: 24px;\n padding-left: 4px;\n border-bottom-style: solid;\n border-bottom-width: thin;\n border-bottom-color: #7f7f7f;\n}\n.igv-roi-menu > div:last-child > div:not(:first-child):hover {\n cursor: pointer;\n background-color: rgba(127, 127, 127, 0.1);\n}\n.igv-roi-menu > div:last-child div:first-child {\n font-style: italic;\n text-align: center;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.igv-roi-menu > div:last-child > div:last-child {\n border-bottom-width: 0;\n border-bottom-color: transparent;\n}\n\n.igv-roi-placeholder {\n font-style: normal;\n color: rgba(75, 75, 75, 0.6);\n}\n\n.igv-roi-table {\n position: absolute;\n z-index: 1024;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n resize: both;\n overflow: hidden;\n width: min-content;\n max-width: 1600px;\n border-color: #7f7f7f;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 400;\n background-color: white;\n cursor: default;\n}\n.igv-roi-table > div {\n height: 24px;\n font-size: 14px;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n}\n.igv-roi-table > div:first-child {\n border-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-top-width: 0;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-roi-table > div:first-child > div:first-child {\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n margin-left: 4px;\n margin-right: 4px;\n width: calc(100% - 4px - 12px);\n}\n.igv-roi-table > div:first-child > div:last-child {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7f7f7f;\n}\n.igv-roi-table > div:first-child > div:last-child > svg {\n display: block;\n}\n.igv-roi-table > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-table > .igv-roi-table-description {\n padding: 4px;\n margin-left: 4px;\n word-break: break-all;\n overflow-y: auto;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-goto-explainer {\n margin-top: 5px;\n margin-left: 4px;\n color: #7F7F7F;\n font-style: italic;\n height: 24px;\n border-top: solid lightgray;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-column-titles {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n padding-right: 16px;\n background-color: white;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: #7f7f7f;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n overflow: auto;\n height: 360px;\n flex: 1 1 auto;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: transparent;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row-hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.igv-roi-table > div:last-child {\n min-height: 32px;\n height: 32px;\n line-height: 32px;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: transparent;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-width: 0;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n\n.igv-roi-table-row-selected {\n background-color: rgba(0, 0, 0, 0.125);\n}\n\n.igv-roi-table-button {\n cursor: pointer;\n height: 20px;\n user-select: none;\n line-height: 20px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 13px;\n font-weight: 400;\n color: black;\n padding-left: 6px;\n padding-right: 6px;\n background-color: rgb(239, 239, 239);\n border-color: black;\n border-style: solid;\n border-width: thin;\n border-radius: 3px;\n}\n\n.igv-roi-table-button:hover {\n font-weight: 400;\n background-color: rgba(0, 0, 0, 0.13);\n}\n\n.igv-roi-region {\n z-index: 64;\n position: absolute;\n top: 0;\n bottom: 0;\n pointer-events: none;\n overflow: visible;\n margin-top: 66px;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-region > div {\n position: relative;\n width: 100%;\n height: 8px;\n pointer-events: auto;\n}\n\n.igv-roi-menu-row {\n height: 24px;\n padding-left: 8px;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n background-color: white;\n}\n\n.igv-roi-menu-row-edit-description {\n width: -webkit-fill-available;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n background-color: white;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-menu-row-edit-description > label {\n margin-left: 2px;\n margin-bottom: 0;\n display: block;\n width: -webkit-fill-available;\n}\n.igv-roi-menu-row-edit-description > input {\n display: block;\n margin-left: 2px;\n margin-right: 2px;\n margin-bottom: 1px;\n width: -webkit-fill-available;\n}\n\n.igv-container {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-top: 4px;\n user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n min-height: 160px;\n}\n\n.igv-viewport {\n position: relative;\n margin-top: 5px;\n line-height: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.igv-viewport-content {\n position: relative;\n width: 100%;\n}\n.igv-viewport-content > canvas {\n position: relative;\n display: block;\n}\n\n.igv-column-container {\n position: relative;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n width: 100%;\n}\n\n.igv-column-shim {\n width: 1px;\n margin-left: 2px;\n margin-right: 2px;\n background-color: #545453;\n}\n\n.igv-axis-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 50px;\n}\n.igv-axis-column > div {\n position: relative;\n margin-top: 5px;\n width: 100%;\n}\n.igv-axis-column > div > div {\n z-index: 512;\n position: absolute;\n top: 8px;\n left: 8px;\n width: fit-content;\n height: fit-content;\n background-color: transparent;\n display: grid;\n align-items: start;\n justify-items: center;\n}\n.igv-axis-column > div > div > input {\n display: block;\n margin: unset;\n cursor: pointer;\n}\n\n.igv-column {\n position: relative;\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-info-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-name-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-scrollbar-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 14px;\n}\n.igv-scrollbar-column > div {\n position: relative;\n margin-top: 5px;\n width: 14px;\n}\n.igv-scrollbar-column > div > div {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 2px;\n width: 8px;\n border-width: 1px;\n border-style: solid;\n border-color: #c4c4c4;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-scrollbar-column > div > div:hover {\n background-color: #c4c4c4;\n}\n\n.igv-track-drag-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 12px;\n background-color: white;\n}\n.igv-track-drag-column > .igv-track-drag-handle {\n z-index: 512;\n position: relative;\n cursor: pointer;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n.igv-track-drag-column .igv-track-drag-handle-color {\n background-color: #c4c4c4;\n}\n.igv-track-drag-column .igv-track-drag-handle-hover-color {\n background-color: #787878;\n}\n.igv-track-drag-column .igv-track-drag-handle-selected-color {\n background-color: #0963fa;\n}\n.igv-track-drag-column > .igv-track-drag-shim {\n position: relative;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n}\n\n.igv-gear-menu-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 28px;\n}\n.igv-gear-menu-column > div {\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 5px;\n width: 100%;\n background: white;\n}\n.igv-gear-menu-column > div > div {\n position: relative;\n margin-top: 4px;\n width: 16px;\n height: 16px;\n color: #7F7F7F;\n}\n.igv-gear-menu-column > div > div:hover {\n cursor: pointer;\n color: #444;\n}\n\n/*# sourceMappingURL=igv.css.map */\n'),n.adoptedStyleSheets=[e]}if(this.root=e({class:"igv-container"}),n.appendChild(this.root),this.spinner=e({class:"igv-loading-spinner-container"}),this.root.appendChild(this.spinner),this.spinner.appendChild(e()),this.spinner.style.width="64px",this.spinner.style.height="64px",this.stopSpinner(),this.alert=new za(this.root),this.columnContainer=e({class:"igv-column-container"}),this.root.appendChild(this.columnContainer),this.menuPopup=new Xu(this.columnContainer),this.menuUtils=new bo(this),this.initialize(t),this.trackViews=[],this.constants={dragThreshold:3,scrollThreshold:5,defaultColor:"rgb(0,0,150)",doubleClickDelay:t.doubleClickDelay||500},this.eventHandlers={},t.listeners)for(let e of Object.keys(t.listeners))this.on(e,t.listeners[e]);this.on("trackremoved",(()=>{0===this.findTracks((e=>"function"==typeof e.getSamples)).length&&(this.sampleInfoControl.setButtonVisibility(!1),this.sampleNameViewportWidth=void 0,this.showSampleNames=!1,this.sampleNameControl.setState(this.showSampleNames),this.sampleNameControl.hide(),this.layoutChange())})),this.on("didchangecolumnlayout",(()=>{if(yu.length>0){const e=yu.length;for(let t=0;t<e;t++)yu[t].dispose();yu.length=0}})),this.addEventHandlers(),this.sampleInfo=new Uu(this),this.setControls(t),this.roiManager=new Wy(this)}get doShowROITable(){return this.roiManager.roiTableIsVisible()}startSpinner(){this.spinner.style.display="flex"}stopSpinner(){this.spinner.style.display="none"}initialize(e){this.flanking=e.flanking,this.crossDomainProxy=e.crossDomainProxy,this.formats=e.formats,this.trackDefaults=e.trackDefaults,this.nucleotideColors=e.nucleotideColors||Mc;for(let e of Object.keys(this.nucleotideColors))this.nucleotideColors[e.toLowerCase()]=this.nucleotideColors[e];this.doShowTrackLabels=e.showTrackLabels,this.doShowCenterLine=e.showCenterGuide,this.doShowCursorGuide=e.showCursorGuide,this.showSampleNames=e.showSampleNames,this.sampleNameViewportWidth=void 0,e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),e.search&&(this.searchConfig={type:"json",url:e.search.url,coords:void 0===e.search.coords?1:e.search.coords,chromosomeField:e.search.chromosomeField||"chromosome",startField:e.search.startField||"start",endField:e.search.endField||"end",geneField:e.search.geneField||"gene",snpField:e.search.snpField||"snp",resultsField:e.search.resultsField})}setControls(e){const t=this.createStandardControls(e);t.insertBefore(Bt(this.columnContainer)),this.$navigation=t,!1===e.showControls&&t.hide()}createStandardControls(t){const i=Bt("<div>",{class:"igv-navbar"});this.$navigation=i;const n=Bt("<div>",{class:"igv-navbar-left-container"});i.append(n);const r=Bt("<div>",{class:"igv-logo"});n.append(r);const o=Bt('<svg width="690px" height="324px" viewBox="0 0 690 324" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>IGV</title><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="IGV" fill="#666666"><polygon id="Path" points="379.54574 8.00169252 455.581247 8.00169252 515.564813 188.87244 532.884012 253.529506 537.108207 253.529506 554.849825 188.87244 614.833392 8.00169252 689.60164 8.00169252 582.729511 320.722144 486.840288 320.722144"></polygon><path d="M261.482414,323.793286 C207.975678,323.793286 168.339046,310.552102 142.571329,284.069337 C116.803612,257.586572 103.919946,217.158702 103.919946,162.784513 C103.919946,108.410325 117.437235,67.8415913 144.472217,41.0770945 C171.507199,14.3125977 212.903894,0.930550071 268.663545,0.930550071 C283.025879,0.930550071 298.232828,1.84616386 314.284849,3.6774189 C330.33687,5.50867394 344.839793,7.97378798 357.794056,11.072835 L357.794056,68.968378 C339.48912,65.869331 323.578145,63.5450806 310.060654,61.9955571 C296.543163,60.4460336 284.574731,59.6712835 274.154998,59.6712835 C255.850062,59.6712835 240.502308,61.4320792 228.111274,64.9537236 C215.720241,68.4753679 205.793482,74.2507779 198.330701,82.2801269 C190.867919,90.309476 185.587729,100.87425 182.48997,113.974767 C179.392212,127.075284 177.843356,143.345037 177.843356,162.784513 C177.843356,181.942258 179.251407,198.000716 182.067551,210.960367 C184.883695,223.920018 189.671068,234.41436 196.429813,242.443709 C203.188559,250.473058 212.059279,256.178037 223.042241,259.558815 C234.025202,262.939594 247.683295,264.629958 264.01693,264.629958 C268.241146,264.629958 273.098922,264.489094 278.590403,264.207362 C284.081883,263.925631 289.643684,263.50304 295.275972,262.939577 L295.275972,159.826347 L361.595831,159.826347 L361.595831,308.579859 C344.698967,313.087564 327.239137,316.750019 309.215815,319.567334 C291.192494,322.38465 275.281519,323.793286 261.482414,323.793286 L261.482414,323.793286 L261.482414,323.793286 Z" id="Path"></path>;<polygon id="Path" points="0.81355666 5.00169252 73.0472883 5.00169252 73.0472883 317.722144 0.81355666 317.722144"></polygon></g> </g> </svg>');o.css("width","34px"),o.css("height","32px"),r.append(o),this.$current_genome=Bt("<div>",{class:"igv-current-genome"}),n.append(this.$current_genome),this.$current_genome.text("");const a=Bt("<div>",{class:"igv-navbar-genomic-location"});n.append(a),this.chromosomeSelectWidget=new Cy(this,a.get(0)),!1!==t.showChromosomeWidget?this.chromosomeSelectWidget.show():this.chromosomeSelectWidget.hide();const c=Bt("<div>",{class:"igv-locus-size-group"});a.append(c);const h=Bt("<div>",{class:"igv-search-container"});c.append(h),this.$searchInput=Bt("<input>",{class:"igv-search-input",type:"text",placeholder:"Locus Search"}),h.append(this.$searchInput),this.$searchInput[0].addEventListener("keyup",(e=>{e.stopImmediatePropagation()})),this.$searchInput.change((()=>this.doSearch(this.$searchInput.val())));const d=e({class:"igv-search-icon-container"});h.append(Bt(d)),d.appendChild(l("search")),d.addEventListener("click",(()=>this.doSearch(this.$searchInput.val()))),this.windowSizePanel=new _y(c.get(0),this);const u=Bt("<div>",{class:"igv-navbar-right-container"});i.append(u);const f=Bt('<div class="igv-navbar-toggle-button-container">');if(u.append(f),this.$toggle_button_container=f,this.overlayTrackButton=new sf(this,f.get(0)),this.overlayTrackButton.setVisibility(!1),this.multiTrackSelectButton=new Jy(this,f.get(0)),this.cursorGuide=new xy(this.columnContainer,this),this.cursorGuideButton=new ky(this,f.get(0)),this.centerLineButton=new Iy(this,f.get(0)),this.setTrackLabelVisibility(t.showTrackLabels),this.trackLabelControl=new Sy(f.get(0),this),this.roiTableControl=new Zy(f.get(0),this),this.sampleInfoControl=new Ny(f.get(0),this),this.sampleNameControl=new Ey(f.get(0),this),!0===t.showSVGButton&&(this.saveImageControl=new Ty(f.get(0),this)),t.customButtons)for(let e of t.customButtons)new Uy(f.get(0),this,e);return this.zoomWidget=new Ry(this,u.get(0)),!1===t.showNavigation&&this.$navigation.hide(),this.sliderDialog=new Na(this.root),this.sliderDialog.container.id=`igv-slider-dialog-${s()}`,this.inputDialog=new Ba(this.root),this.inputDialog.container.id=`igv-input-dialog-${s()}`,this.dataRangeDialog=new _o(this,Bt(this.root)),this.dataRangeDialog.$container.get(0).id=`igv-data-range-dialog-${s()}`,this.genericColorPicker=new Da({parent:this.columnContainer,width:432}),this.genericColorPicker.container.id=`igv-track-color-picker-${s()}`,i}getSampleNameViewportWidth(){return void 0===this.sampleNameViewportWidth||!1===this.showSampleNames?0:this.sampleNameViewportWidth}getSampleInfoViewportWidth(){return this.getSampleInfoColumnWidth()}isMultiLocusMode(){return this.referenceFrameList&&this.referenceFrameList.length>1}isMultiLocusWholeGenomeView(){if(void 0===this.referenceFrameList||1===this.referenceFrameList.length)return!1;for(let e of this.referenceFrameList)if("all"===e.chr.toLowerCase())return!0;return!1}currentLoci(){const e=e=>`${e.chr}:${e.start+1}-${e.end}`;return void 0===this.referenceFrameList||0===this.referenceFrameList.length?"":1===this.referenceFrameList.length?e(this.referenceFrameList[0]):this.referenceFrameList.map((t=>e(t)))}toSVG(){const{x:e,y:t,width:i,height:n}=this.columnContainer.getBoundingClientRect(),r=new lu({width:i,height:n,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:i,height:n}}),s={deltaX:0,deltaY:-t};for(let e of this.trackViews)e.renderSVGContext(r,s);return s.deltaX=e,this.roiManager.renderSVGContext(this.columnContainer,r,s),r.getSerializedSvg(!0)}saveSVGtoFile(e,t){let i=this.toSVG();if(t){const e=document.createElement("svg");e.innerHTML=i,t.append(e),t.appendChild(e)}const n=e||"igvjs.svg",r=URL.createObjectURL(new Blob([i],{type:"application/octet-stream"}));Pt(n,r),URL.revokeObjectURL(r)}savePNGtoFile(e){const t=this.toSVG(),i=new Blob([t],{type:"image/svg+xml"}),n=URL.createObjectURL(i),r=document.createElement("img");r.addEventListener("load",(()=>{const t=this.columnContainer.getBoundingClientRect(),i=window.devicePixelRatio,s=t.width*i,o=t.height*i,a=document.createElement("canvas");a.width=s,a.height=o;const c=a.getContext("2d");c.scale(i,i),c.drawImage(r,0,0);const l=a.toDataURL("image/png");Pt(e=e||"igvjs.png",l),URL.revokeObjectURL(n)})),r.src=n}async loadSession(e){let t;return this.sampleInfo.initialize(),this.roiSets=[],t=e.url||e.file?await lA.loadSessionFile(e):e,this.loadSessionObject(t)}static async loadSessionFile(e){const t=e.url||e.file;let i;if(e.url&&Mt(e.url)&&(e.url.startsWith("blob:")||e.url.startsWith("data:"))){const t=lA.uncompressSession(e.url);i=JSON.parse(t)}else{let n=e.filename;if(n||(n=e.url?await Wa(e.url):e.file.name),n.endsWith(".xml")){const e=mu.KNOWN_GENOMES,n=await Qs.loadString(t);i=new py(n,e)}else if(n.endsWith("hub.txt")){i={reference:(await du.loadHub(t,e)).getGenomeConfig()}}else{if(!n.endsWith(".json"))throw Error("Unrecognized session file format:"+n);i=await Qs.loadJson(t)}}return mA(i)}async loadSessionObject(e){this.cleanHouseForSession(),this.config=e,e.browsers&&(e=await async function(e){const t=e.browsers[0],i={},n=new Mf({url:t.url});await n.readHeaderAndFooter(),i.sampleNameViewportWidth=20,i.genome="hg38";const r=t.state.split(","),s=n.bpResolutions[Number.parseInt(r[2])],o=Number.parseInt(r[0]),a=Math.floor(Number.parseFloat(r[3])*s),c=a+Math.floor(1700*s);return i.locus=`${n.chromosomes[o].name}:${a}-${c}`,i.tracks=(t.tracks||[]).filter((e=>!("refgene"===e.format||"cellType"===e.name))),i.tracks.push({type:"shoebox",url:t.url,name:t.name,colorScale:t.colorScale,_hicFile:n}),i}(e)),this.sampleInfoControl.setButtonVisibility(!1),this.showSampleNames=e.showSampleNames||!1,this.sampleNameControl.setState(!0===this.showSampleNames),e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),Ka(this.columnContainer,"igv-axis-column"),Ka(this.columnContainer,"igv-sample-info-column"),Ka(this.columnContainer,"igv-sample-name-column"),Ka(this.columnContainer,"igv-scrollbar-column"),Ka(this.columnContainer,"igv-track-drag-column"),Ka(this.columnContainer,"igv-gear-menu-column");const t=e.reference||e.genome;if(!t)return void console.warn("No genome or reference object specified");const i=Mt(t)?await mu.expandReference(this.alert,t):t;if(await this.loadReference(i,i.locus||e.locus),this.centerLineList=this.createCenterLineList(this.columnContainer),!1!==e.showIdeogram){const e=new ly(this);e.id="ideogram";const t=new hf(this,this.columnContainer,e);this.trackViews.push(t)}if(!1!==e.showRuler){const e=new hf(this,this.columnContainer,new Wu(this));this.trackViews.push(e)}e.qtlSelections&&(this.qtlSelections=aA.fromJSON(e.qtlSelections)),this.roiManager.clearROIs(),e.roi?this.roiManager.loadROI(e.roi):await this.roiManager.reset();const n=[];if(e.sampleinfo)for(const t of e.sampleinfo)t.file?n.push(t.file):this.loadSampleInfo(t);const r=i.tracks||[],s=e.tracks?r.concat(e.tracks):r;0===s.filter((e=>"sequence"===e.type&&!e.url&&!e.fastaURL)).length&&s.push({type:"sequence",order:Wd,removable:!1});const o=s.filter((e=>void 0!==e.file)).map((({file:e})=>e)),a=s.filter((e=>void 0!==e.indexFile)).map((({indexFile:e})=>e));a.length>0&&o.push(...a),n.length>0&&o.push(...n),o.length>0&&alert(`Local files cannot be loaded automatically.\nThis session contains references to these local files:\n${o.map((e=>` ${e}`)).join("\n")}`);const c=s.filter((e=>void 0===e.file));let l=1;for(let e of c)void 0===e.order&&(e.order=l++);await this.loadTrackList(c);for(let e of this.trackViews.filter((e=>"ruler"===e.track.type||"ideogram"===e.track.type)))await e.updateViews();return this.trackViews.some((e=>e.track.selected))&&this.multiTrackSelectButton.setMultiTrackSelection(!0),this.updateUIWithReferenceFrameList(),this.updateLocusSearchWidget(),s}cleanHouseForSession(){for(let e of this.trackViews)e.removeDOMFromColumnContainer();this.columnContainer.querySelectorAll(".igv-axis-column, .igv-column-shim, .igv-column, .igv-sample-info-column, .igv-sample-name-column, .igv-scrollbar-column, .igv-track-drag-column, .igv-gear-menu-column").forEach((e=>e.remove())),this.trackViews=[],this.circularView&&this.circularView.clearChords()}async loadReference(e,t){let i;this.removeAllTracks(),this.roiManager.clearROIs(),this.multiTrackSelectButton.setMultiTrackSelection(!1),i=e.gbkURL?await wd(e.gbkURL):await oA.createGenome(e,this);const n=void 0===this.genome||this.genome.id!==i.id;this.genome=i,this.updateNavbarDOMWithGenome(i);let r=t||i.initialLocus;Array.isArray(r)&&(r=r.join(" "));if(!await this.search(r,!0))throw new Error(`Cannot set initial locus ${r}`);if(n){let t;if(e.hubURL){t=(await du.loadHub(e.hubURL)).getGroupedTrackConfigurations()}this.fireEvent("genomechange",[{genome:i,trackConfigurations:t}]),this.circularView&&this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:zm(this.genome)})}}updateNavbarDOMWithGenome(e){let t=e.id&&e.id.length<20?e.id:`${e.id.substring(0,8)}...${e.id.substring(e.id.length-8)}`;this.$current_genome.text(t),this.$current_genome.attr("title",e.description);!1!==this.config.showChromosomeWidget&&!1!==this.genome.showChromosomeWidget&&e.chromosomeNames&&e.chromosomeNames.length>1?(this.chromosomeSelectWidget.update(e),this.chromosomeSelectWidget.show()):this.chromosomeSelectWidget.hide()}async loadGenome(e){let t;e.genarkAccession&&(e.url=hu(e.genarkAccession)),e.url&&(Mt(e.url)&&e.url.endsWith("/hub.txt")?(e.hubURL=e.url,delete e.url):"gbk"===function(e){let t;if(e instanceof File)t=e.name;else{if("string"!=typeof e)throw new Error("Input must be a File object or a URL string");t=e}const i=t.split(".").pop();return i.split("?")[0]}(e.url)&&(e.gbkURL=e.url,delete e.url));if(e.hubURL||e.url&&Mt(e.url)&&e.url.endsWith("/hub.txt")){t=(await du.loadHub(e.hubURL||e.url,e)).getGenomeConfig()}else t=Mt(e)||!(e.url||e.fastaURL||e.twoBitURL||e.gbkURL)?await mu.expandReference(this.alert,e):e;let i;await this.loadReference(t),i=t.gbkURL||"gbk"===t.format?[{name:"Annotations",format:"gbk",url:t.gbkURL}]:t.tracks||[];return 0===i.filter((e=>"sequence"===e.type)).length&&i.push({type:"sequence",order:Wd}),await this.loadTrackList(i),await this.updateViews(),this.genome}async loadTrackHub(e){const t=mA((await du.loadHub(e.url,e)).getGenomeConfig());return this.loadGenome(t)}updateUIWithReferenceFrameList(){const e=this.referenceFrameList;this.isMultiLocusWholeGenomeView()||mu.isWholeGenomeView(e[0].chr),yy(this,this.$navigation.width()),pA(this.trackViews,this.doShowTrackLabels),this.doShowCenterLine&&mu.isWholeGenomeView(e[0].chr)&&this.centerLineButton.boundMouseClickHandler(),this.doShowCursorGuide&&mu.isWholeGenomeView(e[0].chr)&&this.cursorGuideButton.boundMouseClickHandler(),this.setCenterLineAndCenterLineButtonVisibility(mu.isWholeGenomeView(e[0].chr))}setCenterLineAndCenterLineButtonVisibility(e){e?this.centerLineButton.setVisibility(!e):this.centerLineButton.setVisibility(this.config.showCenterGuideButton);for(let t of this.centerLineList)e?this.setCenterLineVisibility(!e):this.setCenterLineVisibility(this.doShowCenterLine)}setTrackLabelVisibility(e){pA(this.trackViews,e)}setROITableVisibility(e){!0===e?this.roiManager.presentTable():this.roiManager.dismissTable()}setCursorGuideVisibility(e){e?this.cursorGuide.show():this.cursorGuide.hide()}setCustomCursorGuideMouseHandler(e){this.cursorGuide.customMouseHandler=e}setCenterLineVisibility(e){for(let t of this.centerLineList)!0===e?(t.show(),t.repaint()):t.hide()}async loadTrackList(e){let t=0;for(let i of e)void 0===i.order&&(i.order=t++);const i=[];for(let t of e)i.push(this._loadTrack(t));const n=await Promise.all(i);return this.trackViews.filter((function(e){return e.track.autoscaleGroup})).length>0&&this.updateViews(),n}async loadTrack(e){e.sync=!1!==e.sync;const t=this._loadTrack(e);return t&&e.autoscaleGroup&&(await t,this.updateViews()),t}async _loadTrack(e){Mt(e)&&(e=JSON.parse(e));try{if(e.hidden){const t=Ad(e,this.genome);return void await t.getFeatures({chr:"1",start:0,end:Number.MAX_SAFE_INTEGER})}const t=await this.createTrack(e);if("sampleinfo"===e.type)return void this.layoutChange();if(void 0===t)return;return this.addTrack(e,t)}catch(t){let i=t.message||t.error||t.toString();const n={401:"Access unauthorized",403:"Access forbidden",404:"Not found"};n.hasOwnProperty(i)&&(i=n[i]),i=`${i} : ${Ht(e.url)?e.url.name:e.url}`;const r=new Error(i);throw console.error(r),r}}async addTrack(e,t){void 0===t.order&&(t.order=this.trackViews.length);const i=new hf(this,this.columnContainer,t);if(this.trackViews.push(i),pA(this.trackViews,this.doShowTrackLabels),"function"==typeof t.postInit)try{i.startSpinner(),await t.postInit()}finally{i.stopSpinner()}return t.autoscaleGroup||(e.sync?await i.updateViews():i.updateViews()),"function"==typeof t.hasSamples&&t.hasSamples()&&(this.sampleInfo.hasAttributes()&&this.sampleInfoControl.setButtonVisibility(!0),!1!==this.config.showSampleNameButton&&this.sampleNameControl.show()),this.reorderTracks(),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),this.multiTrackSelectButton.setMultiTrackSelection(this.multiTrackSelectButton.enableMultiTrackSelection),t}async loadROI(e){return this.roiManager.loadROI(e,this.genome)}clearROIs(){this.roiManager.clearROIs()}async getUserDefinedROIs(){if(this.roiManager){const e=this.roiManager.getUserDefinedROISet();if(void 0===e)return[];const t=await e.getAllFeatures(),i=[];for(let e of Object.values(t))i.push(...e);return i}return[]}getRulerTrackView(){const e=this.trackViews.filter((({track:e})=>"ruler"===e.id));return e.length>0?e[0]:void 0}async createTrack(e){let t=await async function(e){return"function"==typeof e?e():e}
59
+ /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(e.url||e.fastaURL);if(Mt(t)&&(t=t.trim()),t)if(e.format)e.format=e.format.toLowerCase();else if(e.fastaURL)e.format="fasta";else if(e.sourceType)"htsget"===e.sourceType&&await Rh.inferFormat(e);else{const t=await om(e);t&&(e.format=t)}e.type&&Pa(e);let i=e.type?e.type.toLowerCase():void 0;if(!i){if(!e.format)throw Error(`Unrecognized track: ${JSON.stringify(e)}`);if("hic"===e.format){const t=new Mf(e);if(await t.readHeaderAndFooter(),!t.chromosomeIndexMap.celltype)throw Error("'.hic' files not supported");i="shoebox",e._hicFile=t}else if(i=Ha(e.format),"bedtype"===i){const t=Ad(e,this.genome);e._featureSource=t;const n=await t.trackType();i=n||"annotation"}e.type=i}if(this.trackDefaults&&i){const t=this.trackDefaults[i];if(t)for(let i in t)t.hasOwnProperty(i)&&void 0===e[i]&&(e[i]=t[i])}const n=function(e,t,i){let n;switch(e){case"annotation":case"genes":case"fusionjuncspan":case"snp":n="feature";break;case"seg":case"maf":case"mut":n="seg";break;case"junctions":case"splicejunctions":n="junction";break;default:n=e}return fy.has(n)?fy.get(n)(t,i):void 0}(i,e,this);if(void 0!==n)return e.roi&&e.roi.length>0&&(n.roiSets=e.roi.map((e=>new Xy(e,this.genome)))),n;this.alert.present(new Error(`Error creating track. Could not determine track type for file: ${e.url||e}`),void 0)}reorderTracks(){this.trackViews.sort((function(e,t){const i=e=>"ideogram"===e.track.id?1:"ruler"===e.track.id?2:3,n=i(e),r=i(t);if(n===r){return(e.track.order||0)-(t.track.order||0)}return n-r}));for(let{axis:e,viewports:t,sampleInfoViewport:i,sampleNameViewport:n,outerScroll:r,dragHandle:s,gearContainer:o}of this.trackViews){e.remove();for(let{$viewport:e}of t)e.detach();i.viewport.remove(),n.viewport.remove(),r.remove(),s.remove(),o.remove()}const e=this.columnContainer.querySelectorAll(".igv-column");for(let{axis:t,viewports:i,sampleInfoViewport:n,sampleNameViewport:r,outerScroll:s,dragHandle:o,gearContainer:a}of this.trackViews){this.columnContainer.querySelector(".igv-axis-column").appendChild(t);for(let t=0;t<e.length;t++){const{$viewport:n}=i[t];e[t].appendChild(n.get(0))}this.columnContainer.querySelector(".igv-sample-info-column").appendChild(n.viewport),this.columnContainer.querySelector(".igv-sample-name-column").appendChild(r.viewport),this.columnContainer.querySelector(".igv-scrollbar-column").appendChild(s),this.columnContainer.querySelector(".igv-track-drag-column").appendChild(o),this.columnContainer.querySelector(".igv-gear-menu-column").appendChild(a)}}getTrackOrder(){return this.trackViews.filter((e=>e.track&&e.track.name)).map((e=>e.track.name))}getSelectedTrackViews(){return this.trackViews.filter((e=>!0===e.track.selected))}removeTrackByName(e){const t=this.trackViews.slice();for(let i of t)e===i.track.name&&this.removeTrack(i.track)}removeTrack(e){for(let t of this.trackViews)if(e===t.track){this._removeTrack(t.track);break}}_removeTrack(e){e.disposed||(this.trackViews.splice(this.trackViews.indexOf(e.trackView),1),this.fireEvent("trackremoved",[e]),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),e.trackView&&e.trackView.dispose())}removeAllTracks(){const e=this.trackViews;this.trackViews=[];for(let t of e)"ruler"!==t.track.id&&"ideogram"!==t.track.id?(this.fireEvent("trackremoved",[t.track]),t.dispose()):this.trackViews.push(t)}get ideogramTrackView(){return this.trackViews[0]}get rulerTrackView(){return this.trackViews[1]}findTracks(e,t){let i="function"==typeof e?t=>e(t.track):i=>t===i.track[e];return this.trackViews.filter(i).map((e=>e.track))}get tracks(){return this.trackViews.map((e=>e.track)).filter((e=>void 0!==e))}setTrackHeight(e){this.trackHeight=e,this.trackViews.forEach((function(t){t.setTrackHeight(e)}))}async visibilityChange(){this.layoutChange()}async layoutChange(){if(this.referenceFrameList.find((e=>e.bpPerPixel<0))){const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel=(t.end-t.start)/e}this.referenceFrameList&&(this.isMultiLocusWholeGenomeView()||mu.isWholeGenomeView(this.referenceFrameList[0].chr),yy(this,this.$navigation.width())),hA.call(this),await this.updateViews()}async updateViews(){const e=this.trackViews;this.updateLocusSearchWidget();for(let e of this.referenceFrameList)e.bpPerPixel<=10&&await this.genome.getSequence(e.chr,e.start,e.start+1);for(let e of this.centerLineList)e.repaint();if(this.dragObject)for(let t of e)await t.updateViews();else{const t={},i=[];for(const n of e)if(n.track.autoscaleGroup){const e=n.track.autoscaleGroup;t[e]||(t[e]=[]),t[e].push(n)}else i.push(n);if(Object.entries(t).length>0)for(const[e,i]of Object.entries(t)){const e=await Promise.all(i.map((e=>e.getInViewFeatures()))),t=Qa(e.flat());for(const e of i)e.track.dataRange=Object.assign({},t),e.track.autoscale=!1;await Promise.all(i.map((e=>e.updateViews())))}await Promise.all(i.map((e=>e.updateViews())))}}repaintViews(){for(let e of this.trackViews)e.repaintViews()}updateLocusSearchWidget(){if(!this.referenceFrameList)return;const e=this.referenceFrameList,t=this.calculateViewportWidth(this.referenceFrameList.length);for(let i of e)i.end=i.start+i.bpPerPixel*t;this.chromosomeSelectWidget&&(this.chromosomeSelectWidget.select.value=1===e.length?this.referenceFrameList[0].chr:"");const i=this.referenceFrameList.map((e=>e.getLocusString())).join(" ");this.$searchInput.val(i),this.fireEvent("locuschange",[this.referenceFrameList])}calculateViewportWidth(e){let{width:t}=this.columnContainer.getBoundingClientRect();return t-=50+this.getSampleInfoViewportWidth()+this.getSampleNameViewportWidth()+14+12+28,t-=5*(e-1),Math.floor(t/e)}minimumBases(){return this.config.minimumBases}zoomIn(){this.zoomWithScaleFactor(.5)}zoomOut(){this.zoomWithScaleFactor(2)}async zoomWithScaleFactor(e,t,i){if(!this.referenceFrameList)return;const n=this.calculateViewportWidth(this.referenceFrameList.length);let r=i?[i]:this.referenceFrameList;for(let i of r)i.zoomWithScaleFactor(this,e,n,t)}async addMultiLocusPanel(e,t,i,n){if(!this.referenceFrameList)return;const r=this.calculateViewportWidth(1+this.referenceFrameList.length),s=this.calculateViewportWidth(this.referenceFrameList.length)/this.calculateViewportWidth(1+this.referenceFrameList.length);for(let e of this.referenceFrameList)e.bpPerPixel*=s;const o=(i-t)/r,a=new my(this.genome,e,t,i,o),c=n?this.referenceFrameList.indexOf(n):this.referenceFrameList.length-1,l=1+c,{$viewport:h}=this.trackViews[0].viewports[c],d=zy(h.get(0).parentElement);if(this.fireEvent("didchangecolumnlayout"),l===this.referenceFrameList.length){this.referenceFrameList.push(a);for(let e of this.trackViews){const t=zu(e,d,a);e.viewports.push(t)}}else{this.referenceFrameList.splice(l,0,a);for(let e of this.trackViews){const t=zu(e,d,a);e.viewports.splice(l,0,t)}}this.centerLineList=this.createCenterLineList(this.columnContainer),hA.call(this),await this.updateViews(!0)}createCenterLineList(e){const t=e.querySelectorAll(".igv-center-line");for(let e=0;e<t.length;e++)t[e].remove();const i=[],n=e.querySelectorAll(".igv-column");for(let e=0;e<n.length;e++)i.push(new Py(this,this.referenceFrameList[e],n[e]));return i}async removeMultiLocusPanel(e){const t=this.referenceFrameList.indexOf(e),{$viewport:i}=this.trackViews[0].viewports[t];Ly(t,i.parent().get(0)),this.fireEvent("didchangecolumnlayout");for(let{viewports:e}of this.trackViews)e[t].dispose(),e.splice(t,1);if(this.referenceFrameList.splice(t,1),1===this.referenceFrameList.length&&this.getRulerTrackView())for(let e of this.getRulerTrackView().viewports)e.dismissLocusLabel();const n=this.calculateViewportWidth(1+this.referenceFrameList.length)/this.calculateViewportWidth(this.referenceFrameList.length);await this.rescaleForMultiLocus(n)}async gotoMultilocusPanel(e){const t=this.referenceFrameList.indexOf(e);this.columnContainer.querySelectorAll(".igv-column").forEach(((e,i)=>{i===t||e.remove()})),this.columnContainer.querySelectorAll(".igv-column-shim").forEach((e=>e.remove()));for(let e of this.trackViews){const i=e.viewports[t];e.viewports.filter(((e,i)=>i!==t)).forEach((e=>e.dispose())),e.viewports=[i]}const i=this.calculateViewportWidth(1);e.bpPerPixel=(e.end-e.start)/i,this.referenceFrameList=[e],this.trackViews.forEach((({viewports:e})=>e.forEach((e=>e.setWidth(i))))),this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}async rescaleForMultiLocus(e){const t=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel*=e;for(let{viewports:e}of this.trackViews)for(let i of e)i.setWidth(t);this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews()}async goto(e,t,i){await this.search(e+":"+t+"-"+i)}async doSearch(e,t){const i=await this.search(e,t);return i||this.alert.present(new Error(`Unrecognized locus: <b> ${e} </b>`)),i}async search(e,t){const i=await async function(e,t){if(void 0===t||""===t.trim())return;const i=t.split(" ");let n=[];const r=async t=>{if("all"===t.trim().toLowerCase()||"*"===t)return e.genome.wholeGenomeView?{chr:"all",start:0,end:e.genome.getChromosome("all").bpLength}:void 0;let i,n;if(t.includes(":")&&(i=Jv(t,e.isSoftclipped()),i&&(n=await e.genome.loadChromosome(i.chr))),!n){i=void 0;const r=await Zv(e,t);r&&(i={chr:r.chr,start:r.start,end:r.end,name:(r.name||t).toUpperCase()}),i||(n=await e.genome.loadChromosome(t),n&&(i={chr:n.name}))}return i&&(n=n||await e.genome.loadChromosome(i.chr),i.chr=n.name,void 0===i.start&&void 0===i.end&&(i.start=0,i.end=n.bpLength)),i};for(let e of i){const t=await r(e);t&&n.push(t)}if(0===n.length){const e=await r(t.replaceAll(" ","+"));e&&n.push(e)}return 0===n.length?void 0:n}(this,e);if(i&&i.length>0){this.referenceFrameList=function(e,t,i,n,r,s){return e.map((e=>{const o=Object.assign({},e);if(i&&o.name&&(o.start=Math.max(0,o.start-i),o.end+=i),!s){const e=t.getChromosome(o.chr);Va(e.bpLength,o,n)}return new my(t,o.chr,o.start,o.end,(o.end-o.start)/r)}))}(i,this.genome,this.flanking,this.minimumBases(),this.calculateViewportWidth(i.length),this.isSoftclipped());for(let e of this.trackViews)e.removeViewportsFromColumnContainer();this.columnContainer.querySelectorAll(".igv-column-shim, .igv-column").forEach((e=>e.remove())),Hy(this.columnContainer.querySelector(".igv-sample-info-column"),this.referenceFrameList.length),this.fireEvent("didchangecolumnlayout");for(let e of this.trackViews)e.createViewports(this,this.columnContainer,this.referenceFrameList);return this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),t||await this.updateViews(),!0}return!1}async loadSampleInfo(e){await this.sampleInfo.loadSampleInfoFile(e.url);for(const{sampleInfoViewport:e}of this.trackViews)e.setWidth(this.getSampleInfoColumnWidth());this.findTracks((e=>"function"==typeof e.getSamples)).length>0&&(this.sampleInfoControl.performClickWithState(this,!0),this.sampleInfoControl.setButtonVisibility(!0));for(const{sampleInfoViewport:e}of this.trackViews)e.repaint()}getSampleInfoColumnWidth(){if(this.sampleInfo.attributeCount){const e=this.findTracks((e=>"function"==typeof e.getSamples)).length>0,t=this.sampleInfo.hasAttributes(),i=this.sampleInfoControl.showSampleInfo;return e&&t&&i?this.sampleInfo.attributeCount*Vu+8:0}return 0}on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)}un(e,t){this.off(e,t)}off(e,t){if(e)if(t){const i=this.eventHandlers[e];if(i&&0!==i.length){const n=i.indexOf(t);-1!==n&&this.eventHandlers[e].splice(n,1)}else console.warn("No handlers to remove for event: "+e)}else this.eventHandlers[e]=[];else this.eventHandlers={}}fireEvent(e,t,i){const n=this.eventHandlers[e];if(void 0===n||0===n.length)return;const r=i||window;return n.map((function(e){return e.apply(r,t)}))[0]}dispose(){this.removeEventHandlers();for(let e of this.trackViews)e.dispose();this.roiManager&&this.roiManager.dispose()}toJSON(){const e={version:"3.0.5"};if(void 0!==this.showSampleNames&&(e.showSampleNames=this.showSampleNames),this.sampleNameViewportWidth&&(e.sampleNameViewportWidth=this.sampleNameViewportWidth),e.reference=this.genome.toJSON(),e.reference.fastaURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.fastaURL.name}.`);if(e.reference.indexURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.indexURL.name}.`);const t=[];let i=this.trackViews[0];for(let{referenceFrame:e}of i.viewports){const i=e.getLocusString();t.push(i)}e.locus=1===t.length?t[0]:t,e.roi=this.roiManager.toJSON(),this.qtlSelections.isEmpty()||(e.qtlSelections=this.qtlSelections.toJSON());const n=[],r=[];for(const{track:e}of this.trackViews)try{let t;"function"==typeof e.getState?t=Hl.localFileInspection(e.getState()):e.config&&(t=Hl.localFileInspection(e.config)),t&&(t.browser&&delete t.browser,t.order=e.order,n.push(t))}catch(t){const i=`Track: ${e.name}: ${t}`;console.error(i),r.push(i)}if(r.length>0){let e=1,t="Errors encountered saving session: </br>";for(let i of r)t+=` (${e++}) ${i.toString()} <br/>`;throw Error(t)}e.tracks=n;const s=[];for(const e of n)for(const t of Object.keys(e))"file"!==t&&"indexFile"!==t||s.push(e[t]);const o=[];if(this.sampleInfo.sampleInfoFiles.length>0){const t=this.sampleInfo.toJSON();t.length>0&&(e.sampleinfo=t);for(const e of this.sampleInfo.sampleInfoFiles){const t=Hl.localFileInspection({url:e});t.file&&o.push(t.file)}o.length>0&&s.push(...o)}return s.length>0&&alert(`This session includes reference(s) to local file(s):\n${s.map((e=>` ${e}`)).join("\n")}\nLocal files cannot be loaded automatically when a saved session is restored.`),e}compressedSession(){return function(e){const t=new Uint8Array(e.length);for(var i=0;i<e.length;i++)t[i]=e.charCodeAt(i);const n=new cs(t),r=String.fromCharCode.apply(null,n);return btoa(r).replace(/\+/g,".").replace(/\//g,"_").replace(/=/g,"-")}(JSON.stringify(this.toJSON()))}sessionURL(){const e=window.location.href.slice(),t=e.indexOf("?");return(t>0?e.substring(0,t):e)+"?sessionURL=blob:"+this.compressedSession()}mouseDownOnViewport(e,t){var i;i=r(e),this.vpMouseDown={viewport:t,lastMouseX:i.x,mouseDownX:i.x,lastMouseY:i.y,mouseDownY:i.y,referenceFrame:t.referenceFrame}}cancelTrackPan(){const e=this.dragObject;this.dragObject=void 0,this.isScrolling=!1,this.vpMouseDown=void 0,e&&e.viewport.referenceFrame.start!==e.start&&(this.updateViews(),this.fireEvent("trackdragend",[e.viewport]))}isTrackPanning(){return this.dragObject}isSoftclipped(){return void 0!==this.trackViews.find((e=>!0===e.track.showSoftClips))}startTrackDrag(e){this.dragTrack=e}updateTrackDrag(e){if(e&&this.dragTrack){const t=this.dragTrack,i=this.trackViews.indexOf(e),n=this.trackViews.indexOf(t),r=this.trackViews;r[i]=t,r[n]=e;const s=this.trackViews[i].track.order;this.trackViews[n].track.order=s;const o=r.length;let a=s;if(i<n)for(let e=i+1;e<o;e++){const t=r[e].track;if(!(t.order<=a))break;t.order=Math.min(Number.MAX_SAFE_INTEGER,a+1),a=t.order}else for(let e=i-1;e>0;e--){const t=r[e].track;if(!(t.order>=a))break;t.order=Math.max(-Number.MAX_SAFE_INTEGER,a-1),a=t.order}this.reorderTracks()}}endTrackDrag(){this.dragTrack?(this.dragTrack=void 0,this.fireEvent("trackorderchanged",[this.getTrackOrder()])):this.dragTrack=void 0}addEventHandlers(){this.addWindowResizeHandler(),this.addRootMouseUpHandler(),this.addRootMouseLeaveHandler(),this.addColumnContainerEventHandlers(),this.addKeyboardHandler()}removeEventHandlers(){this.removeWindowResizeHandler(),this.removeRootMouseUpHandler(),this.removeRootMouseLeaveHandler(),this.removeColumnContainerEventHandlers(),this.removeKeyboardHandler()}addWindowResizeHandler(){this.boundWindowResizeHandler=hA.bind(this),window.addEventListener("resize",this.boundWindowResizeHandler)}removeWindowResizeHandler(){window.removeEventListener("resize",this.boundWindowResizeHandler)}addRootMouseUpHandler(){this.boundRootMouseUpHandler=uA.bind(this),this.root.addEventListener("mouseup",this.boundRootMouseUpHandler)}removeRootMouseUpHandler(){this.root.removeEventListener("mouseup",this.boundRootMouseUpHandler)}addRootMouseLeaveHandler(){this.boundRootMouseLeaveHandler=uA.bind(this),this.root.addEventListener("mouseleave",this.boundRootMouseLeaveHandler)}removeRootMouseLeaveHandler(){this.root.removeEventListener("mouseleave",this.boundRootMouseLeaveHandler)}addColumnContainerEventHandlers(){this.boundColumnContainerMouseMoveHandler=dA.bind(this),this.boundColumnContainerTouchMoveHandler=dA.bind(this),this.boundColumnContainerMouseLeaveHandler=uA.bind(this),this.boundColumnContainerMouseUpHandler=uA.bind(this),this.boundColumnContainerTouchEndHandler=uA.bind(this),this.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.addEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.addEventListener("touchend",this.boundColumnContainerTouchEndHandler)}removeColumnContainerEventHandlers(){this.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.removeEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.removeEventListener("touchend",this.boundColumnContainerTouchEndHandler)}addKeyboardHandler(){this.keyUpHandler=fA.bind(this),document.addEventListener("keyup",this.keyUpHandler)}removeKeyboardHandler(){console.log("Remove handler"),document.addEventListener("keyup",this.keyUpHandler)}static uncompressSession(e){let t;if(e.indexOf("/gzip;base64")>0){t=vs(e);let i="";for(let e of t)i+=String.fromCharCode(e);return i}return function(e){e=e.replace(/\./g,"+").replace(/_/g,"/").replace(/-/g,"=");const t=atob(e),i=[];for(let e=0;e<t.length;e++)i.push(t.charCodeAt(e));const n=hs(i);let r="";for(let e of n)r+=String.fromCharCode(e);return r}(e.substring(5))}createCircularView(e,t){var i;return t=!0===t,this.circularView=(i=this,new Nm(e,{onChordClick:(e,t,n)=>{const r=e.data,s=r.mate;function o(e){e.chr=i.genome.getChromosomeName(e.refName);let t=!1;for(let n of i.referenceFrameList){const i=cm.fromLocusString(n.getLocusString());if(i.contains(e)){t=!0;break}if(i.overlaps(e)){n.extend(e),t=!0;break}}if(!t){const t=2e3,n=(e.start+e.end)/2;i.addMultiLocusPanel(e.chr,n-t,n+t)}}o(r),o(s)}})),this.circularViewControl=new Oy(this.$toggle_button_container.get(0),this),this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:zm(this.genome)}),this.circularViewVisible=t,this.circularView}get circularViewVisible(){return void 0!==this.circularView&&this.circularView.visible}set circularViewVisible(e){this.circularView&&(this.circularView.visible=e,this.circularViewControl.setState(e))}}async function hA(){if(!this.referenceFrameList)return;const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList){const i=this.referenceFrameList.indexOf(t),{chr:n,genome:r}=t,{bpLength:s}=r.getChromosome(t.chr),o=t.toBP(e);mu.isWholeGenomeView(n)||o>s?t.bpPerPixel=s/e:t.end=t.start+t.toBP(e);for(let{viewports:t}of this.trackViews)t[i].setWidth(e)}this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}function dA(e){e.preventDefault();const{x:t,y:i}=r(e);if(this.vpMouseDown){const{viewport:e,referenceFrame:n}=this.vpMouseDown,r=Math.abs(t-this.vpMouseDown.mouseDownX)>Math.abs(i-this.vpMouseDown.mouseDownY);if(!this.dragObject&&!this.isScrolling)if(r)this.vpMouseDown.mouseDownX&&Math.abs(t-this.vpMouseDown.mouseDownX)>this.constants.dragThreshold&&(this.dragObject={viewport:e,start:n.start});else if(this.vpMouseDown.mouseDownY&&Math.abs(i-this.vpMouseDown.mouseDownY)>this.constants.scrollThreshold){this.isScrolling=!0;const t=e.$viewport.height(),i=e.trackView.maxViewportContentHeight();this.vpMouseDown.r=t/i}if(this.dragObject){const i=!this.isSoftclipped();let r=this.vpMouseDown.lastMouseX-t;n.shiftPixels(r,e.$viewport.width(),i)&&this.updateViews(),this.fireEvent("trackdrag")}if(this.isScrolling){const t=this.vpMouseDown.r*(this.vpMouseDown.lastMouseY-i);e.trackView.moveScroller(t)}this.vpMouseDown.lastMouseX=t,this.vpMouseDown.lastMouseY=i}}function uA(e){this.cancelTrackPan(),this.endTrackDrag()}async function fA(e){if(!(this.referenceFrameList.length>1||"KeyF"!==e.code&&"KeyB"!==e.code)){const t=this.getSelectedTrackViews();if(t.length>0){const i=t[0].track;if("function"==typeof i.nextFeatureAfter){const t=this.referenceFrameList[0],n=t.viewport?t.viewport.getWidth():this.calculateViewportWidth(this.referenceFrameList.length),r="all"===t.chr.toLowerCase(),s=i.visibilityWindow;if(r||s&&s>0&&t.bpPerPixel*n>s)return;const o="KeyF"===e.code,a=t.chr,c=t.center,l=await i.nextFeatureAfter(a,c,o);if(l){const i=await this.genome.getChromosomeName(l.chr);if(a===i){const i=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,r=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,i-r/2),t.end=i+r/2,t.bpPerPixel=(t.end-t.start)/n}else t.shift(i-c);this.updateViews()}else{t.chr=i;const r=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,i=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,r-i/2),t.end=t.start+i,t.bpPerPixel=(t.end-t.start)/n}else t.start=r-n*t.bpPerPixel/2,t.end=t.start+n*t.bpPerPixel;this.updateViews()}}}}}}function pA(e,t){for(let{viewports:i}of e)for(let e of i)e.$trackLabel&&(0===i.indexOf(e)&&!0===t?e.$trackLabel.show():e.$trackLabel.hide())}let gA=[];function mA(e){return void 0===e.minimumBases&&(e.minimumBases=40),void 0===e.showIdeogram&&(e.showIdeogram=!0),void 0===e.showCircularView&&(e.showCircularView=!1),void 0===e.showCircularViewButton&&(e.showCircularViewButton=!1),void 0===e.showTrackLabelButton&&(e.showTrackLabelButton=!0),void 0===e.showTrackLabels&&(e.showTrackLabels=!0),void 0===e.showCursorTrackingGuideButton&&(e.showCursorTrackingGuideButton=!0),void 0===e.showCursorGuide&&(e.showCursorGuide=e.showCursorTrackingGuide||!1),void 0===e.showCenterGuideButton&&(e.showCenterGuideButton=!0),void 0===e.showCenterGuide&&(e.showCenterGuide=!1),void 0===e.showSampleNames&&(e.showSampleNames=!1),void 0===e.showSVGButton&&(e.showSVGButton=!0),void 0===e.showControls&&(e.showControls=!0),void 0===e.showNavigation&&(e.showNavigation=!0),void 0===e.showRuler&&(e.showRuler=!0),void 0===e.flanking&&(e.flanking=1e3),void 0===e.pairsSupported&&(e.pairsSupported=!0),e.tracks||(e.tracks=[]),e}const wA=Qs.setApiKey;const bA=Qs.oauth;var FA={TrackUtils:Oa,IGVGraphics:xo,MenuUtils:bo,DataRangeDialog:_o,createTrack:async function(e,t){return await lA.prototype.createTrack.call(t,e)},createBrowser:async function(e,t){void 0===t&&(t={}),mu.KNOWN_GENOMES||await mu.initializeGenomes(t),mA(t),t.queryParametersSupported&&function(e){var t,i,n,r,s,o,a,c,l;let h,d,u;if(a=window.location.href,s={},t=a.indexOf("?"),i=a.lastIndexOf("#"),t>=0)for(i<0&&(i=a.length),n=t+1;n<i;)(r=a.indexOf("&",n))<0&&(r=i),2===(o=a.substring(n,r).split("=",2)).length?(c=o[0],l=decodeURIComponent(o[1]),"file"===c?h=l.split(","):"index"===c?d=l.split(","):"name"===c?u=l.split(","):"genome"===c?!l.startsWith("https://")&&!l.startsWith("http://")||l.endsWith(".json")?(e[c]=l,e.reference=void 0):e.reference={fastaURL:l,indexURL:l+".fai"}:("reference"===c&&(e.genome=void 0),e[c]=l),n=r+1):n++;if(h){e.tracks||(e.tracks=[]);for(let t=0;t<h.length;t++){if(h[t].endsWith(".xml")||h[t].endsWith(".json")){e.sessionURL=h[t];break}const i={url:h[t]};d&&d.length>t&&(i.indexURL=d[t]),u&&u.length>t&&(i.name=u[t]),e.tracks.push(i)}}}(t),t.apiKey&&Qs.setApiKey(t.apiKey),t.oauthToken&&Qs.setOauthToken(t.oauthToken),t.clientId&&!Ts()&&await async function(e){if(!google.accounts.oauth2.initTokenClient)throw new Error("Google accounts token client not loaded (https://accounts.google.com/gsi/client)");if(Ts())throw new Error("Google client is already initialized");const t={client_id:e.client_id||e.clientId,scope:e.scope||"https://www.googleapis.com/auth/userinfo.profile",state:e.state||"igv",error:e=>{throw new Error(e.type)},hint:e.hint,hosted_domain:e.hosted_domain},i=google.accounts.oauth2.initTokenClient(t);google.igv={tokenClient:i,apiKey:e.apiKey}}({client_id:t.clientId,apiKey:t.apiKey,scope:"https://www.googleapis.com/auth/userinfo.profile"});const i=new lA(t,e);gA.push(i),i.startSpinner();const n=t.sessionURL||t.session||t.hubURL;return n?await i.loadSession({url:n}):await i.loadSessionObject(t),i.stopSpinner(),yy(i,i.$navigation.width()),i},removeBrowser:function(e){e.dispose(),e.root.remove(),gA=gA.filter((t=>t!==e))},removeAllBrowsers:function(){for(let e of gA)e.dispose(),e.root.remove();gA=[]},visibilityChange:async function(){for(let e of gA)await e.visibilityChange()},setGoogleOauthToken:function(e){return Qs.setOauthToken(e)},setOauthToken:function(e,t){return Qs.setOauthToken(e,t)},oauth:bA,version:wy,setApiKey:wA,TrackBase:Hl,registerTrackClass:function(e,t){fy.set(e,((e,i)=>new t(e,i)))},registerTrackCreatorFunction:function(e,t){fy.set(e,t)},registerFileFormats:function(e,t){Sl[e]={fields:t}},loadSessionFile:lA.loadSessionFile};export{FA as default};
60
60
  //# sourceMappingURL=igv.esm.min.js.map