!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c80c8d40-d872-5bb9-b5bc-27c3f1889845")}catch(e){}}(); import{j as m}from"./jsx-runtime-D_zvdyIk.js";import{r as f}from"./index-DwaoyV61.js";import{c as p}from"./index-Bc72ctNv.js";const l={"beehiiv-images-production.s3.amazonaws.com":"media.beehiiv.com","media.beehiiv.net":"media.beehiiv.com","beehiiv-images-staging.s3.amazonaws.com":"media.staginghiiv.com","staging-media.beehiiv.net":"media.staginghiiv.com"},v=(i,s)=>{let e=null;try{e=new URL(i)}catch{}if(!!!(e&&Object.keys(l).includes(e.host)))return i;const t=l[e?.host],a=new URLSearchParams(s).toString().replace(/&/g,",");return`https://${t}/cdn-cgi/image/${a}${e?.pathname}`},x=({src:i,alt:s,maxWidth:e,aspectRatio:o,widthClass:t,...a})=>{const c=f.useRef(null),h={social:"aspect-social",square:"aspect-square",video:"aspect-video"}[o],[g,d]={social:[1.9,1],square:[1,1],video:[16,9]}[o],r=e,n=Math.round(r/g*d),u=v(i,{format:"auto",width:String(r),height:String(n),fit:"scale-down",onerror:"redirect"});return m.jsx("figure",{className:p(h,"relative h-full overflow-hidden",t||"w-full"),ref:c,children:m.jsx("img",{...a,width:r,height:n,src:u,alt:s,className:"absolute inset-0 h-full w-full object-cover"})})};export{x as I}; //# sourceMappingURL=Image-DpT3Wxag.js.map //# debugId=c80c8d40-d872-5bb9-b5bc-27c3f1889845