"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[5312],{75312:(t,e,a)=>{a.r(e),a.d(e,{default:()=>h});var s=a(46377),n=a(66885),r=a(6514),o=a(99546),i=a(99834),c=a(35451);class u{constructor(t){this.filehandle=t}async read(t,e){const{buffer:a}=await this.filehandle.read(c.hp.alloc(e),0,e,t);return a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)}}function l(t,e){return new u((0,i.openLocation)(t,e))}class h extends s.BaseFeatureDataAdapter{constructor(t,e,a){super(t,e,a),this.hic=new r.A({file:l(this.getConf("hicLocation"),this.pluginManager)})}async setup(t){const{statusCallback:e=()=>{}}=t||{};return(0,o.updateStatus)("Downloading .hic header",e,(()=>this.hic.getMetaData()))}async getHeader(t){const{chromosomes:e,...a}=await this.setup(t);return{...a,norms:await this.hic.getNormalizationOptions()}}async getRefNames(t){return(await this.setup(t)).chromosomes.map((t=>t.name))}async getResolution(t,e){const{resolutions:a}=await this.setup(e),s=this.getConf("resolutionMultiplier");let n=a.at(-1);for(let e=a.length-1;e>=0;e-=1){const r=a[e];r<=2*t*s&&(n=r)}return n}getFeatures(t,e={}){return(0,n.ObservableCreate)((async a=>{const{refName:s,start:n,end:r}=t,{resolution:i,normalization:c="KR",bpPerPx:u=1,statusCallback:l=()=>{}}=e,h=await this.getResolution(u/(i||1e3),e);await(0,o.updateStatus)("Downloading .hic data",l,(async()=>{const t=await this.hic.getContactRecords(c,{start:n,chr:s,end:r},{start:n,chr:s,end:r},"BP",h);for(const e of t)a.next(e)})),a.complete()}),e.signal)}async getMultiRegionFeatureDensityStats(t){return{featureDensity:0}}freeResources(){}}}}]);
//# sourceMappingURL=5312.e12a50e3.chunk.js.map