"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[2533,5997],{45997:function(e,n,r){r.r(n),r.d(n,{bufferToString:function(){return c},parseCsvBuffer:function(){return d},parseTsvBuffer:function(){return N}});var t=r(33028),a=r(96234),u=r(34795),s=r(77162),o=r.n(s),i=r(81073);function c(e){return new TextDecoder("utf-8",{fatal:!0}).decode(e)}function f(e){return m.apply(this,arguments)}function m(){return m=(0,u.Z)(o().mark((function e(n){var a,u,s=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=s.length>1&&void 0!==s[1]?s[1]:{},e.next=3,r.e(2745).then(r.t.bind(r,12745,23)).then((function(e){return e.default}));case 3:return u=e.sent,e.abrupt("return",u((0,t.Z)({noheader:!0,output:"csv"},a)).fromString(c(n)));case 5:case"end":return e.stop()}}),e)}))),m.apply(this,arguments)}function l(e,n,r){var t,a=e.rows[0].cells[n].text||"",u="Text";try{t=(0,i.parseLocString)(a,r)}catch(s){}return t&&t.refName&&"number"===typeof t.start?u="LocString":/^\d+(\.\d+)?$/.test(a)&&(u="Number"),u}function p(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},r=0,t={isLoaded:!0,rows:e.map((function(e,t){var a=t+(n.hasColumnNameLine?0:1);return e.length>r&&(r=e.length),{id:String(a),cells:e.map((function(e,n){return{columnNumber:n,text:e}}))}}))},u={};if(n.hasColumnNameLine&&void 0!==n.columnNameLineNumber){var s=t.rows.splice(n.columnNameLineNumber-1,1),o=(0,a.Z)(s,1),c=o[0];c&&c.cells.forEach((function(e,n){u[n]=e.text||""}))}for(var f=[],m=[],p=function(e){m.push(e);var r=l(t,e,n.isValidRefName);"LocString"===r&&t.rows.forEach((function(r){var t=r.cells[e];t.extendedData=(0,i.parseLocString)(t.text,n.isValidRefName)})),f[e]={name:u[e],dataType:{type:r}}},d=0;d<r;d+=1)p(d);return{rowSet:t,columnDisplayOrder:m,hasColumnNames:!!n.hasColumnNameLine,columns:f,assemblyName:n.selectedAssemblyName}}function d(e){return h.apply(this,arguments)}function h(){return h=(0,u.Z)(o().mark((function e(n){var r,t,a=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},e.next=3,f(n);case 3:return t=e.sent,e.abrupt("return",p(t,r));case 5:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}function N(e){return v.apply(this,arguments)}function v(){return v=(0,u.Z)(o().mark((function e(n){var r,t,a=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{hasColumnNameLine:!1,columnNameLineNumber:1,isValidRefName:function(){return!1}},e.next=3,f(n,{delimiter:"\t"});case 3:return t=e.sent,e.abrupt("return",p(t,r));case 5:case"end":return e.stop()}}),e)}))),v.apply(this,arguments)}},32533:function(e,n,r){r.r(n),r.d(n,{parseSTARFusionBuffer:function(){return c}});var t=r(34795),a=r(77162),u=r.n(a),s=r(45997);function o(e){var n=e.split(":");return{refName:n[0],pos:parseInt(n[1],10),strand:"-"===n[2]?-1:1}}var i={SpanningFragCount:!0,FFPM:!0,LeftBreakEntropy:!0,RightBreakEntropy:!0,JunctionReadCount:!0};function c(e,n){return f.apply(this,arguments)}function f(){return(f=(0,t.Z)(u().mark((function e(n,r){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,s.parseTsvBuffer)(n,{hasColumnNameLine:!0,columnNameLineNumber:1,selectedAssemblyName:r.selectedAssemblyName,isValidRefName:function(){return!1}});case 2:return(t=e.sent).columns[0].name=t.columns[0].name.replace("#",""),t.columns.forEach((function(e){i[e.name]&&(e.dataType={type:"Number"})})),t.rowSet.rows.forEach((function(e,n){var r={};e.cells.forEach((function(e,n){var a=e.text,u=t.columns[n];if("LeftBreakpoint"===u.name&&a){var s=o(a),c=s.refName,f=s.pos,m=s.strand;r.refName=c,r.start=f,r.end=f,r.strand=m}else if("RightBreakpoint"===u.name&&a){var l=o(a),p=l.refName,d=l.pos,h=l.strand;r.mate={refName:p,start:d,end:d,strand:h}}else a&&i[u.name]?r[u.name]=parseFloat(a):r[u.name]=a})),r.uniqueId="sf-".concat(n+1),e.extendedData={feature:r}})),e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}}]);
//# sourceMappingURL=2533.0d2e2530.chunk.js.map