"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[8976],{58976:(e,t,l)=>{l.r(t),l.d(t,{default:()=>w});var s=l(67758),n=l(87083),o=l(7552),r=l(99546),i=l(7946),a=l(61282),c=l(22762),h=l(84132),d=l(69500);function u(e){const t=(0,s.c)(6),{rows:l,columns:n}=e,[u,w]=(0,o.useState)(!1);let b;if(t[0]!==u||t[1]!==n||t[2]!==l){let e;t[4]!==l?(e=e=>(0,r.measureGridWidth)(l.map(t=>t[e.field])),t[4]=l,t[5]=e):e=t[5];const s=n.map(e);b=l.length?(0,d.jsxs)("div",{children:[(0,d.jsx)(i.A,{label:(0,d.jsx)(a.A,{variant:"body2",children:"Show options"}),control:(0,d.jsx)(c.A,{checked:u,onChange:e=>{w(e.target.checked)}})}),(0,d.jsx)(h.z,{rowHeight:25,hideFooter:l.length<100,rows:l,showToolbar:u,columns:n.map((e,t)=>({...e,width:s[t]}))})]}):null,t[0]=u,t[1]=n,t[2]=l,t[3]=b}else b=t[3];return b}function w(e){const t=(0,s.c)(4),{data:l,fields:o,title:r}=e;let i;return t[0]!==l||t[1]!==o||t[2]!==r?(i=l.length?(0,d.jsx)(n.default,{title:r,children:(0,d.jsx)(u,{rows:l.map((e,t)=>({id:t,...Object.fromEntries(e.split("|").map((e,t)=>[o[t],e]))})),columns:o.map(b)})}):null,t[0]=l,t[1]=o,t[2]=r,t[3]=i):i=t[3],i}function b(e){return{field:e}}}}]);
//# sourceMappingURL=8976.1ebbe7ee.chunk.js.map