"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[298],{30298:function(e,n,t){t.r(n),t.d(n,{default:function(){return k}});var r=t(33028),a=t(32723),u=t(34795),i=t(9249),c=t(87371),s=t(93069),o=t(95058),f=t(45754),p=t(13820),h=t(82972),l=t(32145),v=t(42054),d=t(93824),g=t(7704),Z=t(70899),w=t(4174),k=function(e){(0,f.Z)(t,e);var n=(0,p.Z)(t);function t(){var e;(0,i.Z)(this,t);for(var r=arguments.length,a=new Array(r),u=0;u<r;u++)a[u]=arguments[u];return(e=n.call.apply(n,[this].concat(a))).configured=void 0,e}return(0,c.Z)(t,[{key:"configurePre",value:function(){var e=(0,u.Z)((0,a.Z)().mark((function e(){var n,t,r,u,i,c,s,o;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.pluginManager,t=this.getConf("vcfGzLocation"),r=this.getConf(["index","location"]),u=this.getConf(["index","indexType"]),i=(0,l.openLocation)(t,n),c="CSI"===u,s=new g.pC({filehandle:i,csiFilehandle:c?(0,l.openLocation)(r,n):void 0,tbiFilehandle:c?void 0:(0,l.openLocation)(r,n),chunkCacheSize:50*Math.pow(2,20),chunkSizeLimit:1e9}),e.next=9,s.getHeader();case 9:return o=e.sent,e.abrupt("return",{filehandle:i,vcf:s,parser:new Z.Z({header:o})});case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"configure",value:function(){var e=(0,u.Z)((0,a.Z)().mark((function e(){var n=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.configured||(this.configured=this.configurePre().catch((function(e){throw n.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=(0,u.Z)((0,a.Z)().mark((function e(){var n,t,r,u=arguments;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>0&&void 0!==u[0]?u[0]:{},e.next=3,this.configure();case 3:return t=e.sent,r=t.vcf,e.abrupt("return",r.getReferenceSequenceNames(n));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=(0,u.Z)((0,a.Z)().mark((function e(){var n,t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return n=e.sent,t=n.vcf,e.abrupt("return",t.getHeader());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getMetadata",value:function(){var e=(0,u.Z)((0,a.Z)().mark((function e(){var n,t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return n=e.sent,t=n.parser,e.abrupt("return",t.getMetadata());case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e){var n=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,d.ObservableCreate)(function(){var i=(0,u.Z)((0,a.Z)().mark((function u(i){var c,s,o,f,p,h;return(0,a.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return c=e.refName,s=e.start,o=e.end,a.next=3,n.configure();case 3:return f=a.sent,p=f.vcf,h=f.parser,a.next=8,p.getLines(c,s,o,(0,r.Z)({lineCallback:function(e,t){i.next(new w.Z({variant:h.parseLine(e),parser:h,id:"".concat(n.id,"-vcf-").concat(t)}))}},t));case 8:i.complete();case 9:case"end":return a.stop()}}),u)})));return function(e){return i.apply(this,arguments)}}(),t.signal)}},{key:"getFeaturesInMultipleRegions",value:function(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,d.ObservableCreate)(function(){var i=(0,u.Z)((0,a.Z)().mark((function u(i){var c,f,p,h,l,d,g;return(0,a.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,n.configure();case 2:return c=a.sent,f=c.vcf,a.next=6,(0,v.bytesForRegions)(e,f.index);case 6:return p=a.sent,a.next=9,n.configure();case 9:return h=a.sent,l=h.filehandle,a.next=13,l.stat();case 13:d=a.sent,(g=Math.round(p/d.size*100))>100&&(g=100),g>60&&console.warn("getFeaturesInMultipleRegions fetching ".concat(g,"% of VCF file, but whole-file streaming not yet implemented")),(0,s.Z)((0,o.Z)(t.prototype),"getFeaturesInMultipleRegions",n).call(n,e,r).subscribe(i);case 18:case"end":return a.stop()}}),u)})));return function(e){return i.apply(this,arguments)}}())}},{key:"freeResources",value:function(){}}]),t}(h.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=298.f5a7bfc4.chunk.js.map