1import{r as n,j as e}from"./index-BgbqYyaj.js";function a({name:t}){return t==="x"?e.jsx("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M18.244 2H21.5l-7.51 8.586L23 22h-6.844l-5.36-7.012L4.6 22H1.34l8.04-9.19L1 2h7.02l4.85 6.418L18.244 2Zm-1.2 18h1.89L7.04 4H5.05l11.994 16Z"})}):t==="fb"?e.jsx("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M22 12a10 10 0 1 0-11.56 9.88v-7H7.9V12h2.54V9.8c0-2.5 1.5-3.9 3.78-3.9 1.1 0 2.24.2 2.24.2v2.46h-1.26c-1.24 0-1.63.77-1.63 1.56V12h2.78l-.45 2.88h-2.33v7A10 10 0 0 0 22 12Z"})}):t==="ig"?e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"5"}),e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("circle",{cx:"17.5",cy:"6.5",r:"1",fill:"currentColor",stroke:"none"})]}):t==="link"?e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 1 0-7.07-7.07L11.5 4.5",strokeLinecap:"round"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 1 0 7.07 7.07L12.5 19.5",strokeLinecap:"round"})]}):e.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("path",{d:"M8.6 13.5l6.8 4M15.4 6.5l-6.8 4"})]})}function m({title:t}){const[o,h]=n.useState(""),[d,i]=n.useState(!1),[x,s]=n.useState(!1);n.useEffect(()=>{h(window.location.href)},[]);const u=encodeURIComponent(t),c=encodeURIComponent(o),l=async()=>{try{await navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),1800)}catch{}},p=async()=>{if(!o)return;try{await navigator.clipboard.writeText(o),s(!0),setTimeout(()=>s(!1),2400)}catch{}const r=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);window.open(r?"instagram://app":"https://www.instagram.com/","_blank","noopener,noreferrer")},f=async()=>{if(navigator.share)try{await navigator.share({title:t,url:o})}catch{}else l()},b=[{label:"Share on X",href:`https://twitter.com/intent/tweet?text=${u}&url=${c}`,icon:e.jsx(a,{name:"x"})},{label:"Share on Facebook",href:`https://www.facebook.com/sharer/sharer.php?u=${c}`,icon:e.jsx(a,{name:"fb"})},{label:x?"Link copied â paste in Instagram":"Share on Instagram (copies link)",onClick:p,icon:e.jsx(a,{name:"ig"})},{label:d?"Link copied":"Copy link",onClick:l,icon:e.jsx(a,{name:"link"})},{label:"Share",onClick:f,icon:e.jsx(a,{name:"share"})}];return e.jsxs("div",{className:"hidden lg:flex fixed left-4 xl:left-6 top-1/2 -translate-y-1/2 z-30 flex-col items-center gap-2",children:[e.jsx("span",{className:"yh-eyebrow text-[10px] text-muted-foreground mb-1",children:"Share"}),b.map(r=>r.href?e.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer","aria-label":r.label,className:"grid h-10 w-10 place-items-center border-2 border-foreground bg-background text-foreground hover:bg-cobalt hover:text-cobalt-foreground hover:border-cobalt transition-colors",children:r.icon},r.label):e.jsx("button",{type:"button",onClick:r.onClick,"aria-label":r.label,title:r.label,className:"grid h-10 w-10 place-items-center border-2 border-foreground bg-background text-foreground hover:bg-hotpink hover:text-hotpink-foreground hover:border-hotpink transition-colors",children:r.icon},r.label))]})}export{m as StickyShareRail};
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.