import{_ as I,a as k}from"./WebImage-BBQZzdK6.mjs";import{_ as w,o as n,c as g,a as s,d as y,v as b,F as x,r as S,i as c,b as o,w as v,k as C,n as m,t as z,a8 as E,aZ as M,f as U}from"./entry.DPwc-EV0.js";import{u as V}from"./useImageUrl-1XbeiwSF.mjs";const B={props:{images:{type:Array,required:!0},imageUrl:{type:String,required:!0},metaData:{type:Object},lazyLoad:{type:Boolean,default:!0},credit:{type:String},alt:{type:String},caption:{type:String},imageShaping:{type:String,default:"crop"},fullWidth:{type:Boolean,default:!0},galleryMode:{type:String,default:"button"},aspectRatio:{type:String},useNativeSize:{type:Boolean,default:!1},clickUrl:{type:String,default:""}},data(){return{largeVisible:!1,galleryIndex:0,useImageUrl:V}},computed:{fitParam(){switch(this.imageShaping){case"clip":return"&fit=max";case"max":return"&fit=max";case"fill-blur":return"&fit=fill&fill=blur";case"crop":default:return"&fit=crop"}},galleryImages(){return[...this.images].slice(1,this.images.length)}},methods:{getImageDimensions(t){const a={width:1300};return t<=500?a.width=500:t<=750?a.width=750:t<=1050?a.width=1050:t<=1500&&(a.width=1500),{...a,height:Math.round(a.width/1.78)}},showEnlarged(t){this.largeVisible=!0},hideEnlarged(t){this.largeVisible=!1},incrementGalleryIndex(t){t.stopPropagation(),this.galleryIndex=(this.galleryIndex+1)%this.images.length},setGalleryIndex(t){this.galleryIndex=t},decrementGalleryIndex(t){t.stopPropagation(),this.galleryIndex=(this.galleryIndex-1+this.images.length)%this.images.length},clickMainImage(){this.clickUrl?window.open(this.clickUrl,"_blank"):(this.setGalleryIndex(0),this.showEnlarged())}}},G={key:0,class:"thumbnails"},N={class:"large-image-wrapper"},p=["src"];function D(t,a,e,F,r,l){const d=I,h=M,u=U,_=k;return n(),g("div",{class:"ebm-content-teaser-image",style:m({width:e.fullWidth?"100%":"auto"})},[s("span",{class:b(e.clickUrl?"ebm-content-teaser-image__link":"ebm-content-teaser-image__small"),onClick:a[0]||(a[0]=(...i)=>l.clickMainImage&&l.clickMainImage(...i))},[y(d,{image:r.useImageUrl(e.imageUrl,e.imageShaping,!1),"meta-data":e.metaData,credit:e.credit,caption:e.caption,alt:e.alt,"lazy-load":e.lazyLoad,"credit-position":"top","use-native-size":e.useNativeSize,"aspect-ratio":e.aspectRatio},null,8,["image","meta-data","credit","caption","alt","lazy-load","use-native-size","aspect-ratio"])],2),e.images.length>1&&e.galleryMode==="thumbnails"?(n(),g("div",G,[(n(!0),g(x,null,S(l.galleryImages,(i,f)=>(n(),g("div",{key:i.src},[y(d,{image:`${i.src.split("?")[0]}?auto=format,compress&w=100&h=75${l.fitParam}`,"meta-data":i==null?void 0:i.metaData,alt:i.alt,class:"thumbnail","use-native-size":e.useNativeSize,onClick:P=>{l.setGalleryIndex(f+1),l.showEnlarged()}},null,8,["image","meta-data","alt","use-native-size","onClick"])]))),128))])):c("",!0),e.images.length>1&&e.galleryMode==="button"?(n(),o(h,{key:1,color:t.$ss.baseStyles.primaryColor,class:"view-gallery-btn",onOnClick:l.showEnlarged},{default:v(()=>[C(" View Image Gallery ")]),_:1},8,["color","onOnClick"])):c("",!0),r.largeVisible?(n(),o(E,{key:2,to:"body"},[s("div",{class:"ebm-content-teaser-image__large",style:m({justifyContent:e.images.length>1&&e.galleryMode!=="none"?"space-between":"center"}),onClick:a[1]||(a[1]=(...i)=>l.hideEnlarged&&l.hideEnlarged(...i))},[e.images.length>1&&e.galleryMode!=="none"?(n(),o(u,{key:0,icon:"mdi:arrow-left",width:36,"icon-color":"white",class:"arrow-icon",onClick:l.decrementGalleryIndex},null,8,["onClick"])):c("",!0),s("div",N,[s("div",null,[e.images[r.galleryIndex].credit?(n(),o(_,{key:0,credit:e.images[r.galleryIndex].credit,class:"credit"},null,8,["credit"])):c("",!0),s("img",{src:r.useImageUrl(e.images[r.galleryIndex].src,e.imageShaping,!1)},null,8,p),s("div",{class:"caption",style:m({fontFamily:t.$ss.primaryFontFamily})},z(e.images[r.galleryIndex].caption),5)])]),e.images.length>1&&e.galleryMode!=="none"?(n(),o(u,{key:1,icon:"mdi:arrow-right",width:36,"icon-color":"white",class:"arrow-icon",onClick:l.incrementGalleryIndex},null,8,["onClick"])):c("",!0)],4)])):c("",!0)],4)}const q=w(B,[["render",D]]);export{q as default};