import{s as a}from"./chunk-LvLJmgfZ.js";import{t as d}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import"./compiler-runtime-B3qBwwSJ.js";import{_ as f}from"./useEventListener-BakX-tnw.js";import{t as g}from"./jsx-runtime-PbYoItBR.js";import"./fullscreen-BXI8V5i6.js";import"./dist-Dez1I5M9.js";import"./dist-DblYTes5.js";import"./dist-D-2yWcX9.js";import"./dist-CNKFZCiw.js";import"./dist-ZjSH4Z6x.js";import"./dist-BtrqKtvn.js";import{t as h}from"./copy-icon-EHMT-qlr.js";import{n as c}from"./error-banner-DEWyImqa.js";import{t as x}from"./esm-X3Tr2pur.js";import"./dist-DU8gTNy9.js";import"./dist-DgBuTUso.js";import"./dist-RW5SS83Z.js";import"./dist-Ci66nyHs.js";import"./dist-DkYp4RmM.js";import"./dist-DlREAgj1.js";import"./dist-BbGE6FVk.js";import"./dist-qGjvyIZU.js";import"./dist-C6zQ57IZ.js";import{n as v,t as p}from"./esm-B_l4S2x_.js";var j=a(d(),1),o=a(g(),1);const e={python:"py",python3:"py",javascript:"js",typescript:"ts",shell:"sh",bash:"sh",unknown:"text",undefined:"text"};function m(t){return t?t in p:!1}var y=({language:t,hideUnsupportedLanguageErrors:n,showCopyButton:u,extensions:r=[],...s})=>{t=e[t||""]||t;let i=m(t);i||f.warn(`Language ${t} not found in CodeMirror.`);let l=(0,j.useMemo)(()=>m(t)?[v(t),...r].filter(Boolean):r,[t,r]);return(0,o.jsxs)("div",{className:"relative w-full group hover-actions-parent",children:[!i&&!n&&(0,o.jsx)(c,{className:"mb-1 rounded-sm",error:`Language ${t} not supported. Supported languages are: ${Object.keys(p).join(", ")}`}),u&&i&&(0,o.jsx)(h,{tooltip:!1,buttonClassName:"absolute top-2 right-2 z-10 hover-action",className:"h-4 w-4 text-muted-foreground",value:s.value||"",toastTitle:"Copied to clipboard"}),(0,o.jsx)(x,{...s,extensions:l})]})};export{e as LANGUAGE_MAP,y as default};
