import{k as e,U as r,al as a,an as t,E as n,a0 as o,q as i,a2 as s}from"./index-C-dDkA_D.js";import{I as m}from"./ImageWithError-D4HZ3mfG.js";import{O as d}from"./icon-D8IhN6yM.js";import"./index-BA8MiV3y.js";import"./Layout-DcwX4cVt.js";import"./useTitle-Dwsro-_9.js";import"./FolderTree-BPZyL9IS.js";import"./index-Bl0FjGa1.js";import"./ModalInput-BzQCE109.js";import"./index-D1JlzeXV.js";import"./share-BZFQ1V5G.js";import"./index-2YNnOdV-.js";const l=l=>{const j=i(),{replace:g}=e();let p=l.images||r.objs.filter(e=>e.type===d.IMAGE);0===p.length&&(p=[r.obj]);const f=e=>{"ArrowLeft"===e.key?(()=>{const e=p.findIndex(e=>e.name===r.obj.name);e>0&&(l.navigate?l.navigate(p[e-1].name):g(p[e-1].name))})():"ArrowRight"===e.key&&(()=>{const e=p.findIndex(e=>e.name===r.obj.name);e<p.length-1&&(l.navigate?l.navigate(p[e+1].name):g(p[e+1].name))})()};return a(()=>{window.addEventListener("keydown",f)}),t(()=>{window.removeEventListener("keydown",f)}),n(m,{maxH:"75vh",rounded:"$lg",get src(){return r.raw_url},get fallback(){return n(s,{})},get fallbackErr(){return n(o,{get msg(){return j("home.preview.failed_load_img")}})}})};export{l as default};
