1import{i as x,u as k,a as w,m as E,c as h}from"./ZWeMAqc-.js";import{d as I,en as S,B,L,T as N,ab as _,u as c,ac as P,cA as C,M as z,A as n,o as M}from"./6cw9AFkX.js";const $=["src"],j=I({__name:"NuxtImg",props:x,emits:["load","error"],setup(A,{emit:y}){const s=A,v=S(),a=y,p=!1,m=k(),t=w(s),i=z(!1),o=z(),l=n(()=>m.getSizes(s.src,{...t.options.value,sizes:s.sizes,densities:s.densities,modifiers:{...t.modifiers.value,width:h(s.width),height:h(s.height)}})),f=n(()=>{const e={...t.attrs.value,"data-nuxt-img":""};return(!s.placeholder||i.value)&&(e.sizes=l.value.sizes,e.srcset=l.value.srcset),e}),u=n(()=>{let e=s.placeholder;if(e===""&&(e=!0),!e||i.value)return!1;if(typeof e=="string")return e;const r=Array.isArray(e)?e:typeof e=="number"?[e,e]:[10,10];return m(s.src,{...t.modifiers.value,width:r[0],height:r[1],quality:r[2]||50,blur:r[3]||3},t.options.value)}),d=n(()=>s.sizes?l.value.src:m(s.src,t.modifiers.value,t.options.value)),g=n(()=>u.value?u.value:d.value),b=B().isHydrating;return L(()=>{if(u.value||s.custom){const e=new Image;d.value&&(e.src=d.value),s.sizes&&(e.sizes=l.value.sizes||"",e.srcset=l.value.srcset),e.onload=r=>{i.value=!0,a("load",r)},e.onerror=r=>{a("error",r)},E("nuxt-image");return}o.value&&(o.value.complete&&b&&(o.value.getAttribute("data-error")?a("error",new Event("error")):a("load",new Event("load"))),o.value.onload=e=>{a("load",e)},o.value.onerror=e=>{a("error",e)})}),(e,r)=>e.custom?P(e.$slots,"default",C(_({key:1},{...c(p)?{onerror:"this.setAttribute('data-error', 1)"}:{},imgAttrs:{...f.value,...c(v)},isLoaded:i.value,src:g.value}))):(M(),N("img",_({key:0,ref_key:"imgEl",ref:o,class:u.value&&!i.value?e.placeholderClass:void 0},{...c(p)?{onerror:"this.setAttribute('data-error', 1)"}:{},...f.value,...c(v)},{src:g.value}),null,16,$))}}),O=Object.assign(j,{__name:"NuxtImg"});export{O as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.