"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[2692],{82692:function(e,n,t){t.r(n),t.d(n,{default:function(){return m}});var r=t(32723),a=t(34795),c=t(96234),o=t(30969),s=t(34760),i=t.n(s),l=t(84636),u=t(38357),f=t(94551),d=t(59071),p=t(72097),b=t(33359),g=t(88581),h=t(2374),C=t(9077),j=t(81073),x=t(83534),Z=t(37574),v=(0,h.ZL)()((function(e){return{closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]},content:{minWidth:800}}}));function m(e){var n=e.config,t=e.handleClose,s=v().classes,h=(0,o.useState)(),m=(0,c.Z)(h,2),k=m[0],w=m[1],S=(0,o.useState)(),y=(0,c.Z)(S,2),O=y[0],q=y[1],B=(0,o.useState)(!1),N=(0,c.Z)(B,2),_=N[0],A=N[1],R=(0,j.getSession)(n),I=R.rpcManager,L=(0,C.readConfObject)(n);(0,o.useEffect)((function(){var e=new AbortController,t=e.signal,c=!1;return(0,a.Z)((0,r.Z)().mark((function e(){var a,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a=(0,C.readConfObject)(n,"adapter"),e.next=4,I.call(n.trackId,"CoreGetInfo",{adapterConfig:a,signal:t});case 4:o=e.sent,c||w(o),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),c||(console.error(e.t0),q(e.t0));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))(),function(){e.abort(),c=!0}}),[n,I]);var T=(0,C.readConfObject)(n,"name");if("ReferenceSequenceTrack"===(0,C.readConfObject)(n,"type")){var W=R.assemblies.find((function(e){return e.sequence===n.configuration}));T=W?"Reference Sequence (".concat((0,C.readConfObject)(W,"name"),")"):"Reference Sequence"}var z="string"===typeof k?{header:"<pre>".concat(k.replace(/</g,"&lt;").replace(/>/g,"&gt;"),"</pre>")}:k||{};return(0,Z.jsxs)(l.Z,{open:!0,onClose:t,maxWidth:"xl",children:[(0,Z.jsxs)(u.Z,{children:[T,(0,Z.jsx)(f.Z,{className:s.closeButton,onClick:function(){return t()},size:"large",children:(0,Z.jsx)(g.Z,{})})]}),(0,Z.jsxs)(d.Z,{className:s.content,children:[(0,Z.jsxs)(x.BaseCard,{title:"Configuration",children:[(0,Z.jsx)(p.Z,{variant:"contained",style:{float:"right"},onClick:function(){i()(JSON.stringify(L,null,2)),A(!0),setTimeout((function(){return A(!1)}),1e3)},children:_?"Copied to clipboard!":"Copy config"}),(0,Z.jsx)(x.Attributes,{attributes:L,omit:["displays","baseUri","refNames"]})]}),null!==k?(0,Z.jsx)(x.BaseCard,{title:"File info",children:O?(0,Z.jsx)(b.Z,{color:"error",children:"".concat(O)}):void 0===k?"Loading file data...":(0,Z.jsx)(x.Attributes,{attributes:z})}):null]})]})}}}]);
//# sourceMappingURL=2692.ace3759c.chunk.js.map