import{jsx as t}from"react/jsx-runtime";import{z as i,w as r}from"./index-CQXsL1YZ.js";import e from"./PreviewImage-D7sHp2Yb.js";import"react";import"react-dom";import"@bbodek/hooks";import"@bbodek/utils";import"overlay-kit";import"./ImageErrorBoundary-CO_f5xdF.js";const o=({src:o,imgSize:s,viewerSize:a,downloadOptions:h,previewOptions:d,isError:n,onLoadImage:m,onError:w})=>{const{rotate:p,scale:l}=d,{width:c,height:g}=a,f=0!==Math.abs(p%r.ROTATE[-180]),u=d.fitMode??i.HEIGHT,v=(()=>{if(!s)return{width:a.width,height:a.height};if(u===i.WIDTH){const t=c*l;return{width:t,height:t/(s.width/s.height)}}{const t=g*l;return{height:t,width:t/(s.height/s.width)}}})();return t("div",{className:"relative mx-auto mt-2.5 w-fit first:mt-0",style:f?(({width:t,height:i})=>({height:t,width:i}))(v):v,children:t(e,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",downloadOptions:h,isError:n,previewOptions:d,size:a,src:o,viewerSize:a,onError:w,onLoad:m})})};export{o as default};
//# sourceMappingURL=PreviewPdfViewerImage-D3F7-6hd.js.map
