"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[6838],{10488:function(n,t,e){e.d(t,{Z:function(){return x}});var r=e(33028),o=e(68079),i=e(96902),a=e(27664),s=e(4782),c=e(64335),l=e(29938),u=function(n){var t=n.color,e=void 0===t?"rgb(255,255,255,0.8)":t;return(0,l.jsx)("rect",(0,r.Z)((0,r.Z)({},n),{},{fill:e}))},h=(0,s.observer)((function(n){var t=n.model,e=n.rowHeight,r=n.labelWidth,o=n.exportSVG,a=t.needsCustomLegend,s=t.needsScalebar,c=t.needsFullHeightScalebar,h=t.rowHeightTooSmallForScalebar,d=t.renderColorBoxes,g=t.sources,f=Math.min(e,12),x=e>11,m=d?15:0,v=r+m+5,p=(o?10:0)||(s&&!h?50:0);return g?(0,l.jsxs)(l.Fragment,{children:[c?(0,l.jsx)(u,{y:0,x:p,width:v,height:(g.length+.25)*e}):null,g.map((function(n,t){var r=Math.min(20,e);return(0,l.jsxs)(i.Fragment,{children:[c?null:(0,l.jsx)(u,{y:t*e+1,x:p,width:v,height:r}),n.color?(0,l.jsx)(u,{y:t*e+1,x:p,width:m,height:a?e:r,color:n.color}):null,x?(0,l.jsx)("text",{y:t*e+13,x:p+m+2,fontSize:f,children:n.name}):null]},"".concat(n.name,"-").concat(t))}))]}):null})),d=(0,s.observer)((function(n){var t=n.model,e=t.ticks,r=t.scaleType,o=(0,a.getContainingView)(t).width,i="[".concat(null===e||void 0===e?void 0:e.values[0],"-").concat(null===e||void 0===e?void 0:e.values[1],"]")+("log"===r?" (log scale)":""),s=(0,a.measureText)(i,14),c=o-s-25;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u,{y:0,x:c,width:s+6,height:16}),(0,l.jsx)("text",{y:13,x:c,children:i})]})})),g=e(39947),f=(0,s.observer)((function(n){var t=n.children,e=n.model;if(n.exportSVG)return(0,l.jsx)(l.Fragment,{children:t});var r=e.height;return(0,l.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:r,width:(0,a.getContainingView)(e).width},children:t})})),x=(0,s.observer)((function(n){var t=n.model,e=n.orientation,i=n.exportSVG,s=t.stats,u=t.needsCustomLegend,x=t.needsFullHeightScalebar,m=t.rowHeightTooSmallForScalebar,v=t.rowHeight,p=t.sources,j=t.ticks,w=Math.min(v,12),b=v>11,S=(0,a.getContainingView)(t).width;if(!(s&&p))return null;var C=Math.max.apply(Math,(0,o.Z)(p.map((function(n){return(0,a.measureText)(n.name,w)})).map((function(n){return b?n:20}))||[0]));return(0,l.jsx)(f,(0,r.Z)((0,r.Z)({},n),{},{children:x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("g",{transform:"translate(".concat(i?0:(0,g.os)(t),",0)"),children:(0,l.jsx)(c.Z,{model:t,orientation:e})}),(0,l.jsx)("g",{transform:"translate(".concat(S-C-100,",0)"),children:(0,l.jsx)(h,{exportSVG:i,model:t,rowHeight:12,labelWidth:C})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h,{exportSVG:i,model:t,rowHeight:t.rowHeight,labelWidth:C}),m||u?(0,l.jsx)(d,(0,r.Z)({},n)):p.map((function(n,r){return(0,l.jsx)("g",{transform:"translate(0 ".concat(v*r,")"),children:(0,l.jsx)(c.Z,{model:t,orientation:e})},"".concat(JSON.stringify(j),"-").concat(r))}))]})}))}))},39947:function(n,t,e){e.d(t,{A1:function(){return i},os:function(){return c},vi:function(){return a}});var r=e(27664),o=e(99836);function i(n,t){for(var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.map((function(t){return n.findIndex((function(n){return n.name===t}))})).sort((function(n,t){return n-t})),o=0,i=0;i<r.length;i++){var a=r[i],s=Math.max(o,a-e);s>=o&&n.splice(s,0,n.splice(a,1)[0]),o+=1}return n}function a(n,t){for(var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=t.map((function(t){return n.findIndex((function(n){return n.name===t}))})).sort((function(n,t){return t-n})),o=n.length-1,i=0;i<r.length;i++){var a=r[i],s=Math.min(o,a+e);s<=o&&n.splice(s,0,n.splice(a,1)[0]),o-=1}return n}var s=12.8;function c(n){var t=n.prefersOffset,e=(0,r.getContainingView)(n).trackLabels,i=(0,r.getContainingTrack)(n),a=(0,o.getConf)(i,"name");return"overlapping"!==e||t?10:(0,r.measureText)(a,s)+100}},76838:function(n,t,e){e.r(t),e.d(t,{renderSvg:function(){return l}});var r=e(32723),o=e(34795),i=(e(96902),e(27664)),a=e(75717),s=e(10488),c=e(29938);function l(n,t,e){return u.apply(this,arguments)}function u(){return(u=(0,o.Z)((0,r.Z)().mark((function n(t,e,o){var l,u;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,a.when)((function(){return!!t.stats&&!!t.regionCannotBeRenderedText}));case 2:return l=(0,i.getContainingView)(t),u=l.offsetPx,n.t0=c.jsxs,n.t1=c.Fragment,n.t2=c.jsx,n.next=8,o(e);case 8:return n.t3=n.sent,n.t4={id:"snpcov",children:n.t3},n.t5=(0,n.t2)("g",n.t4),n.t6=(0,c.jsx)("g",{transform:"translate(".concat(Math.max(-u,0),")"),children:(0,c.jsx)(s.Z,{model:t,orientation:"left",exportSVG:!0})}),n.t7=[n.t5,n.t6],n.t8={children:n.t7},n.abrupt("return",(0,n.t0)(n.t1,n.t8));case 15:case"end":return n.stop()}}),n)})))).apply(this,arguments)}}}]);
//# sourceMappingURL=6838.0c5a63cf.chunk.js.map