1import{r,j as e,c6 as f,aS as k,c7 as C,x as y,X as j,Q as l}from"./index-BPJdZEqy.js";import{L as v}from"./link-2-DGcGywQN.js";import{S}from"./share-2-CUDSoEJq.js";const A=({title:c,url:d,className:h=""})=>{const[o,u]=r.useState(!1),[n,s]=r.useState(!1),[m,p]=r.useState("");r.useEffect(()=>{p(window.location.href)},[]);const i=d||m,a=encodeURIComponent(i),b=encodeURIComponent(c),x=[{name:"Twitter",icon:f,url:`https://twitter.com/intent/tweet?text=${b}&url=${a}`,color:"hover:bg-[#1DA1F2] hover:text-white",bgColor:"bg-[#1DA1F2]/10 text-[#1DA1F2]"},{name:"LinkedIn",icon:k,url:`https://www.linkedin.com/sharing/share-offsite/?url=${a}`,color:"hover:bg-[#0A66C2] hover:text-white",bgColor:"bg-[#0A66C2]/10 text-[#0A66C2]"},{name:"Facebook",icon:C,url:`https://www.facebook.com/sharer/sharer.php?u=${a}`,color:"hover:bg-[#1877F2] hover:text-white",bgColor:"bg-[#1877F2]/10 text-[#1877F2]"}],w=async()=>{try{await navigator.clipboard.writeText(i),s(!0),l.success("Link copied to clipboard!"),setTimeout(()=>s(!1),2e3)}catch{l.error("Failed to copy link")}},g=t=>{window.open(t,"_blank","width=600,height=400")};return e.jsxs("div",{className:`hidden md:block fixed bottom-6 right-6 z-50 ${h}`,children:[e.jsxs("div",{className:`absolute bottom-16 right-0 flex flex-col gap-2 transition-all duration-300 ${o?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none"}`,children:[x.map(t=>e.jsx("button",{onClick:()=>g(t.url),className:`w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg backdrop-blur-xs ${t.bgColor} ${t.color}`,"aria-label":`Share on ${t.name}`,children:e.jsx(t.icon,{className:"w-4 h-4"})},t.name)),e.jsx("button",{onClick:w,className:`w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200 shadow-lg backdrop-blur-xs ${n?"bg-green-500 text-white":"bg-muted/80 text-muted-foreground hover:bg-primary hover:text-primary-foreground"}`,"aria-label":"Copy link",children:n?e.jsx(y,{className:"w-4 h-4"}):e.jsx(v,{className:"w-4 h-4"})})]}),e.jsx("button",{onClick:()=>u(!o),className:`w-12 h-12 rounded-full flex items-center justify-center shadow-lg transition-all duration-300 ${o?"bg-muted text-muted-foreground rotate-0":"bg-primary text-primary-foreground hover:scale-110"}`,"aria-label":o?"Close share menu":"Share",children:o?e.jsx(j,{className:"w-5 h-5"}):e.jsx(S,{className:"w-5 h-5"})})]})};export{A as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.