1import{j as e}from"./index-BE1NiiKD.js";import{r as c}from"./vendor-jVyfcstf.js";function f({animals:g,currentIndex:x,onClose:i,onPrev:o,onNext:h}){const l=g[x],[t,n]=c.useState(0);c.useEffect(()=>{n(0)},[x]);const d=c.useCallback(a=>{a.key==="Escape"&&i(),a.key==="ArrowLeft"&&o(),a.key==="ArrowRight"&&h()},[i,o,h]);c.useEffect(()=>(document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}),[d]);const s=l.images,m=s.length>1;return e.jsx("div",{className:"lightbox-overlay",onClick:i,children:e.jsxs("div",{className:"lightbox-content",onClick:a=>a.stopPropagation(),children:[e.jsx("button",{className:"lightbox-close",onClick:i,"aria-label":"éãã",children:"Ã"}),e.jsxs("div",{className:"lightbox-body",children:[e.jsxs("div",{className:"lightbox-image-section",children:[e.jsxs("div",{className:"lightbox-main-image-wrapper",children:[m&&e.jsx("button",{className:"lightbox-img-nav lightbox-img-prev",onClick:()=>n(a=>(a-1+s.length)%s.length),"aria-label":"åã®ç»å",children:"â¹"}),e.jsx("img",{src:s[t],alt:l.japaneseName,className:"lightbox-image",decoding:"async"}),m&&e.jsx("button",{className:"lightbox-img-nav lightbox-img-next",onClick:()=>n(a=>(a+1)%s.length),"aria-label":"次ã®ç»å",children:"âº"})]}),m&&e.jsx("div",{className:"lightbox-thumbnails",children:s.map((a,r)=>e.jsx("img",{src:a,alt:`${l.japaneseName} ${r+1}`,className:`lightbox-thumb ${r===t?"active":""}`,onClick:()=>n(r)},r))}),l.externalImages&&l.externalImages[t]&&e.jsx("a",{href:l.externalImages[t],target:"_blank",rel:"noopener noreferrer",className:"lightbox-external-link",children:"詳細ç»åãè¦ã"})]}),e.jsxs("div",{className:"lightbox-info",children:[e.jsx("table",{className:"lightbox-info-table",children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{children:"ã«ã¿ãã°çªå·"}),e.jsx("td",{children:l.catalogId})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"åå"}),e.jsx("td",{children:l.japaneseName})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"å¦å"}),e.jsx("td",{children:e.jsx("i",{children:l.scientificName})})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"è±å"}),e.jsx("td",{children:l.englishName||"â"})]}),e.jsxs("tr",{children:[e.jsx("th",{children:"åé¡"}),e.jsx("td",{children:l.order?`${l.order} ${l.family}ï¼${l.orderEnglish} ${l.familyEnglish}`:"â"})]})]})}),l.sketchfabEmbed&&e.jsx("div",{className:"lightbox-sketchfab",children:e.jsx("iframe",{title:`${l.japaneseName}/${l.scientificName}`,src:l.sketchfabEmbed,frameBorder:"0",allowFullScreen:!0,mozallowfullscreen:"true",webkitallowfullscreen:"true",allow:"autoplay; fullscreen; xr-spatial-tracking",loading:"lazy"})}),l.modelUrl&&e.jsx("a",{href:l.modelUrl,target:"_blank",rel:"noopener noreferrer",className:"lightbox-3d-link",children:"3Dã¢ãã«ãè¦ã"})]})]}),e.jsxs("div",{className:"lightbox-animal-nav",children:[e.jsx("button",{onClick:o,className:"lightbox-nav-btn",children:"â¹ åã®åç©"}),e.jsx("button",{onClick:h,className:"lightbox-nav-btn",children:"次ã®åç© âº"})]})]})})}export{f as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.