#!/usr/bin/env node
import {a,d,e,f,g,c,h}from'./chunk-BFD3GFRK.js';import'./chunk-5TAVYPOV.js';import {Router}from'express';function y(e$1){let a$1=Router();return a$1.get("/manifest",(o,s)=>{try{let t=a(e$1),n=d(e$1,t);s.json(n);}catch(t){s.status(500).json({error:"Failed to build docs manifest",detail:String(t)});}}),a$1.get("/symbol/:id",(o,s)=>{try{let t=e(e$1,o.params.id);if(!t){s.status(404).json({error:`Symbol "${o.params.id}" not found`});return}s.json(t);}catch(t){s.status(500).json({error:"Failed to build symbol page",detail:String(t)});}}),a$1.get("/flow/:id",(o,s)=>{try{let t=f(e$1,o.params.id);if(!t){s.status(404).json({error:`Flow "${o.params.id}" not found`});return}s.json(t);}catch(t){s.status(500).json({error:"Failed to build flow page",detail:String(t)});}}),a$1.get("/portal",(o,s)=>{try{let t=g(e$1);s.json(t);}catch(t){s.status(500).json({error:"Failed to build portal page",detail:String(t)});}}),a$1.get("/page/:slug",(o,s)=>{try{let t=a(e$1),n=c(e$1,o.params.slug,t);if(!n){s.status(404).json({error:`Page "${o.params.slug}" not found`});return}s.json(n);}catch(t){s.status(500).json({error:"Failed to load custom page",detail:String(t)});}}),a$1.get("/search",(o,s)=>{try{let t=o.query.q||"";if(!t){s.json({count:0,results:[]});return}let n=o.query.limit?parseInt(o.query.limit,10):20,u=h(e$1,t,n);s.json({count:u.length,results:u});}catch(t){s.status(500).json({error:"Failed to search docs",detail:String(t)});}}),a$1}export{y as createDocsRouter};