import{_ as k}from"./WebImage-CIpNTik-.mjs";import{_ as v,o as i,c as l,a as u,d as _,l as r,t as b,b as d,s as o,q as g,F as h,x as z,y as x,p,b8 as U}from"./BDipKYNj.js";import"./nuxt-link-BWzEhDJx.mjs";const w={props:{items:{type:Array},layout:{type:String},imagePosition:{type:String},imageFit:{type:String,default:"crop"}},computed:{featured(){return this.layout!=="grid"?{...this.items[0]}:{}},grid(){return this.layout==="single"?[]:this.layout==="grid"?[...this.items]:[...this.items.slice(1,13)]}},methods:{imageUrl(a){return a.split("?")[0]},navigateTo(a){window.location=a}}},F={class:"magazine-issue-wrapper"},I={key:0,class:"featured"},B=["href"],O={class:"text-box"},S=["href"],C={class:"buttons"},E={key:1,class:"grid"},P=["href"],N={class:"text-box"},T=["href"];function V(a,t,s,c,W,e){var y;const f=k,m=U;return i(),l("div",F,[u("div",{class:x(["magazine-issue",s.layout,s.imagePosition!=="none"?"image-"+s.imagePosition:""]),style:p({alignItems:s.layout==="grid_featured"?"flex-start":"center",fontFamily:a.$ss.primaryFontFamily})},[e.featured.name?(i(),l("div",I,[e.featured.coverImage?(i(),l("a",{key:0,href:"/magazine/"+e.featured.id},[_(f,{image:e.imageUrl(e.featured.coverImage.src)+`?fit=${s.imageFit}&w=640&h=888`,"is-logo":!1,alt:e.featured.name+" cover image",class:"cover","aspect-ratio":"issue"},null,8,["image","alt"])],8,B)):r("",!0),u("div",O,[u("a",{href:"/magazine/"+e.featured.id,class:"name"},b(e.featured.name),9,S),u("div",C,[e.featured.publication&&e.featured.publication.subscribeUrl&&!((y=a.$ss.systemOutage)!=null&&y.disableOmeda)?(i(),d(m,{key:0,type:"link",size:"large",link:e.featured.publication.subscribeUrl},{default:o(()=>t[2]||(t[2]=[g(" Subscribe ")])),_:1},8,["link"])):r("",!0),e.featured.digitalEditionUrl?(i(),d(m,{key:1,type:"link",link:e.featured.digitalEditionUrl,target:"_blank",size:"large"},{default:o(()=>t[3]||(t[3]=[g(" Digital"),u("span",{class:"digital-full-label"}," Edition",-1)])),_:1},8,["link"])):r("",!0),e.featured.publication&&e.featured.publication.id?(i(),d(m,{key:2,type:"link",size:"large",link:"/magazine/"+e.featured.publication.id},{default:o(()=>t[4]||(t[4]=[g(" Archives ")])),_:1},8,["link"])):r("",!0),e.featured.publication&&e.featured.publication.renewalUrl?(i(),d(m,{key:3,size:"large",onOnClick:t[0]||(t[0]=()=>{e.navigateTo(e.featured.publication.renewalUrl)})},{default:o(()=>t[5]||(t[5]=[g(" Renew ")])),_:1})):r("",!0),e.featured.publication&&e.featured.publication.reprintsUrl?(i(),d(m,{key:4,size:"large",onOnClick:t[1]||(t[1]=()=>{e.navigateTo(e.featured.publication.reprintsUrl)})},{default:o(()=>t[6]||(t[6]=[g(" Reprints ")])),_:1})):r("",!0)])])])):r("",!0),e.grid.length?(i(),l("div",E,[(i(!0),l(h,null,z(e.grid,n=>(i(),l("div",{key:n.name,class:"item"},[n.coverImage?(i(),l("a",{key:0,href:"/magazine/"+n.id},[_(f,{image:e.imageUrl(n.coverImage.src)+`?fit=${s.imageFit}&h=444&w=320`,"is-logo":!1,alt:n.name+" cover image",class:"cover","aspect-ratio":"issue"},null,8,["image","alt"])],8,P)):r("",!0),u("div",N,[s.layout==="grid"?(i(),l("a",{key:0,href:"/magazine/"+n.id,class:"name"},b(n.name),9,T)):r("",!0)])]))),128))])):r("",!0)],6)])}const q=v(w,[["render",V]]),M={__name:"MagazineIssueBlock",props:{data:{type:Object,required:!0,validator(a){return["items"].every(t=>t in a)}},settings:{type:Object,required:!0,validator(a){return["layout","imagePosition"].every(t=>t in a)}}},setup(a){return(t,s)=>{const c=q;return i(),d(c,{items:a.data.items,layout:a.settings.layout,"image-position":a.settings.imagePosition,"image-fit":a.settings.imageFit},null,8,["items","layout","image-position","image-fit"])}}};export{M as default};