import a from"node:path";import{slash as f}from"../../../../utils/path/slash.js";import{reporter as l}from"../../../tools/notifiers/reporter.js";import{getNodeAttribute as p}from"../../../../markdoc/helpers/get-node-attribute.js";async function h(t,s,m,{actions:{contentDir:e},context:o}){const r=p(t,s);if(!r)return;const i=r.startsWith("/")?r.slice(1):f(a.relative(e,a.resolve(e,a.dirname(m),r)));if(!o.fs.exists(i)){await l.panicOnBuildContentError(`Diagram file ${i} does not exist`);return}const n=await o.fs.read(i);t.children=[],t.attributes.rawContent=n}export{h as resolveDiagramFromFile};
