import{j as e}from"./@radix-D8tIKeo-.js";import{c as o,l as d,B as h,S as u,m as C,C as x,o as f,q as g,t as b}from"./index-B44sgOyQ.js";import{a as y}from"./@monaco-editor-CuNQBT0l.js";import{S as j}from"./chevron-down-C9YWkVDM.js";function N({open:s,className:a}){return e.jsx(j,{className:o(` ${s?"":"-rotate-90"} size-5 shrink-0 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`,a)})}function v({copyText:s,className:a,...t}){const{copyToClipboard:l,copied:r}=d();return e.jsxs(h,{size:"sm",className:o("flex items-center gap-1 bg-theme-surface-primary",a),intent:"secondary",emphasis:"subtle",onClick:()=>l(s),...t,children:[r?e.jsx(u,{width:16,height:16,className:"shrink-0 fill-neutral-500"}):e.jsx(C,{width:16,height:16,className:"shrink-0 fill-neutral-500"}),r?"Copied":e.jsx("span",{children:"Copy"})]})}function S({title:s,children:a,initialOpen:t=!1,className:l,contentClassName:r,intent:i="primary",headerClassName:p,headerChildren:c}){const[n,m]=y.useState(t);return e.jsxs(x,{className:l,open:n,onOpenChange:m,children:[e.jsxs(f,{intent:i,className:p,children:[e.jsxs(g,{className:"flex flex-1 items-center gap-[10px]",children:[e.jsx(N,{open:n}),s]}),c]}),e.jsx(b,{className:o("space-y-3 border-t border-theme-border-moderate bg-theme-surface-primary px-5 py-3",r),children:a})]})}function E({copyText:s,displayCopyButton:a=!0,headerClassName:t,className:l,headerChildren:r,...i}){return e.jsx(S,{...i,className:o("group",l),headerClassName:o("flex flex-col lg:flex-row items-start lg:items-center gap-2",t),headerChildren:r||(a?e.jsx("div",{className:"opacity-100 transition-opacity duration-200 lg:opacity-0 lg:group-hover:opacity-100",children:e.jsx(v,{copyText:s})}):null)})}export{S as C,v as a,N as b,E as c};
