"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[7239],{87239:(e,t,s)=>{s.r(t),s.d(t,{default:()=>j});var r=s(7552),l=s(67112),n=s(43283),a=s(76218),i=s(93062),o=s(30698),c=s(69092),h=s(68446),d=s(75785),u=s(69500);const x=(0,d.n9)()({dialogContent:{width:"80em"},textAreaFont:{fontFamily:"Courier New"},error:{color:"red",fontSize:"0.8em"}}),j=(0,h.observer)(function({model:e,handleClose:t}){const{classes:s}=x(),{activeFilters:h}=e,[d,j]=(0,r.useState)(h.join("\n")),[m,f]=(0,r.useState)();return(0,r.useEffect)(()=>{try{d.split("\n").map(e=>e.trim()).filter(e=>!!e).map(e=>{var t;t=e.trim(),(0,n.A)(t)}),f(void 0)}catch(e){console.error(e),f(e)}},[d]),(0,u.jsxs)(l.Dialog,{maxWidth:"xl",open:!0,onClose:t,title:"Add track filters",children:[(0,u.jsxs)(a.A,{children:[(0,u.jsxs)("div",{children:["Add filters, in jexl format, one per line, starting with the string jexl:. Examples:"," ",(0,u.jsxs)("ul",{children:[(0,u.jsxs)("li",{children:[(0,u.jsx)("code",{children:"jexl:get(feature,'name')=='BRCA1'"})," - show only feature where the name attribute is BRCA1"]}),(0,u.jsxs)("li",{children:[(0,u.jsx)("code",{children:"jexl:get(feature,'type')=='gene'"})," - show only gene type features in a GFF that has many other feature types"]}),(0,u.jsxs)("li",{children:[(0,u.jsx)("code",{children:"jexl:get(feature,'score') > 400"})," - show only features that have a score greater than 400"]}),(0,u.jsxs)("li",{children:[(0,u.jsx)("code",{children:"jexl:get(feature,'end') - get(feature,'start') < 1000000"})," ","- show only features with length less than 1Mbp"]})]})]}),m?(0,u.jsx)("p",{className:s.error,children:`${m}`}):null,(0,u.jsx)(i.A,{variant:"outlined",multiline:!0,minRows:5,maxRows:10,className:s.dialogContent,fullWidth:!0,value:d,onChange:e=>{j(e.target.value)},slotProps:{input:{classes:{input:s.textAreaFont}}}})]}),(0,u.jsxs)(o.A,{children:[(0,u.jsx)(c.A,{variant:"contained",color:"primary",type:"submit",autoFocus:!0,disabled:!!m,onClick:()=>{e.setJexlFilters(d.split("\n")),t()},children:"Submit"}),(0,u.jsx)(c.A,{variant:"contained",color:"secondary",onClick:()=>{t()},children:"Cancel"})]})]})})}}]);
//# sourceMappingURL=7239.00d30f10.chunk.js.map