import{c as g,r as c,j as o}from"./vendor-tanstack-DE4ALVGD.js";import{u as x,j as b,E as j}from"./vendor-codemirror-BT6VBNns.js";import{z as v,aZ as y,q as C,I as w,y as E}from"./index-CNL5pSma.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-K8EF6rBE.js";import"./vendor-recharts-B3wzJa9e.js";import"./vendor-forms-BvpM0AtX.js";import"./vendor-date-Bck8LDfw.js";const N=[b(),j.lineWrapping],z=g.forwardRef(({className:l,value:s,onChange:u,copy:p=!1,onBlur:I,disabled:r,hideLineNumbers:h=!1,...f},i)=>{const e=c.useRef(null),{resolvedTheme:m}=v();let n;r&&(n={lineNumbers:!h,highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1});const{setContainer:a}=x({container:e.current,extensions:N,value:s,onChange:u,indentWithTab:!1,editable:!r,basicSetup:n,theme:m==="dark"?"dark":"light",height:"100%"});c.useEffect(()=>{e.current&&a(e.current)},[a]);const d=t=>{E.success("Copied to clipboard"),navigator.clipboard.writeText(t)};return o.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)},...f,children:p&&s&&o.jsx(C,{onClick:()=>d(s),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:o.jsx(w,{id:"Copy",className:"size-2"})})})});z.displayName="JsonInput";export{z as JsonInput};
//# sourceMappingURL=json-input-BoqLnQ5-.js.map
