"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9756],{49756:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var s=a(46377),r=a(99546),n=a(66885),o=a(37347),i=a(44728),c=a(82088);class l extends s.BaseFeatureDataAdapter{gcMode="content";static capabilities=["hasLocalStats"];async configure(){const e=await(this.getSubAdapter?.(this.getConf("sequenceAdapter")));if(!e)throw new Error("Error getting subadapter");return e.dataAdapter}async getRefNames(e){return(await this.configure()).getRefNames(e)}getFeatures(e,t){const{statusCallback:a=()=>{},stopToken:s}=t||{};return(0,n.ObservableCreate)((async n=>{const l=await this.configure(),u=this.getConf("windowSize"),g=this.getConf("windowDelta"),w=1===u?1:Math.ceil(u/2),d=1===u,h=Math.max(0,Math.floor((e.start-w)/u)*u),f=Math.ceil((e.end+w)/u)*u;if(f<0||h>f)return void n.complete();const p=await(0,i._)(l.getFeatures({...e,start:h,end:f},t).pipe((0,c.$)())),b=p[0]?.get("seq")||"";let m=performance.now();await(0,r.updateStatus)("Calculating GC",a,(()=>{for(let t=w;t<b.length-w;t+=g){performance.now()-m>400&&((0,o.SW)(s),m=performance.now());const a=d?b[t]:b.slice(t-w,t+w);let i=0,c=0,l=0;for(const e of a)"c"===e||"C"===e?i++:"g"!==e&&"G"!==e||c++,"N"!==e&&l++;const u=h,f="content"===this.gcMode?(c+i)/(l||1):"skew"===this.gcMode?(c-i)/(c+i||1):0;n.next(new r.SimpleFeature({uniqueId:`${this.id}_${u+t}`,refName:e.refName,start:u+t,end:u+t+g,score:f}))}})),n.complete()}))}}}}]);
//# sourceMappingURL=9756.43b2bc5c.chunk.js.map