import{c as h,r as c,j as s}from"./vendor-tanstack-BpuysabX.js";import{u as g,E as x,m as b}from"./vendor-codemirror-q5gL9Jwo.js";import{q as w,I as v,b4 as y,y as C}from"./index-CREafGO4.js";import"./vendor-radix-DIu41Ss_.js";import"./vendor-recharts-C2XeLr4O.js";import"./vendor-forms-Buh7U8Ay.js";import"./vendor-date-C1t37jsh.js";const j=[b(),x.lineWrapping],E=h.forwardRef(({className:l,value:r,onChange:u,copy:p=!1,onBlur:N,disabled:o,hideLineNumbers:f=!1,...d},i)=>{const e=c.useRef(null);let n;o&&(n={lineNumbers:!f,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=g({container:e.current,extensions:j,value:r,onChange:u,indentWithTab:!1,editable:!o,basicSetup:n});c.useEffect(()=>{e.current&&a(e.current)},[a]);const m=t=>{C.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return s.jsx("div",{className:y("rounded-md border shadow-xs overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",l),ref:t=>{e.current=t,typeof i=="function"?i(t):i&&(i.current=t)},...d,children:p&&r&&s.jsx(w,{onClick:()=>m(r),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:s.jsx(v,{id:"Copy",className:"size-2"})})})});E.displayName="MarkdownInput";export{E as MarkdownInput};
//# sourceMappingURL=markdown-input-BKTzdxj8.js.map
