1import{p as B,u as I,a as N,m as S,g as j,b as C}from"./zn91Ragg.js";import{u as L}from"./COfgP330.js";import{d as M,u as O,f as o,e as $,g as H,c as l,o as p,h as T,F as U,i as V,m as q,j as d}from"./BVuyBFAy.js";const D=["type","sizes","srcset"],G=["src","sizes","srcset"],W=M({__name:"NuxtPicture",props:B,emits:["load","error"],setup(y,{emit:_}){const s=y,g=O(),n=_,x=!1,i=I(),{attrs:z,options:b,modifiers:h}=N(s),v=o(()=>j(s.src)),A=o(()=>["png","webp","gif","svg"].includes(v.value)),u=o(()=>s.legacyFormat?s.legacyFormat:A.value?"png":"jpeg"),m=o(()=>{var t,r;const e=((t=s.format)==null?void 0:t.split(","))||(v.value==="svg"?["svg"]:(r=i.options.format)!=null&&r.length?[...i.options.format]:["webp"]);return e[0]==="svg"?[{src:s.src}]:(e.includes(u.value)&&e.splice(e.indexOf(u.value),1),e.push(u.value),e.map(f=>{const{srcset:E,sizes:w,src:P}=i.getSizes(s.src,{...b.value,sizes:s.sizes||i.options.screens,densities:s.densities,modifiers:{...h.value,format:f}});return{src:P,type:`image/${f}`,sizes:w,srcset:E}}))}),c=o(()=>m.value[m.value.length-1]),F=o(()=>{const e={...s.imgAttrs,"data-nuxt-pic":""};for(const t in g)t in C&&!(t in e)&&(e[t]=g[t]);return e}),a=$(),k=L().isHydrating;return H(()=>{a.value&&(a.value.complete&&k&&(a.value.getAttribute("data-error")?n("error",new Event("error")):n("load",new Event("load"))),a.value.onload=e=>{n("load",e)},a.value.onerror=e=>{n("error",e)},S("nuxt-picture"))}),(e,t)=>(p(),l("picture",null,[(p(!0),l(U,null,V(m.value.slice(0,-1),r=>(p(),l("source",{key:r.src,type:r.type,sizes:r.sizes,srcset:r.srcset},null,8,D))),128)),c.value?(p(),l("img",q({key:0,ref_key:"imgEl",ref:a},{...d(z),...d(x)?{onerror:"this.setAttribute('data-error', 1)"}:{},...F.value},{src:c.value.src,sizes:c.value.sizes,srcset:c.value.srcset}),null,16,G)):T("",!0)]))}});export{W 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.