import{u,r,j as s,X as N,Y as y,t as n,Q as C,Z as b}from"./index-iQt3bUih.js";import{c as g}from"./clipboard-t_-sNjVI.js";function E({value:e,className:x="",secret:i}){u();const[p,o]=r.useState(!1),[m,h]=r.useState(!1),t=i&&!m,d=async()=>{await g(e)&&(o(!0),setTimeout(()=>o(!1),1500))},a=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),c=a>0&&a<e.length-1,f=c?e.slice(0,a):e,l=c?e.slice(a):"";return s.jsxs("button",{type:"button",onClick:d,title:t?n("點擊複製"):`${e}
(${n("點擊複製")})`,className:`inline-flex min-w-0 max-w-full items-center gap-1.5 text-left transition hover:text-pal ${x}`,children:[s.jsxs("span",{className:`flex min-w-0 flex-1 ${t?"select-none blur-[6px]":""}`,children:[s.jsx("span",{className:"truncate",children:f}),l&&s.jsx("span",{className:"shrink-0",children:l})]}),i&&s.jsx("span",{role:"button",tabIndex:0,title:t?n("顯示"):n("隱藏"),className:"text-ink-muted transition hover:text-pal",onClick:j=>{j.stopPropagation(),h(k=>!k)},children:t?s.jsx(N,{className:"size-4 shrink-0"}):s.jsx(y,{className:"size-4 shrink-0"})}),p?s.jsx(C,{className:"size-4 shrink-0 text-grass"}):s.jsx(b,{className:"size-4 shrink-0 text-ink-muted"})]})}export{E as C};
