import{s as y}from"./chunk-LvLJmgfZ.js";import{t as j}from"./react-Bj1aDYRI.js";import{t as g}from"./compiler-runtime-B3qBwwSJ.js";import{t as v}from"./cn-DYvqRARy.js";import{t as T}from"./jsx-runtime-Blw4afVn.js";import{t as w}from"./tooltip-4bZlU7jl.js";import{r as D}from"./button-DDGiD1NW.js";import{t as S}from"./check-rzLRd0j9.js";import{t as k}from"./copy-3iHFdt22.js";import{t as E}from"./use-toast-BwJoaaDM.js";import{n as L}from"./copy-Bxb1_Gtw.js";var P=g(),_=y(j(),1),n=y(T(),1);const q=C=>{let t=(0,P.c)(14),{value:a,className:r,buttonClassName:c,tooltip:d,toastTitle:s,ariaLabel:N}=C,[e,x]=(0,_.useState)(!1),i;t[0]!==s||t[1]!==a?(i=D.stopPropagation(async h=>{await L(typeof a=="function"?a(h):a).then(()=>{x(!0),setTimeout(()=>x(!1),2e3),s&&E({title:s})})}),t[0]=s,t[1]=a,t[2]=i):i=t[2];let f=i,u=N??"Copy to clipboard",o;t[3]!==r||t[4]!==e?(o=e?(0,n.jsx)(S,{className:v(r,"text-(--grass-11)")}):(0,n.jsx)(k,{className:r}),t[3]=r,t[4]=e,t[5]=o):o=t[5];let m;t[6]!==c||t[7]!==f||t[8]!==u||t[9]!==o?(m=(0,n.jsx)("button",{type:"button",onClick:f,"aria-label":u,className:c,children:o}),t[6]=c,t[7]=f,t[8]=u,t[9]=o,t[10]=m):m=t[10];let l=m;if(d===!1)return l;let b=e?"Copied!":d??"Copy to clipboard",p;return t[11]!==l||t[12]!==b?(p=(0,n.jsx)(w,{content:b,delayDuration:400,children:l}),t[11]=l,t[12]=b,t[13]=p):p=t[13],p};export{q as t};
