(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[66],{1721:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return m}));var a=r(29),n=r(86),s=r(82),u=r(81),c=r(11),i=r(88),o=r(89),f=r(80),l=r.n(f),d=r(116),h=r(79),p=r(104),v=r(125),b=r(645),g=r(119),w=r(152),j=r(945);function k(e){return 31===e[0]&&139===e[1]&&8===e[2]}var m=function(e){Object(i.a)(r,e);var t=Object(o.a)(r);function r(){var e;Object(u.a)(this,r);for(var a=arguments.length,n=new Array(a),s=0;s<a;s++)n[s]=arguments[s];return(e=t.call.apply(t,[this].concat(n))).gffFeatures=void 0,e}return Object(c.a)(r,[{key:"loadDataP",value:function(){var e=Object(s.a)(l.a.mark((function e(){var t,r,a,n,s,u,c,i,o,f=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(p.openLocation)(Object(h.readConfObject)(this.config,"gffLocation"),this.pluginManager).readFile();case 2:if(!k(t=e.sent)){e.next=9;break}return e.next=6,Object(w.unzip)(t);case 6:e.t0=e.sent,e.next=10;break;case 9:e.t0=t;case 10:if(!((r=e.t0).length>536870888)){e.next=13;break}throw new Error("Data exceeds maximum string length (512MB)");case 13:for(a=new TextDecoder("utf8",{fatal:!0}).decode(r),n=a.split("\n"),s=[],u=0;u<n.length&&n[u].startsWith("#");u++)s.push(n[u]);return c=s.join("\n"),i=j.a.parseStringSync(a,{parseFeatures:!0,parseComments:!1,parseDirectives:!1,parseSequences:!1}),o=i.flat().map((function(e,t){return new g.a({data:f.featureData(e),id:"".concat(f.id,"-offset-").concat(t)})})).reduce((function(e,t){var r=t.get("refName");return e[r]||(e[r]=new b.a),e[r].insert([t.get("start"),t.get("end")],t),e}),{}),e.abrupt("return",{header:c,intervalTree:o});case 21:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"loadData",value:function(){var e=Object(s.a)(l.a.mark((function e(){var t=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.gffFeatures||(this.gffFeatures=this.loadDataP().catch((function(e){throw t.gffFeatures=void 0,e}))),e.abrupt("return",this.gffFeatures);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){var e=Object(s.a)(l.a.mark((function e(){var t,r,a=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.length>0&&void 0!==a[0]?a[0]:{},e.next=3,this.loadData();case 3:return t=e.sent,r=t.intervalTree,e.abrupt("return",Object.keys(r));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=Object(s.a)(l.a.mark((function e(){var t,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.loadData();case 2:return t=e.sent,r=t.header,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(v.ObservableCreate)(function(){var r=Object(s.a)(l.a.mark((function r(a){var n,s,u,c,i,o;return l.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,s=e.start,u=e.end,c=e.refName,r.next=4,t.loadData();case 4:i=r.sent,o=i.intervalTree,null===(n=o[c])||void 0===n||n.search([s,u]).forEach((function(e){return a.next(e)})),a.complete(),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(0),a.error(r.t0);case 13:case"end":return r.stop()}}),r,null,[[0,10]])})));return function(e){return r.apply(this,arguments)}}(),r.signal)}},{key:"featureData",value:function(e){var t=this,r=Object(n.a)({},e);r.start-=1,"+"===e.strand?r.strand=1:"-"===e.strand?r.strand=-1:"."===e.strand?r.strand=0:r.strand=void 0,r.phase=Number(e.phase),r.refName=e.seq_id,null===e.score&&delete r.score,null===e.phase&&delete r.score;var s=["start","end","seq_id","score","type","source","phase","strand"],u=e.attributes||{};return Object.keys(u).forEach((function(e){var t=e.toLowerCase();if(s.includes(t)&&(t+="2"),null!==u[e]){var n=u[e];if(Array.isArray(n)&&1===n.length){var c=n;n=Object(a.a)(c,1)[0]}r[t]=n}})),r.refName=r.seq_id,e.child_features&&e.child_features.length&&(r.subfeatures=e.child_features.map((function(e){return e.map((function(e){return t.featureData(e)}))})).flat()),delete r.child_features,delete r.data,delete r.derived_features,delete r.attributes,delete r.seq_id,r}},{key:"freeResources",value:function(){}}]),r}(d.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=66.473c6f1b.chunk.js.map