import{c as y,j as t,B as a,a as s}from"./index-CJ6jORV3.js";import{F as b}from"./facebook-BWPgJgNL.js";import{T as x,L as w}from"./twitter-drLdlDV2.js";/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const v=y("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),C=({title:c,url:l})=>{const o=`https://lionpost.com${l}`,r=encodeURIComponent(o),d=encodeURIComponent(c),h={facebook:`https://www.facebook.com/sharer/sharer.php?u=${r}`,twitter:`https://twitter.com/intent/tweet?url=${r}&text=${d}`,linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${r}`},p=async()=>{try{await navigator.clipboard.writeText(o)}catch{try{const e=document.createElement("textarea");e.value=o,e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}catch{}}},n=async i=>{navigator.share||await p(),window.open(h[i],"_blank")},m=async()=>{if(navigator.share)try{await navigator.share({title:c,url:o});return}catch(e){if(e.name!=="AbortError")console.error("Share failed:",e);else return}if((()=>{try{const e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="2em",e.style.height="2em",e.style.padding="0",e.style.border="none",e.style.outline="none",e.style.boxShadow="none",e.style.background="transparent",e.style.opacity="0",document.body.appendChild(e),e.focus(),e.select(),e.setSelectionRange(0,o.length);const u=document.execCommand("copy");return document.body.removeChild(e),u}catch{return!1}})()){s.success("Link copied to clipboard!");return}if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(o),s.success("Link copied to clipboard!");return}catch{}s.error("Unable to copy. Long-press the link to copy manually.")};return t.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 bg-primary/5 rounded-lg",children:[t.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Share This Article"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(a,{variant:"outline",size:"icon",onClick:()=>n("facebook"),className:"hover:bg-[#1877F2] hover:text-white hover:border-[#1877F2] transition-colors","aria-label":"Share on Facebook",children:t.jsx(b,{className:"h-5 w-5"})}),t.jsx(a,{variant:"outline",size:"icon",onClick:()=>n("twitter"),className:"hover:bg-[#1DA1F2] hover:text-white hover:border-[#1DA1F2] transition-colors","aria-label":"Share on Twitter",children:t.jsx(x,{className:"h-5 w-5"})}),t.jsx(a,{variant:"outline",size:"icon",onClick:()=>n("linkedin"),className:"hover:bg-[#0A66C2] hover:text-white hover:border-[#0A66C2] transition-colors","aria-label":"Share on LinkedIn",children:t.jsx(w,{className:"h-5 w-5"})}),t.jsx(a,{variant:"outline",size:"icon",onClick:m,className:"hover:bg-primary hover:text-primary-foreground transition-colors","aria-label":"Copy link",children:t.jsx(v,{className:"h-5 w-5"})})]})]})};export{C as B};