import{d as v,r as N,f as a,bD as O,aB as I,h as d,o as l,i as S,D as _,L as g,k as i,v as h,bE as y,a3 as D,a7 as C,q as A}from"./D3yeoG_9.js";const z={class:"base-picture"},E=["data-error"],F=v({inheritAttrs:!1,__name:"BasePicture",props:{placeholder:{},placeholderClass:{},custom:{type:Boolean},src:{},format:{},quality:{},background:{},fit:{},modifiers:{},preset:{},provider:{},sizes:{},densities:{},preload:{},width:{},height:{},alt:{},referrerpolicy:{},usemap:{},longdesc:{},ismap:{type:Boolean},loading:{},crossorigin:{},decoding:{},nonce:{}},setup(m){const e=m,b=!1,p=N(!1),f=a(()=>Number.parseFloat(`${e.height}`)/Number.parseFloat(`${e.width}`)),n=a(()=>O().getSizes(e.src,{modifiers:{width:Number.parseFloat(`${e.width}`),height:Number.parseFloat(`${e.height}`)},sizes:e.sizes})),B=a(()=>{const{sizes:t,...s}=e;return{...I(),...s,src:n.value.src}}),L=a(()=>n.value?.srcset===void 0?[]:n.value.srcset.split(",").map(t=>{const[s,r]=t.trim().split(" "),c=Number.parseFloat(r);return{needles:[c,c/2],url:s,width:r}})),o=a(()=>n.value?.sizes===void 0?[]:(n.value.sizes.split(",")??[]).map(t=>{const s=t.replace(/(.*\)\s)/,"").trim(),r=t.replace(s,"").trim();return{breakpoint:r===""?void 0:r,width:Number.parseFloat(s)}})),u=a(()=>o.value.map(({breakpoint:t,width:s})=>({height:Math.round(s*f.value),key:t,media:t,srcset:L.value.filter(r=>r.needles.includes(s)).map(r=>`${r.url} ${r.width}`).join(", "),width:s})));return(t,s)=>(l(),d("picture",z,[(l(!0),d(_,null,g(i(u),({key:r,...c})=>(l(),d("source",h({key:r},{ref_for:!0},c),null,16))),128)),S("img",h({...i(B),...i(b)?{onerror:"this.setAttribute('data-error', 1)"}:{}},{"data-error":i(p)?1:void 0,onError:s[0]||(s[0]=r=>p.value=!0)}),null,16,E)]))}}),R=Object.assign(F,{__name:"BasePicture"}),k=v({__name:"BaseCover",props:{brandCode:{},bundlePresentation:{default:"rotated"},bundleScale:{default:void 0},issueNumber:{default:""},issueYear:{default:""},productType:{default:void 0},variation:{default:"latest"},placeholder:{},placeholderClass:{},custom:{type:Boolean},format:{},quality:{},background:{},fit:{},modifiers:{},preset:{},provider:{},sizes:{default:""},densities:{},preload:{},width:{},height:{},alt:{},referrerpolicy:{},usemap:{},longdesc:{},ismap:{type:Boolean},loading:{},crossorigin:{},decoding:{},nonce:{}},setup(m){const e=m,b={DONDC:["DONAL","DONPO"],DONDD:["DONAL","DONEX"],DONMK:["DONAL","DONEX","DONPO"],FLWSY:["FLOW","FLWSP"],LIBBS:["LIBBO","LIBSP"],LIBPB:["LIBEL","LIBBO"],LIBPS:["LIBEL","LIBSP"],LIBPU:["LIBEL","LIBBO","LIBPZ"],LISPP:["LIBEL","LIBSP","LIBPZ"],MARPL:["MARGR","MARSP"],MASPP:["MARGR","MARSP","MARPZ"],VTWBS:["VTWON","WLSTY"]},p=a(()=>{const[,o]=Object.entries(b).find(([u])=>u===e.productType)??[];return o||[e.productType]}),f=a(()=>{const{brandCode:o,bundlePresentation:u,bundleScale:t,issueNumber:s,issueYear:r,productType:c,variation:M,...P}=e;return P}),n=a(()=>p.value.map(o=>({...f.value,key:o,src:y({brandCode:e.brandCode,productType:o,variation:e.variation,issueYear:e.issueYear,issueNumber:e.issueNumber})}))),B=a(()=>({[`base-cover--${e.bundlePresentation}`]:n.value.length>1})),L=a(()=>({"--bundle-scale":e.bundleScale??e.bundlePresentation==="rotated"?.85:.75}));return(o,u)=>{const t=R;return l(),d("figure",{class:C(["base-cover",i(B)]),style:D(i(L))},[(l(!0),d(_,null,g(i(n),({key:s,...r})=>(l(),A(t,h({key:s},{ref_for:!0},r),null,16))),128))],6)}}}),T=Object.assign(k,{__name:"BaseCover"});export{T as _}; //# sourceMappingURL=Dv9kAtTR.js.map