import{D as n,J as i}from"./vendor-ui-CGT0cG1n.js";import{v as p,aA as l,ab as d,l as m,ai as f,i as u,ap as a,r as x,ax as o,aO as y,q as w}from"./vendor-core-BKehvho7.js";const h=async e=>{if(!navigator.clipboard)throw new Error("剪贴板API不可用");try{await navigator.clipboard.writeText(e)}catch(t){throw console.error("复制失败:",t),new Error("无法复制文本")}},_={class:"flex items-center gap-[10px]"},E=p({__name:"CopyText",props:{text:{type:String,default:""}},setup(e){const{t}=l(),r=e;async function s(){await h(r.text),i.success(t("common.copySuccess"))}return(c,g)=>(d(),m("div",_,[f(c.$slots,"default",{},()=>[u("span",null,a(e.text),1)]),x(o(n),{type:"primary",href:"javascript:void(0)",onClick:s},{default:y(()=>[w(a(o(t)("common.copy")),1)]),_:1})]))}});export{E as _};
