"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[754],{80754:function(e,t,n){n.r(t),n.d(t,{StatBars:function(){return j},YScaleBar:function(){return h.Z}});var r=n(68079),o=n(33028),i=n(96902),a=n(27664),l=n(99836),s=n(50209),c=n(4782),h=n(64335),u=n(29938);function d(e){var t=e.prefersOffset,n=(0,a.getContainingView)(e).trackLabels,r=(0,a.getContainingTrack)(e),o=(0,l.getConf)(r,"name");return"overlapping"!==n||t?10:(0,a.measureText)(o,12.8)+100}var g=(0,c.observer)((function(e){var t=e.children,n=e.model;if(e.exportSVG)return(0,u.jsx)(u.Fragment,{children:t});var r=n.height;return(0,u.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:r,width:(0,a.getContainingView)(n).width},children:t})})),x=function(e){var t=e.color,n=void 0===t?"rgb(255,255,255,0.8)":t;return(0,u.jsx)("rect",(0,o.Z)((0,o.Z)({},e),{},{fill:n}))},m=(0,c.observer)((function(e){var t=e.model,n=t.ticks,r=t.scaleType,o=(0,a.getContainingView)(t).width,i="[".concat(null===n||void 0===n?void 0:n.values[0],"-").concat(null===n||void 0===n?void 0:n.values[1],"]")+("log"===r?" (log scale)":""),l=(0,a.measureText)(i,14),s=o-l-25;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(x,{y:0,x:s,width:l+6,height:16}),(0,u.jsx)("text",{y:13,x:s,children:i})]})})),f=(0,c.observer)((function(e){var t=e.model,n=e.rowHeight,r=e.labelWidth,o=e.exportSVG,a=t.needsCustomLegend,l=t.needsScalebar,s=t.needsFullHeightScalebar,c=t.rowHeightTooSmallForScalebar,h=t.renderColorBoxes,d=t.sources,g=Math.min(n,12),m=n>11,f=h?15:0,j=r+f+5,v=(o?10:0)||(l&&!c?50:0);return d?(0,u.jsxs)(u.Fragment,{children:[s?(0,u.jsx)(x,{y:0,x:v,width:j,height:(d.length+.25)*n}):null,d.map((function(e,t){var r=Math.min(20,n);return(0,u.jsxs)(i.Fragment,{children:[s?null:(0,u.jsx)(x,{y:t*n+1,x:v,width:j,height:r}),e.color?(0,u.jsx)(x,{y:t*n+1,x:v,width:f,height:a?n:r,color:e.color}):null,m?(0,u.jsx)("text",{y:t*n+13,x:v+f+2,fontSize:g,children:e.name}):null]},"".concat(e.name,"-").concat(t))}))]}):null})),j=(0,c.observer)((function(e){var t=e.model,n=e.orientation,i=e.exportSVG,l=t.stats,s=t.needsCustomLegend,c=t.needsFullHeightScalebar,x=t.rowHeightTooSmallForScalebar,j=t.rowHeight,v=t.sources,w=t.ticks,b=Math.min(j,12),p=j>11,S=(0,a.getContainingView)(t).width;if(!(l&&v))return null;var C=Math.max.apply(Math,(0,r.Z)(v.map((function(e){return(0,a.measureText)(e.name,b)})).map((function(e){return p?e:20}))||[0]));return(0,u.jsx)(g,(0,o.Z)((0,o.Z)({},e),{},{children:c?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("g",{transform:"translate(".concat(i?0:d(t),",0)"),children:(0,u.jsx)(h.Z,{model:t,orientation:n})}),(0,u.jsx)("g",{transform:"translate(".concat(S-C-100,",0)"),children:(0,u.jsx)(f,{exportSVG:i,model:t,rowHeight:12,labelWidth:C})})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(f,{exportSVG:i,model:t,rowHeight:t.rowHeight,labelWidth:C}),x||s?(0,u.jsx)(m,(0,o.Z)({},e)):v.map((function(e,r){return(0,u.jsx)("g",{transform:"translate(0 ".concat(j*r,")"),children:(0,u.jsx)(h.Z,{model:t,orientation:n})},"".concat(JSON.stringify(w),"-").concat(r))}))]})}))}));t.default=(0,c.observer)((function(e){var t=e.model;return(0,u.jsxs)("div",{children:[(0,u.jsx)(s.qb,(0,o.Z)({},e)),(0,u.jsx)(j,{model:t})]})}))}}]);
//# sourceMappingURL=754.a2467feb.chunk.js.map