"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2820],{12820:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var s=n(99834),o=n(7706),i=n(35904);const c="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;class l extends i.default{async setupPre(e){const t=(0,s.openLocation)(this.getConf("deltaLocation"),this.pluginManager),n=await t.readFile(e);return function(e){let t="",n="",s=0,o=0,i=0,l=0,a=0,r=0,h=[],u=0,f=0,d=!1;const g=[],p=new RegExp(/^>(\S+)\s+(\S+)\s+(\d+)\s+(\d+)/);let w=0,b=0;for(;w<e.length;){const x=e.indexOf("\n",w);if(-1===x)break;const k=e.slice(w,x),m=(c?.decode(k)||k.toString()).trim();if(w=x+1,b++,m){const e=p.exec(m);if(null!==e){t=e[1],n=e[2],d=!0;continue}if(!d)continue;const c=m.split(" ");if(7===c.length){const e=+c[0],t=+c[1],n=+c[2],d=+c[3];a=e<t&&n<d||e>t&&n>d?1:-1,i=+(e<t?e:t)-1,l=+(t>e?t:e),s=+(n<d?n:d)-1,o=+(d>n?d:n),u=f=0,r=+c[4],h=[]}else if(1===c.length){const e=+c[0];if(0===e){let e=0;const c=[];if(l-i-u!=o-s-f)throw new Error(`inconsistent alignment on line ${b}`);h.push(l-i-u<<4);for(const t of h){const n=t>>4;e+=n,c.push(n+"MID".charAt(15&h[b]))}g.push({qname:n,qstart:s,qend:o,tname:t,tstart:i,tend:l,strand:a,extra:{numMatches:e-r,blockLen:e,mappingQual:0,NM:r,cg:c.join("")}})}else if(e>0){const t=e-1;u+=t+1,f+=t,t>0&&h.push(t<<4),h.length>0&&2==(15&h[h.length-1])?h[h.length-1]+=16:h.push(18)}else{const t=-e-1;u+=t,f+=t+1,t>0&&h.push(t<<4),h.length>0&&1==(15&h[h.length-1])?h[h.length-1]+=16:h.push(17)}}}}return g}(31===(i=n)[0]&&139===i[1]&&8===i[2]?await(0,o.unzip)(n):n);var i}}}}]);
//# sourceMappingURL=2820.015fef0f.chunk.js.map