// @bun
var g=Object.defineProperty;var I=(n)=>n;function h(n,t){this[n]=I.bind(null,t)}var P=(n,t)=>{for(var e in t)g(n,e,{get:t[e],enumerable:!0,configurable:!0,set:h.bind(t,e)})};var M=(n,t)=>()=>(n&&(t=n(n=0)),t);var m="docs-index.manifest.json";var a={};P(a,{listGeneratedDocs:()=>_,getGeneratedDocById:()=>G,getDocsIndexManifest:()=>j});import{readFile as l}from"fs/promises";import*as o from"path";import{fileURLToPath as E}from"url";function S(n){if(!n)return"_common";if(n.includes("/")){let[t]=n.split("/");return t||"_common"}return"_common"}async function x(){if(!u)u=l(o.join(c,m),"utf8").then((n)=>JSON.parse(n));return u}function C(n){let t=n.contentRoot??".";if(t==="../../../../../../../generated/docs")return w;return o.join(c,t)}async function y(n){let t=D.get(n);if(t)return t;let e=l(o.join(c,n),"utf8").then((s)=>JSON.parse(s));return D.set(n,e),e}async function _(){if(!f)f=(async()=>{let n=await x();return(await Promise.all(n.chunks.map((e)=>y(e.file)))).flat()})();return f}async function j(){return x()}async function G(n){let t=await x(),e=S(n),s=t.chunks.find((r)=>r.key===e);if(!s)return null;let i=(await y(s.file)).find((r)=>r.id===n);if(!i||!i.contentPath)return null;let p=o.join(C(t),i.contentPath);try{let r=await l(p,"utf8");return{entry:i,content:r}}catch{return null}}var c,w,u=null,f=null,D;var d=M(()=>{c=o.dirname(E(import.meta.url)),w=o.join(c,"../../../../../../../generated/docs"),D=new Map});async function A(){let{getDocsIndexManifest:n}=await Promise.resolve().then(() => (d(),a));return n()}async function B(){let{listGeneratedDocs:n}=await Promise.resolve().then(() => (d(),a));return n()}async function T(n){let{getGeneratedDocById:t}=await Promise.resolve().then(() => (d(),a));return t(n)}export{B as listGeneratedDocs,T as getGeneratedDocById,A as getDocsIndexManifest};
