var{defineProperty:K,getOwnPropertyNames:V,getOwnPropertyDescriptor:W}=Object,X=Object.prototype.hasOwnProperty;function Y(q){return this[q]}var N=(q)=>{var C=(M??=new WeakMap).get(q),H;if(C)return C;if(C=K({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var I of V(q))if(!X.call(C,I))K(C,I,{get:Y.bind(q,I),enumerable:!(H=W(q,I))||H.enumerable})}return M.set(q,C),C},M;var Z=(q)=>q;function $(q,C){this[q]=Z.bind(null,C)}var U=(q,C)=>{for(var H in C)K(q,H,{get:C[H],enumerable:!0,configurable:!0,set:$.bind(C,H)})};var _=(q,C)=>()=>(q&&(C=q(q=0)),C);var j=["markdown","react"];function O(q){if(!q.length)return"/";let C=q.startsWith("/")?q:`/${q}`;return C==="/"?"/":C.replace(/\/+$/,"")}function F(q,C){if(q.route)return O(q.route);let H=C??"/docs",I=q.id.replace(/^docs\.?/,"").replace(/\./g,"/").replace(/\/+/g,"/"),J=I.startsWith("/")?I:`${H}/${I}`;return O(J)}function G(q,C){return C?`${C}.${q.id}`:q.id}function Q(q,C){let H=C?.defaultTargets??j,I=q.version??C?.defaultVersion??"1.0.0",J=q.stability??C?.defaultStability??"stable";return{meta:{key:G(q,C?.namespace),title:q.title,version:I,description:q.summary??q.title,tags:q.tags||[],owners:q.owners||[],domain:q.domain||"",stability:J,goal:`Documentation of: ${q.summary}`,context:"Auto-generated"},policy:q.visibility&&q.visibility!=="public"?{flags:[q.visibility]}:void 0,source:{type:"blocknotejs",docJson:q.body},targets:H}}function y(q,C){return q.map((H)=>({block:H,route:F(H,C?.routePrefix),descriptor:Q(H,C)}))}function z(q,C){return q.map((H)=>Q(H,C))}function A(q){return q.map(({route:C,descriptor:H})=>[C,H])}export{A as mapDocRoutes,z as docBlocksToPresentationSpecs,y as docBlocksToPresentationRoutes,Q as docBlockToPresentationSpec};
