"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 k}});var r=t(32723),a=t(34795),o=t(96234),c=t(30969),s=t(34760),i=t.n(s),l=t(22714),u=t(83483),f=t(64501),d=t(32343),p=t(93138),b=t(28599),g=t(80975),C=t(14008),j=t(9077),h=t(81073),x=t(47762),Z=t(37574),v=(0,l.Z)((function(e){return{closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]}}}));function k(e){var n=e.config,t=e.handleClose,s=v(),l=(0,c.useState)(),k=(0,o.Z)(l,2),w=k[0],m=k[1],S=(0,c.useState)(),y=(0,o.Z)(S,2),O=y[0],q=y[1],B=(0,c.useState)(!1),_=(0,o.Z)(B,2),A=_[0],N=_[1],R=(0,h.getSession)(n),I=R.rpcManager,T=(0,j.readConfObject)(n);(0,c.useEffect)((function(){var e=new AbortController,t=e.signal,o=!1;return(0,a.Z)((0,r.Z)().mark((function e(){var a,c;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a=(0,j.readConfObject)(n,"adapter"),e.next=4,I.call(n.trackId,"CoreGetInfo",{adapterConfig:a,signal:t});case 4:c=e.sent,o||m(c),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),o||(console.error(e.t0),q(e.t0));case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))(),function(){e.abort(),o=!0}}),[n,I]);var E=(0,j.readConfObject)(n,"name");if("ReferenceSequenceTrack"===(0,j.readConfObject)(n,"type")){var F=R.assemblies.find((function(e){return e.sequence===n.configuration}));E=F?"Reference Sequence (".concat((0,j.readConfObject)(F,"name"),")"):"Reference Sequence"}var G="string"===typeof w?{header:"<pre>".concat(w.replace(/</g,"&lt;").replace(/>/g,"&gt;"),"</pre>")}:w||{};return(0,Z.jsxs)(u.Z,{open:!0,onClose:t,children:[(0,Z.jsxs)(f.Z,{children:[E,(0,Z.jsx)(d.Z,{className:s.closeButton,onClick:function(){return t()},children:(0,Z.jsx)(C.Z,{})})]}),(0,Z.jsxs)(p.Z,{children:[(0,Z.jsxs)(x.BaseCard,{title:"Configuration",children:[(0,Z.jsx)(b.Z,{variant:"contained",style:{float:"right"},onClick:function(){i()(JSON.stringify(T,null,2)),N(!0),setTimeout((function(){return N(!1)}),1e3)},children:A?"Copied to clipboard!":"Copy config"}),(0,Z.jsx)(x.Attributes,{attributes:T,omit:["displays","baseUri","refNames"]})]}),null!==w?(0,Z.jsx)(x.BaseCard,{title:"File info",children:O?(0,Z.jsx)(g.Z,{color:"error",children:"".concat(O)}):void 0===w?"Loading file data...":(0,Z.jsx)(x.Attributes,{attributes:G})}):null]})]})}}}]);
//# sourceMappingURL=2692.e6bea800.chunk.js.map