import{_ as d}from"./WebImage-mBs9XKmm.mjs";import{_ as c,o as s,c as a,d as l,y as _,a as p,F as f,x as g,p as b,b as y}from"./C8VztkeY.js";import"./nuxt-link-CRFhnX-9.mjs";const h={props:{item:{type:Object,required:!0},imageAspectRatio:{type:[String,Number],default:"1.8"}},computed:{imageAlt(){var e,t,r,n;return((t=(e=this==null?void 0:this.item)==null?void 0:e.primaryImage)==null?void 0:t.displayName)??((n=(r=this==null?void 0:this.item)==null?void 0:r.primaryImage)==null?void 0:n.alt)??""},imageUrl(){var n;const{src:e,isLogo:t}=((n=this.item)==null?void 0:n.primaryImage)??{};return e?`${e.split("?")[0]}?auto=format,compress&fit=${t?"fill&fill-color=white&pad=5":"crop"}`:""},itemUrl(){var e;return((e=this.item.siteContext)==null?void 0:e.path)??""}}},C={class:_(["ebm-content-image-item"]),style:{display:"block",flexDirection:"row"}};function k(e,t,r,n,u,i){const m=d;return s(),a("div",C,[l(m,{image:i.imageUrl,alt:i.imageAlt,credit:r.item.primaryImage?r.item.primaryImage.credit:"","credit-position":"top","content-type":r.item.contentType||r.item.type,"image-link":i.itemUrl,"aspect-ratio":"full-teaser"},null,8,["image","alt","credit","content-type","image-link"])])}const I=c(h,[["render",k],["__scopeId","data-v-52a05ae5"]]),x={props:{items:{type:Array,default(){return[]}},numberOfColumns:{type:Number,default:4}},emits:["item-click"],computed:{cssVars(){let e="";for(let t=0;t<this.numberOfColumns;t++)e=`${e} 1fr`;return{"--four-columns":this.numberOfColumns>=4?"1fr 1fr 1fr 1fr":e,"--three-columns":this.numberOfColumns>=3?"1fr 1fr 1fr":e,"--two-columns":this.numberOfColumns>=2?"1fr 1fr":e}}}},v={class:"web-content-image-grid"},O=["onClick"];function $(e,t,r,n,u,i){const m=I;return s(),a("div",{class:"web-content-image-grid-wrapper",style:b(i.cssVars)},[p("div",v,[(s(!0),a(f,null,g(r.items,o=>(s(),a("div",{key:o.id,class:"item",onClick:()=>{e.$emit("item-click",o)}},[l(m,{class:"content-item",item:o},null,8,["item"])],8,O))),128))])],4)}const w=c(x,[["render",$],["__scopeId","data-v-2c369b57"]]),S={__name:"ContentImageGridBlock",props:{data:{type:Object,required:!0,validator(e){return["items"].every(t=>t in e)}},settings:{type:Object,required:!0,validator(e){return["numberOfColumns"].every(t=>t in e)}}},setup(e){return(t,r)=>{const n=w;return s(),y(n,{items:e.data.items,"number-of-columns":e.settings.numberOfColumns},null,8,["items","number-of-columns"])}}};export{S as default};