import{_ as I,a as k}from"./WebImage-CfGBcAbG.mjs";import{_ as w,o as n,c as g,a as s,d as y,y as x,F as b,x as S,l as c,b as o,s as v,q as C,p as d,t as z,ag as M,b8 as E,f as U}from"./i4_0wS5w.js";import{u as V}from"./useImageUrl-1XbeiwSF.mjs";import"./nuxt-link-Y7s2L2-x.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:this.$ss.siteMaxWidth};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(){this.largeVisible=!0},hideEnlarged(){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 m=I,h=E,u=U,_=k;return n(),g("div",{class:"ebm-content-teaser-image",style:d({width:e.fullWidth?"100%":"auto"})},[s("span",{class:x(e.clickUrl?"ebm-content-teaser-image__link":"ebm-content-teaser-image__small"),onClick:a[0]||(a[0]=(...i)=>l.clickMainImage&&l.clickMainImage(...i))},[y(m,{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(b,null,S(l.galleryImages,(i,f)=>(n(),g("div",{key:i.src},[y(m,{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,class:"view-gallery-btn",onOnClick:l.showEnlarged},{default:v(()=>a[2]||(a[2]=[C(" View Image Gallery ")])),_:1},8,["onOnClick"])):c("",!0),r.largeVisible?(n(),o(M,{key:2,to:"body"},[s("div",{class:"ebm-content-teaser-image__large",style:d({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:d({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 j=w(B,[["render",D]]);export{j as default};