"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[5046],{45046:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}});var r=n(34795),a=n(9249),u=n(87371),i=n(45754),s=n(86906),c=n(69621),o=n(77162),f=n.n(o),l=n(50933),v=n(29598),h=n(26131),b=n(81073),p=n(2877),d=n(9077),g={refName:"seq_id"},k={seq_id:"refName"},w=function(){function e(t,n,r){(0,a.Z)(this,e),this.ncFeature=t,this.parentHandle=void 0,this.uniqueId=void 0,this.uniqueId=r||t.id(),this.parentHandle=n}return(0,u.Z)(e,[{key:"set",value:function(){throw new Error("not implemented")}},{key:"jb2TagToJb1Tag",value:function(e){return(g[e]||e).toLowerCase()}},{key:"jb1TagToJb2Tag",value:function(e){var t=e.toLowerCase();return k[t]||t}},{key:"get",value:function(t){var n=this,r=this.ncFeature.get(this.jb2TagToJb1Tag(t));return r&&"subfeatures"===t?r.map((function(t){return new e(t,n)})):r}},{key:"tags",value:function(){var e=this;return this.ncFeature.tags().map((function(t){return e.jb1TagToJb2Tag(t)}))}},{key:"id",value:function(){return this.uniqueId}},{key:"parent",value:function(){return this.parentHandle}},{key:"children",value:function(){return this.get("subfeatures")}},{key:"toJSON",value:function(){var t=this,n={uniqueId:this.id()};return this.ncFeature.tags().forEach((function(r){var a=t.jb1TagToJb2Tag(r),u=t.ncFeature.get(r);"subfeatures"===a?n.subfeatures=(u||[]).map((function(n){return new e(n,t).toJSON()})):n[a]=u})),n}}]),e}(),m=function(e){(0,i.Z)(n,e);var t=(0,s.Z)(n);function n(e,r,u){var i;(0,a.Z)(this,n),(i=t.call(this,e,r,u)).nclist=void 0,i.configRefNames=void 0;var s=(0,d.readConfObject)(e,"refNames"),c=(0,d.readConfObject)(e,"rootUrlTemplate");return i.configRefNames=s,i.nclist=new l.Z({baseUrl:"",urlTemplate:c.uri,readFile:function(e){return new p.RemoteFile(String(c.baseUri?new URL(e,c.baseUri).toString():e)).readFile()}}),i}return(0,u.Z)(n,[{key:"getFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,h.ObservableCreate)(function(){var a=(0,r.Z)(f().mark((function r(a){var u,i,s,o,l,v,h;return f().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:u=n.signal,i=!1,s=!1,r.prev=3,l=(0,c.Z)(t.nclist.getFeatures(e,n));case 5:return r.next=7,l.next();case 7:if(!(i=!(v=r.sent).done)){r.next=14;break}h=v.value,(0,b.checkAbortSignal)(u),a.next(t.wrapFeature(h));case 11:i=!1,r.next=5;break;case 14:r.next=20;break;case 16:r.prev=16,r.t0=r.catch(3),s=!0,o=r.t0;case 20:if(r.prev=20,r.prev=21,!i||null==l.return){r.next=25;break}return r.next=25,l.return();case 25:if(r.prev=25,!s){r.next=28;break}throw o;case 28:return r.finish(25);case 29:return r.finish(20);case 30:a.complete();case 31:case"end":return r.stop()}}),r,null,[[3,16,20,30],[21,,25,29]])})));return function(e){return a.apply(this,arguments)}}())}},{key:"wrapFeature",value:function(e){return new w(e,void 0,"".concat(this.id,"-").concat(e.id()))}},{key:"hasDataForRefName",value:function(){var e=(0,r.Z)(f().mark((function e(t){var n;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.nclist.getDataRoot(t);case 2:return n=e.sent,e.abrupt("return",!!(n&&n.stats&&n.stats.featureCount));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){return Promise.resolve(this.configRefNames||[])}},{key:"freeResources",value:function(){}}]),n}(v.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=5046.27c4d1f0.chunk.js.map