import{jsx as o,jsxs as b,Fragment as w}from"react/jsx-runtime";import{ButtonContainer as F}from"../containers/button.js";import"../containers/card.js";import{cn as a}from"../../lib/cn.js";import N from"../icons/ico-checkmark.js";import $ from"../icons/ico-copy.js";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/dropdown-selector.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import"../primitives/text.js";import{forwardRef as j,useState as T,useCallback as W,useEffect as k}from"react";import"../utils/client-asset-logo.js";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import"../containers/header.js";import"../containers/menu.js";import"../containers/modal.js";import"../containers/overlay.js";const f={sm:"text-sm",md:"text-base"},x={"text.primary":"text-text-primary","text.secondary":"text-text-secondary","text.tertiary":"text-text-tertiary"},u={normal:"font-normal",medium:"font-medium"},y=j((h,v)=>{const{address:e,onCopy:i,size:m="md",icon:n,fontColor:s="text.tertiary",fontWeight:l="normal",fontFamily:p="inherit"}=h,[t,c]=T(!1),d=`${e.slice(0,6)}...${e?.slice(-4)}`,r=m==="sm"?16:20,g=W(()=>{i&&i(e),c(!0)},[e]);return k(()=>{if(t){const C=setTimeout(()=>{c(!1)},1500);return()=>clearTimeout(C)}},[t]),i?o(F,{className:a(f[m],t?"text-positive-base font-medium":a(x[s],u[l]),"rounded-button [font-variant:no-contextual] transition-none"),style:{fontFamily:p},onPress:g,ref:v,children:b("div",{className:"flex flex-row items-center gap-2",children:[t?n?"Copied":"Copied!":d,n&&o(w,{children:t?o(N,{width:r,height:r,color:"var(--color-positive-base)"}):o($,{width:r,height:r,color:"var(--color-text-tertiary)"})})]})}):o("span",{className:a(f[m],x[s],u[l],"[font-variant:no-contextual]"),style:{fontFamily:p},children:d})});y.displayName="WalletAddress";export{y as default};
//# sourceMappingURL=wallet-address.js.map
