"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 v}});var r=t(32723),a=t(34795),c=t(96234),o=t(30969),s=t(34760),i=t.n(s),l=t(92256),u=t(48651),f=t(66581),d=t(17984),p=t(69852),b=t(70054),g=t(88581),C=t(2374),h=t(9077),j=t(81073),x=t(10131),Z=t(37574),m=(0,C.ZL)()((function(e){return{closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]},content:{minWidth:800}}}));function v(e){var n=e.config,t=e.handleClose,s=m().classes,C=(0,o.useState)(),v=(0,c.Z)(C,2),k=v[0],w=v[1],y=(0,o.useState)(),S=(0,c.Z)(y,2),O=S[0],N=S[1],q=(0,o.useState)(!1),B=(0,c.Z)(q,2),_=B[0],A=B[1],R=(0,j.getSession)(n),I=R.rpcManager,L=(0,h.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,h.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),N(e.t0));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))(),function(){e.abort(),c=!0}}),[n,I]);var T=(0,h.readConfObject)(n,"name");if("ReferenceSequenceTrack"===(0,h.readConfObject)(n,"type")){var W=R.assemblies.find((function(e){return e.sequence===n.configuration}));T=W?"Reference Sequence (".concat((0,h.readConfObject)(W,"displayName")||(0,h.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.49c3ee4b.chunk.js.map