import{bU as p,P as k,D as e,aE as m,aM as _,al as C,ah as x,aR as I,S as o,dR as l,a_ as y,aQ as h,aL as M,bT as v,av as S,O as E,R as b,a4 as f,dk as L,an as G,ag as O,dY as P,q as g,b$ as W,c0 as z,o as A}from"./index-CNZMR1GT.js";import{b as T}from"./style-Cn-hRd7R.js";import{I as F}from"./ImageWithError-BqB24ruv.js";import{O as w,g as K}from"./icon-BZFY9fuK.js";import{I as R,u as $}from"./helper-Dlk8y7oL.js";import{G as B}from"./GridItem-CFKmo0Sw.js";import"./index-DsSWFirV.js";import"./Layout-CjSD56n-.js";import"./useTitle-BClow7LS.js";import"./FolderTree-CTh3_qOS.js";import"./index-B-NmelxC.js";import"./index-DvQYEsdd.js";import"./share-BRMiJJnc.js";import"./index-DUl6hczb.js";const D=t=>{const{isHide:s}=p();if(s(t.obj)||t.obj.type!==w.IMAGE)return null;const{setPathAs:i}=k(),c=e(_,{get color(){return m()},boxSize:"$12",get as(){return K(t.obj)}}),{show:u}=T({id:1}),{rawLink:n}=C(),{openWithDoubleClick:a,toggleWithClick:d,restoreSelectionCache:j}=$();return e(S.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},style:{"flex-grow":1},get children(){return e(x,{w:"$full",get classList(){return{selected:!!t.obj.selected}},class:"image-item viselect-item",get"data-index"(){return t.index},p:"$1",spacing:"$1",rounded:"$lg",transition:"all 0.3s",border:"2px solid transparent",get _hover(){return{border:"2px solid ".concat(m())}},get cursor(){return a()||d()?"default":"pointer"},onMouseEnter:()=>{i(t.obj.name,t.obj.is_dir,!0)},onContextMenu:r=>{v(()=>{l(t.index,!0,!0)}),u(r,{props:t.obj})},get children(){return e(I,{w:"$full",pos:"relative",get children(){return[e(o,{get when(){return y()},get children(){return e(R,{pos:"absolute",left:"$1",top:"$1","on:mousedown":r=>{r.stopPropagation()},"on:click":r=>{r.stopPropagation()},get checked(){return t.obj.selected},onChange:r=>{l(t.index,r.target.checked)}})}}),e(F,{h:"150px",w:"$full",objectFit:"cover",rounded:"$lg",shadow:"$md",get fallback(){return e(M,{size:"lg"})},fallbackErr:c,get src(){return n(t.obj)},loading:"lazy","on:dblclick":()=>{a()&&(h.emit("gallery",t.obj.name),l(t.index,!0,!0))},"on:click":r=>{if(!a()&&!(r.ctrlKey||r.metaKey||r.shiftKey)&&j()){if(d())return l(t.index,!t.obj.selected);h.emit("gallery",t.obj.name)}}})]}})}})}})},ae=t=>{const s=A(),i=E(()=>e(L,{w:"$full",gap:"$1",templateColumns:"repeat(auto-fill, minmax(100px,1fr))",class:"image-folders",get children(){return e(b,{get each(){return f.objs.filter(n=>n.is_dir)},children:(n,a)=>e(B,{obj:n,get index(){return a()}})})}})),{registerSelectContainer:c,captureContentMenu:u}=$();return c(),e(x,{"oncapture:contextmenu":u,class:"viselect-container",spacing:"$2",w:"$full",get children(){return[e(o,{get when(){return g.show_count_msg==="visible"},get children(){return e(G,{w:"100%",textAlign:"left",pl:"$2",get children(){return e(O,{size:"sm",color:"$neutral11",get children(){return P(w.IMAGE)}})}})}}),e(o,{get when(){return g.show_folder_in_image_view==="top"},get children(){return i()}}),e(o,{get when(){return t.images.length>0},get fallback(){return e(z,{m:"$2",get children(){return s("home.no_images")}})},get children(){return e(W,{w:"$full",gap:"$1",flexWrap:"wrap",class:"image-images",get children(){return e(b,{get each(){return f.objs},children:(n,a)=>e(D,{obj:n,get index(){return a()}})})}})}}),e(o,{get when(){return g.show_folder_in_image_view==="bottom"},get children(){return i()}})]}})};export{ae as default};
