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