(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[47],{2432:function(e,t,a){"use strict";a.r(t);var n=a(83),r=a(1),c=a.n(r),i=a(51),l=a(2411),o=a(2380),s=a(2471),u=a(2364),m=a(2415),p=a(2358),d=a(85),f=a(84),g=a(416),v=a.n(g),b=a(477),E=a(283),h=Object(i.a)((function(){return{compact:{paddingRight:0,paddingTop:0,paddingBottom:0}}})),w=["clipPos","flags"];function S(e){var t=h(),a=e.feature.flags;return c.a.createElement(b.BaseCard,Object.assign({},e,{title:"Flags"}),c.a.createElement(b.SimpleValue,{name:"Flag",value:a}),c.a.createElement(l.a,null,["read paired","read mapped in proper pair","read unmapped","mate unmapped","read reverse strand","mate reverse strand","first in pair","second in pair","not primary alignment","read fails platform/vendor quality checks","read is PCR or optical duplicate","supplementary alignment"].map((function(e,n){var r=a&1<<n,i="".concat(e,"_").concat(r);return c.a.createElement(o.a,{key:i,control:c.a.createElement(s.a,{className:t.compact,checked:Boolean(r),name:e,readOnly:!0}),label:e})}))))}function y(e){var t=e.value,a=Object(r.useState)(!1),i=Object(n.a)(a,2),l=i[0],o=i[1],s=String(t);return s.length>100?c.a.createElement(c.a.Fragment,null,c.a.createElement("button",{type:"button",onClick:function(){return v()(s)}},"Copy"),c.a.createElement("button",{type:"button",onClick:function(){return o((function(e){return!e}))}},l?"Show less":"Show more"),c.a.createElement("div",null,l?s:"".concat(s.slice(0,100),"..."))):c.a.createElement("div",null,s)}function O(e){var t=e.tag,a=e.model,r=Object(f.getSession)(a);return c.a.createElement(b.BaseCard,Object.assign({},e,{title:"Supplementary alignments"}),c.a.createElement(u.a,null,"List of supplementary alignment locations"),c.a.createElement("ul",null,t.split(";").filter((function(e){return!!e})).map((function(e,t){var i=e.split(","),l=Object(n.a)(i,4),o=l[0],s=l[1],u=l[2],p=function(e){for(var t=Object(E.parseCigar)(e),a=0,n=0;n<t.length;n+=2){var r=+t[n],c=t[n+1];"H"!==c&&"S"!==c&&"I"!==c&&(a+=r)}return a}(l[3]),d=Math.floor(p/5),f=+s,g=+s+p,v="".concat(o,":").concat(Math.max(1,f-d),"-").concat(g+d),b="".concat(o,":").concat(f,"-").concat(g," (").concat(u,")");return c.a.createElement("li",{key:"".concat(v,"-").concat(t)},c.a.createElement(m.a,{onClick:function(){var e=a.view;e?e.navToLocString(v):r.notify("No view associated with this feature detail panel anymore","warning")},href:"#"},b))}))))}function j(e){var t=e.locString,a=e.model,n=Object(f.getSession)(a);return c.a.createElement(m.a,{onClick:function(){var e=a.view;e?e.navToLocString(t):n.notify("No view associated with this feature detail panel anymore","warning")},href:"#"},t)}t.default=Object(d.observer)((function(e){var t=e.model,a=JSON.parse(JSON.stringify(t.featureData)),n=a.tags&&a.tags.SA||a.SA;return c.a.createElement(p.a,{"data-testid":"alignment-side-drawer"},c.a.createElement(b.FeatureDetails,Object.assign({},e,{omit:w,feature:a,formatter:function(e,a){return"next_segment_position"===a?c.a.createElement(j,{model:t,locString:e}):c.a.createElement(y,{value:e})}})),n?c.a.createElement(O,{model:t,tag:n}):null,c.a.createElement(S,Object.assign({feature:a},e)))}))}}]);
//# sourceMappingURL=47.df2479a6.chunk.js.map