"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[864],{88483:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var o=n(7552),a=n(92562),r=n(99546),i=n(91468),l=n(33039),s=n.n(l),c=n(31409),f=n.n(c),u=n(5401),g=n(75785),b=n(68584),m=n(41990),d=n(36715),C=n(37565);function p({config:e}){const[t,n]=(0,o.useState)(),[a,i]=(0,o.useState)(),l=(0,r.getSession)(e),{rpcManager:s}=l;(0,o.useEffect)((()=>{const t=new AbortController,{signal:o}=t;let a=!1;return(async()=>{try{const t=(0,b.readConfObject)(e,"adapter"),n=await s.call(e.trackId,"CoreGetInfo",{adapterConfig:t,signal:o});a||i(n)}catch(e){a||(console.error(e),n(e))}})(),()=>{t.abort(),a=!0}}),[e,s]);const c="string"==typeof a?{header:`<pre>${a.replaceAll("<","&lt;").replaceAll(">","&gt;")}</pre>`}:a||{};return null!==a?o.createElement(m.BaseCard,{title:"File info"},t?o.createElement(d.A,{color:"error"},`${t}`):void 0===a?o.createElement(C.A,{message:"Loading file data"}):o.createElement(m.Attributes,{attributes:c})):null}const E=(0,g.n9)()({content:{minWidth:800}});function A(e,t){for(const n in e)n===t?delete e[n]:"object"==typeof e[n]&&A(e[n],t);return e}function h({config:e}){const[t,n]=(0,o.useState)(!1),a=(0,b.readConfObject)(e),i=(0,r.getSession)(e),{classes:l}=E(),c=(0,b.getConf)(i,["formatAbout","hideUris"])||(0,b.readConfObject)(e,["formatAbout","hideUris"]),{pluginManager:g}=(0,r.getEnv)(i),d=g.evaluateExtensionPoint("Core-customizeAbout",{config:{...a,...(0,b.getConf)(i,["formatAbout","config"],{config:a}),...(0,b.readConfObject)(e,["formatAbout","config"],{config:a})}},{session:i,config:e}),C=g.evaluateExtensionPoint("Core-extraAboutPanel",null,{session:i,config:e});return o.createElement("div",{className:l.content},o.createElement(m.BaseCard,{title:"Configuration"},c?null:o.createElement(u.A,{variant:"contained",style:{float:"right"},onClick:()=>{const e=A(s()(a),"baseUri");f()(JSON.stringify(e,null,2)),n(!0),setTimeout((()=>n(!1)),1e3)}},t?"Copied to clipboard!":"Copy config"),o.createElement(m.Attributes,{attributes:d,omit:["displays","baseUri","refNames","formatAbout"],hideUris:c})),C?o.createElement(m.BaseCard,{title:C.name},o.createElement(C.Component,{config:e})):null,o.createElement(p,{config:e}))}function v({config:e,handleClose:t}){const n=(0,r.getSession)(e),l=(0,i.getTrackName)(e,n),{pluginManager:s}=(0,r.getEnv)(n),c=s.evaluateExtensionPoint("Core-replaceAbout",h,{session:n,config:e});return o.createElement(a.A,{open:!0,onClose:t,title:l,maxWidth:"xl"},o.createElement(c,{config:e}))}}}]);
//# sourceMappingURL=864.bf3d449b.chunk.js.map