import{r as d,j as r}from"./vendor-react-96lCPsRK.js";import{a as p,b as x,d as y,c as b,M as u}from"./vendor-markdown-CimbIo6Y.js";import{h,p as k}from"./vendor-syntax-DuHI9Ok6.js";function f({inline:e,className:t,children:a,...m}){const[c,n]=d.useState(!1),s=Array.isArray(a)?a.join(""):String(a??""),g=/[\r\n]/.test(s);if(e||!g)return r.jsx("code",{className:`font-mono text-[0.9em] px-1.5 py-0.5 rounded-md bg-gray-100 text-gray-900 border border-gray-200 dark:bg-gray-800/60 dark:text-gray-100 dark:border-gray-700 whitespace-pre-wrap break-words ${t||""}`,...m,children:a});const l=/language-(\w+)/.exec(t||""),o=l?l[1]:"text";return r.jsxs("div",{className:"relative group my-2",children:[o&&o!=="text"&&r.jsx("div",{className:"absolute top-2 left-3 z-10 text-xs text-gray-400 font-medium uppercase",children:o}),r.jsx("button",{type:"button",onClick:()=>{var i;(i=navigator.clipboard)==null||i.writeText(s).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})},className:"absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity text-xs px-2 py-1 rounded-md bg-gray-700/80 hover:bg-gray-700 text-white border border-gray-600",children:c?"Copied!":"Copy"}),r.jsx(h,{language:o,style:k,customStyle:{margin:0,borderRadius:"0.5rem",fontSize:"0.875rem",padding:o&&o!=="text"?"2rem 1rem 1rem 1rem":"1rem"},children:s})]})}const j={code:f,blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),a:({href:e,children:t})=>r.jsx("a",{href:e,className:"text-blue-600 dark:text-blue-400 hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),table:({children:e})=>r.jsx("div",{className:"overflow-x-auto my-2",children:r.jsx("table",{className:"min-w-full border-collapse border border-gray-200 dark:border-gray-700",children:e})}),thead:({children:e})=>r.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800",children:e}),th:({children:e})=>r.jsx("th",{className:"px-3 py-2 text-left text-sm font-semibold border border-gray-200 dark:border-gray-700",children:e}),td:({children:e})=>r.jsx("td",{className:"px-3 py-2 align-top text-sm border border-gray-200 dark:border-gray-700",children:e})};function C({content:e}){const t=d.useMemo(()=>[p,x],[]),a=d.useMemo(()=>[y,b],[]);return r.jsx(u,{remarkPlugins:t,rehypePlugins:a,components:j,children:e})}export{C as default};
