"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RightPanel=void 0;const jsx_runtime_1=require("react/jsx-runtime"),theme_1=require("@redocly/theme"),jotai_1=require("jotai"),Download_1=require("../Download"),Overview_1=require("../Overview"),Language_1=require("../Language"),ServerList_1=require("../ServerList"),store_1=require("../../jotai/store"),utils_1=require("../../utils"),operation_1=require("../../models/operation"),app_1=require("../../jotai/app"),RightPanel=({item:{infoDefinition:e}})=>{const{options:{hideDownloadButtons:r,mockServer:i},parser:{definition:a,definitionUrl:n}}=(0,jotai_1.useAtomValue)(store_1.globalStoreAtom),{languages:t,activeLanguage:s}=(0,jotai_1.useAtomValue)(app_1.languageAtom),o=(0,utils_1.normalizeServers)(n,(0,operation_1.mergeInMockServer)(a.servers||[],i));return(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[!r&&(0,jsx_runtime_1.jsx)(theme_1.Panel,{className:"panel-download",header:"Download OpenAPI description",isExpandable:!1,children:(0,jsx_runtime_1.jsx)(Download_1.DownloadSpecification,{})}),((null==e?void 0:e.license)||(null==e?void 0:e.contact)||(null==e?void 0:e.termsOfService))&&(0,jsx_runtime_1.jsx)(theme_1.Panel,{className:"panel-overview",header:"Overview",isExpandable:!1,children:(0,jsx_runtime_1.jsx)(theme_1.Markdown,{children:(0,jsx_runtime_1.jsx)(Overview_1.Overview,{info:e})})}),!!(null==t?void 0:t.length)&&(0,jsx_runtime_1.jsx)(theme_1.Panel,{className:"panel-language-list",header:"Languages",isExpandable:!1,children:(0,jsx_runtime_1.jsx)(Language_1.LanguageList,{languages:t,activeLanguage:s})}),!!o.length&&(0,jsx_runtime_1.jsx)(theme_1.Panel,{className:"panel-servers-list",header:"Servers",isExpandable:!1,children:(0,jsx_runtime_1.jsx)(ServerList_1.ServerList,{servers:o,path:"/"})})]})};exports.RightPanel=RightPanel;
//# sourceMappingURL=RightPanel.js.map