"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[7167],{17167:function(t,e,r){r.r(e),r.d(e,{default:function(){return m}});var n=r(59740),a=r(68079),u=r(32723),s=r(33028),i=r(34795),c=r(9249),o=r(87371),p=r(45754),f=r(13820),l=r(29598),d=r(26131),v=r(81073),h=r(23288),Z=r(84040),b=["dataAdapter","source"];function g(t){var e=t.slice(t.lastIndexOf("/")+1);return e.slice(0,e.lastIndexOf("."))}var m=function(t){(0,p.Z)(r,t);var e=(0,f.Z)(r);function r(){return(0,c.Z)(this,r),e.apply(this,arguments)}return(0,o.Z)(r,[{key:"getAdapters",value:function(){var t=(0,i.Z)((0,u.Z)().mark((function t(){var e,r,n,a;return(0,u.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.getSubAdapter){t.next=3;break}throw new Error("no getSubAdapter available");case 3:return n=this.getConf("subadapters"),null!==(e=n)&&void 0!==e&&e.length||(a=this.getConf("bigWigs"),n=a.map((function(t){return{type:"BigWigAdapter",source:g(t),bigWigLocation:{uri:t}}}))),t.abrupt("return",Promise.all(n.map(function(){var t=(0,i.Z)((0,u.Z)().mark((function t(e){var n;return(0,u.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r(e);case 2:return n=t.sent.dataAdapter,t.abrupt("return",(0,s.Z)((0,s.Z)({source:n.id},e),{},{dataAdapter:n}));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())));case 6:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"getRefNames",value:function(){var t=(0,i.Z)((0,u.Z)().mark((function t(e){var r;return(0,u.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAdapters();case 2:return r=t.sent,t.abrupt("return",r[0].dataAdapter.getRefNames(e));case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getGlobalStats",value:function(){var t=(0,i.Z)((0,u.Z)().mark((function t(e){var r,n,s,i;return(0,u.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAdapters();case 2:return r=t.sent,t.next=5,Promise.all(r.map((function(t){var r,n;return null===(r=(n=t.dataAdapter).getGlobalStats)||void 0===r?void 0:r.call(n,e)})));case 5:return n=t.sent.filter((function(t){return!!t})),s=Math.min.apply(Math,(0,a.Z)(n.map((function(t){return t.scoreMin})))),i=Math.max.apply(Math,(0,a.Z)(n.map((function(t){return t.scoreMax})))),t.abrupt("return",{scoreMin:s,scoreMax:i});case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"getFeatures",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,d.ObservableCreate)(function(){var n=(0,i.Z)((0,u.Z)().mark((function n(i){var c;return(0,u.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.getAdapters();case 2:c=n.sent,h.T.apply(void 0,(0,a.Z)(c.map((function(e){return e.dataAdapter.getFeatures(t,r).pipe((0,Z.U)((function(t){return t.get("source")?t:new v.SimpleFeature((0,s.Z)((0,s.Z)({},t.toJSON()),{},{uniqueId:e.source+"-"+t.id(),source:e.source}))})))})))).subscribe(i);case 4:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}(),r.signal)}},{key:"estimateRegionsStats",value:function(){var t=(0,i.Z)((0,u.Z)().mark((function t(e){return(0,u.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{featureDensity:0});case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"getSources",value:function(){var t=(0,i.Z)((0,u.Z)().mark((function t(){var e;return(0,u.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getAdapters();case 2:return e=t.sent,t.abrupt("return",e.map((function(t){t.dataAdapter;var e=t.source,r=(0,n.Z)(t,b);return(0,s.Z)({name:e},r)})));case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"freeResources",value:function(){}}]),r}(l.BaseFeatureDataAdapter);m.capabilities=["hasResolution","hasLocalStats","hasGlobalStats"]}}]);
//# sourceMappingURL=7167.214c14dc.chunk.js.map