import{a as e}from"./chunk-BNv3lrIs.js";import{n as t}from"./jsx-runtime-pmtNMKr4.js";var n=e(t());function r(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>`u`)){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var i=`.styles-module_wrapper__1I_qj {
  z-index: 1;
  display: flex;
  align-items: center;
  position: fixed;
  padding: 0px 60px 0px 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  box-sizing: border-box;
}

.styles-module_content__2jwZj {
  margin: auto;
  padding: 0;
  width: 90%;
  height: 100%;
  max-height: 100%;
  text-align: center;
}

.styles-module_slide__1zrfk {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.styles-module_image__2hdkJ {
  max-height: 100%;
  max-width: 100%;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

.styles-module_close__2I1sI {
  color: white;
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 40px;
  font-weight: bold;
  opacity: 0.2;
  cursor: pointer;
}

.styles-module_close__2I1sI:hover {
  opacity: 1;
}

.styles-module_navigation__1pqAE {
  height: 80%;
  color: white;
  cursor: pointer;
  position: absolute;
  font-size: 60px;
  line-height: 60px;
  font-weight: bold;
  display: flex;
  align-items: center;
  opacity: 0.2;
  padding: 0 15px;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

.styles-module_navigation__1pqAE:hover {
  opacity: 1;
}

@media (hover: none) {
  .styles-module_navigation__1pqAE:hover {
    opacity: 0.2;
  }
}

.styles-module_prev__KqFRp {
  left: 0;
}

.styles-module_next__1uQwZ {
  right: 0;
}

@media (max-width: 900px) {
  .styles-module_wrapper__1I_qj {
    padding: 0;
  }
}
`,a={wrapper:`styles-module_wrapper__1I_qj`,content:`styles-module_content__2jwZj`,slide:`styles-module_slide__1zrfk`,image:`styles-module_image__2hdkJ`,close:`styles-module_close__2I1sI`,navigation:`styles-module_navigation__1pqAE`,prev:`styles-module_prev__KqFRp`,next:`styles-module_next__1uQwZ`};r(i);var o=e=>{let[t,r]=(0,n.useState)(e.currentIndex??0),i=(0,n.useCallback)(n=>{let i=(t+n)%e.src.length;i<0&&(i=e.src.length-1),r(i)},[t]),o=(0,n.useCallback)(t=>{var n;if(!t.target||!e.closeOnClickOutside)return;let r=t.target.id===`ReactSimpleImageViewer`,i=t.target.classList.contains(`react-simple-image-viewer__slide`);(r||i)&&(t.stopPropagation(),(n=e.onClose)==null||n.call(e))},[e.onClose]),s=(0,n.useCallback)(t=>{var n;t.key===`Escape`&&((n=e.onClose)==null||n.call(e)),[`ArrowLeft`,`h`].includes(t.key)&&i(-1),[`ArrowRight`,`l`].includes(t.key)&&i(1)},[e.onClose,i]),c=(0,n.useCallback)(e=>{e.wheelDeltaY>0?i(-1):i(1)},[i]);return(0,n.useEffect)(()=>(document.addEventListener(`keydown`,s),e.disableScroll||document.addEventListener(`wheel`,c),()=>{document.removeEventListener(`keydown`,s),e.disableScroll||document.removeEventListener(`wheel`,c)}),[s,c]),n.createElement(`div`,{id:`ReactSimpleImageViewer`,className:`${a.wrapper} react-simple-image-viewer__modal`,onKeyDown:s,onClick:o,style:e.backgroundStyle},n.createElement(`span`,{className:`${a.close} react-simple-image-viewer__close`,onClick:()=>e.onClose?.call(e)},e.closeComponent||`×`),e.src.length>1&&n.createElement(`span`,{className:`${a.navigation} ${a.prev} react-simple-image-viewer__previous`,onClick:()=>i(-1)},e.leftArrowComponent||`❮`),e.src.length>1&&n.createElement(`span`,{className:`${a.navigation} ${a.next} react-simple-image-viewer__next`,onClick:()=>i(1)},e.rightArrowComponent||`❯`),n.createElement(`div`,{className:`${a.content} react-simple-image-viewer__modal-content`,onClick:o},n.createElement(`div`,{className:`${a.slide} react-simple-image-viewer__slide`},n.createElement(`img`,{className:a.image,src:e.src[t],alt:``}))))};export{o as t};