"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[8526],{8526:(e,t,o)=>{o.r(t),o.d(t,{default:()=>i});var n=o(53179),r=o(68446),s=o(40474),l=o(69500);const i=(0,r.observer)(function(e){const{model:t}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)(n.GQ,{...e}),(0,l.jsx)(s.A,{model:t})]})})},40474:(e,t,o)=>{o.d(t,{A:()=>p});var n=o(99546),r=o(68446),s=o(67758),l=o(69500);const i=e=>{const t=(0,s.c)(5),{color:o}=e,r=void 0===o?"rgb(255,255,255,0.8)":o;let i,a;return t[0]!==r?(i=(0,n.getFillProps)(r),t[0]=r,t[1]=i):i=t[1],t[2]!==e||t[3]!==i?(a=(0,l.jsx)("rect",{...e,...i}),t[2]=e,t[3]=i,t[4]=a):a=t[4],a},a=function(e){const t=(0,s.c)(27),{source:o,idx:n,rowHeight:r,labelWidth:a,model:c,exportSVG:h}=e,d=Math.min(20,r),{needsCustomLegend:x,graphType:g,needsFullHeightScalebar:u,rowHeightTooSmallForScalebar:m,renderColorBoxes:p}=c,j=Math.min(r,12),b=r>11,w=p?15:0,f=a+w+5,S=(h?10:0)||(g&&!m?50:0);let v,V,H,C;return t[0]!==d||t[1]!==S||t[2]!==n||t[3]!==f||t[4]!==u||t[5]!==r?(v=u?null:(0,l.jsx)(i,{y:n*r+1,x:S,width:f,height:d}),t[0]=d,t[1]=S,t[2]=n,t[3]=f,t[4]=u,t[5]=r,t[6]=v):v=t[6],t[7]!==d||t[8]!==w||t[9]!==S||t[10]!==n||t[11]!==x||t[12]!==r||t[13]!==o.color?(V=o.color?(0,l.jsx)(i,{y:n*r+1,x:S,width:w,height:x?r:d,color:o.color}):null,t[7]=d,t[8]=w,t[9]=S,t[10]=n,t[11]=x,t[12]=r,t[13]=o.color,t[14]=V):V=t[14],t[15]!==b||t[16]!==w||t[17]!==S||t[18]!==n||t[19]!==r||t[20]!==o.name||t[21]!==j?(H=b?(0,l.jsx)("text",{y:n*r+13,x:S+w+2,fontSize:j,children:o.name}):null,t[15]=b,t[16]=w,t[17]=S,t[18]=n,t[19]=r,t[20]=o.name,t[21]=j,t[22]=H):H=t[22],t[23]!==v||t[24]!==V||t[25]!==H?(C=(0,l.jsxs)(l.Fragment,{children:[v,V,H]}),t[23]=v,t[24]=V,t[25]=H,t[26]=C):C=t[26],C},c=(0,r.observer)(function({model:e,rowHeight:t,exportSVG:o}){const{graphType:n,needsFullHeightScalebar:r,rowHeightTooSmallForScalebar:s,renderColorBoxes:c,sources:h,labelWidth:d}=e,x=d+(c?15:0)+5,g=(o?10:0)||(n&&!s?50:0);return h?(0,l.jsxs)(l.Fragment,{children:[r?(0,l.jsx)(i,{y:0,x:g,width:x,height:(h.length+.25)*t}):null,h.map((n,r)=>(0,l.jsx)(a,{source:n,idx:r,model:e,rowHeight:t,exportSVG:o,labelWidth:d},`${n.name}-${r}`))]}):null});var h=o(58474),d=o(90461);const x=(0,r.observer)(function({model:e,orientation:t,exportSVG:o}){const{labelWidth:r}=e,{width:s}=(0,n.getContainingView)(e);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("g",{transform:`translate(${o?0:(0,h.A3)(e)},0)`,children:(0,l.jsx)(d.A,{model:e,orientation:t})}),(0,l.jsx)("g",{transform:`translate(${s-r-100},0)`,children:(0,l.jsx)(c,{exportSVG:o,model:e,rowHeight:12})})]})}),g=(0,r.observer)(({model:e})=>{const{ticks:t,scaleType:o}=e,{width:r}=(0,n.getContainingView)(e),s=`[${t?.values[0]}-${t?.values[1]}]${"log"===o?" (log scale)":""}`,a=(0,n.measureText)(s,14),c=r-a-25;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i,{y:0,x:c,width:a+6,height:16}),(0,l.jsx)("text",{y:13,x:c,children:s})]})}),u=(0,r.observer)(function({model:e,orientation:t,exportSVG:o}){const{sources:n,rowHeight:r,rowHeightTooSmallForScalebar:s,needsCustomLegend:i,ticks:a}=e;return n?.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c,{exportSVG:o,model:e,rowHeight:e.rowHeight}),s||i?(0,l.jsx)(g,{model:e}):n.map((o,n)=>(0,l.jsx)("g",{transform:`translate(0 ${r*n})`,children:(0,l.jsx)(d.A,{model:e,orientation:t})},`${JSON.stringify(a)}-${n}`))]}):null}),m=(0,r.observer)(function({children:e,model:t,exportSVG:o}){const{height:r}=t;return o?e:(0,l.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:r,width:(0,n.getContainingView)(t).width},children:e})}),p=(0,r.observer)(function(e){const{model:t,orientation:o,exportSVG:n}=e,{showSidebar:r,stats:s,needsFullHeightScalebar:i,sources:a}=t;return s&&a?(0,l.jsx)(m,{...e,children:r?i?(0,l.jsx)(x,{model:t,orientation:o,exportSVG:n}):(0,l.jsx)(u,{model:t,orientation:o,exportSVG:n}):null}):null})},58474:(e,t,o)=>{o.d(t,{A3:()=>a,BO:()=>s,oJ:()=>l});var n=o(68584),r=o(99546);function s(e,t,o=1){const n=t.map(t=>e.findIndex(e=>e.name===t)).sort((e,t)=>e-t);let r=0;for(const t of n){const n=Math.max(r,t-o);n>=r&&e.splice(n,0,e.splice(t,1)[0]),r+=1}return e}function l(e,t,o=1){const n=t.map(t=>e.findIndex(e=>e.name===t)).sort((e,t)=>t-e);let r=e.length-1;for(const t of n){const n=Math.min(r,t+o);n<=r&&e.splice(n,0,e.splice(t,1)[0]),r-=1}return e}const i=12.8;function a(e){const{prefersOffset:t}=e,{trackLabels:o}=(0,r.getContainingView)(e),s=(0,r.getContainingTrack)(e),l=(0,n.getConf)(s,"name");return"overlapping"!==o||t?10:(0,r.measureText)(l,i)+100}}}]);
//# sourceMappingURL=8526.b019bc5b.chunk.js.map