const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KPopper-CuBnpfRA.js","assets/index-m7Z9H1b_.js"])))=>i.map(i=>d[i]);
import{_ as b,d as p,r as c,o as n,f as i,h as o,i as s,w as f,t as d,j as l,v as r,k as x,q as h,a as w}from"./index-m7Z9H1b_.js";import{B as v}from"./ButtonDropdown-CFHTNhfi.js";import"./ButtonElement-VEOfE7ak.js";import"./Dropdown-BZjyHqvW.js";const k={name:"MediaBox",components:{ButtonDropdown:v,KPopper:p(()=>w(()=>import("./KPopper-CuBnpfRA.js"),__vite__mapDeps([0,1])))},props:{item:{type:Object,required:!0},items:{type:Array,default:()=>[]},currentIndex:{type:Number,default:null},openLightbox:{type:Function,default:void 0},showFooter:{type:Boolean,default:!0},footerText:{type:String,default:null},aspectRatio:{type:[String,Boolean],default:!1},boxMargin:{type:String,default:""},actions:{type:Array,default:()=>[]},badgeIcon:{type:Array,default:()=>null},badgeIconSpin:{type:Boolean,default:!1},showProgress:{type:Boolean,default:!1},warning:{type:Object,default:null},placeholderStyles:{type:[Array,Object],default:null}},computed:{inlineStyles:function(){let t={};return typeof this.aspectRatio<"u"&&this.aspectRatio!==!1&&(t["--aspect-ratio"]=this.aspectRatio),t},bgStyle:function(){let t={};return this.item.imgUrl!==null&&(t["background-image"]=`url(${this.item.thumbnail})`,this.item.type==="audio"&&(t["background-size"]="contain",t["background-repeat"]="no-repeat")),t},title:function(){let t="";return this.item.name!=null&&this.item.name!==""&&(t=this.item.name),t.length>103&&(t=t.substring(0,100)+"..."),t},progressStyle:function(){return this.item.isRunning?{position:"absolute","background-color":"#00e2b6",height:"3px",width:`${this.item.progress}%`,transition:"width: 0.2s",bottom:0}:{}}},methods:{showLightbox:function(){return this.item.doneProcessing?this.$lightbox.show(this.items,this.currentIndex):void 0}}},B=["href"],S={key:0,class:"mediaBox__status"},I={class:"popper__tooltip"},P={key:0,class:"warningIcon light",rel:"nofollow"},z={class:"mediaBox__bgimage"},A={key:0},C={class:"headline--xs text-truncate"},M={key:0,class:"byline--sm txt--grey text-truncate"},R={key:1,class:"actions"};function T(t,u,e,j,D,a){const m=c("icon"),y=c("KPopper"),g=c("ButtonDropdown");return n(),i("div",{class:h(["mediaBox",{[e.boxMargin]:e.boxMargin!==""}])},[o("a",{href:e.item.url,target:"_blank",onClick:u[0]||(u[0]=x((..._)=>a.showLightbox&&a.showLightbox(..._),["prevent"]))},[e.warning!==null&&!(typeof e.warning.label>"u")?(n(),i("div",S,[s(y,{hover:"",placement:"left","offset-distance":"15,0",arrow:""},{content:f(()=>[o("div",I,[o("span",null,d(t.$t(e.warning.label,{$capitalize:!0})),1)])]),default:f(()=>[typeof e.warning.icon<"u"?(n(),i("div",P,[s(m,{icon:e.warning.icon},null,8,["icon"])])):l("",!0)]),_:1})])):l("",!0),o("div",z,[o("div",{style:r(a.inlineStyles)},[e.badgeIcon!==null?(n(),i("div",A,[o("div",{class:"placeholder",style:r(e.placeholderStyles)},[s(m,{icon:e.badgeIcon,spin:e.badgeIconSpin},null,8,["icon","spin"])],4)])):(n(),i("div",{key:1,ref:"image",class:"inner",style:r(a.bgStyle)},null,4))],4)]),e.showProgress?(n(),i("div",{key:1,style:r(a.progressStyle)},null,4)):l("",!0)],8,B),e.showFooter?(n(),i("div",{key:0,class:h({mediaBox__footerText:!0,"pe-5":e.actions.length>0})},[o("h3",C,d(a.title),1),e.item!=null?(n(),i("p",M,d(e.footerText!==null?e.footerText:t.$t(`itemTypes.${e.item.typeName}`,{$capitalize:!0})),1)):l("",!0),e.actions.length>0?(n(),i("div",R,[s(g,{"item-id":e.item.id,actions:e.actions,size:"sm"},null,8,["item-id","actions"])])):l("",!0)],2)):l("",!0)],2)}const E=b(k,[["render",T]]);export{E as default};