import{r as s,j as i}from"./index-2SI3TtYZ.js";import{L as k,J as p,s as h,r as L}from"./LoginPage-yYkKaUvX.js";import{m as $}from"./moreIcon-hyogBtJh.js";const C=e=>s.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},s.createElement("g",{opacity:.5},s.createElement("path",{d:"M14 6L6.00076 14",stroke:"#fff",strokeWidth:1.5,strokeLinecap:"round"}),s.createElement("path",{d:"M6 6L13.9992 14",stroke:"#fff",strokeWidth:1.5,strokeLinecap:"round"}))),y=e=>i.jsx("button",{id:e.id,className:"rg-button more",title:"Close",onClick:e.onClick,"aria-label":"close",children:i.jsx(C,{})}),M=e=>{if(e.link!==void 0)return i.jsx(k,{className:"back rg-button",to:e.link,"aria-label":"Link to the previous page",children:i.jsx(p,{})});{const t=()=>{e.onClick&&e.onClick()};return i.jsx("button",{className:"back rg-button",onClick:t,"aria-label":"back",children:i.jsx(p,{})})}};function B(e){const t=a=>typeof window<"u"?window.matchMedia(a).matches:!1,[n,o]=s.useState(t(e));function r(){o(t(e))}return s.useEffect(()=>{const a=window.matchMedia(e);return r(),a.addListener?a.addListener(r):a.addEventListener("change",r),()=>{a.removeListener?a.removeListener(r):a.removeEventListener("change",r)}},[e]),n}const N=()=>{const[e,t]=s.useState(!1);return s.useEffect(()=>{(async()=>await $()?t(!0):t(!1))()}),e},l=()=>"www.redgifs.com",E=()=>"i.redgifs.com",c=e=>{if(!navigator.clipboard){h({title:"Clipboard is not accessible.",variant:"error"});return}return navigator.clipboard.writeText(e).then(()=>{h({title:"Link copied!",variant:"success"})}).catch(()=>{h({title:"Can't copy link",variant:"error"})})},T=e=>`https://${l()}/users/${e}`,R=e=>c(T(e)),A=e=>`https://${l()}/niches/${e}`,j=e=>c(A(e)),d=(e,t)=>`https://${l()}${L.collection(e,t)}`,P=(e,t)=>c(d(e,t)),u=e=>`https://${l()}/watch/${e}`,m=e=>`https://${l()}/ifr/${e}`,F=({id:e,width:t,height:n})=>[``,`
`].join(""),U=({id:e,width:t,height:n})=>{const b=`position:relative; padding-bottom:${(100/(t/n)).toFixed(2)}%`,v="position:absolute; top:0; left:0;";return[`