export declare const sectionNavProviderTemplate = "\"use client\";\nimport { useMemo } from \"react\";\nimport { usePathname } from \"next/navigation\";\nimport { SideBar } from \"@/components/SideBar\";\nimport { DocsNavigation } from \"@/components/layout/DocsNavigation\";\nimport { SectionBarProvider } from \"@/components/layout/DocsComponents\";\nimport { Footer } from \"@/components/layout/Footer\";\nimport { StaticLinks } from \"@/components/layout/StaticLinks\";\nimport {\n transformPagesToGroupedStructure,\n type PagesProps,\n} from \"@/utils/orderNavItems\";\nimport rawNavigation from \"@/navigation.json\";\n\n// navigation.json can be an array (root section only) or an object keyed by section slug\ntype NavLink = {\n slug?: string;\n title: string;\n icon?: string;\n links?: NavLink[];\n};\ntype NavItem = { label: string; icon?: string; links: NavLink[] };\ntype NavigationConfig = NavItem[] | Record;\n\nconst navigation = rawNavigation as NavigationConfig;\n\nfunction getNavigationForSection(\n nav: NavigationConfig,\n sectionSlug: string,\n): NavItem[] | null {\n if (Array.isArray(nav)) {\n return sectionSlug === \"\" && nav.length ? nav : null;\n }\n const sectionNav = nav[sectionSlug];\n return sectionNav && sectionNav.length ? sectionNav : null;\n}\n\ninterface SectionConfig {\n label: string;\n slug: string;\n directory?: string;\n}\n\ninterface SectionNavProviderProps {\n sections: SectionConfig[];\n allPages: PagesProps[];\n hideBranding: boolean;\n children: React.ReactNode;\n}\n\nfunction SectionNavProvider({\n sections,\n allPages,\n hideBranding,\n children,\n}: SectionNavProviderProps) {\n const pathname = usePathname();\n const currentPath = pathname.replace(/^\\//, \"\").replace(/\\/$/, \"\");\n\n const activeSectionSlug = useMemo(() => {\n const match = sections.find((section) => {\n if (section.slug === \"\") return false;\n return (\n currentPath === section.slug ||\n currentPath.startsWith(section.slug + \"/\")\n );\n });\n return match ? match.slug : \"\";\n }, [sections, currentPath]);\n\n const result = useMemo(() => {\n const sectionNav = getNavigationForSection(navigation, activeSectionSlug);\n if (sectionNav) return sectionNav;\n const filtered = allPages.filter(\n (page) => (page.section || \"\") === activeSectionSlug,\n );\n return transformPagesToGroupedStructure(filtered);\n }, [allPages, activeSectionSlug]);\n\n // Fallback when no pages exist yet (also defined in layout.tsx for the non-sections path)\n const defaultPages = [\n {\n slug: \"\",\n title: \"Getting Started\",\n description:\n \"Doccupine is a free and open-source documentation platform. Write MDX, get a production-ready site with AI chat, built-in components, and an MCP server - in one command.\",\n date: \"2025-01-15\",\n category: \"Introduction\",\n categoryOrder: 0,\n categoryIcon: \"rocket\",\n order: 0,\n },\n ];\n\n const defaultResults = transformPagesToGroupedStructure(defaultPages);\n\n return (\n \n \n {children}\n \n \n