import{m as T,o as f,a as s,R as e,c as q,D as w,T as g,d as A,F,i as l,C as i,e as D,B as S,u as E,j as R}from"./index-Bm2SqMk3.js";const N=T()({dialogContent:{width:"40em"}}),_=f(function({model:r,handleClose:n}){const{classes:C}=N(),[a,k]=s.useState(""),[u,y]=s.useState(!0),[h,v]=s.useState(!0),[m,b]=s.useState(!0);let c;try{new RegExp(a)}catch(t){c=t}return e.createElement(q.Dialog,{maxWidth:"xl",open:!0,onClose:n,title:"Sequence search"},e.createElement(w,{className:C.dialogContent},e.createElement(g,null,"Supply a sequence to search for. A track will be created with the resulting matches once submitted. You can also supply regex style expressions e.g. AACT(C|T)."),e.createElement(A,{value:a,onChange:t=>{k(t.target.value)},helperText:"Sequence search pattern"}),e.createElement(F,null,e.createElement(l,{control:e.createElement(i,{checked:u,onChange:t=>{y(t.target.checked)}}),label:"Search forward strand"}),e.createElement(l,{control:e.createElement(i,{checked:h,onChange:t=>{v(t.target.checked)}}),label:"Search reverse strand"}),e.createElement(l,{control:e.createElement(i,{checked:m,onChange:t=>{b(t.target.checked)}}),label:"Case insensitive"})),c?e.createElement(g,{color:"error"},`${c}`):null),e.createElement(D,null,e.createElement(S,{onClick:()=>{var t;if(a){const d=`sequence_search_${+Date.now()}`,o=E.getSession(r),{assemblyManager:x}=o,p=r.assemblyNames[0];E.isSessionWithAddTracks(o)&&(o.addTrackConf({trackId:d,name:`Sequence search ${a}`,assemblyNames:[p],type:"FeatureTrack",adapter:{type:"SequenceSearchAdapter",search:a,searchForward:u,searchReverse:h,caseInsensitive:m,sequenceAdapter:R((t=x.get(p))===null||t===void 0?void 0:t.configuration.sequence.adapter)}}),r.showTrack(d))}n()},variant:"contained",color:"primary"},"Submit"),e.createElement(S,{onClick:()=>{n()},variant:"contained",color:"secondary"},"Close")))});export{_ as default};
