import{getNodeAttribute as a,setNodeAttributeValue as c}from"../../../../shared/markdoc.js";import{FileNotFoundError as m,resolveSrcSet as p}from"../../../utils/index.js";import{reporter as u}from"../../../utils/reporter/reporter.js";import{getLinkOriginalAttrName as g}from"./utils.js";import{MdResolveError as v}from"./md-resolve-error.js";async function P(r,e,l,{actions:{contentDir:n,outdir:s},context:f}){if(a(r,e)){const i=g(e),o=r[i]||a(r,e);if(r[i]=o,!o)return;try{const t=await p(o,f.fs,{fromFileRelativePath:l,contentDir:n,outdir:s});c(r,e,t)}catch(t){if(t instanceof m)throw new v(`File ${t.filePath} does not exist`,{rawLink:t.filePath,link:t.filePath});u.panicOnBuild(`Cannot resolve 'srcSet' attribute: ${t.message}`)}}}export{P as resolveImageSrcSet};
