import{x as X,r as E,c as Y,aa as z,y as i,D as u,n as s,z as l,A as t,K as _,F as V,E as h,X as B,G as d,av as R,a9 as S,q as A,a2 as F,S as p,J as y,ao as j,I as v}from"./index-CFvoaD7J.js";import{d as I}from"./ItemContextMenu.vue_vue_type_style_index_0_scoped_4409cede_lang-41DbVClm.js";import{C as q}from"./Container-BDz3QMuX.js";import{T as G}from"./Toolbar-DNen7a-V.js";import{e as H}from"./eventbus-CGRXT3Tn.js";import{V as J}from"./VList-fGk9SRdf.js";import{V as k,a as K}from"./VRow-BC1No8oB.js";import{V as U}from"./VCard-DxLPF-Ra.js";import{V as O,C as Q,k as W,D as Z,E as ee,w as te}from"./VListItem-CSPID7yq.js";import{V as oe}from"./PanelviewItemCompact-BQIsDE0n.js";import{_ as ae}from"./_plugin-vue_export-helper-DlAUqK2U.js";const se={style:{"margin-bottom":"10px"}},ie=X({__name:"MediaItemImages",props:{modelValue:{}},emits:["update:modelValue"],setup(C,{emit:w}){const b=C,m=E(!1),x=w,P=function(e){window.open(e,"_blank")},f=function(e,o){const n="clientX"in e?e.clientX:e.touches[0].clientX,c="clientY"in e?e.clientY:e.touches[0].clientY;H.emit("contextmenu",{items:[{label:"image_make_primary",icon:"mdi-star-box",action:()=>{L(o)}}],posX:n,posY:c})},M=function(e){return v.getProvider(e)?v.getProvider(e).name:e},D=function(e,o){P(I(o))},g=function(){m.value=!m.value},L=function(e){console.log("MakeImagePrimary",e);const o=[e];o.push(...b.modelValue.filter(n=>n!=e)),x("update:modelValue",o)},T=Y(()=>[{label:"tooltip.collapse_expand",icon:m.value?"mdi-chevron-up":"mdi-chevron-down",action:g,overflowAllowed:!1}]);return(e,o)=>{const n=z("hold");return i(),u("section",se,[s(G,{title:e.$t("images"),"menu-items":T.value,onTitleClicked:g},null,8,["title","menu-items"]),s(J),m.value?(i(),l(q,{key:0},{default:t(()=>[(i(!0),u(V,null,h(d(j),c=>(i(),l(k,{key:c},{default:t(()=>[(i(!0),u(V,null,h(e.modelValue.filter(a=>a.type==c),(a,$)=>(i(),l(K,{key:a.path,cols:"12",class:B(`col-${d(R)(e.$vuetify.display.width)}`)},{default:t(()=>[s(oe,null,{default:t(({props:N})=>[S((i(),l(U,A({ref_for:!0},N,{tile:"",hover:"",class:"panel-item",onClick:r=>{D(r,a)},onContextmenu:F(r=>{f(r,a)},["right","prevent"])}),{default:t(()=>[s(O,{src:d(I)(a,256),class:"bg-grey-lighten-2",width:"100%"},{placeholder:t(()=>[s(k,{align:"center",class:"fill-height ma-0",justify:"center"},{default:t(()=>[s(Q,{color:"grey-lighten-5",indeterminate:""})]),_:1})]),_:2},1032,["src"]),s(W,{variant:"text",slim:"",tile:"",density:"compact",class:"panel-item-details"},{default:t(()=>[s(Z,{width:"95%"},{default:t(()=>[p(y(e.$t("image_type")+": "+a.type),1)]),_:2},1024),s(ee,{class:"line-clamp-1",style:{"margin-right":"25px"}},{default:t(()=>[p(y(e.$t("image_source")+": "+M(a.provider)),1)]),_:2},1024),$==0?(i(),l(te,{key:0,size:"x-large",style:{position:"absolute",right:"0",bottom:"5px"},color:"orange",title:e.$t("tooltip.primary_image")},{default:t(()=>o[0]||(o[0]=[p("mdi-star-box")])),_:1},8,["title"])):_("",!0)]),_:2},1024)]),_:2},1040,["onClick","onContextmenu"])),[[n,r=>{f(r,a)}]])]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})):_("",!0)])}}}),Ve=ae(ie,[["__scopeId","data-v-9e541720"]]);export{Ve as M};
