(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[74],{2484:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return x}));var r=n(92),a=n(89),c=n.n(a),i=n(91),u=n(90),s=n(93),o=n(216),f=n(176),p=n(94),h=n(95),l=n(126),d=n(122),v=n(142),b=n(800),g=n(259),w=n.n(g),j=n(82),O=n(563),x=function(e){Object(p.a)(n,e);var t=Object(h.a)(n);function n(){var e;Object(u.a)(this,n);for(var r=arguments.length,a=new Array(r),c=0;c<r;c++)a[c]=arguments[c];return(e=t.call.apply(t,[this].concat(a))).configured=void 0,e}return Object(s.a)(n,[{key:"configure",value:function(){var e=Object(i.a)(c.a.mark((function e(){var t,n,r,a,i,u,s=this;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.configured||(t=Object(j.readConfObject)(this.config,"vcfGzLocation"),n=Object(j.readConfObject)(this.config,["index","location"]),r=Object(j.readConfObject)(this.config,["index","indexType"]),a=Object(d.openLocation)(t),i="CSI"===r,u=new b.TabixIndexedFile({filehandle:a,csiFilehandle:i?Object(d.openLocation)(n):void 0,tbiFilehandle:i?void 0:Object(d.openLocation)(n),chunkCacheSize:50*Math.pow(2,20),chunkSizeLimit:1e9}),this.configured=u.getHeader().then((function(e){return{filehandle:a,vcf:u,parser:new w.a({header:e})}})).catch((function(e){throw s.configured=void 0,e}))),e.abrupt("return",this.configured);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){var e=Object(i.a)(c.a.mark((function e(){var t,n,r,a=arguments;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},e.next=3,this.configure();case 3:return n=e.sent,r=n.vcf,e.abrupt("return",r.getReferenceSequenceNames(t));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=Object(i.a)(c.a.mark((function e(){var t,n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return t=e.sent,n=t.vcf,e.abrupt("return",n.getHeader());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getMetadata",value:function(){var e=Object(i.a)(c.a.mark((function e(){var t,n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return t=e.sent,n=t.parser,e.abrupt("return",n.getMetadata());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(v.ObservableCreate)(function(){var a=Object(i.a)(c.a.mark((function a(i){var u,s,o,f,p,h;return c.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return u=e.refName,s=e.start,o=e.end,a.next=3,t.configure();case 3:return f=a.sent,p=f.vcf,h=f.parser,a.next=8,p.getLines(u,s,o,Object(r.a)({lineCallback:function(e,n){i.next(new O.a({variant:h.parseLine(e),parser:h,id:"".concat(t.id,"-vcf-").concat(n)}))}},n));case 8:i.complete();case 9:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}(),n.signal)}},{key:"getFeaturesInMultipleRegions",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=Object(o.a)(Object(f.a)(n.prototype),"getFeaturesInMultipleRegions",this);return Object(v.ObservableCreate)(function(){var n=Object(i.a)(c.a.mark((function n(i){var u,s,o,f,p;return c.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.bytesForRegions(e);case 2:return u=n.sent,n.next=5,t.configure();case 5:return s=n.sent,o=s.filehandle,n.next=9,o.stat();case 9:f=n.sent,(p=Math.round(u/f.size*100))>100&&(p=100),p>60&&console.warn("getFeaturesInMultipleRegions fetching ".concat(p,"% of VCF file, but whole-file streaming not yet implemented")),a.call(t,e,r).subscribe(i);case 14:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())}},{key:"bytesForRegions",value:function(){var e=Object(i.a)(c.a.mark((function e(t){var n,r,a,i;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return n=e.sent,r=n.vcf,e.next=6,Promise.all(t.map((function(e){return r.index.blocksForRange(e.refName,e.start,e.end)})));case 6:return a=e.sent,i=[],a.forEach((function(e){e.forEach((function(e){var t=e.minv.blockPosition,n=e.maxv.blockPosition+64e3;i.find((function(e){return e.start<=n&&e.end>=t&&(e.start=Math.min(e.start,t),e.end=Math.max(e.end,n),!0)}))||i.push({start:t,end:n})}))})),e.abrupt("return",i.reduce((function(e,t){return e+t.end-t.start+1}),0));case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"freeResources",value:function(){}}]),n}(l.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=74.a00216ac.chunk.js.map