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