specra 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/docs-page.js +164 -148
- package/dist/app/docs-page.js.map +1 -1
- package/dist/app/docs-page.mjs +3 -3
- package/dist/app/layout.js +84 -5
- package/dist/app/layout.js.map +1 -1
- package/dist/app/layout.mjs +3 -3
- package/dist/{chunk-NXRIAL7T.mjs → chunk-4QHOMV5A.mjs} +8 -5
- package/dist/chunk-4QHOMV5A.mjs.map +1 -0
- package/dist/{chunk-IZFGEAD6.mjs → chunk-5AYOV2KD.mjs} +5 -4
- package/dist/chunk-5AYOV2KD.mjs.map +1 -0
- package/dist/chunk-I3ELVEK2.mjs +56 -0
- package/dist/chunk-I3ELVEK2.mjs.map +1 -0
- package/dist/{chunk-INL2EC72.mjs → chunk-RLMSINLY.mjs} +2 -5
- package/dist/{chunk-INL2EC72.mjs.map → chunk-RLMSINLY.mjs.map} +1 -1
- package/dist/components/index.d.mts +39 -3
- package/dist/components/index.d.ts +39 -3
- package/dist/components/index.js +100 -62
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +83 -48
- package/dist/components/index.mjs.map +1 -1
- package/dist/index.d.mts +39 -3
- package/dist/index.d.ts +39 -3
- package/dist/index.js +129 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.d.mts +7 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.js +1 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +1 -1
- package/package.json +2 -2
- package/src/app/layout.tsx +6 -3
- package/src/components/docs/header.tsx +7 -3
- package/src/components/docs/index.ts +3 -0
- package/src/lib/config.context.tsx +65 -0
- package/src/lib/config.server.ts +9 -5
- package/src/lib/index.ts +1 -0
- package/dist/chunk-IZFGEAD6.mjs.map +0 -1
- package/dist/chunk-MZJHJ6BV.mjs +0 -21
- package/dist/chunk-MZJHJ6BV.mjs.map +0 -1
- package/dist/chunk-NXRIAL7T.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/index.ts","../../src/components/docs/accordion.tsx","../../src/components/docs/badge.tsx","../../src/components/docs/breadcrumb.tsx","../../src/components/docs/callout.tsx","../../src/components/docs/card.tsx","../../src/components/docs/icon.tsx","../../src/components/docs/category-index.tsx","../../src/lib/remark-code-meta.ts","../../src/components/docs/code-block.tsx","../../src/components/docs/tabs.tsx","../../src/components/docs/image.tsx","../../src/components/docs/video.tsx","../../src/components/docs/image-card.tsx","../../src/components/docs/steps.tsx","../../src/components/docs/mermaid.tsx","../../src/components/docs/math.tsx","../../src/components/docs/columns.tsx","../../src/components/docs/tooltip.tsx","../../src/components/docs/frame.tsx","../../src/components/docs/api/api-endpoint.tsx","../../src/lib/utils.ts","../../src/components/docs/api/api-params.tsx","../../src/components/docs/api/api-response.tsx","../../src/components/docs/api/api-playground.tsx","../../src/components/ui/button.tsx","../../src/components/ui/input.tsx","../../src/components/ui/textarea.tsx","../../src/components/ui/badge.tsx","../../src/components/docs/api/api-reference.tsx","../../src/lib/parsers/specra-parser.ts","../../src/lib/parsers/openapi-parser.ts","../../src/lib/parsers/postman-parser.ts","../../src/lib/parsers/index.ts","../../src/components/docs/mdx-components.tsx","../../src/lib/config.types.ts","../../src/lib/config.server.ts","../../src/lib/sidebar-utils.ts","../../src/components/docs/componentTextProps.ts","../../src/components/docs/dev-mode-badge.tsx","../../src/components/docs/doc-layout.tsx","../../src/components/docs/doc-navigation.tsx","../../src/components/docs/doc-metadata.tsx","../../src/components/docs/draft-badge.tsx","../../src/components/docs/doc-tags.tsx","../../src/components/docs/search-highlight.tsx","../../src/components/docs/doc-layout-wrapper.tsx","../../src/components/docs/mobile-doc-layout.tsx","../../src/components/docs/footer.tsx","../../src/components/docs/site-banner.tsx","../../src/components/docs/tab-groups.tsx","../../src/components/docs/sidebar.tsx","../../src/components/docs/tab-context.tsx","../../src/components/docs/doc-loading.tsx","../../src/components/docs/header.tsx","../../src/components/docs/version-switcher.tsx","../../src/components/docs/theme-toggle.tsx","../../src/components/docs/search-modal.tsx","../../src/components/ui/dialog.tsx","../../src/components/docs/hot-reload-indicator.tsx","../../src/components/docs/mdx-hot-reload.tsx","../../src/components/docs/not-found-content.tsx","../../src/components/docs/sidebar-skeleton.tsx","../../src/components/docs/table-of-contents.tsx","../../src/components/global/version-not-found.tsx"],"sourcesContent":["// Documentation Components\nexport * from './docs'\n\n// UI Components\nexport * from './ui'\n\n// Global Components\nexport * from './global'","\"use client\"\n\nimport { ChevronDown } from \"lucide-react\"\nimport { useState } from \"react\"\n\ninterface AccordionItemProps {\n title: string | React.ReactNode\n children: React.ReactNode\n defaultOpen?: boolean\n value?: string // For compatibility with radix-ui style API\n}\n\nexport function AccordionItem({ title, children, defaultOpen = false }: AccordionItemProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen)\n\n return (\n <div className=\"border border-border rounded-xl overflow-hidden mb-2\">\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"w-full flex items-center justify-between p-4 text-left bg-muted/30 hover:bg-muted/50 transition-colors\"\n >\n <span className=\"font-medium text-foreground\">{title}</span>\n <ChevronDown\n className={`h-5 w-5 text-muted-foreground transition-transform ${\n isOpen ? \"rotate-180\" : \"\"\n }`}\n />\n </button>\n {isOpen && (\n <div className=\"p-4 border-t border-border bg-background\">\n <div className=\"prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0\">\n {children}\n </div>\n </div>\n )}\n </div>\n )\n}\n\ninterface AccordionProps {\n children: React.ReactNode\n type?: \"single\" | \"multiple\"\n collapsible?: boolean // For compatibility with radix-ui style API\n className?: string\n}\n\nexport function Accordion({ children, type = \"multiple\", className }: AccordionProps) {\n return (\n <div className={className || \"my-6 space-y-2\"}>\n {children}\n </div>\n )\n}\n","interface BadgeProps {\n children: React.ReactNode\n variant?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n}\n\nexport function Badge({ children, variant = \"default\" }: BadgeProps) {\n const variants = {\n default: \"bg-muted text-foreground border-border\",\n success: \"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20\",\n warning: \"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 border-yellow-500/20\",\n error: \"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20\",\n info: \"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20\",\n }\n\n return (\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium border ${variants[variant]}`}\n >\n {children}\n </span>\n )\n}\n","import Link from \"next/link\"\nimport { ChevronRight } from \"lucide-react\"\n\ninterface BreadcrumbProps {\n version: string\n slug: string\n title: string\n}\n\nexport function Breadcrumb({ version, slug, title }: BreadcrumbProps) {\n const parts = slug.split(\"/\")\n const breadcrumbs = [\n { label: \"Docs\", href: `/docs/${version}` },\n ]\n\n // Build breadcrumb path\n let currentPath = \"\"\n for (let i = 0; i < parts.length - 1; i++) {\n currentPath += (currentPath ? \"/\" : \"\") + parts[i]\n breadcrumbs.push({\n label: parts[i].replace(/-/g, \" \").replace(/\\b\\w/g, (l) => l.toUpperCase()),\n href: `/docs/${version}/${currentPath}`,\n })\n }\n\n // Add current page\n breadcrumbs.push({\n label: title,\n href: `/docs/${version}/${slug}`,\n })\n\n return (\n <nav className=\"flex items-center gap-2 text-sm text-muted-foreground mb-4\" aria-label=\"Breadcrumb\">\n {breadcrumbs.map((crumb, index) => (\n <div key={crumb.href} className=\"flex items-center gap-2\">\n {index > 0 && <ChevronRight className=\"h-4 w-4\" />}\n {index === breadcrumbs.length - 1 ? (\n <span className=\"text-foreground font-medium\">{crumb.label}</span>\n ) : (\n <Link\n href={crumb.href}\n className=\"hover:text-foreground transition-colors\"\n >\n {crumb.label}\n </Link>\n )}\n </div>\n ))}\n </nav>\n )\n}\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport { Info, AlertTriangle, CheckCircle2, XCircle, Lightbulb } from \"lucide-react\"\n\ninterface CalloutProps {\n children: ReactNode\n type?: \"info\" | \"warning\" | \"success\" | \"error\" | \"tip\" | \"note\" | \"danger\"\n title?: string\n}\n\nexport function Callout({ children, type = \"info\", title }: CalloutProps) {\n const configs = {\n info: {\n icon: Info,\n className: \"bg-blue-500/10 border-blue-500/30 text-blue-900 dark:bg-blue-400/5 dark:border-blue-500/20 dark:text-blue-400\",\n iconClassName: \"text-blue-600 dark:text-blue-400\",\n titleClassName: \"text-blue-700 dark:text-blue-300\",\n defaultTitle: \"Info\",\n },\n note: {\n icon: Info,\n className: \"bg-blue-500/10 border-blue-500/30 text-blue-900 dark:bg-blue-400/5 dark:border-blue-500/20 dark:text-blue-400\",\n iconClassName: \"text-blue-600 dark:text-blue-400\",\n titleClassName: \"text-blue-700 dark:text-blue-300\",\n defaultTitle: \"Note\",\n },\n warning: {\n icon: AlertTriangle,\n className: \"bg-yellow-500/10 border-yellow-500/30 text-yellow-900 dark:bg-yellow-400/5 dark:border-yellow-500/20 dark:text-yellow-400\",\n iconClassName: \"text-yellow-600 dark:text-yellow-400\",\n titleClassName: \"text-yellow-700 dark:text-yellow-300\",\n defaultTitle: \"Warning\",\n },\n success: {\n icon: CheckCircle2,\n className: \"bg-green-500/10 border-green-500/30 text-green-900 dark:bg-green-400/5 dark:border-green-500/20 dark:text-green-400\",\n iconClassName: \"text-green-600 dark:text-green-400\",\n titleClassName: \"text-green-700 dark:text-green-300\",\n defaultTitle: \"Success\",\n },\n error: {\n icon: XCircle,\n className: \"bg-red-500/10 border-red-500/30 text-red-900 dark:bg-red-400/5 dark:border-red-500/20 dark:text-red-400\",\n iconClassName: \"text-red-600 dark:text-red-400\",\n titleClassName: \"text-red-700 dark:text-red-300\",\n defaultTitle: \"Error\",\n },\n danger: {\n icon: XCircle,\n className: \"bg-red-500/10 border-red-500/30 text-red-900 dark:bg-red-400/5 dark:border-red-500/20 dark:text-red-400\",\n iconClassName: \"text-red-600 dark:text-red-400\",\n titleClassName: \"text-red-700 dark:text-red-300\",\n defaultTitle: \"Danger\",\n },\n tip: {\n icon: Lightbulb,\n className: \"bg-purple-500/10 border-purple-500/30 text-purple-900 dark:bg-purple-400/5 dark:border-purple-500/20 dark:text-purple-400\",\n iconClassName: \"text-purple-600 dark:text-purple-400\",\n titleClassName: \"text-purple-700 dark:text-purple-300\",\n defaultTitle: \"Tip\",\n },\n }\n\n const config = configs[type]\n const Icon = config.icon\n\n // Extract title from strong/bold text if present, but ONLY if no explicit title prop was provided\n let _title = title || config.defaultTitle\n let content = children\n\n if (!title && children && typeof children === \"object\") {\n const childArray = Array.isArray(children) ? children : [children]\n const firstElement = childArray[0]\n\n // Check if first child is a paragraph with a strong element\n if (firstElement && typeof firstElement === \"object\" && \"props\" in firstElement) {\n const props = (firstElement as any).props\n if (props.children && Array.isArray(props.children)) {\n const strongChild = props.children.find(\n (child: any) => child && typeof child === \"object\" && child.type === \"strong\",\n )\n if (strongChild) {\n _title = strongChild.props.children\n // Remove the title from content\n content = childArray.map((child, idx) => {\n if (idx === 0 && typeof child === \"object\" && \"props\" in child) {\n const newChildren = (child as any).props.children.filter((c: any) => c !== strongChild)\n return { ...child, props: { ...(child as any).props, children: newChildren } }\n }\n return child\n })\n }\n }\n }\n }\n\n return (\n <div className={`flex gap-3 p-4 rounded-xl border my-2 ${config.className}`}>\n <div className=\"flex-shrink-0 mt-0.5\">\n <Icon className={`h-5 w-5 ${config.iconClassName}`} />\n </div>\n <div className=\"flex-1 space-y-0\">\n <div className={`font-semibold text-sm ${config.titleClassName}`}>{_title}</div>\n <div className=\"text-sm leading-relaxed [&>p]:mb-0 [&>p]:text-current\">{content}</div>\n </div>\n </div>\n )\n}\n","import { ArrowRight, ExternalLink } from \"lucide-react\"\nimport Link from \"next/link\"\nimport { Icon } from \"./icon\"\n\ninterface CardProps {\n title: string\n description?: string\n href?: string\n icon?: string | React.ReactNode\n children?: React.ReactNode\n external?: boolean\n}\n\nexport function Card({ title, description, href, icon, children, external = false }: CardProps) {\n const content = (\n <>\n <div className=\"flex items-center gap-3\">\n {icon && (\n <div className=\"shrink-0 w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary\">\n {typeof icon === \"string\" ? <Icon icon={icon} size={20} /> : icon}\n </div>\n )}\n <div className=\"flex-1 min-w-0\">\n <h3 className={`font-semibold text-foreground mb-1 no-underline ${href ? 'group-hover:text-primary transition-colors' : ''}`}>\n {title}\n </h3>\n {description && (\n <p className=\"text-sm text-muted-foreground line-clamp-2 no-underline\">{description}</p>\n )}\n {children && (\n <div className=\"mt-2 text-sm text-muted-foreground no-underline\">{children}</div>\n )}\n </div>\n {href && (\n <div className=\"shrink-0 self-start mt-1\">\n {external ? (\n <ExternalLink className=\"h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors\" />\n ) : (\n <ArrowRight className=\"h-4 w-4 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all\" />\n )}\n </div>\n )}\n </div>\n </>\n )\n\n if (href) {\n const Component = external ? \"a\" : Link\n return (\n <Component\n href={href}\n className=\"card-link group block p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all\"\n {...(external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {content}\n </Component>\n )\n }\n\n return (\n <div className=\"p-4 rounded-xl border border-border bg-muted/30 no-underline\">\n {content}\n </div>\n )\n}\n\ninterface CardGridProps {\n children: React.ReactNode\n cols?: 1 | 2 | 3\n}\n\nexport function CardGrid({ children, cols = 2 }: CardGridProps) {\n const gridCols = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-1 md:grid-cols-2\",\n 3: \"grid-cols-1 md:grid-cols-2 lg:grid-cols-3\",\n }\n\n return (\n <div className={`grid ${gridCols[cols]} gap-4 my-6`}>\n {children}\n </div>\n )\n}\n","\"use client\"\n\nimport * as LucideIcons from \"lucide-react\"\n\ninterface IconProps {\n icon: string | React.ReactNode\n iconType?: \"regular\" | \"solid\" | \"light\" | \"thin\" | \"sharp-solid\" | \"duotone\" | \"brands\"\n color?: string\n size?: number\n className?: string\n}\n\nexport function Icon({ icon, iconType = \"regular\", color, size = 20, className = \"\" }: IconProps) {\n // If icon is a React node (custom SVG), render it directly\n if (typeof icon !== \"string\") {\n return <span className={`inline-flex items-center ${className}`} style={{ color }}>{icon}</span>\n }\n\n // Check if it's a URL (external or local file)\n if (icon.startsWith(\"http\") || icon.startsWith(\"/\")) {\n return (\n <img\n src={icon}\n alt=\"\"\n width={size}\n height={size}\n className={`inline-block ${className}`}\n style={{ color }}\n />\n )\n }\n\n // Check if it's a Font Awesome icon (starts with fa-)\n if (icon.startsWith(\"fa-\")) {\n const faClass = `fa-${iconType} ${icon}`\n return (\n <i\n className={`${faClass} ${className}`}\n style={{ fontSize: size, color }}\n aria-hidden=\"true\"\n />\n )\n }\n\n // Try to find Lucide icon\n const iconName = icon\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\"\")\n\n const LucideIcon = (LucideIcons as any)[iconName]\n\n if (LucideIcon) {\n return (\n <LucideIcon\n size={size}\n className={`inline-block ${className}`}\n style={{ color }}\n aria-hidden=\"true\"\n />\n )\n }\n\n // Fallback: render the icon name\n return (\n <span className={`inline-flex items-center font-mono text-xs ${className}`} style={{ color }}>\n [{icon}]\n </span>\n )\n}\n","import Link from \"next/link\"\nimport { ChevronRight, FileText } from \"lucide-react\"\nimport type { Doc } from \"@/lib/mdx\"\nimport { ReactNode } from \"react\"\nimport { MDXRemote } from \"next-mdx-remote/rsc\"\nimport remarkGfm from \"remark-gfm\"\nimport { remarkCodeMeta } from \"@/lib/remark-code-meta\"\nimport rehypeSlug from \"rehype-slug\"\nimport { mdxComponents } from \"./mdx-components\"\nimport { getConfig, processContentWithEnv, SpecraConfig } from \"@/lib/config\"\nimport { sortSidebarItems } from \"@/lib/sidebar-utils\"\n\ninterface CategoryIndexProps {\n categoryPath: string\n version: string\n allDocs: Doc[]\n title: string\n description?: string\n content?: string\n config: SpecraConfig\n}\n\nexport function CategoryIndex({ categoryPath, version, allDocs, title, description, content , config}: CategoryIndexProps) {\n // Find all docs that are direct children of this category\n const childDocs = allDocs.filter((doc) => {\n // Get the parent path of the doc\n const parts = doc.slug.split(\"/\")\n const docParent = parts.slice(0, -1).join(\"/\")\n\n // Check if this doc is a direct child of the category\n return docParent === categoryPath && doc.slug !== categoryPath\n })\n\n\n // const config = getConfig();\n const processedContent = () => {\n if(content){\n return processContentWithEnv(content, config);\n }\n return \"\";\n };\n\n // Sort by sidebar_position using unified sorting function\n const sortedDocs = sortSidebarItems(childDocs)\n\n return (\n <div className=\"flex-1 min-w-0\">\n <div className=\"mb-8\">\n <h1 className=\"text-4xl font-bold tracking-tight mb-3 text-foreground\">{title}</h1>\n {description && <p className=\"text-lg text-muted-foreground leading-relaxed\">{description}</p>}\n \n <div className=\"prose prose-slate dark:prose-invert max-w-none prose-headings:scroll-mt-24 prose-headings:font-semibold prose-h1:text-4xl prose-h2:text-3xl prose-h2:mt-12 prose-h2:mb-4 prose-h3:text-2xl prose-h3:mt-8 prose-h3:mb-3 prose-p:text-base prose-p:leading-7 prose-p:text-muted-foreground prose-p:mb-4 prose-a:font-normal prose-a:transition-all prose-code:text-primary prose-code:bg-muted/50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:text-[13px] prose-code:font-mono prose-code:border prose-code:border-border/50 prose-code:before:content-none prose-code:after:content-none prose-pre:bg-transparent prose-pre:p-0 prose-ul:list-disc prose-ul:list-inside prose-ul:space-y-2 prose-ul:mb-4 prose-ol:list-decimal prose-ol:list-inside prose-ol:space-y-2 prose-ol:mb-4 prose-li:leading-7 prose-li:text-muted-foreground prose-strong:text-foreground prose-strong:font-semibold\">\n <MDXRemote\n source={processedContent()}\n options={{\n parseFrontmatter: false,\n mdxOptions: {\n remarkPlugins: [remarkGfm, remarkCodeMeta],\n rehypePlugins: [rehypeSlug],\n development: false,\n },\n }}\n components={mdxComponents as any}\n />\n </div>\n\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {sortedDocs.map((doc) => (\n <Link\n key={doc.slug}\n href={`/docs/${version}/${doc.slug}`}\n className=\"group block p-5 rounded-xl border border-border bg-card hover:bg-accent hover:border-primary/50 transition-all duration-200\"\n style={{\n textDecoration: \"none !important\"\n }}\n >\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-2\">\n <FileText className=\"h-6 w-6 text-primary shrink-0\" />\n <h3 className=\"text-lg font-semibold text-foreground group-hover:text-primary transition-colors\">\n {doc.meta.title || doc.title}\n </h3>\n </div>\n {doc.meta.description && (\n <p className=\"text-sm text-muted-foreground line-clamp-2\">\n {doc.meta.description}\n </p>\n )}\n {doc.meta.reading_time && (\n <p className=\"text-xs text-muted-foreground mt-2\">\n {doc.meta.reading_time} min read\n </p>\n )}\n </div>\n <ChevronRight className=\"h-5 w-5 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all flex-shrink-0 mt-1\" />\n </div>\n </Link>\n ))}\n </div>\n\n {sortedDocs.length === 0 && (\n <div className=\"text-center py-12 text-muted-foreground\">\n <FileText className=\"h-12 w-12 mx-auto mb-3 opacity-50\" />\n <p>No documents found in this category.</p>\n </div>\n )}\n </div>\n )\n}\n","/**\n * Remark plugin to extract code block meta strings and pass them as props\n * Converts: ```js filename.js\n * Into props: { language: 'js', meta: 'filename.js' }\n */\nexport function remarkCodeMeta() {\n return (tree: any) => {\n const visit = (node: any) => {\n if (node.type === 'code' && node.meta) {\n // Store the meta string in the node's data\n node.data = node.data || {}\n node.data.hProperties = node.data.hProperties || {}\n node.data.hProperties.meta = node.meta\n }\n \n if (node.children) {\n node.children.forEach(visit)\n }\n }\n \n visit(tree)\n }\n}\n","\"use client\"\n\nimport { useState } from \"react\"\nimport { Check, Copy } from \"lucide-react\"\n\ninterface CodeBlockProps {\n code: string\n language: string\n filename?: string\n}\n\nexport function CodeBlock({ code, language, filename }: CodeBlockProps) {\n const [copied, setCopied] = useState(false)\n\n const handleCopy = async () => {\n await navigator.clipboard.writeText(code)\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n }\n\n const highlightCode = (code: string, lang: string) => {\n const lines = code.split(\"\\n\")\n\n return lines.map((line, i) => {\n const tokens: Array<{ type: string; value: string }> = []\n let currentPos = 0\n\n // Regex patterns for different token types\n const patterns = [\n { type: \"comment\", regex: /(\\/\\/.*$|\\/\\*[\\s\\S]*?\\*\\/|#.*$)/ },\n { type: \"string\", regex: /(\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|`(?:[^`\\\\]|\\\\.)*`)/ },\n {\n type: \"keyword\",\n regex:\n /\\b(const|let|var|function|return|if|else|for|while|do|break|continue|switch|case|default|import|export|from|as|class|extends|implements|interface|type|enum|namespace|async|await|try|catch|finally|throw|new|this|super|static|public|private|protected|readonly|abstract|void|null|undefined|true|false|typeof|instanceof|delete|in|of)\\b/,\n },\n { type: \"operator\", regex: /([+\\-*/%=<>!&|^~?:]+)/ },\n { type: \"number\", regex: /\\b(0x[a-fA-F0-9]+|0b[01]+|\\d+\\.?\\d*(?:e[+-]?\\d+)?)\\b/ },\n { type: \"function\", regex: /\\b([a-zA-Z_$][\\w$]*)\\s*(?=\\()/ },\n { type: \"property\", regex: /\\.([a-zA-Z_$][\\w$]*)/ },\n { type: \"punctuation\", regex: /([{}[\\]();,])/ },\n ]\n\n while (currentPos < line.length) {\n let matched = false\n\n for (const { type, regex } of patterns) {\n const match = line.slice(currentPos).match(regex)\n if (match && match.index === 0) {\n tokens.push({ type, value: match[0] })\n currentPos += match[0].length\n matched = true\n break\n }\n }\n\n if (!matched) {\n // Regular text or whitespace\n const nextSpecialChar = line.slice(currentPos).search(/[\"'`/\\w.+\\-*/%=<>!&|^~?:;,()[\\]{}#]/)\n if (nextSpecialChar === -1) {\n tokens.push({ type: \"text\", value: line.slice(currentPos) })\n break\n } else if (nextSpecialChar > 0) {\n tokens.push({ type: \"text\", value: line.slice(currentPos, currentPos + nextSpecialChar) })\n currentPos += nextSpecialChar\n } else {\n tokens.push({ type: \"text\", value: line[currentPos] })\n currentPos++\n }\n }\n }\n\n return (\n <div key={i} className=\"table-row\">\n <span className=\"table-cell pr-4 text-right select-none text-muted-foreground/40 w-8 align-top\">{i + 1}</span>\n <span className=\"table-cell align-top\">\n {tokens.length === 0 ? (\n <span> </span>\n ) : (\n tokens.map((token, j) => (\n <span key={j} className={`token-${token.type}`}>\n {token.value}\n </span>\n ))\n )}\n </span>\n </div>\n )\n })\n }\n\n return (\n <div className=\"relative group my-2\">\n {/* Header - always visible */}\n <div className=\"bg-muted/50 dark:bg-muted/30 px-4 py-2 rounded-t-xl border border-b-0 border-border/50 flex items-center justify-between\">\n {/* Left section: Safari-style dots + filename */}\n <div className=\"flex items-center gap-3\">\n {/* Safari-style window controls */}\n <div className=\"flex items-center gap-1.5\">\n <div className=\"w-3 h-3 rounded-full bg-red-500/80 dark:bg-red-500/60\" />\n <div className=\"w-3 h-3 rounded-full bg-yellow-500/80 dark:bg-yellow-500/60\" />\n <div className=\"w-3 h-3 rounded-full bg-green-500/80 dark:bg-green-500/60\" />\n </div>\n {/* Filename or \"Code\" */}\n <span className=\"text-xs font-mono text-foreground\">{filename || \"Code\"}</span>\n </div>\n \n {/* Right section: Language + Copy button */}\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs text-muted-foreground/60 font-mono uppercase tracking-wide\">{language}</span>\n <button\n onClick={handleCopy}\n className=\"p-1.5 rounded-md hover:bg-muted/50 transition-colors\"\n aria-label=\"Copy code\"\n >\n {copied ? <Check className=\"h-4 w-4 text-green-400\" /> : <Copy className=\"h-4 w-4 text-muted-foreground\" />}\n </button>\n </div>\n </div>\n \n {/* Code content */}\n <div className=\"bg-gray-200/50 dark:bg-[#0d1117] rounded-b-xl overflow-x-auto border border-border/50\">\n <pre className=\"p-2 text-[13px] font-mono leading-relaxed text-gray-800 dark:text-gray-200\">\n <code className=\"table w-full\">{highlightCode(code, language)}</code>\n </pre>\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport React, { useState, Children, isValidElement } from \"react\"\n\ninterface TabProps {\n label: string\n children: React.ReactNode\n}\n\ninterface TabsProps {\n children: React.ReactElement<TabProps> | React.ReactElement<TabProps>[]\n defaultValue?: string\n}\n\nexport function Tab({ children }: TabProps) {\n return <>{children}</>\n}\n\nexport function Tabs({ children, defaultValue }: TabsProps) {\n const tabs = Children.toArray(children).filter(isValidElement) as React.ReactElement<TabProps>[]\n\n // Use defaultValue or first tab label as initial active tab\n const firstTabLabel = tabs[0]?.props.label || \"\"\n const [activeTab, setActiveTab] = useState(defaultValue || firstTabLabel)\n\n return (\n <div className=\"my-6\">\n {/* Tab buttons */}\n <div className=\"flex items-center gap-1 border-b border-border mb-4\">\n {tabs.map((tab) => {\n const label = tab.props.label\n const isActive = activeTab === label\n\n return (\n <button\n key={label}\n onClick={() => setActiveTab(label)}\n className={`px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${\n isActive\n ? \"border-primary text-primary\"\n : \"border-transparent text-muted-foreground hover:text-foreground hover:border-border\"\n }`}\n >\n {label}\n </button>\n )\n })}\n </div>\n\n {/* Tab content */}\n {tabs.map((tab) => {\n const label = tab.props.label\n if (activeTab !== label) return null\n\n return (\n <div key={label} className=\"prose prose-slate dark:prose-invert max-w-none [&>*:first-child]:mt-0\">\n {tab.props.children}\n </div>\n )\n })}\n </div>\n )\n}\n","\"use client\"\n\nimport NextImage from \"next/image\"\nimport { useState } from \"react\"\nimport { ZoomIn, X } from \"lucide-react\"\n\ninterface ImageProps {\n src: string\n alt: string\n caption?: string\n width?: number\n height?: number\n zoom?: boolean\n}\n\nexport function Image({ src, alt, caption, width, height, zoom = true }: ImageProps) {\n const [isZoomed, setIsZoomed] = useState(false)\n\n return (\n <>\n <figure className=\"my-6\">\n <div className=\"relative group rounded-xl border border-border overflow-hidden bg-muted/30\">\n <NextImage\n src={src}\n alt={alt}\n width={width || 1200}\n height={height || 675}\n className=\"w-full h-auto\"\n />\n {zoom && (\n <button\n onClick={() => setIsZoomed(true)}\n className=\"absolute top-3 right-3 p-2 rounded-md bg-background/80 backdrop-blur-sm border border-border opacity-0 group-hover:opacity-100 transition-opacity hover:bg-background\"\n aria-label=\"Zoom image\"\n >\n <ZoomIn className=\"h-4 w-4 text-foreground\" />\n </button>\n )}\n </div>\n {caption && (\n <figcaption className=\"mt-2 text-center text-sm text-muted-foreground italic\">\n {caption}\n </figcaption>\n )}\n </figure>\n\n {/* Zoom Modal */}\n {isZoomed && (\n <div\n className=\"fixed inset-0 z-50 bg-background/95 backdrop-blur-sm flex items-center justify-center p-4\"\n onClick={() => setIsZoomed(false)}\n >\n <button\n onClick={() => setIsZoomed(false)}\n className=\"absolute top-4 right-4 p-2 rounded-md bg-muted hover:bg-muted/80 transition-colors\"\n aria-label=\"Close\"\n >\n <X className=\"h-5 w-5 text-foreground\" />\n </button>\n <div className=\"max-w-7xl max-h-[90vh] overflow-auto\">\n <NextImage\n src={src}\n alt={alt}\n width={width || 1920}\n height={height || 1080}\n className=\"w-full h-auto\"\n />\n </div>\n </div>\n )}\n </>\n )\n}\n","\"use client\"\n\ninterface VideoProps {\n src: string\n caption?: string\n autoplay?: boolean\n loop?: boolean\n muted?: boolean\n controls?: boolean\n poster?: string\n}\n\nexport function Video({\n src,\n caption,\n autoplay = false,\n loop = false,\n muted = false,\n controls = true,\n poster,\n}: VideoProps) {\n // Check if it's a YouTube or Vimeo URL\n const isYouTube = src.includes(\"youtube.com\") || src.includes(\"youtu.be\")\n const isVimeo = src.includes(\"vimeo.com\")\n\n const getYouTubeId = (url: string) => {\n const match = url.match(/(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/\\s]{11})/)\n return match ? match[1] : null\n }\n\n const getVimeoId = (url: string) => {\n const match = url.match(/vimeo\\.com\\/(\\d+)/)\n return match ? match[1] : null\n }\n\n return (\n <figure className=\"my-6\">\n <div className=\"relative rounded-xl border border-border overflow-hidden bg-muted/30\">\n {isYouTube ? (\n <div className=\"relative w-full\" style={{ paddingBottom: \"56.25%\" }}>\n <iframe\n className=\"absolute top-0 left-0 w-full h-full\"\n src={`https://www.youtube.com/embed/${getYouTubeId(src)}${autoplay ? \"?autoplay=1\" : \"\"}`}\n title=\"YouTube video\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n </div>\n ) : isVimeo ? (\n <div className=\"relative w-full\" style={{ paddingBottom: \"56.25%\" }}>\n <iframe\n className=\"absolute top-0 left-0 w-full h-full\"\n src={`https://player.vimeo.com/video/${getVimeoId(src)}${autoplay ? \"?autoplay=1\" : \"\"}`}\n title=\"Vimeo video\"\n allow=\"autoplay; fullscreen; picture-in-picture\"\n allowFullScreen\n />\n </div>\n ) : (\n <video\n src={src}\n controls={controls}\n autoPlay={autoplay}\n loop={loop}\n muted={muted}\n poster={poster}\n className=\"w-full h-auto\"\n >\n Your browser does not support the video tag.\n </video>\n )}\n </div>\n {caption && (\n <figcaption className=\"mt-2 text-center text-sm text-muted-foreground italic\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n}\n","import NextImage from \"next/image\"\nimport Link from \"next/link\"\n\ninterface ImageCardProps {\n src: string\n alt: string\n title?: string\n description?: string\n href?: string\n external?: boolean\n aspectRatio?: \"square\" | \"video\" | \"portrait\"\n}\n\nexport function ImageCard({\n src,\n alt,\n title,\n description,\n href,\n external = false,\n aspectRatio = \"video\",\n}: ImageCardProps) {\n const aspectRatios = {\n square: \"aspect-square\",\n video: \"aspect-video\",\n portrait: \"aspect-[3/4]\",\n }\n\n const content = (\n <div className=\"flex flex-col gap-0 p-0\">\n <div className={`w-full ${aspectRatios[aspectRatio]} overflow-hidden ${(title || description) ? 'rounded-t-xl' : 'rounded-xl'} bg-muted relative`}>\n <NextImage\n src={src}\n alt={alt}\n fill\n sizes=\"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw\"\n className=\"object-cover transition-transform duration-300 group-hover:scale-105\"\n />\n </div>\n {(title || description) && (\n <div className=\"p-3 flex flex-col gap-1\">\n {title && (\n <h3 className={`font-semibold text-foreground mb-0 no-underline ${href ? 'group-hover:text-primary transition-colors' : ''}`}>\n {title}\n </h3>\n )}\n {description && (\n <p className=\"text-sm text-muted-foreground line-clamp-2 no-underline mb-0\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n )\n\n if (href) {\n const Component = external ? \"a\" : Link\n return (\n <Component\n href={href}\n className=\"image-card-link group block rounded-xl border border-border hover:border-primary/50 hover:shadow-lg transition-all overflow-hidden p-0\"\n {...(external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {content}\n </Component>\n )\n }\n\n return (\n <div className=\"block rounded-xl border border-border overflow-hidden bg-card p-0\">\n {content}\n </div>\n )\n}\n\ninterface ImageCardGridProps {\n children: React.ReactNode\n cols?: 1 | 2 | 3 | 4\n}\n\nexport function ImageCardGrid({ children, cols = 3 }: ImageCardGridProps) {\n const gridCols = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-1 md:grid-cols-2\",\n 3: \"grid-cols-1 md:grid-cols-2 lg:grid-cols-3\",\n 4: \"grid-cols-1 md:grid-cols-2 lg:grid-cols-4\",\n }\n\n return (\n <div className={`grid ${gridCols[cols]} gap-4 my-6`}>\n {children}\n </div>\n )\n}\n","interface StepsProps {\n children: React.ReactNode\n}\n\ninterface StepProps {\n title: string\n children: React.ReactNode\n}\n\nexport function Steps({ children }: StepsProps) {\n return (\n <div className=\"my-6 ml-4 space-y-6 [counter-reset:step]\">\n {children}\n </div>\n )\n}\n\nexport function Step({ title, children }: StepProps) {\n return (\n <div className=\"relative pl-8 pb-6 border-l-2 border-border last:border-l-0 last:pb-0 [counter-increment:step] before:content-[counter(step)] before:absolute before:left-0 before:-translate-x-1/2 before:w-8 before:h-8 before:rounded-full before:bg-primary before:text-primary-foreground before:flex before:items-center before:justify-center before:text-sm before:font-semibold before:z-10\">\n <div className=\"mb-2\">\n <h3 className=\"text-lg font-semibold text-foreground\">{title}</h3>\n </div>\n <div className=\"prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0\">\n {children}\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\n\ninterface MermaidProps {\n chart: string\n caption?: string\n}\n\nexport function Mermaid({ chart, caption }: MermaidProps) {\n const containerRef = useRef<HTMLDivElement>(null)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n const renderChart = async () => {\n try {\n // Dynamically import mermaid\n const mermaid = (await import(\"mermaid\")).default\n\n mermaid.initialize({\n startOnLoad: false,\n theme: document.documentElement.classList.contains(\"dark\") ? \"dark\" : \"default\",\n securityLevel: \"loose\",\n fontFamily: \"inherit\",\n })\n\n if (containerRef.current) {\n const id = `mermaid-${Math.random().toString(36).substr(2, 9)}`\n const { svg } = await mermaid.render(id, chart)\n containerRef.current.innerHTML = svg\n }\n } catch (err) {\n console.error(\"Mermaid rendering error:\", err)\n setError(err instanceof Error ? err.message : \"Failed to render diagram\")\n }\n }\n\n renderChart()\n\n // Re-render on theme change\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === \"class\") {\n renderChart()\n }\n })\n })\n\n observer.observe(document.documentElement, { attributes: true })\n\n return () => observer.disconnect()\n }, [chart])\n\n if (error) {\n return (\n <div className=\"my-6 p-4 rounded-xl border border-red-500/50 bg-red-500/10\">\n <p className=\"text-sm text-red-600 dark:text-red-400 font-mono\">\n Mermaid Error: {error}\n </p>\n </div>\n )\n }\n\n return (\n <figure className=\"my-6\">\n <div\n ref={containerRef}\n className=\"flex justify-center items-center p-6 rounded-xl border border-border bg-muted/30 overflow-x-auto\"\n />\n {caption && (\n <figcaption className=\"mt-2 text-center text-sm text-muted-foreground italic\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n}\n","\"use client\"\n\nimport { useEffect, useRef } from \"react\"\n\ninterface MathProps {\n children: string\n block?: boolean\n}\n\nexport function Math({ children, block = false }: MathProps) {\n const containerRef = useRef<HTMLSpanElement | HTMLDivElement>(null)\n\n useEffect(() => {\n const renderMath = async () => {\n try {\n // Dynamically import KaTeX\n const katex = (await import(\"katex\")).default\n\n if (containerRef.current) {\n katex.render(children, containerRef.current, {\n throwOnError: false,\n displayMode: block,\n })\n }\n } catch (err) {\n console.error(\"KaTeX rendering error:\", err)\n if (containerRef.current) {\n containerRef.current.textContent = children\n }\n }\n }\n\n renderMath()\n }, [children, block])\n\n if (block) {\n return (\n <div\n ref={containerRef as React.RefObject<HTMLDivElement>}\n className=\"my-6 overflow-x-auto text-center\"\n />\n )\n }\n\n return <span ref={containerRef as React.RefObject<HTMLSpanElement>} className=\"inline-block\" />\n}\n","interface ColumnsProps {\n children: React.ReactNode\n cols?: {\n sm?: 1 | 2 | 3 | 4\n md?: 1 | 2 | 3 | 4\n lg?: 1 | 2 | 3 | 4\n xl?: 1 | 2 | 3 | 4\n }\n}\n\nexport function Columns({ children, cols = { sm: 1, md: 2, lg: 3 } }: ColumnsProps) {\n const colClasses = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-2\",\n 3: \"grid-cols-3\",\n 4: \"grid-cols-4\",\n }\n\n const smClass = cols.sm ? colClasses[cols.sm] : \"grid-cols-1\"\n const mdClass = cols.md ? `md:${colClasses[cols.md]}` : \"\"\n const lgClass = cols.lg ? `lg:${colClasses[cols.lg]}` : \"\"\n const xlClass = cols.xl ? `xl:${colClasses[cols.xl]}` : \"\"\n\n return (\n <div className={`grid ${smClass} ${mdClass} ${lgClass} ${xlClass} gap-4 my-6`}>\n {children}\n </div>\n )\n}\n\ninterface ColumnProps {\n children: React.ReactNode\n span?: 1 | 2 | 3 | 4\n}\n\nexport function Column({ children, span = 1 }: ColumnProps) {\n const spanClass = {\n 1: \"col-span-1\",\n 2: \"col-span-2\",\n 3: \"col-span-3\",\n 4: \"col-span-4\",\n }\n\n return <div className={spanClass[span]}>{children}</div>\n}\n","\"use client\"\n\nimport { useState } from \"react\"\n\ninterface TooltipProps {\n children: React.ReactNode\n content: string\n position?: \"top\" | \"bottom\" | \"left\" | \"right\"\n}\n\nexport function Tooltip({ children, content, position = \"top\" }: TooltipProps) {\n const [isVisible, setIsVisible] = useState(false)\n\n const positions = {\n top: \"bottom-full left-1/2 -translate-x-1/2 mb-2\",\n bottom: \"top-full left-1/2 -translate-x-1/2 mt-2\",\n left: \"right-full top-1/2 -translate-y-1/2 mr-2\",\n right: \"left-full top-1/2 -translate-y-1/2 ml-2\",\n }\n\n return (\n <span\n className=\"relative inline-flex underline decoration-dotted cursor-help\"\n onMouseEnter={() => setIsVisible(true)}\n onMouseLeave={() => setIsVisible(false)}\n >\n {children}\n {isVisible && (\n <span\n className={`absolute ${positions[position]} z-50 px-2 py-1 text-xs text-white bg-gray-900 dark:bg-gray-700 rounded whitespace-nowrap pointer-events-none`}\n >\n {content}\n </span>\n )}\n </span>\n )\n}\n","interface FrameProps {\n src: string\n title?: string\n height?: number | string\n width?: string\n}\n\nexport function Frame({ src, title = \"Embedded content\", height = 500, width = \"100%\" }: FrameProps) {\n return (\n <div className=\"my-6 rounded-xl border border-border overflow-hidden bg-muted/30\">\n <iframe\n src={src}\n title={title}\n width={width}\n height={height}\n className=\"w-full\"\n loading=\"lazy\"\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups\"\n />\n </div>\n )\n}\n","\"use client\"\n\nimport { type ReactNode, useState } from \"react\"\nimport { ChevronDown } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\n\ninterface ApiEndpointProps {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n summary?: string\n children?: ReactNode\n defaultOpen?: boolean\n}\n\nconst methodColors = {\n GET: \"bg-blue-500/10 text-blue-600 dark:text-blue-400\",\n POST: \"bg-green-500/10 text-green-600 dark:text-green-400\",\n PUT: \"bg-orange-500/10 text-orange-600 dark:text-orange-400\",\n PATCH: \"bg-purple-500/10 text-purple-600 dark:text-purple-400\",\n DELETE: \"bg-red-500/10 text-red-600 dark:text-red-400\",\n}\n\nexport function ApiEndpoint({ method, path, summary, children, defaultOpen = false }: ApiEndpointProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen)\n\n return (\n <div className=\"not-prose mb-4 rounded-xl border border-border overflow-hidden\">\n {/* Accordion Header */}\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"w-full flex items-center gap-3 px-4 py-3 text-left bg-muted/30 hover:bg-muted/50 transition-colors\"\n >\n <span\n className={cn(\n \"text-xs font-semibold px-2 py-0.5 rounded\",\n methodColors[method]\n )}\n >\n {method}\n </span>\n <code className=\"text-sm font-mono\">{path}</code>\n {summary && <span className=\"text-sm text-muted-foreground ml-auto mr-2\">{summary}</span>}\n <ChevronDown\n className={cn(\n \"h-5 w-5 text-muted-foreground transition-transform flex-shrink-0\",\n isOpen ? \"rotate-180\" : \"\"\n )}\n />\n </button>\n\n {/* Accordion Content */}\n {isOpen && children && (\n <div className=\"border-t border-border bg-background\">\n <div className=\"px-4 py-4 space-y-6\">{children}</div>\n </div>\n )}\n </div>\n )\n}\n","import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\n\n/**\n * Get the correct asset path based on deployment configuration\n * Handles different deployment scenarios:\n * - Vercel/Node.js hosting (standalone build): No basePath needed\n * - GitHub Pages without custom domain: Uses basePath from config\n * - Static hosting with custom domain: No basePath needed\n *\n * @param path - The asset path (can start with or without '/')\n * @returns The properly formatted asset path\n */\nexport function getAssetPath(path: string): string {\n // Get basePath from Next.js config (set during build for static exports)\n const basePath = process.env.NEXT_PUBLIC_BASE_PATH || process.env.__NEXT_ROUTER_BASEPATH || ''\n\n // Normalize the input path: ensure it starts with '/'\n const normalizedPath = path.startsWith('/') ? path : `/${path}`\n\n // If we have a basePath (GitHub Pages without custom domain), prepend it\n if (basePath) {\n // Normalize basePath: remove trailing slash, ensure leading slash\n const normalizedBase = basePath.startsWith('/') ? basePath : `/${basePath}`\n const cleanBase = normalizedBase.replace(/\\/$/, '')\n return `${cleanBase}${normalizedPath}`\n }\n\n // Default: return the normalized path (works for Vercel, custom domains, and dev)\n return normalizedPath\n}","interface ApiParam {\n name: string\n type: string\n required?: boolean\n description?: string\n default?: string\n}\n\ninterface ApiParamsProps {\n title?: string\n params: ApiParam[]\n}\n\nexport function ApiParams({ title = \"Parameters\", params }: ApiParamsProps) {\n if (!params || params.length === 0) return null\n\n return (\n <div className=\"mb-6\">\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">{title}</h4>\n <div className=\"space-y-3\">\n {params.map((param) => (\n <div key={param.name} className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-2\">\n <code className=\"text-sm font-mono text-foreground\">{param.name}</code>\n <span className=\"text-xs text-muted-foreground\">{param.type}</span>\n {param.required && (\n <span className=\"text-xs text-red-600 dark:text-red-400\">required</span>\n )}\n {param.default && (\n <span className=\"text-xs text-muted-foreground\">\n default: <code className=\"text-xs\">{param.default}</code>\n </span>\n )}\n </div>\n {param.description && (\n <p className=\"text-sm text-muted-foreground\">{param.description}</p>\n )}\n </div>\n ))}\n </div>\n </div>\n )\n}\n","import { CodeBlock } from \"../code-block\"\n\ninterface ApiResponseProps {\n status: number\n description?: string\n example?: any\n schema?: any\n}\n\nconst statusColors: Record<string, string> = {\n \"2\": \"text-green-600 dark:text-green-400\",\n \"3\": \"text-blue-600 dark:text-blue-400\",\n \"4\": \"text-orange-600 dark:text-orange-400\",\n \"5\": \"text-red-600 dark:text-red-400\",\n}\n\nexport function ApiResponse({ status, description, example, schema }: ApiResponseProps) {\n const statusClass = statusColors[String(status)[0]] || \"text-muted-foreground\"\n\n return (\n <div className=\"mb-4\">\n <div className=\"flex items-center gap-2 mb-2\">\n <span className={`text-sm font-semibold ${statusClass}`}>{status}</span>\n {description && <span className=\"text-sm text-muted-foreground\">{description}</span>}\n </div>\n\n {example && (\n <div className=\"mb-3\">\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Example Response</p>\n <CodeBlock\n code={typeof example === \"string\" ? example : JSON.stringify(example, null, 2)}\n language=\"json\"\n />\n </div>\n )}\n\n {schema && (\n <div>\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Schema</p>\n <CodeBlock\n code={typeof schema === \"string\" ? schema : JSON.stringify(schema, null, 2)}\n language=\"json\"\n />\n </div>\n )}\n </div>\n )\n}\n","\"use client\"\n\nimport { useState, useMemo } from \"react\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Textarea } from \"@/components/ui/textarea\"\nimport { Badge } from \"@/components/ui/badge\"\nimport { CodeBlock } from \"../code-block\"\nimport { Play, Loader2 } from \"lucide-react\"\n\ninterface PathParam {\n name: string\n type: string\n example?: any\n}\n\ninterface ApiPlaygroundProps {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n baseUrl?: string\n headers?: Record<string, string>\n defaultBody?: string\n pathParams?: PathParam[]\n}\n\nexport function ApiPlayground({\n method,\n path,\n baseUrl = \"\",\n headers = {},\n defaultBody,\n pathParams = []\n}: ApiPlaygroundProps) {\n const [loading, setLoading] = useState(false)\n const [response, setResponse] = useState<any>(null)\n const [error, setError] = useState<string | null>(null)\n const [requestBody, setRequestBody] = useState(defaultBody || \"\")\n\n // Initialize headers with empty strings if not provided\n const initialHeaders = useMemo(() => {\n const cleanHeaders: Record<string, string> = {}\n Object.entries(headers).forEach(([key, value]) => {\n cleanHeaders[key] = value || \"\"\n })\n return cleanHeaders\n }, [headers])\n\n const [requestHeaders, setRequestHeaders] = useState(JSON.stringify(initialHeaders, null, 2))\n\n // Extract path parameters and initialize with defaults\n const extractedParams = useMemo(() => {\n const params: Record<string, string> = {}\n const pathParamPattern = /:(\\w+)/g\n let match\n\n while ((match = pathParamPattern.exec(path)) !== null) {\n const paramName = match[1]\n const paramConfig = pathParams.find(p => p.name === paramName)\n\n // Set default value based on example or type\n if (paramConfig?.example !== undefined) {\n params[paramName] = String(paramConfig.example)\n } else if (paramConfig?.type === \"number\") {\n params[paramName] = \"1\"\n } else {\n params[paramName] = \"\"\n }\n }\n\n return params\n }, [path, pathParams])\n\n const [pathParamValues, setPathParamValues] = useState<Record<string, string>>(extractedParams)\n\n // Build the final URL with path params replaced\n const buildUrl = () => {\n let finalPath = path\n Object.entries(pathParamValues).forEach(([key, value]) => {\n finalPath = finalPath.replace(`:${key}`, value)\n })\n return `${baseUrl}${finalPath}`\n }\n\n const handleSend = async () => {\n setLoading(true)\n setError(null)\n setResponse(null)\n\n try {\n const url = buildUrl()\n const parsedHeaders = JSON.parse(requestHeaders)\n\n const options: RequestInit = {\n method,\n headers: {\n \"Content-Type\": \"application/json\",\n ...parsedHeaders,\n },\n }\n\n if (method !== \"GET\" && method !== \"DELETE\" && requestBody) {\n options.body = requestBody\n }\n\n const res = await fetch(url, options)\n const data = await res.json()\n\n setResponse({\n status: res.status,\n statusText: res.statusText,\n headers: Object.fromEntries(res.headers.entries()),\n body: data,\n })\n } catch (err) {\n setError(err instanceof Error ? err.message : \"An error occurred\")\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <div className=\"not-prose border border-border rounded-lg overflow-hidden bg-card/30\">\n <div className=\"bg-muted/50 px-4 py-2 border-b border-border\">\n <h4 className=\"text-sm font-semibold text-foreground\">API Playground</h4>\n </div>\n\n <div className=\"p-4 space-y-4\">\n {/* Path Parameters */}\n {Object.keys(pathParamValues).length > 0 && (\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Path Parameters\n </label>\n <div className=\"space-y-2\">\n {Object.entries(pathParamValues).map(([paramName, paramValue]) => {\n const paramConfig = pathParams.find(p => p.name === paramName)\n return (\n <div key={paramName} className=\"flex items-center gap-2\">\n <span className=\"text-xs text-muted-foreground min-w-[80px]\">\n :{paramName}\n </span>\n <Input\n value={paramValue}\n onChange={(e) =>\n setPathParamValues((prev) => ({ ...prev, [paramName]: e.target.value }))\n }\n placeholder={paramConfig?.example || paramConfig?.type || \"value\"}\n className=\"font-mono text-sm\"\n />\n </div>\n )\n })}\n </div>\n </div>\n )}\n\n {/* URL */}\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Request URL\n </label>\n <div className=\"flex items-center gap-2\">\n <Badge variant=\"outline\" className=\"font-mono\">\n {method}\n </Badge>\n <Input value={buildUrl()} readOnly className=\"font-mono text-sm\" />\n </div>\n </div>\n\n {/* Headers */}\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Headers (JSON)\n </label>\n <Textarea\n value={requestHeaders}\n onChange={(e) => setRequestHeaders(e.target.value)}\n className=\"font-mono text-sm\"\n rows={4}\n />\n </div>\n\n {/* Body (for POST, PUT, PATCH) */}\n {method !== \"GET\" && method !== \"DELETE\" && (\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Request Body (JSON)\n </label>\n <Textarea\n value={requestBody}\n onChange={(e) => setRequestBody(e.target.value)}\n className=\"font-mono text-sm\"\n rows={6}\n placeholder='{\\n \"key\": \"value\"\\n}'\n />\n </div>\n )}\n\n {/* Send Button */}\n <Button onClick={handleSend} disabled={loading} className=\"w-full\">\n {loading ? (\n <>\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n Sending...\n </>\n ) : (\n <>\n <Play className=\"mr-2 h-4 w-4\" />\n Send Request\n </>\n )}\n </Button>\n\n {/* Response */}\n {response && (\n <div className=\"mt-4\">\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Response ({response.status} {response.statusText})\n </label>\n <CodeBlock code={JSON.stringify(response.body, null, 2)} language=\"json\" />\n </div>\n )}\n\n {/* Error */}\n {error && (\n <div className=\"mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-md\">\n <p className=\"text-sm text-red-600 dark:text-red-400\">{error}</p>\n </div>\n )}\n </div>\n </div>\n )\n}\n","import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\"\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nexport { Badge, badgeVariants }\n","\"use client\"\n\nimport { useState, useEffect } from \"react\"\nimport type { SpecraApiSpec } from \"@/lib/api-parser.types\"\nimport { parseApiSpec, type ParserType } from \"@/lib/parsers\"\nimport { Accordion, AccordionItem } from \"../accordion\"\nimport { ApiEndpoint } from \"./api-endpoint\"\nimport { ApiParams } from \"./api-params\"\nimport { ApiResponse } from \"./api-response\"\nimport { ApiPlayground } from \"./api-playground\"\nimport { CodeBlock } from \"../code-block\"\nimport { Loader2 } from \"lucide-react\"\n\ninterface ApiReferenceProps {\n /**\n * Path to the API spec JSON file (relative to /public)\n * Example: \"/api-specs/my-api.json\"\n */\n spec: string\n\n /**\n * Parser type - auto-detect by default\n * - \"auto\": Auto-detect format (Specra, OpenAPI, or Postman)\n * - \"specra\": Native Specra format\n * - \"openapi\": OpenAPI 3.x / Swagger\n * - \"postman\": Postman Collection v2.x\n */\n parser?: ParserType\n\n /**\n * Show API playground for testing\n */\n showPlayground?: boolean\n}\n\nexport function ApiReference({ spec, parser = \"auto\", showPlayground = true }: ApiReferenceProps) {\n const [apiSpec, setApiSpec] = useState<SpecraApiSpec | null>(null)\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n async function loadSpec() {\n try {\n const response = await fetch(spec)\n if (!response.ok) {\n throw new Error(`Failed to load API spec: ${response.statusText}`)\n }\n const data = await response.json()\n\n // Parse using the appropriate parser\n const parsedSpec = parseApiSpec(data, parser)\n setApiSpec(parsedSpec)\n } catch (err) {\n setError(err instanceof Error ? err.message : \"Failed to load API spec\")\n } finally {\n setLoading(false)\n }\n }\n\n loadSpec()\n }, [spec, parser])\n\n // Replace environment variables in text\n const interpolateEnv = (text: string, env?: Record<string, string>): string => {\n if (!env) return text\n return text.replace(/\\{(\\w+)\\}/g, (match, key) => {\n return env[key] || match\n })\n }\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 className=\"h-6 w-6 animate-spin text-muted-foreground\" />\n <span className=\"ml-2 text-muted-foreground\">Loading API specification...</span>\n </div>\n )\n }\n\n if (error) {\n return (\n <div className=\"rounded-lg border border-red-500/20 bg-red-500/10 p-4\">\n <p className=\"text-sm text-red-600 dark:text-red-400\">Error: {error}</p>\n </div>\n )\n }\n\n if (!apiSpec) {\n return null\n }\n\n return (\n <div className=\"space-y-6\">\n {/* API Info */}\n {(apiSpec.title || apiSpec.description) && (\n <div className=\"mb-8\">\n {apiSpec.title && (\n <h2 className=\"text-2xl font-semibold mb-2 text-foreground\">{apiSpec.title}</h2>\n )}\n {apiSpec.description && (\n <p className=\"text-muted-foreground\">{apiSpec.description}</p>\n )}\n {apiSpec.baseUrl && (\n <div className=\"mt-4\">\n <p className=\"text-sm font-semibold text-muted-foreground mb-1\">Base URL</p>\n <code className=\"text-sm px-2 py-1 bg-muted rounded\">{apiSpec.baseUrl}</code>\n </div>\n )}\n </div>\n )}\n\n {/* Authentication */}\n {apiSpec.auth && (\n <div className=\"rounded-lg border border-border bg-card/30 p-4 mb-6\">\n <h3 className=\"text-lg font-semibold mb-2 text-foreground\">Authentication</h3>\n <p className=\"text-sm text-muted-foreground mb-2\">\n {apiSpec.auth.description || `This API uses ${apiSpec.auth.type} authentication.`}\n </p>\n {apiSpec.auth.type === \"bearer\" && (\n <CodeBlock\n code={`Authorization: ${apiSpec.auth.tokenPrefix || \"Bearer\"} {YOUR_TOKEN}`}\n language=\"bash\"\n />\n )}\n {apiSpec.auth.type === \"apiKey\" && (\n <CodeBlock\n code={`${apiSpec.auth.headerName || \"X-API-Key\"}: {YOUR_API_KEY}`}\n language=\"bash\"\n />\n )}\n </div>\n )}\n\n {/* Endpoints as Accordion */}\n <Accordion type=\"single\" collapsible className=\"space-y-4\">\n {apiSpec.endpoints.map((endpoint, index) => {\n // Merge global and endpoint-specific headers\n const allHeaders = [\n ...(apiSpec.globalHeaders || []),\n ...(endpoint.headers || []),\n ].map((header) => ({\n ...header,\n value: interpolateEnv(header.value, apiSpec.env),\n }))\n\n return (\n <AccordionItem\n key={index}\n value={`endpoint-${index}`}\n title={\n <div className=\"flex items-center gap-3\">\n <span\n className={`text-xs font-semibold px-2 py-0.5 rounded ${\n endpoint.method === \"GET\"\n ? \"bg-blue-500/10 text-blue-600 dark:text-blue-400\"\n : endpoint.method === \"POST\"\n ? \"bg-green-500/10 text-green-600 dark:text-green-400\"\n : endpoint.method === \"PUT\"\n ? \"bg-orange-500/10 text-orange-600 dark:text-orange-400\"\n : endpoint.method === \"PATCH\"\n ? \"bg-purple-500/10 text-purple-600 dark:text-purple-400\"\n : \"bg-red-500/10 text-red-600 dark:text-red-400\"\n }`}\n >\n {endpoint.method}\n </span>\n <code className=\"text-sm font-mono\">{endpoint.path}</code>\n <span className=\"text-sm text-muted-foreground ml-auto\">{endpoint.title}</span>\n </div>\n }\n >\n <div className=\"space-y-6 pt-4\">\n {/* Description */}\n {endpoint.description && (\n <p className=\"text-sm text-muted-foreground\">{endpoint.description}</p>\n )}\n\n {/* Path Parameters */}\n {endpoint.pathParams && endpoint.pathParams.length > 0 && (\n <ApiParams title=\"Path Parameters\" params={endpoint.pathParams} />\n )}\n\n {/* Query Parameters */}\n {endpoint.queryParams && endpoint.queryParams.length > 0 && (\n <ApiParams title=\"Query Parameters\" params={endpoint.queryParams} />\n )}\n\n {/* Headers */}\n {allHeaders.length > 0 && (\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Headers</h4>\n <div className=\"space-y-2\">\n {allHeaders.map((header, idx) => (\n <div key={idx} className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-2\">\n <code className=\"text-sm font-mono text-foreground\">{header.name}</code>\n <span className=\"text-xs text-muted-foreground\">{header.value}</span>\n </div>\n {header.description && (\n <p className=\"text-sm text-muted-foreground\">{header.description}</p>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Request Body */}\n {endpoint.body && (\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Request Body</h4>\n {endpoint.body.description && (\n <p className=\"text-sm text-muted-foreground mb-2\">\n {endpoint.body.description}\n </p>\n )}\n {endpoint.body.example && (\n <CodeBlock\n code={\n typeof endpoint.body.example === \"string\"\n ? endpoint.body.example\n : JSON.stringify(endpoint.body.example, null, 2)\n }\n language=\"json\"\n />\n )}\n </div>\n )}\n\n {/* Responses */}\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Responses</h4>\n {endpoint.successResponse && (\n <ApiResponse\n status={endpoint.successResponse.status}\n description={endpoint.successResponse.description}\n example={endpoint.successResponse.example}\n schema={endpoint.successResponse.schema}\n />\n )}\n {endpoint.errorResponses?.map((response, idx) => (\n <ApiResponse\n key={idx}\n status={response.status}\n description={response.description}\n example={response.example}\n schema={response.schema}\n />\n ))}\n </div>\n\n {/* Code Examples */}\n {endpoint.examples && endpoint.examples.length > 0 && (\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Examples</h4>\n {endpoint.examples.map((example, idx) => (\n <div key={idx} className=\"mb-3\">\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">\n {example.title}\n </p>\n <CodeBlock code={example.code} language={example.language} />\n </div>\n ))}\n </div>\n )}\n\n {/* API Playground */}\n {showPlayground && (\n <ApiPlayground\n method={endpoint.method}\n path={endpoint.path}\n baseUrl={apiSpec.baseUrl}\n headers={Object.fromEntries(allHeaders.map((h) => [h.name, h.value]))}\n pathParams={endpoint.pathParams}\n defaultBody={\n endpoint.body?.example\n ? typeof endpoint.body.example === \"string\"\n ? endpoint.body.example\n : JSON.stringify(endpoint.body.example, null, 2)\n : undefined\n }\n />\n )}\n </div>\n </AccordionItem>\n )\n })}\n </Accordion>\n </div>\n )\n}\n","import type { SpecraApiSpec } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\n\n/**\n * Parser for native Specra API format\n * This is a pass-through parser since the input is already in the correct format\n */\nexport class SpecraParser implements ApiSpecParser {\n validate(input: any): boolean {\n return (\n typeof input === \"object\" &&\n input !== null &&\n \"endpoints\" in input &&\n Array.isArray(input.endpoints)\n )\n }\n\n parse(input: any): SpecraApiSpec {\n if (!this.validate(input)) {\n throw new Error(\"Invalid Specra API spec format\")\n }\n return input as SpecraApiSpec\n }\n}\n","import type { SpecraApiSpec, ApiEndpointSpec, ApiParam, ApiResponse } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\n\n/**\n * Parser for OpenAPI 3.0/3.1 specifications\n */\nexport class OpenApiParser implements ApiSpecParser {\n validate(input: any): boolean {\n return (\n typeof input === \"object\" &&\n input !== null &&\n (\"openapi\" in input || \"swagger\" in input) &&\n \"paths\" in input\n )\n }\n\n parse(input: any): SpecraApiSpec {\n if (!this.validate(input)) {\n throw new Error(\"Invalid OpenAPI spec format\")\n }\n\n const baseUrl = this.extractBaseUrl(input)\n const endpoints: ApiEndpointSpec[] = []\n\n // Parse paths\n for (const [path, pathItem] of Object.entries(input.paths || {})) {\n const methods = [\"get\", \"post\", \"put\", \"patch\", \"delete\"] as const\n\n for (const method of methods) {\n const operation = (pathItem as any)[method]\n if (!operation) continue\n\n const endpoint = this.parseOperation(path, method.toUpperCase() as any, operation, input)\n endpoints.push(endpoint)\n }\n }\n\n return {\n version: input.info?.version,\n title: input.info?.title,\n description: input.info?.description,\n baseUrl,\n auth: this.extractAuth(input),\n endpoints,\n }\n }\n\n private extractBaseUrl(spec: any): string {\n // OpenAPI 3.x servers\n if (spec.servers && spec.servers.length > 0) {\n return spec.servers[0].url\n }\n\n // Swagger 2.0\n if (spec.host) {\n const scheme = spec.schemes?.[0] || \"https\"\n const basePath = spec.basePath || \"\"\n return `${scheme}://${spec.host}${basePath}`\n }\n\n return \"\"\n }\n\n private extractAuth(spec: any): SpecraApiSpec[\"auth\"] {\n const securitySchemes = spec.components?.securitySchemes || spec.securityDefinitions\n\n if (!securitySchemes) return undefined\n\n // Get the first security scheme\n const firstScheme = Object.values(securitySchemes)[0] as any\n if (!firstScheme) return undefined\n\n if (firstScheme.type === \"http\" && firstScheme.scheme === \"bearer\") {\n return {\n type: \"bearer\",\n description: firstScheme.description,\n tokenPrefix: \"Bearer\",\n }\n }\n\n if (firstScheme.type === \"apiKey\") {\n return {\n type: \"apiKey\",\n description: firstScheme.description,\n headerName: firstScheme.name || \"X-API-Key\",\n }\n }\n\n if (firstScheme.type === \"http\" && firstScheme.scheme === \"basic\") {\n return {\n type: \"basic\",\n description: firstScheme.description,\n }\n }\n\n return undefined\n }\n\n private parseOperation(\n path: string,\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\",\n operation: any,\n spec: any\n ): ApiEndpointSpec {\n const endpoint: ApiEndpointSpec = {\n title: operation.summary || operation.operationId || `${method} ${path}`,\n method,\n path: this.convertPathParams(path),\n description: operation.description,\n }\n\n // Parse parameters\n const params = this.parseParameters(operation.parameters || [], spec)\n if (params.path.length > 0) endpoint.pathParams = params.path\n if (params.query.length > 0) endpoint.queryParams = params.query\n if (params.header.length > 0) {\n endpoint.headers = params.header.map((p) => ({\n name: p.name,\n value: p.example || \"\",\n description: p.description,\n }))\n }\n\n // Parse request body\n if (operation.requestBody) {\n endpoint.body = this.parseRequestBody(operation.requestBody, spec)\n }\n\n // Parse responses\n const responses = this.parseResponses(operation.responses || {}, spec)\n if (responses.success) endpoint.successResponse = responses.success\n if (responses.errors.length > 0) endpoint.errorResponses = responses.errors\n\n return endpoint\n }\n\n private convertPathParams(path: string): string {\n // Convert OpenAPI {param} to :param\n return path.replace(/\\{([^}]+)\\}/g, \":$1\")\n }\n\n private parseParameters(\n parameters: any[],\n spec: any\n ): { path: ApiParam[]; query: ApiParam[]; header: ApiParam[] } {\n const result = { path: [] as ApiParam[], query: [] as ApiParam[], header: [] as ApiParam[] }\n\n for (const param of parameters) {\n // Resolve $ref if present\n const resolved = param.$ref ? this.resolveRef(param.$ref, spec) : param\n\n const apiParam: ApiParam = {\n name: resolved.name,\n type: resolved.schema?.type || resolved.type || \"string\",\n required: resolved.required,\n description: resolved.description,\n example: resolved.example || resolved.schema?.example,\n }\n\n if (resolved.in === \"path\") result.path.push(apiParam)\n else if (resolved.in === \"query\") result.query.push(apiParam)\n else if (resolved.in === \"header\") result.header.push(apiParam)\n }\n\n return result\n }\n\n private parseRequestBody(requestBody: any, spec: any): ApiEndpointSpec[\"body\"] {\n const content = requestBody.content?.[\"application/json\"]\n if (!content) return undefined\n\n return {\n description: requestBody.description,\n example: content.example || this.generateExample(content.schema, spec),\n schema: content.schema,\n }\n }\n\n private parseResponses(\n responses: any,\n spec: any\n ): { success?: ApiResponse; errors: ApiResponse[] } {\n const result: { success?: ApiResponse; errors: ApiResponse[] } = { errors: [] }\n\n for (const [statusCode, response] of Object.entries(responses)) {\n const status = parseInt(statusCode)\n if (isNaN(status)) continue\n\n const resolved = (response as any).$ref ? this.resolveRef((response as any).$ref, spec) : response\n const content = (resolved as any).content?.[\"application/json\"]\n\n const apiResponse: ApiResponse = {\n status,\n description: (resolved as any).description,\n example: content?.example || this.generateExample(content?.schema, spec),\n schema: content?.schema,\n }\n\n if (status >= 200 && status < 300) {\n result.success = apiResponse\n } else {\n result.errors.push(apiResponse)\n }\n }\n\n return result\n }\n\n private generateExample(schema: any, spec: any): any {\n if (!schema) return undefined\n if (schema.$ref) schema = this.resolveRef(schema.$ref, spec)\n if (schema.example) return schema.example\n\n // Simple example generation based on schema type\n if (schema.type === \"object\" && schema.properties) {\n const example: any = {}\n for (const [key, prop] of Object.entries(schema.properties)) {\n example[key] = this.generateExample(prop, spec)\n }\n return example\n }\n\n if (schema.type === \"array\" && schema.items) {\n return [this.generateExample(schema.items, spec)]\n }\n\n // Default values by type\n const defaults: any = {\n string: \"string\",\n number: 0,\n integer: 0,\n boolean: false,\n object: {},\n array: [],\n }\n\n return defaults[schema.type] || null\n }\n\n private resolveRef(ref: string, spec: any): any {\n const path = ref.replace(/^#\\//, \"\").split(\"/\")\n let current = spec\n\n for (const segment of path) {\n current = current[segment]\n if (!current) return {}\n }\n\n return current\n }\n}\n","import type { SpecraApiSpec, ApiEndpointSpec, ApiParam, ApiHeader } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\n\n/**\n * Parser for Postman Collection v2.0/v2.1\n */\nexport class PostmanParser implements ApiSpecParser {\n validate(input: any): boolean {\n return (\n typeof input === \"object\" &&\n input !== null &&\n \"info\" in input &&\n input.info?.schema?.includes(\"v2\")\n )\n }\n\n parse(input: any): SpecraApiSpec {\n if (!this.validate(input)) {\n throw new Error(\"Invalid Postman Collection format (requires v2.0 or v2.1)\")\n }\n\n const baseUrl = this.extractBaseUrl(input)\n const endpoints: ApiEndpointSpec[] = []\n\n // Parse items (can be nested in folders)\n this.parseItems(input.item || [], endpoints, baseUrl, input)\n\n return {\n version: input.info?.version,\n title: input.info?.name,\n description: input.info?.description,\n baseUrl,\n auth: this.extractAuth(input.auth),\n globalHeaders: this.extractGlobalHeaders(input),\n endpoints,\n }\n }\n\n private extractBaseUrl(collection: any): string {\n // Try to get from variables\n const baseUrlVar = collection.variable?.find(\n (v: any) => v.key === \"baseUrl\" || v.key === \"base_url\" || v.key === \"url\"\n )\n if (baseUrlVar) return baseUrlVar.value\n\n // Try to extract from first request\n if (collection.item && collection.item.length > 0) {\n const firstRequest = this.findFirstRequest(collection.item)\n if (firstRequest?.request?.url) {\n const url = this.parseUrl(firstRequest.request.url)\n if (url.host) {\n return `${url.protocol}://${url.host.join(\".\")}`\n }\n }\n }\n\n return \"\"\n }\n\n private findFirstRequest(items: any[]): any {\n for (const item of items) {\n if (item.request) return item\n if (item.item) {\n const found = this.findFirstRequest(item.item)\n if (found) return found\n }\n }\n return null\n }\n\n private extractAuth(auth: any): SpecraApiSpec[\"auth\"] {\n if (!auth) return undefined\n\n if (auth.type === \"bearer\") {\n return {\n type: \"bearer\",\n tokenPrefix: \"Bearer\",\n }\n }\n\n if (auth.type === \"apikey\") {\n const keyData = auth.apikey?.find((a: any) => a.key === \"key\")\n const keyName = keyData?.value || \"X-API-Key\"\n\n return {\n type: \"apiKey\",\n headerName: keyName,\n }\n }\n\n if (auth.type === \"basic\") {\n return {\n type: \"basic\",\n }\n }\n\n return undefined\n }\n\n private extractGlobalHeaders(collection: any): ApiHeader[] {\n // Postman doesn't have global headers in the same way, but we can check for common patterns\n return []\n }\n\n private parseItems(items: any[], endpoints: ApiEndpointSpec[], baseUrl: string, collection: any) {\n for (const item of items) {\n // If it's a folder, recurse\n if (item.item && Array.isArray(item.item)) {\n this.parseItems(item.item, endpoints, baseUrl, collection)\n }\n // If it's a request\n else if (item.request) {\n const endpoint = this.parseRequest(item, baseUrl, collection)\n endpoints.push(endpoint)\n }\n }\n }\n\n private parseRequest(item: any, baseUrl: string, collection: any): ApiEndpointSpec {\n const request = item.request\n const url = this.parseUrl(request.url)\n\n const endpoint: ApiEndpointSpec = {\n title: item.name,\n method: request.method.toUpperCase(),\n path: this.buildPath(url, baseUrl),\n description: item.request.description || item.description,\n }\n\n // Parse URL parameters (path and query)\n const params = this.parseUrlParams(url)\n if (params.path.length > 0) endpoint.pathParams = params.path\n if (params.query.length > 0) endpoint.queryParams = params.query\n\n // Parse headers\n if (request.header && request.header.length > 0) {\n endpoint.headers = request.header\n .filter((h: any) => !h.disabled)\n .map((h: any) => ({\n name: h.key,\n value: h.value || \"\",\n description: h.description,\n }))\n }\n\n // Parse request body\n if (request.body) {\n endpoint.body = this.parseBody(request.body)\n }\n\n // Parse response examples\n const responses = this.parseResponses(item.response || [])\n if (responses.success) endpoint.successResponse = responses.success\n if (responses.errors.length > 0) endpoint.errorResponses = responses.errors\n\n return endpoint\n }\n\n private parseUrl(url: any): {\n protocol: string\n host: string[]\n path: string[]\n query: any[]\n variable: any[]\n } {\n if (typeof url === \"string\") {\n // Parse string URL\n const urlObj = new URL(url)\n return {\n protocol: urlObj.protocol.replace(\":\", \"\"),\n host: urlObj.hostname.split(\".\"),\n path: urlObj.pathname.split(\"/\").filter(Boolean),\n query: [],\n variable: [],\n }\n }\n\n return {\n protocol: url.protocol || \"https\",\n host: url.host || [],\n path: url.path || [],\n query: url.query || [],\n variable: url.variable || [],\n }\n }\n\n private buildPath(url: any, baseUrl: string): string {\n let path = \"/\"\n\n if (url.path && url.path.length > 0) {\n path += url.path.join(\"/\")\n }\n\n // Convert Postman :param to our :param format (they're the same!)\n // But we need to handle {{variable}} syntax\n path = path.replace(/\\{\\{([^}]+)\\}\\}/g, \":$1\")\n\n return path\n }\n\n private parseUrlParams(url: any): { path: ApiParam[]; query: ApiParam[] } {\n const result = { path: [] as ApiParam[], query: [] as ApiParam[] }\n\n // Path parameters from variables\n if (url.variable && url.variable.length > 0) {\n for (const v of url.variable) {\n result.path.push({\n name: v.key,\n type: v.type || \"string\",\n description: v.description,\n example: v.value,\n })\n }\n }\n\n // Extract path params from the path itself\n if (url.path && url.path.length > 0) {\n for (const segment of url.path) {\n if (segment.startsWith(\":\")) {\n const paramName = segment.slice(1)\n // Only add if not already added from variables\n if (!result.path.find((p) => p.name === paramName)) {\n result.path.push({\n name: paramName,\n type: \"string\",\n })\n }\n }\n }\n }\n\n // Query parameters\n if (url.query && url.query.length > 0) {\n for (const q of url.query) {\n if (q.disabled) continue\n result.query.push({\n name: q.key,\n type: \"string\",\n description: q.description,\n example: q.value,\n })\n }\n }\n\n return result\n }\n\n private parseBody(body: any): ApiEndpointSpec[\"body\"] {\n if (!body) return undefined\n\n let example: any\n let description = body.description\n\n if (body.mode === \"raw\") {\n try {\n example = JSON.parse(body.raw)\n } catch {\n example = body.raw\n }\n } else if (body.mode === \"formdata\" || body.mode === \"urlencoded\") {\n example = {}\n for (const item of body[body.mode] || []) {\n if (!item.disabled) {\n example[item.key] = item.value\n }\n }\n }\n\n return {\n description,\n example,\n }\n }\n\n private parseResponses(responses: any[]): { success?: any; errors: any[] } {\n const result: { success?: any; errors: any[] } = { errors: [] }\n\n for (const response of responses) {\n let example: any\n try {\n example = JSON.parse(response.body)\n } catch {\n example = response.body\n }\n\n const apiResponse = {\n status: response.code || 200,\n description: response.name,\n example,\n }\n\n if (apiResponse.status >= 200 && apiResponse.status < 300) {\n if (!result.success) result.success = apiResponse\n } else {\n result.errors.push(apiResponse)\n }\n }\n\n return result\n }\n}\n","import type { SpecraApiSpec } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\nimport { SpecraParser } from \"./specra-parser\"\nimport { OpenApiParser } from \"./openapi-parser\"\nimport { PostmanParser } from \"./postman-parser\"\n\nexport type ParserType = \"auto\" | \"specra\" | \"openapi\" | \"postman\"\n\n/**\n * Registry of all available parsers\n */\nconst parsers: Map<string, ApiSpecParser> = new Map([\n [\"specra\", new SpecraParser()],\n [\"openapi\", new OpenApiParser()],\n [\"postman\", new PostmanParser()],\n])\n\n/**\n * Auto-detect the parser type based on the input structure\n */\nexport function detectParserType(input: any): ParserType {\n if (!input || typeof input !== \"object\") {\n throw new Error(\"Invalid API spec: input must be an object\")\n }\n\n // Check for Postman Collection\n if (input.info?.schema?.includes(\"v2\")) {\n return \"postman\"\n }\n\n // Check for OpenAPI/Swagger\n if (input.openapi || input.swagger) {\n return \"openapi\"\n }\n\n // Check for Specra format\n if (input.endpoints && Array.isArray(input.endpoints)) {\n return \"specra\"\n }\n\n throw new Error(\n \"Unable to auto-detect API spec format. Supported formats: Specra, OpenAPI 3.x, Postman Collection v2.x\"\n )\n}\n\n/**\n * Parse an API spec using the specified or auto-detected parser\n */\nexport function parseApiSpec(input: any, parserType: ParserType = \"auto\"): SpecraApiSpec {\n // Auto-detect if needed\n const actualType = parserType === \"auto\" ? detectParserType(input) : parserType\n\n // Get the parser\n const parser = parsers.get(actualType)\n if (!parser) {\n throw new Error(`Unknown parser type: ${actualType}`)\n }\n\n // Validate and parse\n if (!parser.validate(input)) {\n throw new Error(`Input does not match ${actualType} format`)\n }\n\n return parser.parse(input)\n}\n\n// Export parsers for direct use\nexport { SpecraParser, OpenApiParser, PostmanParser }\nexport type { ApiSpecParser }\n","import type { ReactNode } from \"react\"\nimport { CodeBlock } from \"./code-block\"\nimport { Callout } from \"./callout\"\nimport { Accordion, AccordionItem } from \"./accordion\"\nimport { Tabs, Tab } from \"./tabs\"\nimport { Image } from \"./image\"\nimport { Video } from \"./video\"\nimport { Card, CardGrid } from \"./card\"\nimport { ImageCard, ImageCardGrid } from \"./image-card\"\nimport { Steps, Step } from \"./steps\"\nimport { Icon } from \"./icon\"\nimport { Mermaid } from \"./mermaid\"\nimport { Math } from \"./math\"\nimport { Columns, Column } from \"./columns\"\nimport { Badge } from \"./badge\"\nimport { Tooltip } from \"./tooltip\"\nimport { Frame } from \"./frame\"\nimport { ApiEndpoint, ApiParams, ApiResponse, ApiPlayground, ApiReference } from \"./api\"\n\nexport const mdxComponents = {\n h1: ({ children }: { children: ReactNode }) => (\n <h1 className=\"text-3xl font-semibold tracking-tight mb-6 text-foreground\">{children}</h1>\n ),\n h2: ({ children, id }: { children: ReactNode; id?: string }) => (\n <h2 id={id} className=\"text-2xl font-semibold tracking-tight mt-10 mb-4 text-foreground scroll-mt-24\">\n {children}\n </h2>\n ),\n h3: ({ children, id }: { children: ReactNode; id?: string }) => (\n <h3 id={id} className=\"text-xl font-medium tracking-tight mt-8 mb-3 text-foreground scroll-mt-24\">\n {children}\n </h3>\n ),\n p: ({ children }: { children: ReactNode }) => (\n <p className=\"text-base leading-7 text-muted-foreground mb-4\">{children}</p>\n ),\n code: ({ children, className, meta, ...props }: { children: ReactNode; className?: string; meta?: string; [key: string]: any }) => {\n const isInline = !className\n if (isInline) {\n return (\n <code className=\"px-1.5 py-0.5 rounded-md bg-muted/50 text-primary font-mono text-[13px] border border-border/50\">\n {children}\n </code>\n )\n }\n \n // Extract language from className\n const language = className?.replace(\"language-\", \"\") || \"text\"\n \n // Use meta string as filename if provided\n const filename = meta || undefined\n \n const code = String(children).replace(/\\n$/, \"\")\n\n return <CodeBlock code={code} language={language} filename={filename} />\n },\n pre: ({ children }: { children: ReactNode }) => <>{children}</>,\n ul: ({ children }: { children: ReactNode }) => (\n <ul className=\"list-disc list-outside pl-5 space-y-2 mb-4 text-muted-foreground [&_p]:mb-0 [&_p]:inline [&_ul]:ml-6 [&_ol]:ml-6\">{children}</ul>\n ),\n ol: ({ children }: { children: ReactNode }) => (\n <ol className=\"list-decimal list-outside pl-5 space-y-2 mb-4 text-muted-foreground [&_p]:mb-0 [&_p]:inline [&_ul]:ml-6 [&_ol]:ml-6\">{children}</ol>\n ),\n li: ({ children }: { children: ReactNode }) => <li className=\"leading-7 [&>p]:mb-0 [&>p]:inline\">{children}</li>,\n a: ({ children, href }: { children: ReactNode; href?: string }) => (\n <a\n href={href}\n className=\"text-primary hover:underline font-medium\"\n target={href?.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={href?.startsWith(\"http\") ? \"noopener noreferrer\" : undefined}\n >\n {children}\n </a>\n ),\n blockquote: ({ children }: { children: ReactNode }) => {\n // Check if this is a GitHub-style alert blockquote\n const childrenArray = Array.isArray(children) ? children : [children]\n const firstChild = childrenArray[0]\n\n // Extract text content from the blockquote\n let textContent = \"\"\n if (firstChild && typeof firstChild === \"object\" && \"props\" in firstChild) {\n const props = (firstChild as any).props\n if (props.children) {\n const text = Array.isArray(props.children) ? props.children.join(\"\") : String(props.children)\n textContent = text\n }\n }\n\n // Check for alert patterns like [!INFO], [!WARNING], etc.\n const alertMatch = textContent.match(/^\\[!(INFO|TIP|WARNING|SUCCESS|ERROR)\\]/)\n\n if (alertMatch) {\n const type = alertMatch[1].toLowerCase() as \"info\" | \"tip\" | \"warning\" | \"success\" | \"error\"\n\n // Extract the content after the alert marker\n const processChildren = (node: any): any => {\n if (typeof node === \"string\") {\n return node.replace(/^\\[!(INFO|TIP|WARNING|SUCCESS|ERROR)\\]\\s*\\n?/, \"\")\n }\n if (node && typeof node === \"object\" && \"props\" in node) {\n return {\n ...node,\n props: {\n ...node.props,\n children: Array.isArray(node.props.children)\n ? node.props.children.map(processChildren)\n : processChildren(node.props.children),\n },\n }\n }\n return node\n }\n\n const cleanedChildren = Array.isArray(children) ? children.map(processChildren) : processChildren(children)\n\n return <Callout type={type}>{cleanedChildren}</Callout>\n }\n\n // Regular blockquote\n return (\n <blockquote className=\"border-l-4 border-primary/50 bg-muted/30 pl-4 pr-4 py-3 my-6 rounded-r-lg\">\n <div className=\"text-muted-foreground italic [&>p]:mb-0\">{children}</div>\n </blockquote>\n )\n },\n table: ({ children }: { children: ReactNode }) => (\n <div className=\"overflow-x-auto mb-6 rounded-xl border border-border\">\n <table className=\"min-w-full border-collapse\">{children}</table>\n </div>\n ),\n th: ({ children }: { children: ReactNode }) => (\n <th className=\"border-b border-r border-border bg-muted px-4 py-2 text-left font-semibold text-foreground last:border-r-0\">{children}</th>\n ),\n td: ({ children }: { children: ReactNode }) => (\n <td className=\"border-b border-r border-border px-4 py-2 text-muted-foreground last:border-r-0\">{children}</td>\n ),\n // Custom components\n Callout,\n Accordion,\n AccordionItem,\n Tabs,\n Tab,\n Image,\n Video,\n Card,\n CardGrid,\n ImageCard,\n ImageCardGrid,\n Steps,\n Step,\n Icon,\n Mermaid,\n Math,\n Columns,\n Column,\n Badge,\n Tooltip,\n Frame,\n // API Documentation components\n ApiEndpoint,\n ApiParams,\n ApiResponse,\n ApiPlayground,\n ApiReference,\n}\n","/**\n * Configuration schema for Specra documentation system\n */\n\n/**\n * Site metadata and branding\n */\nexport interface SiteConfig {\n /** The title of the documentation site */\n title: string\n /** Short description of the documentation */\n description?: string\n /** URL where the documentation is hosted */\n url?: string\n /** Base URL path for the documentation (e.g., '/docs') */\n baseUrl?: string\n /** Path to the site logo */\n logo?: string\n /** Path to the favicon */\n favicon?: string\n /** Default language for the documentation */\n language?: string\n /** Organization or author name */\n organizationName?: string\n /** Project name */\n projectName?: string\n /** Active/default version for the documentation */\n activeVersion?: string\n}\n\n/**\n * Theme and appearance settings\n */\nexport interface ThemeConfig {\n /** Primary color for the theme */\n primaryColor?: string\n /** Default theme mode */\n defaultMode?: \"light\" | \"dark\" | \"system\"\n /** Whether to respect system preferences */\n respectPrefersColorScheme?: boolean\n /** Custom CSS file path */\n customCss?: string\n}\n\n/**\n * Tab group for organizing documentation\n */\nexport interface TabGroup {\n /** Unique identifier for the tab group */\n id: string\n /** Display label for the tab */\n label: string\n /** Optional icon name (lucide-react icon) */\n icon?: string\n}\n\n/**\n * Navigation and sidebar configuration\n */\nexport interface NavigationConfig {\n /** Whether to show the sidebar by default */\n showSidebar?: boolean\n /** Whether the sidebar is collapsible */\n collapsibleSidebar?: boolean\n /** Whether to show breadcrumbs */\n showBreadcrumbs?: boolean\n /** Whether to show table of contents */\n showTableOfContents?: boolean\n /** Position of table of contents */\n tocPosition?: \"left\" | \"right\"\n /** Maximum depth for table of contents */\n tocMaxDepth?: number\n /** Tab groups for organizing documentation sections */\n tabGroups?: TabGroup[]\n}\n\n/**\n * Social and external links\n */\nexport interface SocialLinks {\n /** GitHub repository URL */\n github?: string\n /** Twitter/X handle or URL */\n twitter?: string\n /** Discord invite URL */\n discord?: string\n /** LinkedIn profile or company page */\n linkedin?: string\n /** YouTube channel URL */\n youtube?: string\n /** Custom social links */\n custom?: Array<{\n label: string\n url: string\n icon?: string\n }>\n}\n\n/**\n * Search configuration\n */\nexport interface SearchConfig {\n /** Enable/disable search functionality */\n enabled?: boolean\n /** Placeholder text for search input */\n placeholder?: string\n /** Search provider type */\n provider?: \"meilisearch\" | \"algolia\" | \"local\"\n /** Meilisearch configuration */\n meilisearch?: {\n /** Meilisearch server URL */\n host: string\n /** API key for Meilisearch */\n apiKey?: string\n /** Index name */\n indexName: string\n }\n}\n\n/**\n * Analytics configuration\n */\nexport interface AnalyticsConfig {\n /** Google Analytics tracking ID */\n googleAnalytics?: string\n /** Google Tag Manager ID */\n googleTagManager?: string\n /** Plausible Analytics domain */\n plausible?: string\n /** Custom analytics scripts */\n custom?: Array<{\n src: string\n async?: boolean\n defer?: boolean\n }>\n}\n\n/**\n * Footer configuration\n */\nexport interface FooterConfig {\n /** Copyright text */\n copyright?: string\n /** Footer links organized by columns */\n links?: Array<{\n title: string\n items: Array<{\n label: string\n href: string\n }>\n }>\n /** Custom footer content */\n customContent?: string\n}\n\n/**\n * Documentation features\n */\nexport interface FeaturesConfig {\n /** Enable/disable edit this page links */\n editUrl?: string | false\n /** Show last updated timestamp */\n showLastUpdated?: boolean\n /** Show reading time estimate */\n showReadingTime?: boolean\n /** Show author information */\n showAuthors?: boolean\n /** Show tags */\n showTags?: boolean\n /** Enable version dropdown */\n versioning?: boolean\n /** Enable i18n (internationalization) */\n i18n?: boolean\n}\n\n/**\n * Site-wide banner configuration\n */\nexport interface BannerConfig {\n /** Whether the banner is enabled */\n enabled?: boolean\n /** Banner message */\n message?: string\n /** Banner type */\n type?: \"info\" | \"warning\" | \"success\" | \"error\"\n /** Whether the banner can be dismissed */\n dismissible?: boolean\n}\n\n/**\n * Environment variables that can be used in documentation\n * These will be replaced at build time or runtime\n */\nexport interface EnvironmentVariables {\n /** API base URL */\n API_BASE_URL?: string\n /** API version */\n API_VERSION?: string\n /** CDN URL */\n CDN_URL?: string\n /** Custom environment variables */\n [key: string]: string | undefined\n}\n\n/**\n * Deployment configuration for different hosting scenarios\n */\nexport interface DeploymentConfig {\n /**\n * Deployment target\n * - 'vercel': For Vercel or similar Node.js hosting (uses 'standalone' output)\n * - 'github-pages': For GitHub Pages static hosting (uses 'export' output)\n * - 'static': For any static hosting like Netlify, Cloudflare Pages, etc.\n * - 'custom-domain-static': For static hosting with custom domain (no basePath needed)\n */\n target?: \"vercel\" | \"github-pages\" | \"static\" | \"custom-domain-static\"\n\n /**\n * Base path for assets when deploying to GitHub Pages without custom domain\n * This should be your repository name (e.g., 'my-repo')\n * Only used when target is 'github-pages' and no custom domain is configured\n */\n basePath?: string\n\n /**\n * Whether a custom domain is configured\n * When true, basePath will be ignored even for GitHub Pages\n */\n customDomain?: boolean\n}\n\n/**\n * Main configuration interface\n */\nexport interface SpecraConfig {\n /** Site metadata and branding */\n site: SiteConfig\n /** Theme and appearance settings */\n theme?: ThemeConfig\n /** Navigation and sidebar configuration */\n navigation?: NavigationConfig\n /** Social and external links */\n social?: SocialLinks\n /** Search configuration */\n search?: SearchConfig\n /** Analytics configuration */\n analytics?: AnalyticsConfig\n /** Footer configuration */\n footer?: FooterConfig\n /** Site-wide banner */\n banner?: BannerConfig\n /** Documentation features */\n features?: FeaturesConfig\n /** Environment variables for use in docs */\n env?: EnvironmentVariables\n /** Deployment configuration */\n deployment?: DeploymentConfig\n}\n\n/**\n * Default configuration values\n */\nexport const defaultConfig: SpecraConfig = {\n site: {\n title: \"Documentation\",\n description: \"Project documentation\",\n baseUrl: \"/\",\n language: \"en\",\n },\n theme: {\n defaultMode: \"system\",\n respectPrefersColorScheme: true,\n },\n navigation: {\n showSidebar: true,\n collapsibleSidebar: true,\n showBreadcrumbs: true,\n showTableOfContents: true,\n tocPosition: \"right\",\n tocMaxDepth: 3,\n },\n search: {\n enabled: true,\n provider: \"local\",\n placeholder: \"Search documentation...\",\n },\n features: {\n showLastUpdated: true,\n showReadingTime: true,\n showAuthors: false,\n showTags: true,\n versioning: true,\n i18n: false,\n },\n}\n","import specraConfigJson from \"../specra.config.json\"\nimport { SpecraConfig, defaultConfig } from \"./config.types\"\n\n/**\n * Deep merge two objects\n */\nfunction deepMerge<T extends Record<string, any>>(target: T, source: Partial<T>): T {\n const result = { ...target }\n\n for (const key in source) {\n const sourceValue = source[key]\n const targetValue = result[key]\n\n if (sourceValue && typeof sourceValue === \"object\" && !Array.isArray(sourceValue)) {\n result[key] = deepMerge(\n targetValue && typeof targetValue === \"object\" ? targetValue : {},\n sourceValue,\n ) as T[Extract<keyof T, string>]\n } else if (sourceValue !== undefined) {\n result[key] = sourceValue as T[Extract<keyof T, string>]\n }\n }\n\n return result\n}\n\n/**\n * Load and parse the Specra configuration file\n * Falls back to default configuration if file doesn't exist or is invalid\n */\nexport function loadConfig(userConfig: Partial<SpecraConfig>): SpecraConfig {\n try {\n // const userConfig = specraConfigJson as unknown as Partial<SpecraConfig>\n\n // Merge user config with defaults \n const config = deepMerge(defaultConfig, userConfig)\n\n return config\n } catch (error) {\n console.error(`❌ Error loading configuration:`, error)\n console.warn(\"Using default configuration.\")\n return defaultConfig\n }\n}\n\n/**\n * Get a specific configuration value by path (SERVER ONLY)\n * Example: getConfigValue('site.title') or getConfigValue('theme.defaultMode')\n */\nexport function getConfigValue<T = any>(path: string, config?: SpecraConfig): T | undefined {\n const cfg = config || loadConfig({})\n const keys = path.split(\".\")\n let value: any = cfg\n\n for (const key of keys) {\n if (value && typeof value === \"object\" && key in value) {\n value = value[key]\n } else {\n return undefined\n }\n }\n\n return value as T\n}\n\n/**\n * Replace environment variables in a string (SERVER ONLY)\n * Supports ${ENV_VAR} and {{ENV_VAR}} syntax\n */\nexport function replaceEnvVariables(text: string, config?: SpecraConfig): string {\n const cfg = config || loadConfig({})\n const envVars = cfg.env || {}\n\n let result = text\n\n // Replace ${VAR} syntax\n result = result.replace(/\\$\\{([^}]+)\\}/g, (match, varName) => {\n return envVars[varName] || match\n })\n\n // Replace {{VAR}} syntax\n result = result.replace(/\\{\\{([^}]+)\\}\\}/g, (match, varName) => {\n return envVars[varName] || match\n })\n\n return result\n}\n\n/**\n * Process content and replace all environment variables (SERVER ONLY)\n */\nexport function processContentWithEnv(content: string, config?: SpecraConfig): string {\n return replaceEnvVariables(content, config)\n}\n\n/**\n * Validate configuration (basic validation) (SERVER ONLY)\n */\nexport function validateConfig(config: SpecraConfig): { valid: boolean; errors: string[] } {\n const errors: string[] = []\n\n // Required fields\n if (!config.site?.title) {\n errors.push(\"site.title is required\")\n }\n\n // URL validation\n if (config.site?.url) {\n try {\n new URL(config.site.url)\n } catch {\n errors.push(\"site.url must be a valid URL\")\n }\n }\n\n // Social links validation\n if (config.social) {\n const socialKeys = [\"github\", \"twitter\", \"discord\", \"linkedin\", \"youtube\"] as const\n for (const key of socialKeys) {\n const url = config.social[key]\n if (url) {\n try {\n new URL(url)\n } catch {\n errors.push(`social.${key} must be a valid URL`)\n }\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n}\n\n// Singleton instance\nlet configInstance: SpecraConfig | null = null\n\nexport function initConfig(userConfig: Partial<SpecraConfig>): SpecraConfig {\n if (configInstance) {\n throw new Error(\"Specra config has already been initialized\")\n }\n\n configInstance = loadConfig(userConfig)\n return configInstance\n}\n\n/**\n * Get the configuration instance (cached) (SERVER ONLY)\n */\nexport function getConfig(): SpecraConfig {\n if (!configInstance) {\n throw new Error(\"Specra config has not been initialized\")\n }\n return configInstance\n}\n\n/**\n * Reload the configuration (useful for development) (SERVER ONLY)\n */\nexport function reloadConfig(userConfig: Partial<SpecraConfig>): SpecraConfig {\n configInstance = loadConfig(userConfig)\n return configInstance\n}\n\n/**\n * Export the loaded config as default (SERVER ONLY)\n */\n// export default getConfig()\n","/**\n * Unified sidebar sorting and structure building utilities\n * This module provides consistent sidebar logic across the application\n * to ensure ordering is handled the same way everywhere.\n */\n\nexport interface SidebarGroup {\n label: string\n path: string\n icon?: string\n items: any[]\n position: number\n collapsible: boolean\n defaultCollapsed: boolean\n children: Record<string, SidebarGroup>\n}\n\n/**\n * Sort sidebar items by their position.\n * Items with explicit sidebar_position come first (sorted numerically),\n * followed by items without position (sorted by their original order).\n *\n * @param items - Array of items with optional sidebar_position\n * @returns Sorted array of items\n */\nexport function sortSidebarItems<T extends { sidebar_position?: number; meta?: any }>(items: T[]): T[] {\n return [...items].sort((a, b) => {\n const posA = a.sidebar_position ?? a.meta?.sidebar_position ?? a.meta?.order ?? 999\n const posB = b.sidebar_position ?? b.meta?.sidebar_position ?? b.meta?.order ?? 999\n return posA - posB\n })\n}\n\n/**\n * Sort sidebar groups by their position.\n * Groups with explicit position come first (sorted numerically),\n * followed by groups without position at the end (sorted by their original order).\n *\n * @param groups - Record of group key to group object with position\n * @returns Sorted array of [key, group] tuples\n */\nexport function sortSidebarGroups<T extends { position: number }>(\n groups: Record<string, T>\n): [string, T][] {\n return Object.entries(groups).sort(([, a], [, b]) => {\n const posA = a.position ?? 999\n const posB = b.position ?? 999\n return posA - posB\n })\n}\n\n/**\n * Build hierarchical sidebar structure from flat list of documents\n * This is the single source of truth for sidebar structure used by both\n * the sidebar component and navigation (prev/next) links.\n *\n * @param docs - Array of documents with metadata\n * @returns Object containing root groups and standalone items\n */\nexport function buildSidebarStructure<T extends {\n filePath: string\n slug: string\n categoryLabel?: string\n categoryPosition?: number\n categoryIcon?: string\n categoryCollapsible?: boolean\n categoryCollapsed?: boolean\n meta: any\n}>(docs: T[]): {\n rootGroups: Record<string, SidebarGroup>\n standalone: T[]\n} {\n const rootGroups: Record<string, SidebarGroup> = {}\n const standalone: T[] = []\n\n // First pass: collect category metadata from all docs to build complete folder structure\n const categoryMetadata = new Map<string, {\n label?: string\n position?: number\n icon?: string\n collapsible?: boolean\n collapsed?: boolean\n }>()\n\n docs.forEach((doc) => {\n const pathParts = doc.filePath.split(\"/\")\n const folderPath = pathParts.length > 1 ? pathParts.slice(0, -1).join(\"/\") : \"\"\n\n if (folderPath && doc.categoryLabel) {\n categoryMetadata.set(folderPath, {\n label: doc.categoryLabel,\n position: doc.categoryPosition,\n icon: doc.categoryIcon,\n collapsible: doc.categoryCollapsible,\n collapsed: doc.categoryCollapsed\n })\n }\n })\n\n docs.forEach((doc) => {\n const pathParts = doc.filePath.split(\"/\")\n const isIndexFile = doc.filePath.endsWith(\"/index\") ||\n doc.filePath === \"index\" ||\n (pathParts.length > 1 && doc.slug === pathParts.slice(0, -1).join(\"/\"))\n\n const customGroup = doc.meta.sidebar || doc.meta.group\n\n if (customGroup) {\n const groupName = customGroup.charAt(0).toUpperCase() + customGroup.slice(1)\n if (!rootGroups[groupName]) {\n rootGroups[groupName] = {\n label: groupName,\n path: customGroup,\n items: [],\n position: 999,\n collapsible: doc.categoryCollapsible ?? true,\n defaultCollapsed: doc.categoryCollapsed ?? false,\n children: {}\n }\n }\n if (isIndexFile) {\n // Use categoryPosition if available (from _category_.json), otherwise sidebar_position from frontmatter\n rootGroups[groupName].position = doc.categoryPosition ?? doc.meta.sidebar_position ?? 999\n rootGroups[groupName].icon = doc.categoryIcon\n } else {\n rootGroups[groupName].items.push(doc)\n }\n return\n }\n\n if (pathParts.length > 1) {\n const folderParts = pathParts.slice(0, -1)\n let currentLevel = rootGroups\n let currentPath = \"\"\n\n for (let i = 0; i < folderParts.length; i++) {\n const folder = folderParts[i]\n currentPath = currentPath ? `${currentPath}/${folder}` : folder\n const folderLabel = folder.split(\"-\").map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(\" \")\n\n // Get metadata for this specific folder path\n const metadata = categoryMetadata.get(currentPath)\n\n if (!currentLevel[folder]) {\n currentLevel[folder] = {\n label: metadata?.label ?? folderLabel,\n path: currentPath,\n icon: metadata?.icon,\n items: [],\n position: metadata?.position ?? 999,\n collapsible: metadata?.collapsible ?? true,\n defaultCollapsed: metadata?.collapsed ?? false,\n children: {}\n }\n }\n\n if (i === folderParts.length - 1) {\n if (isIndexFile) {\n // Update position, label, and icon if this is the index file for this folder\n currentLevel[folder].position = doc.categoryPosition ?? doc.meta.sidebar_position ?? currentLevel[folder].position\n if (doc.categoryLabel) {\n currentLevel[folder].label = doc.categoryLabel\n }\n if (doc.categoryIcon) {\n currentLevel[folder].icon = doc.categoryIcon\n }\n if (doc.categoryCollapsible !== undefined) {\n currentLevel[folder].collapsible = doc.categoryCollapsible\n }\n if (doc.categoryCollapsed !== undefined) {\n currentLevel[folder].defaultCollapsed = doc.categoryCollapsed\n }\n } else {\n currentLevel[folder].items.push(doc)\n }\n }\n\n currentLevel = currentLevel[folder].children\n }\n } else {\n if (!isIndexFile) {\n standalone.push(doc)\n }\n }\n })\n\n return { rootGroups, standalone }\n}\n","\n\nexport const COMPONENT_TEXT_PROPS: Record<string, string[]> = {\n // Accordion components\n Accordion: [\"title\"],\n AccordionItem: [\"title\"],\n\n // Alert/Callout components\n Alert: [\"title\", \"description\"],\n Banner: [\"title\"],\n Callout: [\"title\", \"content\"],\n Note: [\"title\"],\n Warning: [\"title\", \"text\"],\n\n // Navigation components\n BreadCrumb: [\"title\", \"slug\", \"version\"],\n\n // Card components\n Card: [\"title\", \"description\"],\n ImageCard: [\"title\", \"description\", \"alt\"],\n\n // Media components\n Image: [\"alt\", \"caption\"],\n Video: [\"caption\"],\n Frame: [\"title\"],\n Mermaid: [\"caption\"],\n\n // Interactive components\n Tooltip: [\"content\"],\n\n // Code components\n CodeBlock: [\"filename\"],\n\n // Step components\n Step: [\"title\"],\n}\n\nexport function extractComponentPropsText(mdx: string): string {\n return mdx.replace(\n /<([A-Z][\\w]*)\\b([^/>]*)\\/>/g,\n (_, component, props) => {\n const searchableProps = COMPONENT_TEXT_PROPS[component]\n if (!searchableProps) return \" \"\n\n let extracted = \"\"\n\n for (const prop of searchableProps) {\n const match = props.match(\n new RegExp(`${prop}=\"([^\"]+)\"`, \"i\")\n )\n if (match) {\n extracted += \" \" + match[1]\n }\n }\n\n return extracted || \" \"\n }\n )\n}\n\nexport function extractSearchText(mdx: string): string {\n return extractComponentPropsText(mdx)\n // 2. Remove fenced code blocks\n .replace(/```[\\s\\S]*?```/g, \" \")\n\n // 3. Remove JSX blocks with children\n .replace(/<([A-Z][\\w]*)\\b[^>]*>[\\s\\S]*?<\\/\\1>/g, \" \")\n\n // 4. Remove remaining JSX & HTML\n .replace(/<\\/?[A-Za-z][^>]*>/g, \" \")\n\n // 5. Remove inline code\n .replace(/`[^`]+`/g, \" \")\n\n // 6. Remove markdown links (keep text)\n .replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, \"$1\")\n\n // 7. Remove markdown noise\n .replace(/[#>*_~=-]+/g, \" \")\n\n // 8. Normalize whitespace\n .replace(/\\s+/g, \" \")\n .trim()\n .slice(0, 1000)\n}","\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { Code2, Wifi } from \"lucide-react\"\n\nexport function DevModeBadge() {\n const [isConnected, setIsConnected] = useState(true)\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Check WebSocket connection status\n const checkConnection = () => {\n setIsConnected(navigator.onLine)\n }\n\n window.addEventListener(\"online\", checkConnection)\n window.addEventListener(\"offline\", checkConnection)\n\n return () => {\n window.removeEventListener(\"online\", checkConnection)\n window.removeEventListener(\"offline\", checkConnection)\n }\n }, [])\n\n if (process.env.NODE_ENV !== \"development\") return null\n\n return (\n <div className=\"fixed top-20 left-4 z-40 flex items-center gap-2 px-3 py-1.5 bg-orange-500/10 text-orange-600 dark:text-orange-400 border border-orange-500/20 rounded-full text-xs font-medium\">\n <Code2 className=\"h-3 w-3\" />\n <span>Dev Mode</span>\n <div className={`h-2 w-2 rounded-full ${isConnected ? \"bg-green-500\" : \"bg-red-500\"} animate-pulse`} />\n </div>\n )\n}\n","import { ExternalLink, FileEdit } from \"lucide-react\"\nimport { MDXRemote, type MDXRemoteProps } from \"next-mdx-remote/rsc\"\nimport remarkGfm from \"remark-gfm\"\nimport rehypeSlug from \"rehype-slug\"\nimport { remarkCodeMeta } from \"@/lib/remark-code-meta\"\nimport { mdxComponents } from \"./mdx-components\"\nimport type { ComponentPropsWithoutRef } from \"react\"\nimport { DocNavigation } from \"./doc-navigation\"\nimport { Breadcrumb } from \"./breadcrumb\"\nimport { DocMetadata } from \"./doc-metadata\"\nimport { DraftBadge } from \"./draft-badge\"\nimport { DocTags } from \"./doc-tags\"\nimport { SearchHighlight } from \"./search-highlight\"\nimport type { DocMeta } from \"@/lib/mdx\"\nimport { getConfig, processContentWithEnv, type SpecraConfig } from \"@/lib/config\"\n\ninterface DocLayoutProps {\n meta: DocMeta\n content: string\n previousDoc?: {\n title: string\n slug: string\n }\n nextDoc?: {\n title: string\n slug: string\n }\n version: string\n slug: string\n config: SpecraConfig\n}\n\n\n\nexport async function DocLayout({ content, meta, previousDoc, nextDoc, version, slug, config }: DocLayoutProps) {\n const isDevelopment = process.env.NODE_ENV === \"development\"\n // const config = getConfig()\n\n // Process content with environment variables\n const processedContent = processContentWithEnv(content, config)\n\n // Build edit URL if configured\n const editUrl = config.features?.editUrl && typeof config.features.editUrl === 'string'\n ? `${config.features.editUrl}/${version}/${slug}.mdx`\n : null\n\n return (\n <article className=\"flex-1 min-w-0\">\n <SearchHighlight />\n\n {config.navigation?.showBreadcrumbs && (\n <Breadcrumb version={version} slug={slug} title={meta.title} />\n )}\n\n {isDevelopment && meta.draft && <DraftBadge />}\n\n <div className=\"mb-8\">\n <h1 className=\"text-4xl font-bold tracking-tight mb-3 text-foreground\">{meta.title}</h1>\n {meta.description && <p className=\"text-lg text-muted-foreground leading-relaxed\">{meta.description}</p>}\n </div>\n\n <DocMetadata meta={meta} config={config} />\n\n <div className=\"prose prose-slate dark:prose-invert max-w-none prose-headings:scroll-mt-24 prose-headings:font-semibold prose-h1:text-4xl prose-h2:text-3xl prose-h2:mt-12 prose-h2:mb-4 prose-h3:text-2xl prose-h3:mt-8 prose-h3:mb-3 prose-p:text-base prose-p:leading-7 prose-p:text-muted-foreground prose-p:mb-4 prose-a:font-normal prose-a:transition-all prose-code:text-primary prose-code:bg-muted/50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:text-[13px] prose-code:font-mono prose-code:border prose-code:border-border/50 prose-code:before:content-none prose-code:after:content-none prose-pre:bg-transparent prose-pre:p-0 prose-ul:list-disc prose-ul:list-inside prose-ul:space-y-2 prose-ul:mb-4 prose-ol:list-decimal prose-ol:list-inside prose-ol:space-y-2 prose-ol:mb-4 prose-li:leading-7 prose-li:text-muted-foreground prose-strong:text-foreground prose-strong:font-semibold\">\n <MDXRemote\n source={processedContent}\n options={{\n parseFrontmatter: false,\n mdxOptions: {\n remarkPlugins: [remarkGfm, remarkCodeMeta],\n rehypePlugins: [rehypeSlug],\n development: false,\n },\n }}\n components={mdxComponents as any}\n />\n </div>\n\n {config.features?.showTags && meta.tags && meta.tags.length > 0 && <DocTags tags={meta.tags} />}\n\n {(editUrl || config.social?.github) && (\n <div className=\"mt-12 pt-6 border-t border-border flex items-center justify-between\">\n {editUrl ? (\n <a\n href={editUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n <FileEdit className=\"h-4 w-4\" />\n Edit this page\n </a>\n ) : <div />}\n {config.social?.github && (\n <a\n href={`${config.social.github}/issues/new`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n <ExternalLink className=\"h-4 w-4\" />\n Report an issue\n </a>\n )}\n </div>\n )}\n\n <DocNavigation previousDoc={previousDoc} nextDoc={nextDoc} version={version} />\n </article>\n )\n}\n","import Link from \"next/link\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\n\ninterface DocNavigationProps {\n previousDoc?: {\n title: string\n slug: string\n }\n nextDoc?: {\n title: string\n slug: string\n }\n version: string\n}\n\nexport function DocNavigation({ previousDoc, nextDoc, version }: DocNavigationProps) {\n if (!previousDoc && !nextDoc) return null\n\n return (\n <div className=\"mt-12 pt-8 border-t border-border grid grid-cols-2 gap-4\">\n {previousDoc ? (\n <Link\n href={`/docs/${version}/${previousDoc.slug}`}\n className=\"group flex flex-col gap-2 p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all\"\n style={{\n textDecoration: \"none !important\"\n }}\n >\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </div>\n <div className=\"text-base font-medium text-foreground group-hover:text-primary transition-colors\">\n {previousDoc.title}\n </div>\n </Link>\n ) : (\n <div />\n )}\n\n {nextDoc ? (\n <Link\n href={`/docs/${version}/${nextDoc.slug}`}\n className=\"group flex flex-col gap-2 p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all text-right\"\n style={{\n textDecoration: \"none !important\"\n }}\n >\n <div className=\"flex items-center justify-end gap-2 text-sm text-muted-foreground\">\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </div>\n <div className=\"text-base font-medium text-foreground group-hover:text-primary transition-colors\">\n {nextDoc.title}\n </div>\n </Link>\n ) : (\n <div />\n )}\n </div>\n )\n}\n","import { Clock, Calendar, User } from \"lucide-react\"\nimport type { DocMeta } from \"@/lib/mdx\"\nimport { getConfig, SpecraConfig } from \"@/lib/config\"\n\ninterface DocMetadataProps {\n meta: DocMeta\n config: SpecraConfig\n}\n\nexport function DocMetadata({ meta, config }: DocMetadataProps) {\n // Server component - can use getConfig directly\n // const config = getConfig()\n \n const showReadingTime = config.features?.showReadingTime && meta.reading_time\n const showLastUpdated = config.features?.showLastUpdated && meta.last_updated\n const showAuthors = config.features?.showAuthors && meta.authors?.length\n \n const hasMetadata = showReadingTime || showLastUpdated || showAuthors\n\n if (!hasMetadata) {\n return null\n }\n\n return (\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-muted-foreground border-b border-border pb-4 mb-6\">\n {showReadingTime && (\n <div className=\"flex items-center gap-1.5\">\n <Clock className=\"h-4 w-4\" />\n <span>{meta.reading_time} min read</span>\n </div>\n )}\n \n {showLastUpdated && meta.last_updated && (\n <div className=\"flex items-center gap-1.5\">\n <Calendar className=\"h-4 w-4\" />\n <span>Updated {new Date(meta.last_updated).toLocaleDateString()}</span>\n </div>\n )}\n \n {showAuthors && (\n <div className=\"flex items-center gap-1.5\">\n <User className=\"h-4 w-4\" />\n <span>\n {meta.authors!.map((author, idx) => (\n <span key={author.id}>\n {author.name || author.id}\n {idx < meta.authors!.length - 1 && \", \"}\n </span>\n ))}\n </span>\n </div>\n )}\n </div>\n )\n}\n","import { FileWarning } from \"lucide-react\"\n\nexport function DraftBadge() {\n return (\n <div className=\"inline-flex items-center gap-2 px-3 py-1.5 rounded-md bg-yellow-500/10 border border-yellow-500/20 text-yellow-600 dark:text-yellow-400 text-sm font-medium mb-4\">\n <FileWarning className=\"h-4 w-4\" />\n <span>Draft - Not visible in production</span>\n </div>\n )\n}\n","import { Tag } from \"lucide-react\"\n\ninterface DocTagsProps {\n tags: string[]\n}\n\nexport function DocTags({ tags }: DocTagsProps) {\n if (!tags || tags.length === 0) {\n return null\n }\n\n return (\n <div className=\"flex flex-wrap items-center gap-2 mt-6 pt-6 border-t border-border\">\n <Tag className=\"h-4 w-4 text-muted-foreground\" />\n {tags.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-primary/10 text-primary border border-primary/20\"\n >\n {tag}\n </span>\n ))}\n </div>\n )\n}\n","\"use client\"\n\nimport { useEffect } from \"react\"\nimport { useSearchParams } from \"next/navigation\"\n\nexport function SearchHighlight() {\n const searchParams = useSearchParams()\n const query = searchParams.get(\"q\")\n\n useEffect(() => {\n if (!query) {\n // Remove any existing highlights\n document.querySelectorAll(\"mark.search-highlight\").forEach((mark) => {\n const parent = mark.parentNode\n if (parent) {\n parent.replaceChild(document.createTextNode(mark.textContent || \"\"), mark)\n parent.normalize()\n }\n })\n return\n }\n\n // Wait for content to load\n const timeout = setTimeout(() => {\n highlightSearchTerm(query)\n }, 100)\n\n return () => {\n clearTimeout(timeout)\n // Cleanup highlights on unmount\n document.querySelectorAll(\"mark.search-highlight\").forEach((mark) => {\n const parent = mark.parentNode\n if (parent) {\n parent.replaceChild(document.createTextNode(mark.textContent || \"\"), mark)\n parent.normalize()\n }\n })\n }\n }, [query])\n\n return null\n}\n\nfunction highlightSearchTerm(searchTerm: string) {\n // Remove existing highlights first\n document.querySelectorAll(\"mark.search-highlight\").forEach((mark) => {\n const parent = mark.parentNode\n if (parent) {\n parent.replaceChild(document.createTextNode(mark.textContent || \"\"), mark)\n parent.normalize()\n }\n })\n\n // Only highlight in the main content area\n const contentArea = document.querySelector(\"main\") || document.body\n \n const walker = document.createTreeWalker(\n contentArea,\n NodeFilter.SHOW_TEXT,\n {\n acceptNode: (node) => {\n // Skip if parent is already a mark, script, style, or code element\n const parent = node.parentElement\n if (!parent) return NodeFilter.FILTER_REJECT\n \n const tagName = parent.tagName.toLowerCase()\n if ([\"mark\", \"script\", \"style\", \"code\", \"pre\"].includes(tagName)) {\n return NodeFilter.FILTER_REJECT\n }\n \n // Check if text contains the search term\n if (node.textContent && node.textContent.toLowerCase().includes(searchTerm.toLowerCase())) {\n return NodeFilter.FILTER_ACCEPT\n }\n \n return NodeFilter.FILTER_REJECT\n }\n }\n )\n\n const nodesToHighlight: { node: Text; text: string }[] = []\n let currentNode: Node | null\n\n while ((currentNode = walker.nextNode())) {\n if (currentNode.textContent) {\n nodesToHighlight.push({\n node: currentNode as Text,\n text: currentNode.textContent\n })\n }\n }\n\n // Highlight all found nodes\n nodesToHighlight.forEach(({ node, text }) => {\n const regex = new RegExp(`(${escapeRegex(searchTerm)})`, \"gi\")\n const parts = text.split(regex)\n \n if (parts.length > 1) {\n const fragment = document.createDocumentFragment()\n \n parts.forEach((part) => {\n if (part.toLowerCase() === searchTerm.toLowerCase()) {\n const mark = document.createElement(\"mark\")\n mark.className = \"search-highlight bg-yellow-200 dark:bg-yellow-900/50 text-foreground px-1 rounded\"\n mark.textContent = part\n fragment.appendChild(mark)\n } else if (part) {\n fragment.appendChild(document.createTextNode(part))\n }\n })\n \n node.parentNode?.replaceChild(fragment, node)\n }\n })\n\n // Scroll to first highlight\n const firstHighlight = document.querySelector(\"mark.search-highlight\")\n if (firstHighlight) {\n setTimeout(() => {\n firstHighlight.scrollIntoView({ behavior: \"smooth\", block: \"center\" })\n }, 200)\n }\n}\n\nfunction escapeRegex(string: string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n","\"use client\"\n\nimport { ReactNode, useEffect, useRef } from \"react\"\nimport { MobileDocLayout } from \"./mobile-doc-layout\"\nimport { useTabContext } from \"./tab-context\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport type { Doc } from \"@/lib/mdx\"\n\ninterface DocLayoutWrapperProps {\n header: ReactNode\n docs: Doc[]\n version: string\n content: ReactNode\n toc: ReactNode\n config: SpecraConfig\n currentPageTabGroup?: string\n}\n\nexport function DocLayoutWrapper({ header, docs, version, content, toc, config, currentPageTabGroup }: DocLayoutWrapperProps) {\n // Use global tab context instead of local state\n const { activeTabGroup, setActiveTabGroup } = useTabContext()\n const lastPageTabGroupRef = useRef<string | undefined>(undefined)\n const isInitialMount = useRef(true)\n\n // Set tab based on page's tab group\n useEffect(() => {\n // On initial mount, always set to current page's tab group\n if (isInitialMount.current && currentPageTabGroup) {\n setActiveTabGroup(currentPageTabGroup)\n lastPageTabGroupRef.current = currentPageTabGroup\n isInitialMount.current = false\n return\n }\n\n // On subsequent renders, only update if navigating to a different page\n if (currentPageTabGroup && lastPageTabGroupRef.current !== currentPageTabGroup) {\n setActiveTabGroup(currentPageTabGroup)\n lastPageTabGroupRef.current = currentPageTabGroup\n }\n }, [currentPageTabGroup, setActiveTabGroup])\n\n return (\n <MobileDocLayout\n header={header}\n docs={docs}\n version={version}\n content={content}\n toc={toc}\n config={config}\n activeTabGroup={activeTabGroup}\n onTabChange={setActiveTabGroup}\n />\n )\n}\n","\"use client\"\n\nimport { useState, ReactNode, cloneElement, isValidElement } from \"react\"\nimport { Footer } from \"./footer\"\nimport { SiteBanner } from \"./site-banner\"\nimport { TabGroups } from \"./tab-groups\"\nimport { Sidebar } from \"./sidebar\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport type { Doc } from \"@/lib/mdx\"\n\ninterface MobileDocLayoutProps {\n header: ReactNode\n docs: Doc[]\n version: string\n content: ReactNode\n toc: ReactNode\n config: SpecraConfig\n activeTabGroup?: string\n onTabChange?: (tabId: string) => void\n}\n\nexport function MobileDocLayout({ header, docs, version, content, toc, config, activeTabGroup, onTabChange }: MobileDocLayoutProps) {\n const [sidebarOpen, setSidebarOpen] = useState(false)\n\n const handleTabChange = (tabId: string) => {\n onTabChange?.(tabId)\n }\n\n const closeSidebar = () => setSidebarOpen(false)\n const toggleSidebar = () => setSidebarOpen(!sidebarOpen)\n\n // Clone header and pass onMenuClick prop if it's a valid React element\n const headerWithProps = isValidElement(header)\n ? cloneElement(header as React.ReactElement<any>, {\n onMenuClick: toggleSidebar,\n })\n : header\n\n return (\n <div className=\"min-h-screen bg-background\">\n {/* Header */}\n {headerWithProps}\n\n {/* Site-wide Banner */}\n <SiteBanner config={config} />\n\n {/* Tab Groups - shown only if configured */}\n {config.navigation?.tabGroups && config.navigation.tabGroups.length > 0 && (\n <TabGroups\n tabGroups={config.navigation.tabGroups}\n activeTabId={activeTabGroup}\n onTabChange={handleTabChange}\n />\n )}\n\n {/* Mobile Sidebar Overlay */}\n {sidebarOpen && (\n <div\n className=\"lg:hidden fixed inset-0 bg-background/80 backdrop-blur-sm z-40\"\n onClick={() => setSidebarOpen(false)}\n />\n )}\n\n {/* Mobile Sidebar */}\n <div\n className={`lg:hidden fixed top-0 left-0 h-full w-64 bg-background border-r border-border z-40 transform transition-transform duration-300 ease-in-out overflow-y-auto ${sidebarOpen ? \"translate-x-0\" : \"-translate-x-full\"\n }`}\n >\n <div className=\"pt-20 px-4\">\n <Sidebar\n docs={docs}\n version={version}\n config={config}\n onLinkClick={closeSidebar}\n activeTabGroup={activeTabGroup}\n />\n </div>\n </div>\n\n {/* Main Content */}\n <main className=\"container mx-auto px-6 py-8\">\n <div className=\"flex\">\n {/* Desktop Sidebar */}\n <div className=\"hidden lg:block\">\n <Sidebar\n docs={docs}\n version={version}\n config={config}\n activeTabGroup={activeTabGroup}\n />\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex flex-col gap-2 px-2 md:px-8\">\n {/* Content */}\n {content}\n\n {/* Footer */}\n <Footer config={config} />\n\n </div>\n </div>\n\n {/* ToC */}\n {toc}\n </div>\n\n\n </main>\n\n\n\n </div>\n )\n}\n","import Link from \"next/link\"\nimport { getConfig, SpecraConfig } from \"@/lib/config\"\n\nexport function Footer({ config }: { config: SpecraConfig }) {\n // Server component - can use getConfig directly\n // const config = getConfig()\n\n if (!config.footer) {\n return null\n }\n\n return (\n <footer className=\"bg-muted/30 dark:bg-muted/10 rounded-2xl mt-24\">\n <div className=\"px-6 py-12\">\n {config.footer.links && config.footer.links.length > 0 && (\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-8 mb-8\">\n {config.footer.links.map((column, idx) => (\n <div key={idx}>\n <h3 className=\"font-semibold text-foreground mb-4\">{column.title}</h3>\n <ul className=\"space-y-2\">\n {column.items.map((item, itemIdx) => (\n <li key={itemIdx}>\n <Link\n href={item.href}\n className=\"text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n {item.label}\n </Link>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n )}\n\n {config.footer.copyright && (\n <div className=\"pt-8\">\n <p className=\"text-sm text-muted-foreground text-center\">\n {config.footer.copyright}\n </p>\n </div>\n )}\n </div>\n </footer>\n )\n}\n","\"use client\"\n\nimport { X, AlertCircle, CheckCircle, Info, XCircle } from \"lucide-react\"\nimport { useState, useEffect } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\n\ninterface SiteBannerProps {\n config: SpecraConfig\n}\n\nexport function SiteBanner({ config }: SiteBannerProps) {\n const [dismissed, setDismissed] = useState(false)\n const [mounted, setMounted] = useState(false)\n \n const banner = config.banner\n const storageKey = \"site-banner-dismissed\"\n \n useEffect(() => {\n setMounted(true)\n // Check if banner was previously dismissed\n const isDismissed = localStorage.getItem(storageKey) === \"true\"\n setDismissed(isDismissed)\n }, [])\n \n const handleDismiss = () => {\n setDismissed(true)\n localStorage.setItem(storageKey, \"true\")\n }\n \n // Don't render on server or if no banner configured or if dismissed\n if (!mounted || !banner || !banner.enabled || dismissed) {\n return null\n }\n\n const typeConfig = {\n info: {\n icon: Info,\n bg: \"bg-blue-500/10 dark:bg-blue-400/5\",\n border: \"border-blue-500/30 dark:border-blue-500/20\",\n iconColor: \"text-blue-600 dark:text-blue-400\",\n textColor: \"text-blue-900 dark:text-blue-300\",\n },\n success: {\n icon: CheckCircle,\n bg: \"bg-green-500/10 dark:bg-green-400/5\",\n border: \"border-green-500/30 dark:border-green-500/20\",\n iconColor: \"text-green-600 dark:text-green-400\",\n textColor: \"text-green-900 dark:text-green-300\",\n },\n warning: {\n icon: AlertCircle,\n bg: \"bg-yellow-500/10 dark:bg-yellow-400/5\",\n border: \"border-yellow-500/30 dark:border-yellow-500/20\",\n iconColor: \"text-yellow-600 dark:text-yellow-400\",\n textColor: \"text-yellow-900 dark:text-yellow-300\",\n },\n error: {\n icon: XCircle,\n bg: \"bg-red-500/10 dark:bg-red-400/5\",\n border: \"border-red-500/30 dark:border-red-500/20\",\n iconColor: \"text-red-600 dark:text-red-400\",\n textColor: \"text-red-900 dark:text-red-300\",\n },\n }\n\n const type = banner.type || \"info\"\n const { icon: IconComponent, bg, border, iconColor, textColor } = typeConfig[type]\n\n return (\n <div className={`w-full border-b ${border} ${bg}`}>\n <div className=\"container mx-auto px-6 py-3\">\n <div className=\"flex items-center gap-3\">\n <IconComponent className={`h-5 w-5 shrink-0 ${iconColor}`} />\n <div className=\"flex-1 min-w-0\">\n <p className={`text-sm font-medium ${textColor}`}>\n {banner.message}\n </p>\n </div>\n {banner.dismissible && (\n <button\n onClick={handleDismiss}\n className={`shrink-0 p-1 rounded-md hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${iconColor}`}\n aria-label=\"Dismiss banner\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport { Icon } from \"./icon\"\nimport type { TabGroup } from \"@/lib/config.types\"\n\ninterface TabGroupsProps {\n tabGroups: TabGroup[]\n activeTabId?: string\n onTabChange?: (tabId: string) => void\n}\n\nexport function TabGroups({ tabGroups, activeTabId, onTabChange }: TabGroupsProps) {\n const activeTab = activeTabId || tabGroups[0]?.id || \"\"\n\n const handleTabChange = (tabId: string) => {\n onTabChange?.(tabId)\n }\n\n if (!tabGroups || tabGroups.length === 0) {\n return null\n }\n\n return (\n <div className=\"sticky top-16 z-30 border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60\">\n <div className=\"container mx-auto px-6\">\n <nav className=\"flex gap-1 overflow-x-auto no-scrollbar\" aria-label=\"Documentation tabs\">\n {tabGroups.map((tab) => {\n const isActive = tab.id === activeTab\n\n return (\n <button\n key={tab.id}\n onClick={() => handleTabChange(tab.id)}\n className={`flex items-center gap-2 px-4 py-3 text-sm font-medium whitespace-nowrap transition-all border-b-2 ${\n isActive\n ? \"border-primary text-primary\"\n : \"border-transparent text-muted-foreground hover:text-foreground hover:border-border\"\n }`}\n aria-current={isActive ? \"page\" : undefined}\n >\n {tab.icon && <Icon icon={tab.icon} size={16} className=\"shrink-0\" />}\n {tab.label}\n </button>\n )\n })}\n </nav>\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport Link from \"next/link\"\nimport { usePathname } from \"next/navigation\"\nimport { ChevronRight, ChevronDown, FolderOpen } from \"lucide-react\"\nimport { useState } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport { Icon } from \"./icon\"\nimport { sortSidebarItems, sortSidebarGroups } from \"@/lib/sidebar-utils\"\n\ninterface DocItem {\n title: string\n slug: string\n filePath: string\n section?: string\n group?: string\n sidebar?: string\n sidebar_position?: number\n categoryLabel?: string\n categoryPosition?: number\n categoryCollapsible?: boolean\n categoryCollapsed?: boolean\n categoryIcon?: string // Icon from _category_.json\n categoryTabGroup?: string // Tab group from _category_.json\n meta?: {\n icon?: string // Icon name from frontmatter\n tab_group?: string // Tab group from frontmatter\n [key: string]: any\n }\n}\n\ninterface SidebarProps {\n docs: DocItem[]\n version: string\n onLinkClick?: () => void\n config: SpecraConfig\n activeTabGroup?: string // Current active tab group filter\n}\n\ninterface SidebarGroup {\n label: string\n path: string // Path for navigation (e.g., \"components\" for /docs/v1.0.0/components)\n icon?: string // Icon from _category_.json\n items: DocItem[]\n position: number\n collapsible: boolean\n defaultCollapsed: boolean\n children: Record<string, SidebarGroup>\n}\n\nexport function Sidebar({ docs, version, onLinkClick, config, activeTabGroup }: SidebarProps) {\n const pathname = usePathname()\n const [collapsed, setCollapsed] = useState<Record<string, boolean>>(() => {\n const initial: Record<string, boolean> = {}\n return initial\n })\n\n if (!config.navigation?.showSidebar) {\n return null\n }\n\n // Filter docs by active tab group if tab groups are configured\n const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0\n const filteredDocs = hasTabGroups && activeTabGroup\n ? docs.filter((doc) => {\n // Get tab group from either frontmatter or category config\n const docTabGroup = doc.meta?.tab_group || doc.categoryTabGroup\n\n // If doc has no tab group, include it in the first tab group\n if (!docTabGroup) {\n return activeTabGroup === config.navigation?.tabGroups?.[0]?.id\n }\n\n return docTabGroup === activeTabGroup\n })\n : docs\n\n // Build a hierarchical tree structure\n const rootGroups: Record<string, SidebarGroup> = {}\n const standalone: DocItem[] = []\n\n filteredDocs.forEach((doc) => {\n const pathParts = doc.filePath.split(\"/\")\n const isIndexFile = doc.filePath.endsWith(\"/index\") ||\n doc.filePath === \"index\" ||\n (pathParts.length > 1 && doc.slug === pathParts.slice(0, -1).join(\"/\"))\n\n // Use the sidebar or group from frontmatter if provided\n const customGroup = doc.sidebar || doc.group\n\n if (customGroup) {\n const groupName = customGroup.charAt(0).toUpperCase() + customGroup.slice(1)\n if (!rootGroups[groupName]) {\n rootGroups[groupName] = {\n label: groupName,\n path: customGroup,\n items: [],\n position: 999,\n collapsible: doc.categoryCollapsible ?? true,\n defaultCollapsed: doc.categoryCollapsed ?? false,\n children: {}\n }\n }\n if (isIndexFile) {\n rootGroups[groupName].position = doc.sidebar_position ?? 999\n rootGroups[groupName].icon = doc.categoryIcon\n } else {\n rootGroups[groupName].items.push(doc)\n }\n return\n }\n\n // Build nested structure based on folder path\n if (pathParts.length > 1) {\n const folderParts = pathParts.slice(0, -1) // All folders except the file\n\n // Navigate/create the tree structure\n let currentLevel = rootGroups\n let currentPath = \"\"\n\n for (let i = 0; i < folderParts.length; i++) {\n const folder = folderParts[i]\n currentPath = currentPath ? `${currentPath}/${folder}` : folder\n const folderLabel = folder.split(\"-\").map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(\" \")\n\n if (!currentLevel[folder]) {\n currentLevel[folder] = {\n label: doc.categoryLabel && i === folderParts.length - 1 ? doc.categoryLabel : folderLabel,\n path: currentPath,\n icon: doc.categoryIcon,\n items: [],\n position: doc.categoryPosition ?? 999,\n collapsible: doc.categoryCollapsible ?? true,\n defaultCollapsed: doc.categoryCollapsed ?? false,\n children: {}\n }\n }\n\n // If this is the deepest folder (where the file lives), add the doc\n if (i === folderParts.length - 1) {\n if (isIndexFile) {\n currentLevel[folder].position = doc.categoryPosition ?? doc.sidebar_position ?? 999\n // Update label and icon from category config if available\n if (doc.categoryLabel) {\n currentLevel[folder].label = doc.categoryLabel\n }\n if (doc.categoryIcon) {\n currentLevel[folder].icon = doc.categoryIcon\n }\n } else {\n currentLevel[folder].items.push(doc)\n }\n }\n\n currentLevel = currentLevel[folder].children\n }\n } else {\n if (!isIndexFile) {\n standalone.push(doc)\n }\n }\n })\n\n const toggleSection = (section: string) => {\n setCollapsed((prev) => ({ ...prev, [section]: !prev[section] }))\n }\n\n // Recursive component to render nested groups\n const renderGroup = (groupKey: string, group: SidebarGroup, depth: number = 0) => {\n const sortedItems = sortSidebarItems(group.items)\n const sortedChildren = sortSidebarGroups(group.children)\n const hasChildren = sortedChildren.length > 0\n const hasItems = sortedItems.length > 0\n const hasContent = hasChildren || hasItems\n\n // Check if any item in this group (or nested children) is active\n const isActiveInGroup = (g: SidebarGroup): boolean => {\n const hasActiveItem = g.items.some((doc) => pathname === `/docs/${version}/${doc.slug}`)\n if (hasActiveItem) return true\n return Object.values(g.children).some(child => isActiveInGroup(child))\n }\n\n const hasActiveItem = isActiveInGroup(group)\n const isGroupActive = pathname === `/docs/${version}/${group.path}`\n const isCollapsed = hasActiveItem || isGroupActive ? false : (collapsed[groupKey] ?? group.defaultCollapsed)\n const marginLeft = depth > 0 ? \"ml-4\" : \"\"\n const groupHref = `/docs/${version}/${group.path}`\n\n return (\n <div key={`group-${groupKey}`} className={`space-y-1 ${marginLeft}`}>\n {/* Group header: Docusaurus-style with clickable label and chevron toggle */}\n <div className=\"flex items-center group\">\n {/* Icon + Label (clickable, navigates to index) */}\n <Link\n href={groupHref}\n onClick={onLinkClick}\n className={`flex items-center gap-2 flex-1 px-3 py-2 text-sm font-semibold rounded-l-xl transition-all ${isGroupActive\n ? \"bg-primary/10 text-primary\"\n : \"text-foreground hover:bg-accent/50\"\n }`}\n >\n {group.icon ? (\n <Icon icon={group.icon} size={16} className=\"shrink-0\" />\n ) : (\n <FolderOpen size={16} className=\"shrink-0\" />\n )}\n {group.label}\n </Link>\n\n {/* Chevron toggle (only if has content and is collapsible) */}\n {hasContent && group.collapsible && config.navigation?.collapsibleSidebar && (\n <button\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleSection(groupKey)\n }}\n className={`p-2 rounded-r-xl transition-all ${isGroupActive ? \"hover:bg-primary/20\" : \"hover:bg-accent/50\"}`}\n aria-label={isCollapsed ? \"Expand section\" : \"Collapse section\"}\n >\n {isCollapsed ? (\n <ChevronRight className={`h-4 w-4 ${isGroupActive ? \"text-primary\" : \"text-muted-foreground\"}`} />\n ) : (\n <ChevronDown className={`h-4 w-4 ${isGroupActive ? \"text-primary\" : \"text-muted-foreground\"}`} />\n )}\n </button>\n )}\n </div>\n\n {/* Children (shown when not collapsed) */}\n {!isCollapsed && hasContent && (\n <div className=\"ml-4 space-y-1\">\n {/* Merge and sort both child groups and items by position */}\n {(() => {\n // Create a unified list with type indicators\n const merged: Array<{type: 'group', key: string, group: SidebarGroup, position: number} | {type: 'item', doc: DocItem, position: number}> = [\n ...sortedChildren.map(([childKey, childGroup]) => ({\n type: 'group' as const,\n key: childKey,\n group: childGroup,\n position: childGroup.position\n })),\n ...sortedItems.map((doc) => ({\n type: 'item' as const,\n doc,\n position: doc.sidebar_position ?? doc.meta?.sidebar_position ?? doc.meta?.order ?? 999\n }))\n ]\n\n // Sort by position\n merged.sort((a, b) => a.position - b.position)\n\n // Render in sorted order\n return merged.map((item) => {\n if (item.type === 'group') {\n return renderGroup(`${groupKey}/${item.key}`, item.group, depth + 1)\n } else {\n const href = `/docs/${version}/${item.doc.slug}`\n const isActive = pathname === href\n\n return (\n <Link\n key={`grouped-${item.doc.slug}`}\n href={href}\n onClick={onLinkClick}\n className={`flex items-center gap-2 px-3 py-2 text-sm rounded-xl transition-all ${isActive\n ? \"bg-primary/10 text-primary font-medium\"\n : \"text-foreground hover:text-foreground hover:bg-accent/50\"\n }`}\n >\n {item.doc.meta?.icon && <Icon icon={item.doc.meta.icon} size={16} className=\"shrink-0\" />}\n {item.doc.title}\n </Link>\n )\n }\n })\n })()}\n </div>\n )}\n </div>\n )\n }\n\n const sortedRootGroups = sortSidebarGroups(rootGroups)\n const sortedStandalone = sortSidebarItems(standalone)\n\n // Adjust top position based on whether tabs are present\n const stickyTop = hasTabGroups ? \"top-[7.5rem]\" : \"top-24\"\n const maxHeight = hasTabGroups ? \"max-h-[calc(100vh-10rem)]\" : \"max-h-[calc(100vh-7rem)]\"\n\n return (\n <aside className={`w-64 shrink-0 sticky ${stickyTop} self-start`}>\n <div className={`${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`}>\n <h2 className=\"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2\">Documentation</h2>\n <nav className=\"space-y-1\">\n {/* Standalone pages (not in folders) */}\n {sortedStandalone.length > 0 && sortedStandalone.map((doc) => {\n const href = `/docs/${version}/${doc.slug}`\n const isActive = pathname === href\n\n return (\n <Link\n key={`standalone-${doc.slug}`}\n href={href}\n onClick={onLinkClick}\n className={`flex items-center gap-2 px-3 py-2 text-sm rounded-xl transition-all ${isActive\n ? \"bg-primary/10 text-primary font-medium\"\n : \"text-foreground hover:text-foreground hover:bg-accent/50\"\n }`}\n >\n {doc.meta?.icon && <Icon icon={doc.meta.icon} size={16} className=\"shrink-0\" />}\n {doc.title}\n </Link>\n )\n })}\n\n {/* Grouped pages (in folders) - now hierarchical */}\n {sortedRootGroups.map(([groupKey, group]) => renderGroup(groupKey, group, 0))}\n </nav>\n </div>\n </aside>\n )\n}\n","\"use client\"\n\nimport { createContext, useContext, useState, ReactNode } from \"react\"\n\ninterface TabContextType {\n activeTabGroup: string\n setActiveTabGroup: (tabId: string) => void\n}\n\nconst TabContext = createContext<TabContextType | undefined>(undefined)\n\nexport function TabProvider({ children, defaultTab }: { children: ReactNode; defaultTab: string }) {\n const [activeTabGroup, setActiveTabGroup] = useState(defaultTab)\n\n return (\n <TabContext.Provider value={{ activeTabGroup, setActiveTabGroup }}>\n {children}\n </TabContext.Provider>\n )\n}\n\nexport function useTabContext() {\n const context = useContext(TabContext)\n if (!context) {\n throw new Error(\"useTabContext must be used within TabProvider\")\n }\n return context\n}\n","export function DocLoading() {\n return (\n <div className=\"max-w-4xl mx-auto px-6 py-8\">\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-gray-200 rounded w-3/4\" />\n <div className=\"h-4 bg-gray-200 rounded w-1/2\" />\n <div className=\"space-y-3 mt-8\">\n <div className=\"h-4 bg-gray-200 rounded\" />\n <div className=\"h-4 bg-gray-200 rounded w-5/6\" />\n <div className=\"h-4 bg-gray-200 rounded w-4/6\" />\n </div>\n </div>\n </div>\n )\n}","\"use client\"\n\nimport Link from \"next/link\"\nimport { Search, Menu, Github, Twitter, MessageCircle } from \"lucide-react\"\nimport { Button } from \"@/components/ui/button\"\nimport { VersionSwitcher } from \"./version-switcher\"\nimport { ThemeToggle } from \"./theme-toggle\"\nimport { SearchModal } from \"./search-modal\"\nimport { useState, useEffect } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport { getAssetPath } from \"@/lib/utils\"\n\ninterface HeaderProps {\n currentVersion: string\n versions: string[]\n onMenuClick?: () => void\n config: SpecraConfig\n}\n\nexport function Header({ currentVersion, versions, onMenuClick, config }: HeaderProps) {\n const [searchOpen, setSearchOpen] = useState(false)\n\n // Keyboard shortcut for search (Cmd+K or Ctrl+K)\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === \"k\") {\n e.preventDefault()\n setSearchOpen(true)\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [])\n\n return (\n <header className=\"sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60\">\n <div className=\"container flex h-16 items-center justify-between px-6 mx-auto\">\n <div className=\"flex items-center gap-2\">\n <button \n onClick={onMenuClick}\n className=\"lg:hidden hover:bg-muted p-2 rounded-md transition-colors\"\n aria-label=\"Toggle menu\"\n >\n <Menu className=\"h-5 w-5\" />\n </button>\n <Link href=\"/\" className=\"flex items-center gap-2\">\n {config.site.logo ? (\n <img src={getAssetPath(config.site.logo)} alt={config.site.title} className=\"h-8 w-auto\" />\n ) : (\n <div className=\"h-8 w-8 rounded-xl bg-primary flex items-center justify-center\">\n <span className=\"text-primary-foreground font-bold text-lg\">\n {config.site.title.charAt(0).toUpperCase()}\n </span>\n </div>\n )}\n <span className=\"font-semibold text-lg text-foreground\">Specra</span>\n </Link>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {config.search?.enabled && (\n <button\n onClick={() => setSearchOpen(true)}\n className=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground bg-muted rounded-md transition-colors\"\n >\n <Search className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">{config.search.placeholder || \"Search\"}</span>\n <kbd className=\"hidden sm:inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-background px-1.5 font-mono text-xs font-medium\">\n ⌘K\n </kbd>\n </button>\n )}\n\n {config.features?.versioning && (\n <VersionSwitcher currentVersion={currentVersion} versions={versions} />\n )}\n\n {/* Social Links */}\n {config.social?.github && (\n <a\n href={config.social.github}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors\"\n aria-label=\"GitHub\"\n >\n <Github className=\"h-4 w-4\" />\n </a>\n )}\n {config.social?.twitter && (\n <a\n href={config.social.twitter}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors\"\n aria-label=\"Twitter\"\n >\n <Twitter className=\"h-4 w-4\" />\n </a>\n )}\n {config.social?.discord && (\n <a\n href={config.social.discord}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors\"\n aria-label=\"Discord\"\n >\n <MessageCircle className=\"h-4 w-4\" />\n </a>\n )}\n\n <ThemeToggle />\n </div>\n </div>\n\n {/* Search Modal */}\n <SearchModal isOpen={searchOpen} onClose={() => setSearchOpen(false)} config={config} />\n </header>\n )\n}\n","\"use client\"\n\nimport { useState } from \"react\"\nimport { Check, ChevronDown } from \"lucide-react\"\nimport { useRouter } from \"next/navigation\"\n\ninterface VersionSwitcherProps {\n currentVersion: string\n versions: string[]\n}\n\nexport function VersionSwitcher({ currentVersion, versions }: VersionSwitcherProps) {\n const [open, setOpen] = useState(false)\n const router = useRouter()\n\n const handleVersionChange = (version: string) => {\n router.push(`/docs/${version}`)\n setOpen(false)\n }\n\n return (\n <div className=\"relative\">\n <button\n onClick={() => setOpen(!open)}\n className=\"flex items-center gap-2 px-3 py-2 text-sm text-foreground bg-muted rounded-md hover:bg-muted/80 transition-colors\"\n >\n <span className=\"font-medium\">{currentVersion}</span>\n <ChevronDown className=\"h-4 w-4\" />\n </button>\n\n {open && (\n <>\n <div className=\"fixed inset-0 z-40\" onClick={() => setOpen(false)} />\n <div className=\"absolute right-0 mt-2 w-48 bg-background border border-border rounded-md shadow-lg z-50\">\n <div className=\"p-2\">\n {versions.map((version) => (\n <button\n key={version}\n onClick={() => handleVersionChange(version)}\n className=\"flex items-center justify-between w-full px-3 py-2 text-sm text-foreground hover:bg-muted rounded-md transition-colors\"\n >\n <span>{version}</span>\n {version === currentVersion && <Check className=\"h-4 w-4 text-primary\" />}\n </button>\n ))}\n </div>\n </div>\n </>\n )}\n </div>\n )\n}\n","\"use client\"\n\nimport { Moon, Sun } from \"lucide-react\"\nimport { useEffect, useState } from \"react\"\n\nexport function ThemeToggle() {\n const [theme, setTheme] = useState<\"light\" | \"dark\">(\"dark\")\n\n useEffect(() => {\n // Check for saved theme preference or default to dark\n const savedTheme = localStorage.getItem(\"theme\") as \"light\" | \"dark\" | null\n const prefersDark = window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n const initialTheme = savedTheme || (prefersDark ? \"dark\" : \"light\")\n \n setTheme(initialTheme)\n document.documentElement.classList.toggle(\"dark\", initialTheme === \"dark\")\n }, [])\n\n const toggleTheme = () => {\n const newTheme = theme === \"dark\" ? \"light\" : \"dark\"\n setTheme(newTheme)\n localStorage.setItem(\"theme\", newTheme)\n document.documentElement.classList.toggle(\"dark\", newTheme === \"dark\")\n }\n\n return (\n <button\n onClick={toggleTheme}\n className=\"flex items-center justify-center w-9 h-9 rounded-md border border-border bg-background hover:bg-accent transition-colors\"\n aria-label=\"Toggle theme\"\n >\n {theme === \"dark\" ? (\n <Sun className=\"h-4 w-4 text-foreground\" />\n ) : (\n <Moon className=\"h-4 w-4 text-foreground\" />\n )}\n </button>\n )\n}\n","\"use client\"\n\nimport { useState, useEffect, useCallback } from \"react\"\nimport { Search, FileText, Loader2 } from \"lucide-react\"\nimport { useRouter } from \"next/navigation\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport {\n Dialog,\n DialogContent,\n} from \"@/components/ui/dialog\"\n\ninterface SearchResult {\n id: string\n title: string\n content: string\n slug: string\n version: string\n category?: string\n}\n\ninterface SearchModalProps {\n isOpen: boolean\n onClose: () => void\n config: SpecraConfig\n}\n\nexport function SearchModal({ isOpen, onClose, config }: SearchModalProps) {\n const [query, setQuery] = useState(\"\")\n const [results, setResults] = useState<SearchResult[]>([])\n const [isLoading, setIsLoading] = useState(false)\n const [selectedIndex, setSelectedIndex] = useState(0)\n const router = useRouter()\n\n const searchConfig = config.search\n\n // Search function\n const performSearch = useCallback(async (searchQuery: string) => {\n if (!searchQuery.trim() || !searchConfig?.enabled) {\n setResults([])\n return\n }\n\n setIsLoading(true)\n try {\n const response = await fetch(\"/api/search\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n query: searchQuery,\n // filter: 'version = \"v1.0.0\"',\n distinct: \"version\",\n limit: 2\n }),\n })\n\n\n if (response.ok) {\n const data = await response.json()\n console.log(\"Search response:\", data)\n setResults(data.hits || [])\n } else {\n console.error(\"Search failed:\", response.status, await response.text())\n }\n } catch (error) {\n console.error(\"Search error:\", error)\n setResults([])\n } finally {\n setIsLoading(false)\n }\n }, [searchConfig])\n\n // Debounced search\n useEffect(() => {\n const timer = setTimeout(() => {\n performSearch(query)\n }, 300)\n\n return () => clearTimeout(timer)\n }, [query, performSearch])\n\n // Handle keyboard navigation\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!isOpen) return\n\n switch (e.key) {\n case \"Escape\":\n onClose()\n break\n case \"ArrowDown\":\n e.preventDefault()\n setSelectedIndex((prev) => Math.min(prev + 1, results.length - 1))\n break\n case \"ArrowUp\":\n e.preventDefault()\n setSelectedIndex((prev) => Math.max(prev - 1, 0))\n break\n case \"Enter\":\n e.preventDefault()\n if (results[selectedIndex]) {\n handleResultClick(results[selectedIndex])\n }\n break\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [isOpen, results, selectedIndex, onClose])\n\n // Reset on open/close\n useEffect(() => {\n if (isOpen) {\n setQuery(\"\")\n setResults([])\n setSelectedIndex(0)\n }\n }, [isOpen])\n\n const handleResultClick = (result: SearchResult) => {\n // Add search query as URL parameter for highlighting\n const url = `/docs/${result.version}/${result.slug}?q=${encodeURIComponent(query)}`\n router.push(url)\n onClose()\n }\n\n const highlightText = (text: string, query: string) => {\n if (!query.trim()) return text\n\n const parts = text.split(new RegExp(`(${query})`, \"gi\"))\n return parts.map((part, i) =>\n part.toLowerCase() === query.toLowerCase()\n ? <mark key={i} className=\"bg-yellow-200 dark:bg-yellow-900/50 text-foreground\">{part}</mark>\n : part\n )\n }\n\n return (\n <Dialog open={isOpen} onOpenChange={onClose} modal={true}>\n <DialogContent\n className=\"max-w-2xl p-0 gap-0 top-[10vh] translate-y-0\"\n showCloseButton={false}\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n {/* Search Input */}\n <div className=\"flex items-center gap-3 px-4 py-3 border-b border-border\">\n <Search className=\"h-5 w-5 text-muted-foreground shrink-0\" />\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={searchConfig?.placeholder || \"Search documentation...\"}\n className=\"flex-1 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground\"\n autoFocus\n />\n {isLoading && <Loader2 className=\"h-5 w-5 text-muted-foreground animate-spin\" />}\n </div>\n\n {/* Results */}\n <div className=\"max-h-[60vh] overflow-y-auto\">\n {query.trim() && results.length === 0 && !isLoading && (\n <div className=\"px-4 py-8 text-center text-muted-foreground\">\n No results found for \"{query}\"\n </div>\n )}\n\n {results.length > 0 && (\n <div className=\"py-2\">\n {results.map((result, index) => (\n <button\n key={result.id}\n onClick={() => handleResultClick(result)}\n className={`w-full px-4 py-3 text-left hover:bg-muted/50 transition-colors border-l-2 ${index === selectedIndex\n ? \"bg-muted/50 border-primary\"\n : \"border-transparent\"\n }`}\n onMouseEnter={() => setSelectedIndex(index)}\n >\n <div className=\"flex items-start gap-3\">\n <FileText className=\"h-5 w-5 text-muted-foreground shrink-0 mt-0.5\" />\n <div className=\"flex-1 min-w-0\">\n <div className=\"font-medium text-foreground mb-1\">\n {highlightText(result.title, query)}\n </div>\n {result.content && (\n <div className=\"text-sm text-muted-foreground line-clamp-2\">\n {highlightText(result.content, query)}\n </div>\n )}\n <div className=\"flex items-center gap-2 mt-1 text-xs text-muted-foreground\">\n <span>{result.version}</span>\n {result.category && (\n <>\n <span>•</span>\n <span>{result.category}</span>\n </>\n )}\n </div>\n </div>\n </div>\n </button>\n ))}\n </div>\n )}\n\n {!query.trim() && (\n <div className=\"px-4 py-8 text-center text-muted-foreground text-sm\">\n <p>Start typing to search documentation...</p>\n <div className=\"mt-4 flex items-center justify-center gap-4 text-xs\">\n <kbd className=\"px-2 py-1 bg-muted rounded border border-border\">↑↓</kbd>\n <span>Navigate</span>\n <kbd className=\"px-2 py-1 bg-muted rounded border border-border\">Enter</kbd>\n <span>Select</span>\n <kbd className=\"px-2 py-1 bg-muted rounded border border-border\">Esc</kbd>\n <span>Close</span>\n </div>\n </div>\n )}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 dark:bg-black/70 backdrop-blur-md\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { usePathname } from \"next/navigation\"\nimport { RefreshCw } from \"lucide-react\"\n\nexport function HotReloadIndicator() {\n const [isReloading, setIsReloading] = useState(false)\n const [lastReload, setLastReload] = useState<Date | null>(null)\n const pathname = usePathname()\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Track when content updates\n setIsReloading(true)\n const timer = setTimeout(() => {\n setIsReloading(false)\n setLastReload(new Date())\n \n // Auto-hide after 3 seconds\n setTimeout(() => {\n setLastReload(null)\n }, 3000)\n }, 500)\n\n return () => clearTimeout(timer)\n }, [pathname])\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Listen for Next.js Fast Refresh\n const handleBeforeRefresh = () => {\n setIsReloading(true)\n }\n\n const handleAfterRefresh = () => {\n setIsReloading(false)\n setLastReload(new Date())\n setTimeout(() => setLastReload(null), 3000)\n }\n\n // @ts-ignore - Next.js internal API\n if (typeof window !== 'undefined' && window.__NEXT_DATA__) {\n window.addEventListener('beforeunload', handleBeforeRefresh)\n }\n\n return () => {\n window.removeEventListener('beforeunload', handleBeforeRefresh)\n }\n }, [])\n\n if (process.env.NODE_ENV !== \"development\") return null\n\n return (\n <>\n {/* Reloading indicator */}\n {isReloading && (\n <div className=\"fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-xl shadow-lg animate-in slide-in-from-bottom-2\">\n <RefreshCw className=\"h-4 w-4 animate-spin\" />\n <span className=\"text-sm font-medium\">Reloading...</span>\n </div>\n )}\n\n {/* Success indicator */}\n {lastReload && !isReloading && (\n <div className=\"fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-green-500 text-white rounded-xl shadow-lg animate-in slide-in-from-bottom-2\">\n <RefreshCw className=\"h-4 w-4\" />\n <span className=\"text-sm font-medium\">\n Updated at {lastReload.toLocaleTimeString()}\n </span>\n </div>\n )}\n </>\n )\n}\n","\"use client\"\n\nimport { useEffect } from \"react\"\nimport { useRouter } from \"next/navigation\"\n\nexport function MdxHotReload() {\n const router = useRouter()\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Use Server-Sent Events to watch for file changes\n const eventSource = new EventSource('/api/mdx-watch')\n\n eventSource.onmessage = (event) => {\n const data = JSON.parse(event.data)\n \n if (data.type === 'change') {\n console.log('[MDX Hot Reload] File changed:', data.file)\n router.refresh()\n } else if (data.type === 'connected') {\n console.log('[MDX Hot Reload] Watching for changes...')\n }\n }\n\n eventSource.onerror = (error) => {\n console.error('[MDX Hot Reload] Connection error:', error)\n eventSource.close()\n }\n\n return () => {\n eventSource.close()\n }\n }, [router])\n\n return null\n}\n","\"use client\"\n\nimport Link from \"next/link\"\nimport { AlertTriangle, Home, ArrowLeft } from \"lucide-react\"\n\ninterface NotFoundContentProps {\n version: string\n}\n\nexport function NotFoundContent({ version }: NotFoundContentProps) {\n return (\n <div className=\"flex min-h-[calc(100vh-12rem)] items-center justify-center px-4 py-12\">\n <div className=\"w-full max-w-2xl text-center\">\n <div className=\"mb-6 flex justify-center\">\n <div className=\"rounded-full bg-yellow-500/10 p-4\">\n <AlertTriangle className=\"h-16 w-16 text-yellow-500\" />\n </div>\n </div>\n\n <h1 className=\"mb-3 text-5xl font-bold tracking-tight\">404</h1>\n <h2 className=\"mb-4 text-2xl font-semibold\">Page Not Found</h2>\n\n <p className=\"mb-8 text-base text-muted-foreground\">\n The documentation page you're looking for doesn't exist or may have been moved.\n <br />\n Try using the sidebar to find what you're looking for, or return to the documentation home.\n </p>\n\n <div className=\"flex flex-col items-center justify-center gap-3 sm:flex-row\">\n <Link\n href={`/docs/${version}`}\n className=\"inline-flex items-center gap-2 rounded-lg bg-primary px-6 py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <ArrowLeft className=\"h-4 w-4\" />\n Back to Documentation\n </Link>\n\n <Link\n href=\"/\"\n className=\"inline-flex items-center gap-2 rounded-lg border border-border bg-background px-6 py-3 text-sm font-medium hover:bg-muted transition-colors\"\n >\n <Home className=\"h-4 w-4\" />\n Go to Homepage\n </Link>\n </div>\n\n <div className=\"mt-12 rounded-lg border border-border bg-muted/30 p-6\">\n <p className=\"text-sm text-muted-foreground\">\n <strong className=\"font-medium text-foreground\">Tip:</strong> Use the sidebar navigation on the left to browse all available documentation pages.\n </p>\n </div>\n </div>\n </div>\n )\n}\n","export function SidebarSkeleton() {\n return (\n <aside className=\"w-64 pr-8 py-6\">\n <div className=\"space-y-6\">\n {/* Documentation title */}\n <div className=\"px-2\">\n <div className=\"h-5 w-32 bg-muted/50 rounded animate-pulse\" />\n </div>\n\n {/* Skeleton items */}\n <div className=\"space-y-1\">\n {[...Array(8)].map((_, i) => (\n <div key={i} className=\"px-3 py-2\">\n <div\n className=\"h-4 bg-muted/50 rounded animate-pulse\"\n style={{ width: `${60 + Math.random() * 40}%` }}\n />\n </div>\n ))}\n </div>\n\n {/* Another section */}\n <div className=\"space-y-1\">\n <div className=\"px-2 mb-2\">\n <div className=\"h-4 w-24 bg-muted/50 rounded animate-pulse\" />\n </div>\n {[...Array(5)].map((_, i) => (\n <div key={i} className=\"px-3 py-2\">\n <div\n className=\"h-4 bg-muted/50 rounded animate-pulse\"\n style={{ width: `${50 + Math.random() * 50}%` }}\n />\n </div>\n ))}\n </div>\n </div>\n </aside>\n )\n}\n","\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\n\ninterface TOCItem {\n id: string\n title: string\n level: number\n}\n\ninterface TableOfContentsProps {\n items: TOCItem[]\n config: SpecraConfig\n}\n\nexport function TableOfContents({ items, config }: TableOfContentsProps) {\n const [activeId, setActiveId] = useState<string>(\"\")\n\n // Check if TOC should be shown\n if (!config.navigation?.showTableOfContents) {\n return null\n }\n\n // Filter items by max depth\n const maxDepth = config.navigation?.tocMaxDepth || 3\n const filteredItems = items.filter(item => item.level <= maxDepth)\n\n // Check if tab groups are configured\n const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setActiveId(entry.target.id)\n }\n })\n },\n { rootMargin: \"-80px 0px -80% 0px\" },\n )\n\n filteredItems.forEach((item) => {\n const element = document.getElementById(item.id)\n if (element) {\n observer.observe(element)\n }\n })\n\n return () => observer.disconnect()\n }, [filteredItems])\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>, id: string) => {\n e.preventDefault()\n const element = document.getElementById(id)\n if (element) {\n const offset = 100 // Offset for fixed header\n const elementPosition = element.getBoundingClientRect().top\n const offsetPosition = elementPosition + window.scrollY - offset\n\n window.scrollTo({\n top: offsetPosition,\n behavior: \"smooth\",\n })\n \n // Update URL without jumping\n window.history.replaceState(null, \"\", `#${id}`)\n \n // Manually set active ID after scroll\n setActiveId(id)\n }\n }\n\n // Adjust top position based on whether tabs are present\n const stickyTop = hasTabGroups ? \"top-[7.5rem]\" : \"top-24\"\n const maxHeight = hasTabGroups ? \"max-h-[calc(100vh-10rem)]\" : \"max-h-[calc(100vh-7rem)]\"\n\n return (\n <aside className={`w-64 hidden xl:block shrink-0 sticky ${stickyTop} self-start`}>\n {filteredItems.length > 0 && (\n <div className={`${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`}>\n <h3 className=\"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2\">On this page</h3>\n <nav className=\"space-y-1\">\n {filteredItems.map((item) => (\n <a\n key={item.id}\n href={`#${item.id}`}\n onClick={(e) => handleClick(e, item.id)}\n className={`block text-sm transition-all cursor-pointer rounded-xl px-3 py-2 ${item.level === 3 ? \"ml-3\" : \"\"} ${\n activeId === item.id\n ? \"text-primary font-medium\"\n : \"text-foreground hover:bg-accent/50\"\n }`}\n >\n {item.title}\n </a>\n ))}\n </nav>\n </div>\n )}\n </aside>\n )\n}\n","import { AlertTriangle } from \"lucide-react\";\nimport Link from \"next/link\";\n\nexport function VersionNotFound() {\n return (\n <>\n <div className=\"flex min-h-screen items-center justify-center px-4\">\n <div className=\"text-center\">\n <div className=\"mb-4 flex justify-center\">\n <AlertTriangle className=\"h-16 w-16 text-yellow-500\" />\n </div>\n <h1 className=\"mb-2 text-4xl font-bold\">Version Not Found</h1>\n <p className=\"mb-6 text-muted-foreground\">\n The documentation version you're looking for doesn't exist.\n </p>\n <Link\n href=\"/docs/v1.0.0\"\n className=\"inline-flex items-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90\"\n >\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MAAM,IAAI,KAAK,EAAE;AAAA,QACjB,SAAS,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE;AAAA,QACtC,WAAW,oEAAoE,KAAK,UAAU,IAAI,SAAS,EAAE,IAC3G,aAAa,KAAK,KACd,6BACA,oCACN;AAAA,QAEC,eAAK;AAAA;AAAA,MATD,KAAK;AAAA,IAUZ,CACD,GACH;AAAA,KACF,GAEJ;AAEJ;;;ACvGA,IAAAC,wBAA8B;AAC9B,IAAAC,gBAAiB;AAIb,IAAAC,uBAAA;AAFG,SAAS,kBAAkB;AAChC,SACE,+EACA,wDAAC,SAAI,WAAU,sDACb,yDAAC,SAAI,WAAU,eACb;AAAA,kDAAC,SAAI,WAAU,4BACb,wDAAC,uCAAc,WAAU,6BAA4B,GACvD;AAAA,IACA,8CAAC,QAAG,WAAU,2BAA0B,+BAAiB;AAAA,IACzD,8CAAC,OAAE,WAAU,8BAA6B,yEAE1C;AAAA,IACA;AAAA,MAAC,cAAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACX;AAAA;AAAA,IAED;AAAA,KACF,GACF,GACA;AAEJ;","names":["Badge","Math","import_jsx_runtime","import_lucide_react","import_jsx_runtime","Link","import_lucide_react","import_jsx_runtime","Icon","import_lucide_react","import_link","import_jsx_runtime","import_jsx_runtime","Link","import_link","import_lucide_react","import_react","import_lucide_react","import_jsx_runtime","code","import_react","import_jsx_runtime","import_react","import_lucide_react","import_jsx_runtime","NextImage","import_jsx_runtime","import_image","import_link","import_jsx_runtime","NextImage","Link","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","Math","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_lucide_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react_slot","import_class_variance_authority","import_jsx_runtime","Badge","import_lucide_react","import_jsx_runtime","Badge","import_react","import_lucide_react","import_jsx_runtime","import_jsx_runtime","Math","import_jsx_runtime","remarkGfm","rehypeSlug","Link","import_react","import_lucide_react","import_jsx_runtime","import_lucide_react","import_rsc","import_remark_gfm","import_rehype_slug","import_link","import_lucide_react","import_jsx_runtime","Link","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_react","import_jsx_runtime","remarkGfm","rehypeSlug","import_react","import_react","import_link","import_jsx_runtime","Link","import_lucide_react","import_react","import_jsx_runtime","import_jsx_runtime","import_link","import_navigation","import_lucide_react","import_react","import_jsx_runtime","hasActiveItem","Link","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_link","import_lucide_react","import_react","import_lucide_react","import_navigation","import_jsx_runtime","import_lucide_react","import_react","import_jsx_runtime","import_react","import_lucide_react","import_navigation","import_lucide_react","import_jsx_runtime","import_jsx_runtime","query","import_react","import_jsx_runtime","Link","import_react","import_navigation","import_lucide_react","import_jsx_runtime","import_react","import_navigation","import_link","import_lucide_react","import_jsx_runtime","Link","import_jsx_runtime","import_react","import_jsx_runtime","import_lucide_react","import_link","import_jsx_runtime","Link"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/index.ts","../../src/components/docs/accordion.tsx","../../src/components/docs/badge.tsx","../../src/components/docs/breadcrumb.tsx","../../src/components/docs/callout.tsx","../../src/components/docs/card.tsx","../../src/components/docs/icon.tsx","../../src/components/docs/category-index.tsx","../../src/lib/remark-code-meta.ts","../../src/components/docs/code-block.tsx","../../src/components/docs/tabs.tsx","../../src/components/docs/image.tsx","../../src/components/docs/video.tsx","../../src/components/docs/image-card.tsx","../../src/components/docs/steps.tsx","../../src/components/docs/mermaid.tsx","../../src/components/docs/math.tsx","../../src/components/docs/columns.tsx","../../src/components/docs/tooltip.tsx","../../src/components/docs/frame.tsx","../../src/components/docs/api/api-endpoint.tsx","../../src/lib/utils.ts","../../src/components/docs/api/api-params.tsx","../../src/components/docs/api/api-response.tsx","../../src/components/docs/api/api-playground.tsx","../../src/components/ui/button.tsx","../../src/components/ui/input.tsx","../../src/components/ui/textarea.tsx","../../src/components/ui/badge.tsx","../../src/components/docs/api/api-reference.tsx","../../src/lib/parsers/specra-parser.ts","../../src/lib/parsers/openapi-parser.ts","../../src/lib/parsers/postman-parser.ts","../../src/lib/parsers/index.ts","../../src/components/docs/mdx-components.tsx","../../src/lib/config.types.ts","../../src/lib/config.server.ts","../../src/lib/sidebar-utils.ts","../../src/components/docs/componentTextProps.ts","../../src/components/docs/dev-mode-badge.tsx","../../src/components/docs/doc-layout.tsx","../../src/components/docs/doc-navigation.tsx","../../src/components/docs/doc-metadata.tsx","../../src/components/docs/draft-badge.tsx","../../src/components/docs/doc-tags.tsx","../../src/components/docs/search-highlight.tsx","../../src/components/docs/doc-layout-wrapper.tsx","../../src/components/docs/mobile-doc-layout.tsx","../../src/components/docs/footer.tsx","../../src/components/docs/site-banner.tsx","../../src/components/docs/tab-groups.tsx","../../src/components/docs/sidebar.tsx","../../src/components/docs/tab-context.tsx","../../src/components/docs/doc-loading.tsx","../../src/components/docs/header.tsx","../../src/components/docs/version-switcher.tsx","../../src/components/docs/theme-toggle.tsx","../../src/components/docs/search-modal.tsx","../../src/components/ui/dialog.tsx","../../src/lib/config.context.tsx","../../src/components/docs/hot-reload-indicator.tsx","../../src/components/docs/mdx-hot-reload.tsx","../../src/components/docs/not-found-content.tsx","../../src/components/docs/sidebar-skeleton.tsx","../../src/components/docs/table-of-contents.tsx","../../src/components/global/version-not-found.tsx"],"sourcesContent":["// Documentation Components\nexport * from './docs'\n\n// UI Components\nexport * from './ui'\n\n// Global Components\nexport * from './global'","\"use client\"\n\nimport { ChevronDown } from \"lucide-react\"\nimport { useState } from \"react\"\n\ninterface AccordionItemProps {\n title: string | React.ReactNode\n children: React.ReactNode\n defaultOpen?: boolean\n value?: string // For compatibility with radix-ui style API\n}\n\nexport function AccordionItem({ title, children, defaultOpen = false }: AccordionItemProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen)\n\n return (\n <div className=\"border border-border rounded-xl overflow-hidden mb-2\">\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"w-full flex items-center justify-between p-4 text-left bg-muted/30 hover:bg-muted/50 transition-colors\"\n >\n <span className=\"font-medium text-foreground\">{title}</span>\n <ChevronDown\n className={`h-5 w-5 text-muted-foreground transition-transform ${\n isOpen ? \"rotate-180\" : \"\"\n }`}\n />\n </button>\n {isOpen && (\n <div className=\"p-4 border-t border-border bg-background\">\n <div className=\"prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0\">\n {children}\n </div>\n </div>\n )}\n </div>\n )\n}\n\ninterface AccordionProps {\n children: React.ReactNode\n type?: \"single\" | \"multiple\"\n collapsible?: boolean // For compatibility with radix-ui style API\n className?: string\n}\n\nexport function Accordion({ children, type = \"multiple\", className }: AccordionProps) {\n return (\n <div className={className || \"my-6 space-y-2\"}>\n {children}\n </div>\n )\n}\n","interface BadgeProps {\n children: React.ReactNode\n variant?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n}\n\nexport function Badge({ children, variant = \"default\" }: BadgeProps) {\n const variants = {\n default: \"bg-muted text-foreground border-border\",\n success: \"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20\",\n warning: \"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 border-yellow-500/20\",\n error: \"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20\",\n info: \"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20\",\n }\n\n return (\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium border ${variants[variant]}`}\n >\n {children}\n </span>\n )\n}\n","import Link from \"next/link\"\nimport { ChevronRight } from \"lucide-react\"\n\ninterface BreadcrumbProps {\n version: string\n slug: string\n title: string\n}\n\nexport function Breadcrumb({ version, slug, title }: BreadcrumbProps) {\n const parts = slug.split(\"/\")\n const breadcrumbs = [\n { label: \"Docs\", href: `/docs/${version}` },\n ]\n\n // Build breadcrumb path\n let currentPath = \"\"\n for (let i = 0; i < parts.length - 1; i++) {\n currentPath += (currentPath ? \"/\" : \"\") + parts[i]\n breadcrumbs.push({\n label: parts[i].replace(/-/g, \" \").replace(/\\b\\w/g, (l) => l.toUpperCase()),\n href: `/docs/${version}/${currentPath}`,\n })\n }\n\n // Add current page\n breadcrumbs.push({\n label: title,\n href: `/docs/${version}/${slug}`,\n })\n\n return (\n <nav className=\"flex items-center gap-2 text-sm text-muted-foreground mb-4\" aria-label=\"Breadcrumb\">\n {breadcrumbs.map((crumb, index) => (\n <div key={crumb.href} className=\"flex items-center gap-2\">\n {index > 0 && <ChevronRight className=\"h-4 w-4\" />}\n {index === breadcrumbs.length - 1 ? (\n <span className=\"text-foreground font-medium\">{crumb.label}</span>\n ) : (\n <Link\n href={crumb.href}\n className=\"hover:text-foreground transition-colors\"\n >\n {crumb.label}\n </Link>\n )}\n </div>\n ))}\n </nav>\n )\n}\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport { Info, AlertTriangle, CheckCircle2, XCircle, Lightbulb } from \"lucide-react\"\n\ninterface CalloutProps {\n children: ReactNode\n type?: \"info\" | \"warning\" | \"success\" | \"error\" | \"tip\" | \"note\" | \"danger\"\n title?: string\n}\n\nexport function Callout({ children, type = \"info\", title }: CalloutProps) {\n const configs = {\n info: {\n icon: Info,\n className: \"bg-blue-500/10 border-blue-500/30 text-blue-900 dark:bg-blue-400/5 dark:border-blue-500/20 dark:text-blue-400\",\n iconClassName: \"text-blue-600 dark:text-blue-400\",\n titleClassName: \"text-blue-700 dark:text-blue-300\",\n defaultTitle: \"Info\",\n },\n note: {\n icon: Info,\n className: \"bg-blue-500/10 border-blue-500/30 text-blue-900 dark:bg-blue-400/5 dark:border-blue-500/20 dark:text-blue-400\",\n iconClassName: \"text-blue-600 dark:text-blue-400\",\n titleClassName: \"text-blue-700 dark:text-blue-300\",\n defaultTitle: \"Note\",\n },\n warning: {\n icon: AlertTriangle,\n className: \"bg-yellow-500/10 border-yellow-500/30 text-yellow-900 dark:bg-yellow-400/5 dark:border-yellow-500/20 dark:text-yellow-400\",\n iconClassName: \"text-yellow-600 dark:text-yellow-400\",\n titleClassName: \"text-yellow-700 dark:text-yellow-300\",\n defaultTitle: \"Warning\",\n },\n success: {\n icon: CheckCircle2,\n className: \"bg-green-500/10 border-green-500/30 text-green-900 dark:bg-green-400/5 dark:border-green-500/20 dark:text-green-400\",\n iconClassName: \"text-green-600 dark:text-green-400\",\n titleClassName: \"text-green-700 dark:text-green-300\",\n defaultTitle: \"Success\",\n },\n error: {\n icon: XCircle,\n className: \"bg-red-500/10 border-red-500/30 text-red-900 dark:bg-red-400/5 dark:border-red-500/20 dark:text-red-400\",\n iconClassName: \"text-red-600 dark:text-red-400\",\n titleClassName: \"text-red-700 dark:text-red-300\",\n defaultTitle: \"Error\",\n },\n danger: {\n icon: XCircle,\n className: \"bg-red-500/10 border-red-500/30 text-red-900 dark:bg-red-400/5 dark:border-red-500/20 dark:text-red-400\",\n iconClassName: \"text-red-600 dark:text-red-400\",\n titleClassName: \"text-red-700 dark:text-red-300\",\n defaultTitle: \"Danger\",\n },\n tip: {\n icon: Lightbulb,\n className: \"bg-purple-500/10 border-purple-500/30 text-purple-900 dark:bg-purple-400/5 dark:border-purple-500/20 dark:text-purple-400\",\n iconClassName: \"text-purple-600 dark:text-purple-400\",\n titleClassName: \"text-purple-700 dark:text-purple-300\",\n defaultTitle: \"Tip\",\n },\n }\n\n const config = configs[type]\n const Icon = config.icon\n\n // Extract title from strong/bold text if present, but ONLY if no explicit title prop was provided\n let _title = title || config.defaultTitle\n let content = children\n\n if (!title && children && typeof children === \"object\") {\n const childArray = Array.isArray(children) ? children : [children]\n const firstElement = childArray[0]\n\n // Check if first child is a paragraph with a strong element\n if (firstElement && typeof firstElement === \"object\" && \"props\" in firstElement) {\n const props = (firstElement as any).props\n if (props.children && Array.isArray(props.children)) {\n const strongChild = props.children.find(\n (child: any) => child && typeof child === \"object\" && child.type === \"strong\",\n )\n if (strongChild) {\n _title = strongChild.props.children\n // Remove the title from content\n content = childArray.map((child, idx) => {\n if (idx === 0 && typeof child === \"object\" && \"props\" in child) {\n const newChildren = (child as any).props.children.filter((c: any) => c !== strongChild)\n return { ...child, props: { ...(child as any).props, children: newChildren } }\n }\n return child\n })\n }\n }\n }\n }\n\n return (\n <div className={`flex gap-3 p-4 rounded-xl border my-2 ${config.className}`}>\n <div className=\"flex-shrink-0 mt-0.5\">\n <Icon className={`h-5 w-5 ${config.iconClassName}`} />\n </div>\n <div className=\"flex-1 space-y-0\">\n <div className={`font-semibold text-sm ${config.titleClassName}`}>{_title}</div>\n <div className=\"text-sm leading-relaxed [&>p]:mb-0 [&>p]:text-current\">{content}</div>\n </div>\n </div>\n )\n}\n","import { ArrowRight, ExternalLink } from \"lucide-react\"\nimport Link from \"next/link\"\nimport { Icon } from \"./icon\"\n\ninterface CardProps {\n title: string\n description?: string\n href?: string\n icon?: string | React.ReactNode\n children?: React.ReactNode\n external?: boolean\n}\n\nexport function Card({ title, description, href, icon, children, external = false }: CardProps) {\n const content = (\n <>\n <div className=\"flex items-center gap-3\">\n {icon && (\n <div className=\"shrink-0 w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary\">\n {typeof icon === \"string\" ? <Icon icon={icon} size={20} /> : icon}\n </div>\n )}\n <div className=\"flex-1 min-w-0\">\n <h3 className={`font-semibold text-foreground mb-1 no-underline ${href ? 'group-hover:text-primary transition-colors' : ''}`}>\n {title}\n </h3>\n {description && (\n <p className=\"text-sm text-muted-foreground line-clamp-2 no-underline\">{description}</p>\n )}\n {children && (\n <div className=\"mt-2 text-sm text-muted-foreground no-underline\">{children}</div>\n )}\n </div>\n {href && (\n <div className=\"shrink-0 self-start mt-1\">\n {external ? (\n <ExternalLink className=\"h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors\" />\n ) : (\n <ArrowRight className=\"h-4 w-4 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all\" />\n )}\n </div>\n )}\n </div>\n </>\n )\n\n if (href) {\n const Component = external ? \"a\" : Link\n return (\n <Component\n href={href}\n className=\"card-link group block p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all\"\n {...(external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {content}\n </Component>\n )\n }\n\n return (\n <div className=\"p-4 rounded-xl border border-border bg-muted/30 no-underline\">\n {content}\n </div>\n )\n}\n\ninterface CardGridProps {\n children: React.ReactNode\n cols?: 1 | 2 | 3\n}\n\nexport function CardGrid({ children, cols = 2 }: CardGridProps) {\n const gridCols = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-1 md:grid-cols-2\",\n 3: \"grid-cols-1 md:grid-cols-2 lg:grid-cols-3\",\n }\n\n return (\n <div className={`grid ${gridCols[cols]} gap-4 my-6`}>\n {children}\n </div>\n )\n}\n","\"use client\"\n\nimport * as LucideIcons from \"lucide-react\"\n\ninterface IconProps {\n icon: string | React.ReactNode\n iconType?: \"regular\" | \"solid\" | \"light\" | \"thin\" | \"sharp-solid\" | \"duotone\" | \"brands\"\n color?: string\n size?: number\n className?: string\n}\n\nexport function Icon({ icon, iconType = \"regular\", color, size = 20, className = \"\" }: IconProps) {\n // If icon is a React node (custom SVG), render it directly\n if (typeof icon !== \"string\") {\n return <span className={`inline-flex items-center ${className}`} style={{ color }}>{icon}</span>\n }\n\n // Check if it's a URL (external or local file)\n if (icon.startsWith(\"http\") || icon.startsWith(\"/\")) {\n return (\n <img\n src={icon}\n alt=\"\"\n width={size}\n height={size}\n className={`inline-block ${className}`}\n style={{ color }}\n />\n )\n }\n\n // Check if it's a Font Awesome icon (starts with fa-)\n if (icon.startsWith(\"fa-\")) {\n const faClass = `fa-${iconType} ${icon}`\n return (\n <i\n className={`${faClass} ${className}`}\n style={{ fontSize: size, color }}\n aria-hidden=\"true\"\n />\n )\n }\n\n // Try to find Lucide icon\n const iconName = icon\n .split(\"-\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\"\")\n\n const LucideIcon = (LucideIcons as any)[iconName]\n\n if (LucideIcon) {\n return (\n <LucideIcon\n size={size}\n className={`inline-block ${className}`}\n style={{ color }}\n aria-hidden=\"true\"\n />\n )\n }\n\n // Fallback: render the icon name\n return (\n <span className={`inline-flex items-center font-mono text-xs ${className}`} style={{ color }}>\n [{icon}]\n </span>\n )\n}\n","import Link from \"next/link\"\nimport { ChevronRight, FileText } from \"lucide-react\"\nimport type { Doc } from \"@/lib/mdx\"\nimport { ReactNode } from \"react\"\nimport { MDXRemote } from \"next-mdx-remote/rsc\"\nimport remarkGfm from \"remark-gfm\"\nimport { remarkCodeMeta } from \"@/lib/remark-code-meta\"\nimport rehypeSlug from \"rehype-slug\"\nimport { mdxComponents } from \"./mdx-components\"\nimport { getConfig, processContentWithEnv, SpecraConfig } from \"@/lib/config\"\nimport { sortSidebarItems } from \"@/lib/sidebar-utils\"\n\ninterface CategoryIndexProps {\n categoryPath: string\n version: string\n allDocs: Doc[]\n title: string\n description?: string\n content?: string\n config: SpecraConfig\n}\n\nexport function CategoryIndex({ categoryPath, version, allDocs, title, description, content , config}: CategoryIndexProps) {\n // Find all docs that are direct children of this category\n const childDocs = allDocs.filter((doc) => {\n // Get the parent path of the doc\n const parts = doc.slug.split(\"/\")\n const docParent = parts.slice(0, -1).join(\"/\")\n\n // Check if this doc is a direct child of the category\n return docParent === categoryPath && doc.slug !== categoryPath\n })\n\n\n // const config = getConfig();\n const processedContent = () => {\n if(content){\n return processContentWithEnv(content, config);\n }\n return \"\";\n };\n\n // Sort by sidebar_position using unified sorting function\n const sortedDocs = sortSidebarItems(childDocs)\n\n return (\n <div className=\"flex-1 min-w-0\">\n <div className=\"mb-8\">\n <h1 className=\"text-4xl font-bold tracking-tight mb-3 text-foreground\">{title}</h1>\n {description && <p className=\"text-lg text-muted-foreground leading-relaxed\">{description}</p>}\n \n <div className=\"prose prose-slate dark:prose-invert max-w-none prose-headings:scroll-mt-24 prose-headings:font-semibold prose-h1:text-4xl prose-h2:text-3xl prose-h2:mt-12 prose-h2:mb-4 prose-h3:text-2xl prose-h3:mt-8 prose-h3:mb-3 prose-p:text-base prose-p:leading-7 prose-p:text-muted-foreground prose-p:mb-4 prose-a:font-normal prose-a:transition-all prose-code:text-primary prose-code:bg-muted/50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:text-[13px] prose-code:font-mono prose-code:border prose-code:border-border/50 prose-code:before:content-none prose-code:after:content-none prose-pre:bg-transparent prose-pre:p-0 prose-ul:list-disc prose-ul:list-inside prose-ul:space-y-2 prose-ul:mb-4 prose-ol:list-decimal prose-ol:list-inside prose-ol:space-y-2 prose-ol:mb-4 prose-li:leading-7 prose-li:text-muted-foreground prose-strong:text-foreground prose-strong:font-semibold\">\n <MDXRemote\n source={processedContent()}\n options={{\n parseFrontmatter: false,\n mdxOptions: {\n remarkPlugins: [remarkGfm, remarkCodeMeta],\n rehypePlugins: [rehypeSlug],\n development: false,\n },\n }}\n components={mdxComponents as any}\n />\n </div>\n\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {sortedDocs.map((doc) => (\n <Link\n key={doc.slug}\n href={`/docs/${version}/${doc.slug}`}\n className=\"group block p-5 rounded-xl border border-border bg-card hover:bg-accent hover:border-primary/50 transition-all duration-200\"\n style={{\n textDecoration: \"none !important\"\n }}\n >\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-2\">\n <FileText className=\"h-6 w-6 text-primary shrink-0\" />\n <h3 className=\"text-lg font-semibold text-foreground group-hover:text-primary transition-colors\">\n {doc.meta.title || doc.title}\n </h3>\n </div>\n {doc.meta.description && (\n <p className=\"text-sm text-muted-foreground line-clamp-2\">\n {doc.meta.description}\n </p>\n )}\n {doc.meta.reading_time && (\n <p className=\"text-xs text-muted-foreground mt-2\">\n {doc.meta.reading_time} min read\n </p>\n )}\n </div>\n <ChevronRight className=\"h-5 w-5 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all flex-shrink-0 mt-1\" />\n </div>\n </Link>\n ))}\n </div>\n\n {sortedDocs.length === 0 && (\n <div className=\"text-center py-12 text-muted-foreground\">\n <FileText className=\"h-12 w-12 mx-auto mb-3 opacity-50\" />\n <p>No documents found in this category.</p>\n </div>\n )}\n </div>\n )\n}\n","/**\n * Remark plugin to extract code block meta strings and pass them as props\n * Converts: ```js filename.js\n * Into props: { language: 'js', meta: 'filename.js' }\n */\nexport function remarkCodeMeta() {\n return (tree: any) => {\n const visit = (node: any) => {\n if (node.type === 'code' && node.meta) {\n // Store the meta string in the node's data\n node.data = node.data || {}\n node.data.hProperties = node.data.hProperties || {}\n node.data.hProperties.meta = node.meta\n }\n \n if (node.children) {\n node.children.forEach(visit)\n }\n }\n \n visit(tree)\n }\n}\n","\"use client\"\n\nimport { useState } from \"react\"\nimport { Check, Copy } from \"lucide-react\"\n\ninterface CodeBlockProps {\n code: string\n language: string\n filename?: string\n}\n\nexport function CodeBlock({ code, language, filename }: CodeBlockProps) {\n const [copied, setCopied] = useState(false)\n\n const handleCopy = async () => {\n await navigator.clipboard.writeText(code)\n setCopied(true)\n setTimeout(() => setCopied(false), 2000)\n }\n\n const highlightCode = (code: string, lang: string) => {\n const lines = code.split(\"\\n\")\n\n return lines.map((line, i) => {\n const tokens: Array<{ type: string; value: string }> = []\n let currentPos = 0\n\n // Regex patterns for different token types\n const patterns = [\n { type: \"comment\", regex: /(\\/\\/.*$|\\/\\*[\\s\\S]*?\\*\\/|#.*$)/ },\n { type: \"string\", regex: /(\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|`(?:[^`\\\\]|\\\\.)*`)/ },\n {\n type: \"keyword\",\n regex:\n /\\b(const|let|var|function|return|if|else|for|while|do|break|continue|switch|case|default|import|export|from|as|class|extends|implements|interface|type|enum|namespace|async|await|try|catch|finally|throw|new|this|super|static|public|private|protected|readonly|abstract|void|null|undefined|true|false|typeof|instanceof|delete|in|of)\\b/,\n },\n { type: \"operator\", regex: /([+\\-*/%=<>!&|^~?:]+)/ },\n { type: \"number\", regex: /\\b(0x[a-fA-F0-9]+|0b[01]+|\\d+\\.?\\d*(?:e[+-]?\\d+)?)\\b/ },\n { type: \"function\", regex: /\\b([a-zA-Z_$][\\w$]*)\\s*(?=\\()/ },\n { type: \"property\", regex: /\\.([a-zA-Z_$][\\w$]*)/ },\n { type: \"punctuation\", regex: /([{}[\\]();,])/ },\n ]\n\n while (currentPos < line.length) {\n let matched = false\n\n for (const { type, regex } of patterns) {\n const match = line.slice(currentPos).match(regex)\n if (match && match.index === 0) {\n tokens.push({ type, value: match[0] })\n currentPos += match[0].length\n matched = true\n break\n }\n }\n\n if (!matched) {\n // Regular text or whitespace\n const nextSpecialChar = line.slice(currentPos).search(/[\"'`/\\w.+\\-*/%=<>!&|^~?:;,()[\\]{}#]/)\n if (nextSpecialChar === -1) {\n tokens.push({ type: \"text\", value: line.slice(currentPos) })\n break\n } else if (nextSpecialChar > 0) {\n tokens.push({ type: \"text\", value: line.slice(currentPos, currentPos + nextSpecialChar) })\n currentPos += nextSpecialChar\n } else {\n tokens.push({ type: \"text\", value: line[currentPos] })\n currentPos++\n }\n }\n }\n\n return (\n <div key={i} className=\"table-row\">\n <span className=\"table-cell pr-4 text-right select-none text-muted-foreground/40 w-8 align-top\">{i + 1}</span>\n <span className=\"table-cell align-top\">\n {tokens.length === 0 ? (\n <span> </span>\n ) : (\n tokens.map((token, j) => (\n <span key={j} className={`token-${token.type}`}>\n {token.value}\n </span>\n ))\n )}\n </span>\n </div>\n )\n })\n }\n\n return (\n <div className=\"relative group my-2\">\n {/* Header - always visible */}\n <div className=\"bg-muted/50 dark:bg-muted/30 px-4 py-2 rounded-t-xl border border-b-0 border-border/50 flex items-center justify-between\">\n {/* Left section: Safari-style dots + filename */}\n <div className=\"flex items-center gap-3\">\n {/* Safari-style window controls */}\n <div className=\"flex items-center gap-1.5\">\n <div className=\"w-3 h-3 rounded-full bg-red-500/80 dark:bg-red-500/60\" />\n <div className=\"w-3 h-3 rounded-full bg-yellow-500/80 dark:bg-yellow-500/60\" />\n <div className=\"w-3 h-3 rounded-full bg-green-500/80 dark:bg-green-500/60\" />\n </div>\n {/* Filename or \"Code\" */}\n <span className=\"text-xs font-mono text-foreground\">{filename || \"Code\"}</span>\n </div>\n \n {/* Right section: Language + Copy button */}\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs text-muted-foreground/60 font-mono uppercase tracking-wide\">{language}</span>\n <button\n onClick={handleCopy}\n className=\"p-1.5 rounded-md hover:bg-muted/50 transition-colors\"\n aria-label=\"Copy code\"\n >\n {copied ? <Check className=\"h-4 w-4 text-green-400\" /> : <Copy className=\"h-4 w-4 text-muted-foreground\" />}\n </button>\n </div>\n </div>\n \n {/* Code content */}\n <div className=\"bg-gray-200/50 dark:bg-[#0d1117] rounded-b-xl overflow-x-auto border border-border/50\">\n <pre className=\"p-2 text-[13px] font-mono leading-relaxed text-gray-800 dark:text-gray-200\">\n <code className=\"table w-full\">{highlightCode(code, language)}</code>\n </pre>\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport React, { useState, Children, isValidElement } from \"react\"\n\ninterface TabProps {\n label: string\n children: React.ReactNode\n}\n\ninterface TabsProps {\n children: React.ReactElement<TabProps> | React.ReactElement<TabProps>[]\n defaultValue?: string\n}\n\nexport function Tab({ children }: TabProps) {\n return <>{children}</>\n}\n\nexport function Tabs({ children, defaultValue }: TabsProps) {\n const tabs = Children.toArray(children).filter(isValidElement) as React.ReactElement<TabProps>[]\n\n // Use defaultValue or first tab label as initial active tab\n const firstTabLabel = tabs[0]?.props.label || \"\"\n const [activeTab, setActiveTab] = useState(defaultValue || firstTabLabel)\n\n return (\n <div className=\"my-6\">\n {/* Tab buttons */}\n <div className=\"flex items-center gap-1 border-b border-border mb-4\">\n {tabs.map((tab) => {\n const label = tab.props.label\n const isActive = activeTab === label\n\n return (\n <button\n key={label}\n onClick={() => setActiveTab(label)}\n className={`px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${\n isActive\n ? \"border-primary text-primary\"\n : \"border-transparent text-muted-foreground hover:text-foreground hover:border-border\"\n }`}\n >\n {label}\n </button>\n )\n })}\n </div>\n\n {/* Tab content */}\n {tabs.map((tab) => {\n const label = tab.props.label\n if (activeTab !== label) return null\n\n return (\n <div key={label} className=\"prose prose-slate dark:prose-invert max-w-none [&>*:first-child]:mt-0\">\n {tab.props.children}\n </div>\n )\n })}\n </div>\n )\n}\n","\"use client\"\n\nimport NextImage from \"next/image\"\nimport { useState } from \"react\"\nimport { ZoomIn, X } from \"lucide-react\"\n\ninterface ImageProps {\n src: string\n alt: string\n caption?: string\n width?: number\n height?: number\n zoom?: boolean\n}\n\nexport function Image({ src, alt, caption, width, height, zoom = true }: ImageProps) {\n const [isZoomed, setIsZoomed] = useState(false)\n\n return (\n <>\n <figure className=\"my-6\">\n <div className=\"relative group rounded-xl border border-border overflow-hidden bg-muted/30\">\n <NextImage\n src={src}\n alt={alt}\n width={width || 1200}\n height={height || 675}\n className=\"w-full h-auto\"\n />\n {zoom && (\n <button\n onClick={() => setIsZoomed(true)}\n className=\"absolute top-3 right-3 p-2 rounded-md bg-background/80 backdrop-blur-sm border border-border opacity-0 group-hover:opacity-100 transition-opacity hover:bg-background\"\n aria-label=\"Zoom image\"\n >\n <ZoomIn className=\"h-4 w-4 text-foreground\" />\n </button>\n )}\n </div>\n {caption && (\n <figcaption className=\"mt-2 text-center text-sm text-muted-foreground italic\">\n {caption}\n </figcaption>\n )}\n </figure>\n\n {/* Zoom Modal */}\n {isZoomed && (\n <div\n className=\"fixed inset-0 z-50 bg-background/95 backdrop-blur-sm flex items-center justify-center p-4\"\n onClick={() => setIsZoomed(false)}\n >\n <button\n onClick={() => setIsZoomed(false)}\n className=\"absolute top-4 right-4 p-2 rounded-md bg-muted hover:bg-muted/80 transition-colors\"\n aria-label=\"Close\"\n >\n <X className=\"h-5 w-5 text-foreground\" />\n </button>\n <div className=\"max-w-7xl max-h-[90vh] overflow-auto\">\n <NextImage\n src={src}\n alt={alt}\n width={width || 1920}\n height={height || 1080}\n className=\"w-full h-auto\"\n />\n </div>\n </div>\n )}\n </>\n )\n}\n","\"use client\"\n\ninterface VideoProps {\n src: string\n caption?: string\n autoplay?: boolean\n loop?: boolean\n muted?: boolean\n controls?: boolean\n poster?: string\n}\n\nexport function Video({\n src,\n caption,\n autoplay = false,\n loop = false,\n muted = false,\n controls = true,\n poster,\n}: VideoProps) {\n // Check if it's a YouTube or Vimeo URL\n const isYouTube = src.includes(\"youtube.com\") || src.includes(\"youtu.be\")\n const isVimeo = src.includes(\"vimeo.com\")\n\n const getYouTubeId = (url: string) => {\n const match = url.match(/(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/\\s]{11})/)\n return match ? match[1] : null\n }\n\n const getVimeoId = (url: string) => {\n const match = url.match(/vimeo\\.com\\/(\\d+)/)\n return match ? match[1] : null\n }\n\n return (\n <figure className=\"my-6\">\n <div className=\"relative rounded-xl border border-border overflow-hidden bg-muted/30\">\n {isYouTube ? (\n <div className=\"relative w-full\" style={{ paddingBottom: \"56.25%\" }}>\n <iframe\n className=\"absolute top-0 left-0 w-full h-full\"\n src={`https://www.youtube.com/embed/${getYouTubeId(src)}${autoplay ? \"?autoplay=1\" : \"\"}`}\n title=\"YouTube video\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n </div>\n ) : isVimeo ? (\n <div className=\"relative w-full\" style={{ paddingBottom: \"56.25%\" }}>\n <iframe\n className=\"absolute top-0 left-0 w-full h-full\"\n src={`https://player.vimeo.com/video/${getVimeoId(src)}${autoplay ? \"?autoplay=1\" : \"\"}`}\n title=\"Vimeo video\"\n allow=\"autoplay; fullscreen; picture-in-picture\"\n allowFullScreen\n />\n </div>\n ) : (\n <video\n src={src}\n controls={controls}\n autoPlay={autoplay}\n loop={loop}\n muted={muted}\n poster={poster}\n className=\"w-full h-auto\"\n >\n Your browser does not support the video tag.\n </video>\n )}\n </div>\n {caption && (\n <figcaption className=\"mt-2 text-center text-sm text-muted-foreground italic\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n}\n","import NextImage from \"next/image\"\nimport Link from \"next/link\"\n\ninterface ImageCardProps {\n src: string\n alt: string\n title?: string\n description?: string\n href?: string\n external?: boolean\n aspectRatio?: \"square\" | \"video\" | \"portrait\"\n}\n\nexport function ImageCard({\n src,\n alt,\n title,\n description,\n href,\n external = false,\n aspectRatio = \"video\",\n}: ImageCardProps) {\n const aspectRatios = {\n square: \"aspect-square\",\n video: \"aspect-video\",\n portrait: \"aspect-[3/4]\",\n }\n\n const content = (\n <div className=\"flex flex-col gap-0 p-0\">\n <div className={`w-full ${aspectRatios[aspectRatio]} overflow-hidden ${(title || description) ? 'rounded-t-xl' : 'rounded-xl'} bg-muted relative`}>\n <NextImage\n src={src}\n alt={alt}\n fill\n sizes=\"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw\"\n className=\"object-cover transition-transform duration-300 group-hover:scale-105\"\n />\n </div>\n {(title || description) && (\n <div className=\"p-3 flex flex-col gap-1\">\n {title && (\n <h3 className={`font-semibold text-foreground mb-0 no-underline ${href ? 'group-hover:text-primary transition-colors' : ''}`}>\n {title}\n </h3>\n )}\n {description && (\n <p className=\"text-sm text-muted-foreground line-clamp-2 no-underline mb-0\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n )\n\n if (href) {\n const Component = external ? \"a\" : Link\n return (\n <Component\n href={href}\n className=\"image-card-link group block rounded-xl border border-border hover:border-primary/50 hover:shadow-lg transition-all overflow-hidden p-0\"\n {...(external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {content}\n </Component>\n )\n }\n\n return (\n <div className=\"block rounded-xl border border-border overflow-hidden bg-card p-0\">\n {content}\n </div>\n )\n}\n\ninterface ImageCardGridProps {\n children: React.ReactNode\n cols?: 1 | 2 | 3 | 4\n}\n\nexport function ImageCardGrid({ children, cols = 3 }: ImageCardGridProps) {\n const gridCols = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-1 md:grid-cols-2\",\n 3: \"grid-cols-1 md:grid-cols-2 lg:grid-cols-3\",\n 4: \"grid-cols-1 md:grid-cols-2 lg:grid-cols-4\",\n }\n\n return (\n <div className={`grid ${gridCols[cols]} gap-4 my-6`}>\n {children}\n </div>\n )\n}\n","interface StepsProps {\n children: React.ReactNode\n}\n\ninterface StepProps {\n title: string\n children: React.ReactNode\n}\n\nexport function Steps({ children }: StepsProps) {\n return (\n <div className=\"my-6 ml-4 space-y-6 [counter-reset:step]\">\n {children}\n </div>\n )\n}\n\nexport function Step({ title, children }: StepProps) {\n return (\n <div className=\"relative pl-8 pb-6 border-l-2 border-border last:border-l-0 last:pb-0 [counter-increment:step] before:content-[counter(step)] before:absolute before:left-0 before:-translate-x-1/2 before:w-8 before:h-8 before:rounded-full before:bg-primary before:text-primary-foreground before:flex before:items-center before:justify-center before:text-sm before:font-semibold before:z-10\">\n <div className=\"mb-2\">\n <h3 className=\"text-lg font-semibold text-foreground\">{title}</h3>\n </div>\n <div className=\"prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0\">\n {children}\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport { useEffect, useRef, useState } from \"react\"\n\ninterface MermaidProps {\n chart: string\n caption?: string\n}\n\nexport function Mermaid({ chart, caption }: MermaidProps) {\n const containerRef = useRef<HTMLDivElement>(null)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n const renderChart = async () => {\n try {\n // Dynamically import mermaid\n const mermaid = (await import(\"mermaid\")).default\n\n mermaid.initialize({\n startOnLoad: false,\n theme: document.documentElement.classList.contains(\"dark\") ? \"dark\" : \"default\",\n securityLevel: \"loose\",\n fontFamily: \"inherit\",\n })\n\n if (containerRef.current) {\n const id = `mermaid-${Math.random().toString(36).substr(2, 9)}`\n const { svg } = await mermaid.render(id, chart)\n containerRef.current.innerHTML = svg\n }\n } catch (err) {\n console.error(\"Mermaid rendering error:\", err)\n setError(err instanceof Error ? err.message : \"Failed to render diagram\")\n }\n }\n\n renderChart()\n\n // Re-render on theme change\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === \"class\") {\n renderChart()\n }\n })\n })\n\n observer.observe(document.documentElement, { attributes: true })\n\n return () => observer.disconnect()\n }, [chart])\n\n if (error) {\n return (\n <div className=\"my-6 p-4 rounded-xl border border-red-500/50 bg-red-500/10\">\n <p className=\"text-sm text-red-600 dark:text-red-400 font-mono\">\n Mermaid Error: {error}\n </p>\n </div>\n )\n }\n\n return (\n <figure className=\"my-6\">\n <div\n ref={containerRef}\n className=\"flex justify-center items-center p-6 rounded-xl border border-border bg-muted/30 overflow-x-auto\"\n />\n {caption && (\n <figcaption className=\"mt-2 text-center text-sm text-muted-foreground italic\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n}\n","\"use client\"\n\nimport { useEffect, useRef } from \"react\"\n\ninterface MathProps {\n children: string\n block?: boolean\n}\n\nexport function Math({ children, block = false }: MathProps) {\n const containerRef = useRef<HTMLSpanElement | HTMLDivElement>(null)\n\n useEffect(() => {\n const renderMath = async () => {\n try {\n // Dynamically import KaTeX\n const katex = (await import(\"katex\")).default\n\n if (containerRef.current) {\n katex.render(children, containerRef.current, {\n throwOnError: false,\n displayMode: block,\n })\n }\n } catch (err) {\n console.error(\"KaTeX rendering error:\", err)\n if (containerRef.current) {\n containerRef.current.textContent = children\n }\n }\n }\n\n renderMath()\n }, [children, block])\n\n if (block) {\n return (\n <div\n ref={containerRef as React.RefObject<HTMLDivElement>}\n className=\"my-6 overflow-x-auto text-center\"\n />\n )\n }\n\n return <span ref={containerRef as React.RefObject<HTMLSpanElement>} className=\"inline-block\" />\n}\n","interface ColumnsProps {\n children: React.ReactNode\n cols?: {\n sm?: 1 | 2 | 3 | 4\n md?: 1 | 2 | 3 | 4\n lg?: 1 | 2 | 3 | 4\n xl?: 1 | 2 | 3 | 4\n }\n}\n\nexport function Columns({ children, cols = { sm: 1, md: 2, lg: 3 } }: ColumnsProps) {\n const colClasses = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-2\",\n 3: \"grid-cols-3\",\n 4: \"grid-cols-4\",\n }\n\n const smClass = cols.sm ? colClasses[cols.sm] : \"grid-cols-1\"\n const mdClass = cols.md ? `md:${colClasses[cols.md]}` : \"\"\n const lgClass = cols.lg ? `lg:${colClasses[cols.lg]}` : \"\"\n const xlClass = cols.xl ? `xl:${colClasses[cols.xl]}` : \"\"\n\n return (\n <div className={`grid ${smClass} ${mdClass} ${lgClass} ${xlClass} gap-4 my-6`}>\n {children}\n </div>\n )\n}\n\ninterface ColumnProps {\n children: React.ReactNode\n span?: 1 | 2 | 3 | 4\n}\n\nexport function Column({ children, span = 1 }: ColumnProps) {\n const spanClass = {\n 1: \"col-span-1\",\n 2: \"col-span-2\",\n 3: \"col-span-3\",\n 4: \"col-span-4\",\n }\n\n return <div className={spanClass[span]}>{children}</div>\n}\n","\"use client\"\n\nimport { useState } from \"react\"\n\ninterface TooltipProps {\n children: React.ReactNode\n content: string\n position?: \"top\" | \"bottom\" | \"left\" | \"right\"\n}\n\nexport function Tooltip({ children, content, position = \"top\" }: TooltipProps) {\n const [isVisible, setIsVisible] = useState(false)\n\n const positions = {\n top: \"bottom-full left-1/2 -translate-x-1/2 mb-2\",\n bottom: \"top-full left-1/2 -translate-x-1/2 mt-2\",\n left: \"right-full top-1/2 -translate-y-1/2 mr-2\",\n right: \"left-full top-1/2 -translate-y-1/2 ml-2\",\n }\n\n return (\n <span\n className=\"relative inline-flex underline decoration-dotted cursor-help\"\n onMouseEnter={() => setIsVisible(true)}\n onMouseLeave={() => setIsVisible(false)}\n >\n {children}\n {isVisible && (\n <span\n className={`absolute ${positions[position]} z-50 px-2 py-1 text-xs text-white bg-gray-900 dark:bg-gray-700 rounded whitespace-nowrap pointer-events-none`}\n >\n {content}\n </span>\n )}\n </span>\n )\n}\n","interface FrameProps {\n src: string\n title?: string\n height?: number | string\n width?: string\n}\n\nexport function Frame({ src, title = \"Embedded content\", height = 500, width = \"100%\" }: FrameProps) {\n return (\n <div className=\"my-6 rounded-xl border border-border overflow-hidden bg-muted/30\">\n <iframe\n src={src}\n title={title}\n width={width}\n height={height}\n className=\"w-full\"\n loading=\"lazy\"\n sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups\"\n />\n </div>\n )\n}\n","\"use client\"\n\nimport { type ReactNode, useState } from \"react\"\nimport { ChevronDown } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\n\ninterface ApiEndpointProps {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n summary?: string\n children?: ReactNode\n defaultOpen?: boolean\n}\n\nconst methodColors = {\n GET: \"bg-blue-500/10 text-blue-600 dark:text-blue-400\",\n POST: \"bg-green-500/10 text-green-600 dark:text-green-400\",\n PUT: \"bg-orange-500/10 text-orange-600 dark:text-orange-400\",\n PATCH: \"bg-purple-500/10 text-purple-600 dark:text-purple-400\",\n DELETE: \"bg-red-500/10 text-red-600 dark:text-red-400\",\n}\n\nexport function ApiEndpoint({ method, path, summary, children, defaultOpen = false }: ApiEndpointProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen)\n\n return (\n <div className=\"not-prose mb-4 rounded-xl border border-border overflow-hidden\">\n {/* Accordion Header */}\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"w-full flex items-center gap-3 px-4 py-3 text-left bg-muted/30 hover:bg-muted/50 transition-colors\"\n >\n <span\n className={cn(\n \"text-xs font-semibold px-2 py-0.5 rounded\",\n methodColors[method]\n )}\n >\n {method}\n </span>\n <code className=\"text-sm font-mono\">{path}</code>\n {summary && <span className=\"text-sm text-muted-foreground ml-auto mr-2\">{summary}</span>}\n <ChevronDown\n className={cn(\n \"h-5 w-5 text-muted-foreground transition-transform flex-shrink-0\",\n isOpen ? \"rotate-180\" : \"\"\n )}\n />\n </button>\n\n {/* Accordion Content */}\n {isOpen && children && (\n <div className=\"border-t border-border bg-background\">\n <div className=\"px-4 py-4 space-y-6\">{children}</div>\n </div>\n )}\n </div>\n )\n}\n","import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\n\n/**\n * Get the correct asset path based on deployment configuration\n * Handles different deployment scenarios:\n * - Vercel/Node.js hosting (standalone build): No basePath needed\n * - GitHub Pages without custom domain: Uses basePath from config\n * - Static hosting with custom domain: No basePath needed\n *\n * @param path - The asset path (can start with or without '/')\n * @returns The properly formatted asset path\n */\nexport function getAssetPath(path: string): string {\n // Get basePath from Next.js config (set during build for static exports)\n const basePath = process.env.NEXT_PUBLIC_BASE_PATH || process.env.__NEXT_ROUTER_BASEPATH || ''\n\n // Normalize the input path: ensure it starts with '/'\n const normalizedPath = path.startsWith('/') ? path : `/${path}`\n\n // If we have a basePath (GitHub Pages without custom domain), prepend it\n if (basePath) {\n // Normalize basePath: remove trailing slash, ensure leading slash\n const normalizedBase = basePath.startsWith('/') ? basePath : `/${basePath}`\n const cleanBase = normalizedBase.replace(/\\/$/, '')\n return `${cleanBase}${normalizedPath}`\n }\n\n // Default: return the normalized path (works for Vercel, custom domains, and dev)\n return normalizedPath\n}","interface ApiParam {\n name: string\n type: string\n required?: boolean\n description?: string\n default?: string\n}\n\ninterface ApiParamsProps {\n title?: string\n params: ApiParam[]\n}\n\nexport function ApiParams({ title = \"Parameters\", params }: ApiParamsProps) {\n if (!params || params.length === 0) return null\n\n return (\n <div className=\"mb-6\">\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">{title}</h4>\n <div className=\"space-y-3\">\n {params.map((param) => (\n <div key={param.name} className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-2\">\n <code className=\"text-sm font-mono text-foreground\">{param.name}</code>\n <span className=\"text-xs text-muted-foreground\">{param.type}</span>\n {param.required && (\n <span className=\"text-xs text-red-600 dark:text-red-400\">required</span>\n )}\n {param.default && (\n <span className=\"text-xs text-muted-foreground\">\n default: <code className=\"text-xs\">{param.default}</code>\n </span>\n )}\n </div>\n {param.description && (\n <p className=\"text-sm text-muted-foreground\">{param.description}</p>\n )}\n </div>\n ))}\n </div>\n </div>\n )\n}\n","import { CodeBlock } from \"../code-block\"\n\ninterface ApiResponseProps {\n status: number\n description?: string\n example?: any\n schema?: any\n}\n\nconst statusColors: Record<string, string> = {\n \"2\": \"text-green-600 dark:text-green-400\",\n \"3\": \"text-blue-600 dark:text-blue-400\",\n \"4\": \"text-orange-600 dark:text-orange-400\",\n \"5\": \"text-red-600 dark:text-red-400\",\n}\n\nexport function ApiResponse({ status, description, example, schema }: ApiResponseProps) {\n const statusClass = statusColors[String(status)[0]] || \"text-muted-foreground\"\n\n return (\n <div className=\"mb-4\">\n <div className=\"flex items-center gap-2 mb-2\">\n <span className={`text-sm font-semibold ${statusClass}`}>{status}</span>\n {description && <span className=\"text-sm text-muted-foreground\">{description}</span>}\n </div>\n\n {example && (\n <div className=\"mb-3\">\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Example Response</p>\n <CodeBlock\n code={typeof example === \"string\" ? example : JSON.stringify(example, null, 2)}\n language=\"json\"\n />\n </div>\n )}\n\n {schema && (\n <div>\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">Schema</p>\n <CodeBlock\n code={typeof schema === \"string\" ? schema : JSON.stringify(schema, null, 2)}\n language=\"json\"\n />\n </div>\n )}\n </div>\n )\n}\n","\"use client\"\n\nimport { useState, useMemo } from \"react\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Textarea } from \"@/components/ui/textarea\"\nimport { Badge } from \"@/components/ui/badge\"\nimport { CodeBlock } from \"../code-block\"\nimport { Play, Loader2 } from \"lucide-react\"\n\ninterface PathParam {\n name: string\n type: string\n example?: any\n}\n\ninterface ApiPlaygroundProps {\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\"\n path: string\n baseUrl?: string\n headers?: Record<string, string>\n defaultBody?: string\n pathParams?: PathParam[]\n}\n\nexport function ApiPlayground({\n method,\n path,\n baseUrl = \"\",\n headers = {},\n defaultBody,\n pathParams = []\n}: ApiPlaygroundProps) {\n const [loading, setLoading] = useState(false)\n const [response, setResponse] = useState<any>(null)\n const [error, setError] = useState<string | null>(null)\n const [requestBody, setRequestBody] = useState(defaultBody || \"\")\n\n // Initialize headers with empty strings if not provided\n const initialHeaders = useMemo(() => {\n const cleanHeaders: Record<string, string> = {}\n Object.entries(headers).forEach(([key, value]) => {\n cleanHeaders[key] = value || \"\"\n })\n return cleanHeaders\n }, [headers])\n\n const [requestHeaders, setRequestHeaders] = useState(JSON.stringify(initialHeaders, null, 2))\n\n // Extract path parameters and initialize with defaults\n const extractedParams = useMemo(() => {\n const params: Record<string, string> = {}\n const pathParamPattern = /:(\\w+)/g\n let match\n\n while ((match = pathParamPattern.exec(path)) !== null) {\n const paramName = match[1]\n const paramConfig = pathParams.find(p => p.name === paramName)\n\n // Set default value based on example or type\n if (paramConfig?.example !== undefined) {\n params[paramName] = String(paramConfig.example)\n } else if (paramConfig?.type === \"number\") {\n params[paramName] = \"1\"\n } else {\n params[paramName] = \"\"\n }\n }\n\n return params\n }, [path, pathParams])\n\n const [pathParamValues, setPathParamValues] = useState<Record<string, string>>(extractedParams)\n\n // Build the final URL with path params replaced\n const buildUrl = () => {\n let finalPath = path\n Object.entries(pathParamValues).forEach(([key, value]) => {\n finalPath = finalPath.replace(`:${key}`, value)\n })\n return `${baseUrl}${finalPath}`\n }\n\n const handleSend = async () => {\n setLoading(true)\n setError(null)\n setResponse(null)\n\n try {\n const url = buildUrl()\n const parsedHeaders = JSON.parse(requestHeaders)\n\n const options: RequestInit = {\n method,\n headers: {\n \"Content-Type\": \"application/json\",\n ...parsedHeaders,\n },\n }\n\n if (method !== \"GET\" && method !== \"DELETE\" && requestBody) {\n options.body = requestBody\n }\n\n const res = await fetch(url, options)\n const data = await res.json()\n\n setResponse({\n status: res.status,\n statusText: res.statusText,\n headers: Object.fromEntries(res.headers.entries()),\n body: data,\n })\n } catch (err) {\n setError(err instanceof Error ? err.message : \"An error occurred\")\n } finally {\n setLoading(false)\n }\n }\n\n return (\n <div className=\"not-prose border border-border rounded-lg overflow-hidden bg-card/30\">\n <div className=\"bg-muted/50 px-4 py-2 border-b border-border\">\n <h4 className=\"text-sm font-semibold text-foreground\">API Playground</h4>\n </div>\n\n <div className=\"p-4 space-y-4\">\n {/* Path Parameters */}\n {Object.keys(pathParamValues).length > 0 && (\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Path Parameters\n </label>\n <div className=\"space-y-2\">\n {Object.entries(pathParamValues).map(([paramName, paramValue]) => {\n const paramConfig = pathParams.find(p => p.name === paramName)\n return (\n <div key={paramName} className=\"flex items-center gap-2\">\n <span className=\"text-xs text-muted-foreground min-w-[80px]\">\n :{paramName}\n </span>\n <Input\n value={paramValue}\n onChange={(e) =>\n setPathParamValues((prev) => ({ ...prev, [paramName]: e.target.value }))\n }\n placeholder={paramConfig?.example || paramConfig?.type || \"value\"}\n className=\"font-mono text-sm\"\n />\n </div>\n )\n })}\n </div>\n </div>\n )}\n\n {/* URL */}\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Request URL\n </label>\n <div className=\"flex items-center gap-2\">\n <Badge variant=\"outline\" className=\"font-mono\">\n {method}\n </Badge>\n <Input value={buildUrl()} readOnly className=\"font-mono text-sm\" />\n </div>\n </div>\n\n {/* Headers */}\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Headers (JSON)\n </label>\n <Textarea\n value={requestHeaders}\n onChange={(e) => setRequestHeaders(e.target.value)}\n className=\"font-mono text-sm\"\n rows={4}\n />\n </div>\n\n {/* Body (for POST, PUT, PATCH) */}\n {method !== \"GET\" && method !== \"DELETE\" && (\n <div>\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Request Body (JSON)\n </label>\n <Textarea\n value={requestBody}\n onChange={(e) => setRequestBody(e.target.value)}\n className=\"font-mono text-sm\"\n rows={6}\n placeholder='{\\n \"key\": \"value\"\\n}'\n />\n </div>\n )}\n\n {/* Send Button */}\n <Button onClick={handleSend} disabled={loading} className=\"w-full\">\n {loading ? (\n <>\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n Sending...\n </>\n ) : (\n <>\n <Play className=\"mr-2 h-4 w-4\" />\n Send Request\n </>\n )}\n </Button>\n\n {/* Response */}\n {response && (\n <div className=\"mt-4\">\n <label className=\"text-xs font-semibold text-muted-foreground mb-2 block\">\n Response ({response.status} {response.statusText})\n </label>\n <CodeBlock code={JSON.stringify(response.body, null, 2)} language=\"json\" />\n </div>\n )}\n\n {/* Error */}\n {error && (\n <div className=\"mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-md\">\n <p className=\"text-sm text-red-600 dark:text-red-400\">{error}</p>\n </div>\n )}\n </div>\n </div>\n )\n}\n","import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@/lib/utils'\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\"\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nexport { Badge, badgeVariants }\n","\"use client\"\n\nimport { useState, useEffect } from \"react\"\nimport type { SpecraApiSpec } from \"@/lib/api-parser.types\"\nimport { parseApiSpec, type ParserType } from \"@/lib/parsers\"\nimport { Accordion, AccordionItem } from \"../accordion\"\nimport { ApiEndpoint } from \"./api-endpoint\"\nimport { ApiParams } from \"./api-params\"\nimport { ApiResponse } from \"./api-response\"\nimport { ApiPlayground } from \"./api-playground\"\nimport { CodeBlock } from \"../code-block\"\nimport { Loader2 } from \"lucide-react\"\n\ninterface ApiReferenceProps {\n /**\n * Path to the API spec JSON file (relative to /public)\n * Example: \"/api-specs/my-api.json\"\n */\n spec: string\n\n /**\n * Parser type - auto-detect by default\n * - \"auto\": Auto-detect format (Specra, OpenAPI, or Postman)\n * - \"specra\": Native Specra format\n * - \"openapi\": OpenAPI 3.x / Swagger\n * - \"postman\": Postman Collection v2.x\n */\n parser?: ParserType\n\n /**\n * Show API playground for testing\n */\n showPlayground?: boolean\n}\n\nexport function ApiReference({ spec, parser = \"auto\", showPlayground = true }: ApiReferenceProps) {\n const [apiSpec, setApiSpec] = useState<SpecraApiSpec | null>(null)\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState<string | null>(null)\n\n useEffect(() => {\n async function loadSpec() {\n try {\n const response = await fetch(spec)\n if (!response.ok) {\n throw new Error(`Failed to load API spec: ${response.statusText}`)\n }\n const data = await response.json()\n\n // Parse using the appropriate parser\n const parsedSpec = parseApiSpec(data, parser)\n setApiSpec(parsedSpec)\n } catch (err) {\n setError(err instanceof Error ? err.message : \"Failed to load API spec\")\n } finally {\n setLoading(false)\n }\n }\n\n loadSpec()\n }, [spec, parser])\n\n // Replace environment variables in text\n const interpolateEnv = (text: string, env?: Record<string, string>): string => {\n if (!env) return text\n return text.replace(/\\{(\\w+)\\}/g, (match, key) => {\n return env[key] || match\n })\n }\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 className=\"h-6 w-6 animate-spin text-muted-foreground\" />\n <span className=\"ml-2 text-muted-foreground\">Loading API specification...</span>\n </div>\n )\n }\n\n if (error) {\n return (\n <div className=\"rounded-lg border border-red-500/20 bg-red-500/10 p-4\">\n <p className=\"text-sm text-red-600 dark:text-red-400\">Error: {error}</p>\n </div>\n )\n }\n\n if (!apiSpec) {\n return null\n }\n\n return (\n <div className=\"space-y-6\">\n {/* API Info */}\n {(apiSpec.title || apiSpec.description) && (\n <div className=\"mb-8\">\n {apiSpec.title && (\n <h2 className=\"text-2xl font-semibold mb-2 text-foreground\">{apiSpec.title}</h2>\n )}\n {apiSpec.description && (\n <p className=\"text-muted-foreground\">{apiSpec.description}</p>\n )}\n {apiSpec.baseUrl && (\n <div className=\"mt-4\">\n <p className=\"text-sm font-semibold text-muted-foreground mb-1\">Base URL</p>\n <code className=\"text-sm px-2 py-1 bg-muted rounded\">{apiSpec.baseUrl}</code>\n </div>\n )}\n </div>\n )}\n\n {/* Authentication */}\n {apiSpec.auth && (\n <div className=\"rounded-lg border border-border bg-card/30 p-4 mb-6\">\n <h3 className=\"text-lg font-semibold mb-2 text-foreground\">Authentication</h3>\n <p className=\"text-sm text-muted-foreground mb-2\">\n {apiSpec.auth.description || `This API uses ${apiSpec.auth.type} authentication.`}\n </p>\n {apiSpec.auth.type === \"bearer\" && (\n <CodeBlock\n code={`Authorization: ${apiSpec.auth.tokenPrefix || \"Bearer\"} {YOUR_TOKEN}`}\n language=\"bash\"\n />\n )}\n {apiSpec.auth.type === \"apiKey\" && (\n <CodeBlock\n code={`${apiSpec.auth.headerName || \"X-API-Key\"}: {YOUR_API_KEY}`}\n language=\"bash\"\n />\n )}\n </div>\n )}\n\n {/* Endpoints as Accordion */}\n <Accordion type=\"single\" collapsible className=\"space-y-4\">\n {apiSpec.endpoints.map((endpoint, index) => {\n // Merge global and endpoint-specific headers\n const allHeaders = [\n ...(apiSpec.globalHeaders || []),\n ...(endpoint.headers || []),\n ].map((header) => ({\n ...header,\n value: interpolateEnv(header.value, apiSpec.env),\n }))\n\n return (\n <AccordionItem\n key={index}\n value={`endpoint-${index}`}\n title={\n <div className=\"flex items-center gap-3\">\n <span\n className={`text-xs font-semibold px-2 py-0.5 rounded ${\n endpoint.method === \"GET\"\n ? \"bg-blue-500/10 text-blue-600 dark:text-blue-400\"\n : endpoint.method === \"POST\"\n ? \"bg-green-500/10 text-green-600 dark:text-green-400\"\n : endpoint.method === \"PUT\"\n ? \"bg-orange-500/10 text-orange-600 dark:text-orange-400\"\n : endpoint.method === \"PATCH\"\n ? \"bg-purple-500/10 text-purple-600 dark:text-purple-400\"\n : \"bg-red-500/10 text-red-600 dark:text-red-400\"\n }`}\n >\n {endpoint.method}\n </span>\n <code className=\"text-sm font-mono\">{endpoint.path}</code>\n <span className=\"text-sm text-muted-foreground ml-auto\">{endpoint.title}</span>\n </div>\n }\n >\n <div className=\"space-y-6 pt-4\">\n {/* Description */}\n {endpoint.description && (\n <p className=\"text-sm text-muted-foreground\">{endpoint.description}</p>\n )}\n\n {/* Path Parameters */}\n {endpoint.pathParams && endpoint.pathParams.length > 0 && (\n <ApiParams title=\"Path Parameters\" params={endpoint.pathParams} />\n )}\n\n {/* Query Parameters */}\n {endpoint.queryParams && endpoint.queryParams.length > 0 && (\n <ApiParams title=\"Query Parameters\" params={endpoint.queryParams} />\n )}\n\n {/* Headers */}\n {allHeaders.length > 0 && (\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Headers</h4>\n <div className=\"space-y-2\">\n {allHeaders.map((header, idx) => (\n <div key={idx} className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-2\">\n <code className=\"text-sm font-mono text-foreground\">{header.name}</code>\n <span className=\"text-xs text-muted-foreground\">{header.value}</span>\n </div>\n {header.description && (\n <p className=\"text-sm text-muted-foreground\">{header.description}</p>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Request Body */}\n {endpoint.body && (\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Request Body</h4>\n {endpoint.body.description && (\n <p className=\"text-sm text-muted-foreground mb-2\">\n {endpoint.body.description}\n </p>\n )}\n {endpoint.body.example && (\n <CodeBlock\n code={\n typeof endpoint.body.example === \"string\"\n ? endpoint.body.example\n : JSON.stringify(endpoint.body.example, null, 2)\n }\n language=\"json\"\n />\n )}\n </div>\n )}\n\n {/* Responses */}\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Responses</h4>\n {endpoint.successResponse && (\n <ApiResponse\n status={endpoint.successResponse.status}\n description={endpoint.successResponse.description}\n example={endpoint.successResponse.example}\n schema={endpoint.successResponse.schema}\n />\n )}\n {endpoint.errorResponses?.map((response, idx) => (\n <ApiResponse\n key={idx}\n status={response.status}\n description={response.description}\n example={response.example}\n schema={response.schema}\n />\n ))}\n </div>\n\n {/* Code Examples */}\n {endpoint.examples && endpoint.examples.length > 0 && (\n <div>\n <h4 className=\"text-sm font-semibold text-foreground mb-3\">Examples</h4>\n {endpoint.examples.map((example, idx) => (\n <div key={idx} className=\"mb-3\">\n <p className=\"text-xs font-semibold text-muted-foreground mb-2\">\n {example.title}\n </p>\n <CodeBlock code={example.code} language={example.language} />\n </div>\n ))}\n </div>\n )}\n\n {/* API Playground */}\n {showPlayground && (\n <ApiPlayground\n method={endpoint.method}\n path={endpoint.path}\n baseUrl={apiSpec.baseUrl}\n headers={Object.fromEntries(allHeaders.map((h) => [h.name, h.value]))}\n pathParams={endpoint.pathParams}\n defaultBody={\n endpoint.body?.example\n ? typeof endpoint.body.example === \"string\"\n ? endpoint.body.example\n : JSON.stringify(endpoint.body.example, null, 2)\n : undefined\n }\n />\n )}\n </div>\n </AccordionItem>\n )\n })}\n </Accordion>\n </div>\n )\n}\n","import type { SpecraApiSpec } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\n\n/**\n * Parser for native Specra API format\n * This is a pass-through parser since the input is already in the correct format\n */\nexport class SpecraParser implements ApiSpecParser {\n validate(input: any): boolean {\n return (\n typeof input === \"object\" &&\n input !== null &&\n \"endpoints\" in input &&\n Array.isArray(input.endpoints)\n )\n }\n\n parse(input: any): SpecraApiSpec {\n if (!this.validate(input)) {\n throw new Error(\"Invalid Specra API spec format\")\n }\n return input as SpecraApiSpec\n }\n}\n","import type { SpecraApiSpec, ApiEndpointSpec, ApiParam, ApiResponse } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\n\n/**\n * Parser for OpenAPI 3.0/3.1 specifications\n */\nexport class OpenApiParser implements ApiSpecParser {\n validate(input: any): boolean {\n return (\n typeof input === \"object\" &&\n input !== null &&\n (\"openapi\" in input || \"swagger\" in input) &&\n \"paths\" in input\n )\n }\n\n parse(input: any): SpecraApiSpec {\n if (!this.validate(input)) {\n throw new Error(\"Invalid OpenAPI spec format\")\n }\n\n const baseUrl = this.extractBaseUrl(input)\n const endpoints: ApiEndpointSpec[] = []\n\n // Parse paths\n for (const [path, pathItem] of Object.entries(input.paths || {})) {\n const methods = [\"get\", \"post\", \"put\", \"patch\", \"delete\"] as const\n\n for (const method of methods) {\n const operation = (pathItem as any)[method]\n if (!operation) continue\n\n const endpoint = this.parseOperation(path, method.toUpperCase() as any, operation, input)\n endpoints.push(endpoint)\n }\n }\n\n return {\n version: input.info?.version,\n title: input.info?.title,\n description: input.info?.description,\n baseUrl,\n auth: this.extractAuth(input),\n endpoints,\n }\n }\n\n private extractBaseUrl(spec: any): string {\n // OpenAPI 3.x servers\n if (spec.servers && spec.servers.length > 0) {\n return spec.servers[0].url\n }\n\n // Swagger 2.0\n if (spec.host) {\n const scheme = spec.schemes?.[0] || \"https\"\n const basePath = spec.basePath || \"\"\n return `${scheme}://${spec.host}${basePath}`\n }\n\n return \"\"\n }\n\n private extractAuth(spec: any): SpecraApiSpec[\"auth\"] {\n const securitySchemes = spec.components?.securitySchemes || spec.securityDefinitions\n\n if (!securitySchemes) return undefined\n\n // Get the first security scheme\n const firstScheme = Object.values(securitySchemes)[0] as any\n if (!firstScheme) return undefined\n\n if (firstScheme.type === \"http\" && firstScheme.scheme === \"bearer\") {\n return {\n type: \"bearer\",\n description: firstScheme.description,\n tokenPrefix: \"Bearer\",\n }\n }\n\n if (firstScheme.type === \"apiKey\") {\n return {\n type: \"apiKey\",\n description: firstScheme.description,\n headerName: firstScheme.name || \"X-API-Key\",\n }\n }\n\n if (firstScheme.type === \"http\" && firstScheme.scheme === \"basic\") {\n return {\n type: \"basic\",\n description: firstScheme.description,\n }\n }\n\n return undefined\n }\n\n private parseOperation(\n path: string,\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\",\n operation: any,\n spec: any\n ): ApiEndpointSpec {\n const endpoint: ApiEndpointSpec = {\n title: operation.summary || operation.operationId || `${method} ${path}`,\n method,\n path: this.convertPathParams(path),\n description: operation.description,\n }\n\n // Parse parameters\n const params = this.parseParameters(operation.parameters || [], spec)\n if (params.path.length > 0) endpoint.pathParams = params.path\n if (params.query.length > 0) endpoint.queryParams = params.query\n if (params.header.length > 0) {\n endpoint.headers = params.header.map((p) => ({\n name: p.name,\n value: p.example || \"\",\n description: p.description,\n }))\n }\n\n // Parse request body\n if (operation.requestBody) {\n endpoint.body = this.parseRequestBody(operation.requestBody, spec)\n }\n\n // Parse responses\n const responses = this.parseResponses(operation.responses || {}, spec)\n if (responses.success) endpoint.successResponse = responses.success\n if (responses.errors.length > 0) endpoint.errorResponses = responses.errors\n\n return endpoint\n }\n\n private convertPathParams(path: string): string {\n // Convert OpenAPI {param} to :param\n return path.replace(/\\{([^}]+)\\}/g, \":$1\")\n }\n\n private parseParameters(\n parameters: any[],\n spec: any\n ): { path: ApiParam[]; query: ApiParam[]; header: ApiParam[] } {\n const result = { path: [] as ApiParam[], query: [] as ApiParam[], header: [] as ApiParam[] }\n\n for (const param of parameters) {\n // Resolve $ref if present\n const resolved = param.$ref ? this.resolveRef(param.$ref, spec) : param\n\n const apiParam: ApiParam = {\n name: resolved.name,\n type: resolved.schema?.type || resolved.type || \"string\",\n required: resolved.required,\n description: resolved.description,\n example: resolved.example || resolved.schema?.example,\n }\n\n if (resolved.in === \"path\") result.path.push(apiParam)\n else if (resolved.in === \"query\") result.query.push(apiParam)\n else if (resolved.in === \"header\") result.header.push(apiParam)\n }\n\n return result\n }\n\n private parseRequestBody(requestBody: any, spec: any): ApiEndpointSpec[\"body\"] {\n const content = requestBody.content?.[\"application/json\"]\n if (!content) return undefined\n\n return {\n description: requestBody.description,\n example: content.example || this.generateExample(content.schema, spec),\n schema: content.schema,\n }\n }\n\n private parseResponses(\n responses: any,\n spec: any\n ): { success?: ApiResponse; errors: ApiResponse[] } {\n const result: { success?: ApiResponse; errors: ApiResponse[] } = { errors: [] }\n\n for (const [statusCode, response] of Object.entries(responses)) {\n const status = parseInt(statusCode)\n if (isNaN(status)) continue\n\n const resolved = (response as any).$ref ? this.resolveRef((response as any).$ref, spec) : response\n const content = (resolved as any).content?.[\"application/json\"]\n\n const apiResponse: ApiResponse = {\n status,\n description: (resolved as any).description,\n example: content?.example || this.generateExample(content?.schema, spec),\n schema: content?.schema,\n }\n\n if (status >= 200 && status < 300) {\n result.success = apiResponse\n } else {\n result.errors.push(apiResponse)\n }\n }\n\n return result\n }\n\n private generateExample(schema: any, spec: any): any {\n if (!schema) return undefined\n if (schema.$ref) schema = this.resolveRef(schema.$ref, spec)\n if (schema.example) return schema.example\n\n // Simple example generation based on schema type\n if (schema.type === \"object\" && schema.properties) {\n const example: any = {}\n for (const [key, prop] of Object.entries(schema.properties)) {\n example[key] = this.generateExample(prop, spec)\n }\n return example\n }\n\n if (schema.type === \"array\" && schema.items) {\n return [this.generateExample(schema.items, spec)]\n }\n\n // Default values by type\n const defaults: any = {\n string: \"string\",\n number: 0,\n integer: 0,\n boolean: false,\n object: {},\n array: [],\n }\n\n return defaults[schema.type] || null\n }\n\n private resolveRef(ref: string, spec: any): any {\n const path = ref.replace(/^#\\//, \"\").split(\"/\")\n let current = spec\n\n for (const segment of path) {\n current = current[segment]\n if (!current) return {}\n }\n\n return current\n }\n}\n","import type { SpecraApiSpec, ApiEndpointSpec, ApiParam, ApiHeader } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\n\n/**\n * Parser for Postman Collection v2.0/v2.1\n */\nexport class PostmanParser implements ApiSpecParser {\n validate(input: any): boolean {\n return (\n typeof input === \"object\" &&\n input !== null &&\n \"info\" in input &&\n input.info?.schema?.includes(\"v2\")\n )\n }\n\n parse(input: any): SpecraApiSpec {\n if (!this.validate(input)) {\n throw new Error(\"Invalid Postman Collection format (requires v2.0 or v2.1)\")\n }\n\n const baseUrl = this.extractBaseUrl(input)\n const endpoints: ApiEndpointSpec[] = []\n\n // Parse items (can be nested in folders)\n this.parseItems(input.item || [], endpoints, baseUrl, input)\n\n return {\n version: input.info?.version,\n title: input.info?.name,\n description: input.info?.description,\n baseUrl,\n auth: this.extractAuth(input.auth),\n globalHeaders: this.extractGlobalHeaders(input),\n endpoints,\n }\n }\n\n private extractBaseUrl(collection: any): string {\n // Try to get from variables\n const baseUrlVar = collection.variable?.find(\n (v: any) => v.key === \"baseUrl\" || v.key === \"base_url\" || v.key === \"url\"\n )\n if (baseUrlVar) return baseUrlVar.value\n\n // Try to extract from first request\n if (collection.item && collection.item.length > 0) {\n const firstRequest = this.findFirstRequest(collection.item)\n if (firstRequest?.request?.url) {\n const url = this.parseUrl(firstRequest.request.url)\n if (url.host) {\n return `${url.protocol}://${url.host.join(\".\")}`\n }\n }\n }\n\n return \"\"\n }\n\n private findFirstRequest(items: any[]): any {\n for (const item of items) {\n if (item.request) return item\n if (item.item) {\n const found = this.findFirstRequest(item.item)\n if (found) return found\n }\n }\n return null\n }\n\n private extractAuth(auth: any): SpecraApiSpec[\"auth\"] {\n if (!auth) return undefined\n\n if (auth.type === \"bearer\") {\n return {\n type: \"bearer\",\n tokenPrefix: \"Bearer\",\n }\n }\n\n if (auth.type === \"apikey\") {\n const keyData = auth.apikey?.find((a: any) => a.key === \"key\")\n const keyName = keyData?.value || \"X-API-Key\"\n\n return {\n type: \"apiKey\",\n headerName: keyName,\n }\n }\n\n if (auth.type === \"basic\") {\n return {\n type: \"basic\",\n }\n }\n\n return undefined\n }\n\n private extractGlobalHeaders(collection: any): ApiHeader[] {\n // Postman doesn't have global headers in the same way, but we can check for common patterns\n return []\n }\n\n private parseItems(items: any[], endpoints: ApiEndpointSpec[], baseUrl: string, collection: any) {\n for (const item of items) {\n // If it's a folder, recurse\n if (item.item && Array.isArray(item.item)) {\n this.parseItems(item.item, endpoints, baseUrl, collection)\n }\n // If it's a request\n else if (item.request) {\n const endpoint = this.parseRequest(item, baseUrl, collection)\n endpoints.push(endpoint)\n }\n }\n }\n\n private parseRequest(item: any, baseUrl: string, collection: any): ApiEndpointSpec {\n const request = item.request\n const url = this.parseUrl(request.url)\n\n const endpoint: ApiEndpointSpec = {\n title: item.name,\n method: request.method.toUpperCase(),\n path: this.buildPath(url, baseUrl),\n description: item.request.description || item.description,\n }\n\n // Parse URL parameters (path and query)\n const params = this.parseUrlParams(url)\n if (params.path.length > 0) endpoint.pathParams = params.path\n if (params.query.length > 0) endpoint.queryParams = params.query\n\n // Parse headers\n if (request.header && request.header.length > 0) {\n endpoint.headers = request.header\n .filter((h: any) => !h.disabled)\n .map((h: any) => ({\n name: h.key,\n value: h.value || \"\",\n description: h.description,\n }))\n }\n\n // Parse request body\n if (request.body) {\n endpoint.body = this.parseBody(request.body)\n }\n\n // Parse response examples\n const responses = this.parseResponses(item.response || [])\n if (responses.success) endpoint.successResponse = responses.success\n if (responses.errors.length > 0) endpoint.errorResponses = responses.errors\n\n return endpoint\n }\n\n private parseUrl(url: any): {\n protocol: string\n host: string[]\n path: string[]\n query: any[]\n variable: any[]\n } {\n if (typeof url === \"string\") {\n // Parse string URL\n const urlObj = new URL(url)\n return {\n protocol: urlObj.protocol.replace(\":\", \"\"),\n host: urlObj.hostname.split(\".\"),\n path: urlObj.pathname.split(\"/\").filter(Boolean),\n query: [],\n variable: [],\n }\n }\n\n return {\n protocol: url.protocol || \"https\",\n host: url.host || [],\n path: url.path || [],\n query: url.query || [],\n variable: url.variable || [],\n }\n }\n\n private buildPath(url: any, baseUrl: string): string {\n let path = \"/\"\n\n if (url.path && url.path.length > 0) {\n path += url.path.join(\"/\")\n }\n\n // Convert Postman :param to our :param format (they're the same!)\n // But we need to handle {{variable}} syntax\n path = path.replace(/\\{\\{([^}]+)\\}\\}/g, \":$1\")\n\n return path\n }\n\n private parseUrlParams(url: any): { path: ApiParam[]; query: ApiParam[] } {\n const result = { path: [] as ApiParam[], query: [] as ApiParam[] }\n\n // Path parameters from variables\n if (url.variable && url.variable.length > 0) {\n for (const v of url.variable) {\n result.path.push({\n name: v.key,\n type: v.type || \"string\",\n description: v.description,\n example: v.value,\n })\n }\n }\n\n // Extract path params from the path itself\n if (url.path && url.path.length > 0) {\n for (const segment of url.path) {\n if (segment.startsWith(\":\")) {\n const paramName = segment.slice(1)\n // Only add if not already added from variables\n if (!result.path.find((p) => p.name === paramName)) {\n result.path.push({\n name: paramName,\n type: \"string\",\n })\n }\n }\n }\n }\n\n // Query parameters\n if (url.query && url.query.length > 0) {\n for (const q of url.query) {\n if (q.disabled) continue\n result.query.push({\n name: q.key,\n type: \"string\",\n description: q.description,\n example: q.value,\n })\n }\n }\n\n return result\n }\n\n private parseBody(body: any): ApiEndpointSpec[\"body\"] {\n if (!body) return undefined\n\n let example: any\n let description = body.description\n\n if (body.mode === \"raw\") {\n try {\n example = JSON.parse(body.raw)\n } catch {\n example = body.raw\n }\n } else if (body.mode === \"formdata\" || body.mode === \"urlencoded\") {\n example = {}\n for (const item of body[body.mode] || []) {\n if (!item.disabled) {\n example[item.key] = item.value\n }\n }\n }\n\n return {\n description,\n example,\n }\n }\n\n private parseResponses(responses: any[]): { success?: any; errors: any[] } {\n const result: { success?: any; errors: any[] } = { errors: [] }\n\n for (const response of responses) {\n let example: any\n try {\n example = JSON.parse(response.body)\n } catch {\n example = response.body\n }\n\n const apiResponse = {\n status: response.code || 200,\n description: response.name,\n example,\n }\n\n if (apiResponse.status >= 200 && apiResponse.status < 300) {\n if (!result.success) result.success = apiResponse\n } else {\n result.errors.push(apiResponse)\n }\n }\n\n return result\n }\n}\n","import type { SpecraApiSpec } from \"../api-parser.types\"\nimport type { ApiSpecParser } from \"./base-parser\"\nimport { SpecraParser } from \"./specra-parser\"\nimport { OpenApiParser } from \"./openapi-parser\"\nimport { PostmanParser } from \"./postman-parser\"\n\nexport type ParserType = \"auto\" | \"specra\" | \"openapi\" | \"postman\"\n\n/**\n * Registry of all available parsers\n */\nconst parsers: Map<string, ApiSpecParser> = new Map([\n [\"specra\", new SpecraParser()],\n [\"openapi\", new OpenApiParser()],\n [\"postman\", new PostmanParser()],\n])\n\n/**\n * Auto-detect the parser type based on the input structure\n */\nexport function detectParserType(input: any): ParserType {\n if (!input || typeof input !== \"object\") {\n throw new Error(\"Invalid API spec: input must be an object\")\n }\n\n // Check for Postman Collection\n if (input.info?.schema?.includes(\"v2\")) {\n return \"postman\"\n }\n\n // Check for OpenAPI/Swagger\n if (input.openapi || input.swagger) {\n return \"openapi\"\n }\n\n // Check for Specra format\n if (input.endpoints && Array.isArray(input.endpoints)) {\n return \"specra\"\n }\n\n throw new Error(\n \"Unable to auto-detect API spec format. Supported formats: Specra, OpenAPI 3.x, Postman Collection v2.x\"\n )\n}\n\n/**\n * Parse an API spec using the specified or auto-detected parser\n */\nexport function parseApiSpec(input: any, parserType: ParserType = \"auto\"): SpecraApiSpec {\n // Auto-detect if needed\n const actualType = parserType === \"auto\" ? detectParserType(input) : parserType\n\n // Get the parser\n const parser = parsers.get(actualType)\n if (!parser) {\n throw new Error(`Unknown parser type: ${actualType}`)\n }\n\n // Validate and parse\n if (!parser.validate(input)) {\n throw new Error(`Input does not match ${actualType} format`)\n }\n\n return parser.parse(input)\n}\n\n// Export parsers for direct use\nexport { SpecraParser, OpenApiParser, PostmanParser }\nexport type { ApiSpecParser }\n","import type { ReactNode } from \"react\"\nimport { CodeBlock } from \"./code-block\"\nimport { Callout } from \"./callout\"\nimport { Accordion, AccordionItem } from \"./accordion\"\nimport { Tabs, Tab } from \"./tabs\"\nimport { Image } from \"./image\"\nimport { Video } from \"./video\"\nimport { Card, CardGrid } from \"./card\"\nimport { ImageCard, ImageCardGrid } from \"./image-card\"\nimport { Steps, Step } from \"./steps\"\nimport { Icon } from \"./icon\"\nimport { Mermaid } from \"./mermaid\"\nimport { Math } from \"./math\"\nimport { Columns, Column } from \"./columns\"\nimport { Badge } from \"./badge\"\nimport { Tooltip } from \"./tooltip\"\nimport { Frame } from \"./frame\"\nimport { ApiEndpoint, ApiParams, ApiResponse, ApiPlayground, ApiReference } from \"./api\"\n\nexport const mdxComponents = {\n h1: ({ children }: { children: ReactNode }) => (\n <h1 className=\"text-3xl font-semibold tracking-tight mb-6 text-foreground\">{children}</h1>\n ),\n h2: ({ children, id }: { children: ReactNode; id?: string }) => (\n <h2 id={id} className=\"text-2xl font-semibold tracking-tight mt-10 mb-4 text-foreground scroll-mt-24\">\n {children}\n </h2>\n ),\n h3: ({ children, id }: { children: ReactNode; id?: string }) => (\n <h3 id={id} className=\"text-xl font-medium tracking-tight mt-8 mb-3 text-foreground scroll-mt-24\">\n {children}\n </h3>\n ),\n p: ({ children }: { children: ReactNode }) => (\n <p className=\"text-base leading-7 text-muted-foreground mb-4\">{children}</p>\n ),\n code: ({ children, className, meta, ...props }: { children: ReactNode; className?: string; meta?: string; [key: string]: any }) => {\n const isInline = !className\n if (isInline) {\n return (\n <code className=\"px-1.5 py-0.5 rounded-md bg-muted/50 text-primary font-mono text-[13px] border border-border/50\">\n {children}\n </code>\n )\n }\n \n // Extract language from className\n const language = className?.replace(\"language-\", \"\") || \"text\"\n \n // Use meta string as filename if provided\n const filename = meta || undefined\n \n const code = String(children).replace(/\\n$/, \"\")\n\n return <CodeBlock code={code} language={language} filename={filename} />\n },\n pre: ({ children }: { children: ReactNode }) => <>{children}</>,\n ul: ({ children }: { children: ReactNode }) => (\n <ul className=\"list-disc list-outside pl-5 space-y-2 mb-4 text-muted-foreground [&_p]:mb-0 [&_p]:inline [&_ul]:ml-6 [&_ol]:ml-6\">{children}</ul>\n ),\n ol: ({ children }: { children: ReactNode }) => (\n <ol className=\"list-decimal list-outside pl-5 space-y-2 mb-4 text-muted-foreground [&_p]:mb-0 [&_p]:inline [&_ul]:ml-6 [&_ol]:ml-6\">{children}</ol>\n ),\n li: ({ children }: { children: ReactNode }) => <li className=\"leading-7 [&>p]:mb-0 [&>p]:inline\">{children}</li>,\n a: ({ children, href }: { children: ReactNode; href?: string }) => (\n <a\n href={href}\n className=\"text-primary hover:underline font-medium\"\n target={href?.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={href?.startsWith(\"http\") ? \"noopener noreferrer\" : undefined}\n >\n {children}\n </a>\n ),\n blockquote: ({ children }: { children: ReactNode }) => {\n // Check if this is a GitHub-style alert blockquote\n const childrenArray = Array.isArray(children) ? children : [children]\n const firstChild = childrenArray[0]\n\n // Extract text content from the blockquote\n let textContent = \"\"\n if (firstChild && typeof firstChild === \"object\" && \"props\" in firstChild) {\n const props = (firstChild as any).props\n if (props.children) {\n const text = Array.isArray(props.children) ? props.children.join(\"\") : String(props.children)\n textContent = text\n }\n }\n\n // Check for alert patterns like [!INFO], [!WARNING], etc.\n const alertMatch = textContent.match(/^\\[!(INFO|TIP|WARNING|SUCCESS|ERROR)\\]/)\n\n if (alertMatch) {\n const type = alertMatch[1].toLowerCase() as \"info\" | \"tip\" | \"warning\" | \"success\" | \"error\"\n\n // Extract the content after the alert marker\n const processChildren = (node: any): any => {\n if (typeof node === \"string\") {\n return node.replace(/^\\[!(INFO|TIP|WARNING|SUCCESS|ERROR)\\]\\s*\\n?/, \"\")\n }\n if (node && typeof node === \"object\" && \"props\" in node) {\n return {\n ...node,\n props: {\n ...node.props,\n children: Array.isArray(node.props.children)\n ? node.props.children.map(processChildren)\n : processChildren(node.props.children),\n },\n }\n }\n return node\n }\n\n const cleanedChildren = Array.isArray(children) ? children.map(processChildren) : processChildren(children)\n\n return <Callout type={type}>{cleanedChildren}</Callout>\n }\n\n // Regular blockquote\n return (\n <blockquote className=\"border-l-4 border-primary/50 bg-muted/30 pl-4 pr-4 py-3 my-6 rounded-r-lg\">\n <div className=\"text-muted-foreground italic [&>p]:mb-0\">{children}</div>\n </blockquote>\n )\n },\n table: ({ children }: { children: ReactNode }) => (\n <div className=\"overflow-x-auto mb-6 rounded-xl border border-border\">\n <table className=\"min-w-full border-collapse\">{children}</table>\n </div>\n ),\n th: ({ children }: { children: ReactNode }) => (\n <th className=\"border-b border-r border-border bg-muted px-4 py-2 text-left font-semibold text-foreground last:border-r-0\">{children}</th>\n ),\n td: ({ children }: { children: ReactNode }) => (\n <td className=\"border-b border-r border-border px-4 py-2 text-muted-foreground last:border-r-0\">{children}</td>\n ),\n // Custom components\n Callout,\n Accordion,\n AccordionItem,\n Tabs,\n Tab,\n Image,\n Video,\n Card,\n CardGrid,\n ImageCard,\n ImageCardGrid,\n Steps,\n Step,\n Icon,\n Mermaid,\n Math,\n Columns,\n Column,\n Badge,\n Tooltip,\n Frame,\n // API Documentation components\n ApiEndpoint,\n ApiParams,\n ApiResponse,\n ApiPlayground,\n ApiReference,\n}\n","/**\n * Configuration schema for Specra documentation system\n */\n\n/**\n * Site metadata and branding\n */\nexport interface SiteConfig {\n /** The title of the documentation site */\n title: string\n /** Short description of the documentation */\n description?: string\n /** URL where the documentation is hosted */\n url?: string\n /** Base URL path for the documentation (e.g., '/docs') */\n baseUrl?: string\n /** Path to the site logo */\n logo?: string\n /** Path to the favicon */\n favicon?: string\n /** Default language for the documentation */\n language?: string\n /** Organization or author name */\n organizationName?: string\n /** Project name */\n projectName?: string\n /** Active/default version for the documentation */\n activeVersion?: string\n}\n\n/**\n * Theme and appearance settings\n */\nexport interface ThemeConfig {\n /** Primary color for the theme */\n primaryColor?: string\n /** Default theme mode */\n defaultMode?: \"light\" | \"dark\" | \"system\"\n /** Whether to respect system preferences */\n respectPrefersColorScheme?: boolean\n /** Custom CSS file path */\n customCss?: string\n}\n\n/**\n * Tab group for organizing documentation\n */\nexport interface TabGroup {\n /** Unique identifier for the tab group */\n id: string\n /** Display label for the tab */\n label: string\n /** Optional icon name (lucide-react icon) */\n icon?: string\n}\n\n/**\n * Navigation and sidebar configuration\n */\nexport interface NavigationConfig {\n /** Whether to show the sidebar by default */\n showSidebar?: boolean\n /** Whether the sidebar is collapsible */\n collapsibleSidebar?: boolean\n /** Whether to show breadcrumbs */\n showBreadcrumbs?: boolean\n /** Whether to show table of contents */\n showTableOfContents?: boolean\n /** Position of table of contents */\n tocPosition?: \"left\" | \"right\"\n /** Maximum depth for table of contents */\n tocMaxDepth?: number\n /** Tab groups for organizing documentation sections */\n tabGroups?: TabGroup[]\n}\n\n/**\n * Social and external links\n */\nexport interface SocialLinks {\n /** GitHub repository URL */\n github?: string\n /** Twitter/X handle or URL */\n twitter?: string\n /** Discord invite URL */\n discord?: string\n /** LinkedIn profile or company page */\n linkedin?: string\n /** YouTube channel URL */\n youtube?: string\n /** Custom social links */\n custom?: Array<{\n label: string\n url: string\n icon?: string\n }>\n}\n\n/**\n * Search configuration\n */\nexport interface SearchConfig {\n /** Enable/disable search functionality */\n enabled?: boolean\n /** Placeholder text for search input */\n placeholder?: string\n /** Search provider type */\n provider?: \"meilisearch\" | \"algolia\" | \"local\"\n /** Meilisearch configuration */\n meilisearch?: {\n /** Meilisearch server URL */\n host: string\n /** API key for Meilisearch */\n apiKey?: string\n /** Index name */\n indexName: string\n }\n}\n\n/**\n * Analytics configuration\n */\nexport interface AnalyticsConfig {\n /** Google Analytics tracking ID */\n googleAnalytics?: string\n /** Google Tag Manager ID */\n googleTagManager?: string\n /** Plausible Analytics domain */\n plausible?: string\n /** Custom analytics scripts */\n custom?: Array<{\n src: string\n async?: boolean\n defer?: boolean\n }>\n}\n\n/**\n * Footer configuration\n */\nexport interface FooterConfig {\n /** Copyright text */\n copyright?: string\n /** Footer links organized by columns */\n links?: Array<{\n title: string\n items: Array<{\n label: string\n href: string\n }>\n }>\n /** Custom footer content */\n customContent?: string\n}\n\n/**\n * Documentation features\n */\nexport interface FeaturesConfig {\n /** Enable/disable edit this page links */\n editUrl?: string | false\n /** Show last updated timestamp */\n showLastUpdated?: boolean\n /** Show reading time estimate */\n showReadingTime?: boolean\n /** Show author information */\n showAuthors?: boolean\n /** Show tags */\n showTags?: boolean\n /** Enable version dropdown */\n versioning?: boolean\n /** Enable i18n (internationalization) */\n i18n?: boolean\n}\n\n/**\n * Site-wide banner configuration\n */\nexport interface BannerConfig {\n /** Whether the banner is enabled */\n enabled?: boolean\n /** Banner message */\n message?: string\n /** Banner type */\n type?: \"info\" | \"warning\" | \"success\" | \"error\"\n /** Whether the banner can be dismissed */\n dismissible?: boolean\n}\n\n/**\n * Environment variables that can be used in documentation\n * These will be replaced at build time or runtime\n */\nexport interface EnvironmentVariables {\n /** API base URL */\n API_BASE_URL?: string\n /** API version */\n API_VERSION?: string\n /** CDN URL */\n CDN_URL?: string\n /** Custom environment variables */\n [key: string]: string | undefined\n}\n\n/**\n * Deployment configuration for different hosting scenarios\n */\nexport interface DeploymentConfig {\n /**\n * Deployment target\n * - 'vercel': For Vercel or similar Node.js hosting (uses 'standalone' output)\n * - 'github-pages': For GitHub Pages static hosting (uses 'export' output)\n * - 'static': For any static hosting like Netlify, Cloudflare Pages, etc.\n * - 'custom-domain-static': For static hosting with custom domain (no basePath needed)\n */\n target?: \"vercel\" | \"github-pages\" | \"static\" | \"custom-domain-static\"\n\n /**\n * Base path for assets when deploying to GitHub Pages without custom domain\n * This should be your repository name (e.g., 'my-repo')\n * Only used when target is 'github-pages' and no custom domain is configured\n */\n basePath?: string\n\n /**\n * Whether a custom domain is configured\n * When true, basePath will be ignored even for GitHub Pages\n */\n customDomain?: boolean\n}\n\n/**\n * Main configuration interface\n */\nexport interface SpecraConfig {\n /** Site metadata and branding */\n site: SiteConfig\n /** Theme and appearance settings */\n theme?: ThemeConfig\n /** Navigation and sidebar configuration */\n navigation?: NavigationConfig\n /** Social and external links */\n social?: SocialLinks\n /** Search configuration */\n search?: SearchConfig\n /** Analytics configuration */\n analytics?: AnalyticsConfig\n /** Footer configuration */\n footer?: FooterConfig\n /** Site-wide banner */\n banner?: BannerConfig\n /** Documentation features */\n features?: FeaturesConfig\n /** Environment variables for use in docs */\n env?: EnvironmentVariables\n /** Deployment configuration */\n deployment?: DeploymentConfig\n}\n\n/**\n * Default configuration values\n */\nexport const defaultConfig: SpecraConfig = {\n site: {\n title: \"Documentation\",\n description: \"Project documentation\",\n baseUrl: \"/\",\n language: \"en\",\n },\n theme: {\n defaultMode: \"system\",\n respectPrefersColorScheme: true,\n },\n navigation: {\n showSidebar: true,\n collapsibleSidebar: true,\n showBreadcrumbs: true,\n showTableOfContents: true,\n tocPosition: \"right\",\n tocMaxDepth: 3,\n },\n search: {\n enabled: true,\n provider: \"local\",\n placeholder: \"Search documentation...\",\n },\n features: {\n showLastUpdated: true,\n showReadingTime: true,\n showAuthors: false,\n showTags: true,\n versioning: true,\n i18n: false,\n },\n}\n","import specraConfigJson from \"../specra.config.json\"\nimport { SpecraConfig, defaultConfig } from \"./config.types\"\n\n/**\n * Deep merge two objects\n */\nfunction deepMerge<T extends Record<string, any>>(target: T, source: Partial<T>): T {\n const result = { ...target }\n\n for (const key in source) {\n const sourceValue = source[key]\n const targetValue = result[key]\n\n if (sourceValue && typeof sourceValue === \"object\" && !Array.isArray(sourceValue)) {\n result[key] = deepMerge(\n targetValue && typeof targetValue === \"object\" ? targetValue : {},\n sourceValue,\n ) as T[Extract<keyof T, string>]\n } else if (sourceValue !== undefined) {\n result[key] = sourceValue as T[Extract<keyof T, string>]\n }\n }\n\n return result\n}\n\n/**\n * Load and parse the Specra configuration file\n * Falls back to default configuration if file doesn't exist or is invalid\n */\nexport function loadConfig(userConfig: Partial<SpecraConfig>): SpecraConfig {\n try {\n // const userConfig = specraConfigJson as unknown as Partial<SpecraConfig>\n\n // Merge user config with defaults \n const config = deepMerge(defaultConfig, userConfig)\n\n return config\n } catch (error) {\n console.error(`❌ Error loading configuration:`, error)\n console.warn(\"Using default configuration.\")\n return defaultConfig\n }\n}\n\n/**\n * Get a specific configuration value by path (SERVER ONLY)\n * Example: getConfigValue('site.title') or getConfigValue('theme.defaultMode')\n */\nexport function getConfigValue<T = any>(path: string, config?: SpecraConfig): T | undefined {\n const cfg = config || loadConfig({})\n const keys = path.split(\".\")\n let value: any = cfg\n\n for (const key of keys) {\n if (value && typeof value === \"object\" && key in value) {\n value = value[key]\n } else {\n return undefined\n }\n }\n\n return value as T\n}\n\n/**\n * Replace environment variables in a string (SERVER ONLY)\n * Supports ${ENV_VAR} and {{ENV_VAR}} syntax\n */\nexport function replaceEnvVariables(text: string, config?: SpecraConfig): string {\n const cfg = config || loadConfig({})\n const envVars = cfg.env || {}\n\n let result = text\n\n // Replace ${VAR} syntax\n result = result.replace(/\\$\\{([^}]+)\\}/g, (match, varName) => {\n return envVars[varName] || match\n })\n\n // Replace {{VAR}} syntax\n result = result.replace(/\\{\\{([^}]+)\\}\\}/g, (match, varName) => {\n return envVars[varName] || match\n })\n\n return result\n}\n\n/**\n * Process content and replace all environment variables (SERVER ONLY)\n */\nexport function processContentWithEnv(content: string, config?: SpecraConfig): string {\n return replaceEnvVariables(content, config)\n}\n\n/**\n * Validate configuration (basic validation) (SERVER ONLY)\n */\nexport function validateConfig(config: SpecraConfig): { valid: boolean; errors: string[] } {\n const errors: string[] = []\n\n // Required fields\n if (!config.site?.title) {\n errors.push(\"site.title is required\")\n }\n\n // URL validation\n if (config.site?.url) {\n try {\n new URL(config.site.url)\n } catch {\n errors.push(\"site.url must be a valid URL\")\n }\n }\n\n // Social links validation\n if (config.social) {\n const socialKeys = [\"github\", \"twitter\", \"discord\", \"linkedin\", \"youtube\"] as const\n for (const key of socialKeys) {\n const url = config.social[key]\n if (url) {\n try {\n new URL(url)\n } catch {\n errors.push(`social.${key} must be a valid URL`)\n }\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n}\n\n// Singleton instance\nlet configInstance: SpecraConfig | null = null\n\n/**\n * Initialize the Specra configuration\n * Can be called multiple times - subsequent calls will update the config\n * @param userConfig - Partial configuration to merge with defaults\n * @returns The initialized configuration\n */\nexport function initConfig(userConfig: Partial<SpecraConfig>): SpecraConfig {\n configInstance = loadConfig(userConfig)\n return configInstance\n}\n\n/**\n * Get the configuration instance (cached) (SERVER ONLY)\n * If not initialized, returns default config\n */\nexport function getConfig(): SpecraConfig {\n if (!configInstance) {\n // Auto-initialize with defaults if not already initialized\n configInstance = loadConfig({})\n }\n return configInstance\n}\n\n/**\n * Reload the configuration (useful for development) (SERVER ONLY)\n */\nexport function reloadConfig(userConfig: Partial<SpecraConfig>): SpecraConfig {\n configInstance = loadConfig(userConfig)\n return configInstance\n}\n\n/**\n * Export the loaded config as default (SERVER ONLY)\n */\n// export default getConfig()\n","/**\n * Unified sidebar sorting and structure building utilities\n * This module provides consistent sidebar logic across the application\n * to ensure ordering is handled the same way everywhere.\n */\n\nexport interface SidebarGroup {\n label: string\n path: string\n icon?: string\n items: any[]\n position: number\n collapsible: boolean\n defaultCollapsed: boolean\n children: Record<string, SidebarGroup>\n}\n\n/**\n * Sort sidebar items by their position.\n * Items with explicit sidebar_position come first (sorted numerically),\n * followed by items without position (sorted by their original order).\n *\n * @param items - Array of items with optional sidebar_position\n * @returns Sorted array of items\n */\nexport function sortSidebarItems<T extends { sidebar_position?: number; meta?: any }>(items: T[]): T[] {\n return [...items].sort((a, b) => {\n const posA = a.sidebar_position ?? a.meta?.sidebar_position ?? a.meta?.order ?? 999\n const posB = b.sidebar_position ?? b.meta?.sidebar_position ?? b.meta?.order ?? 999\n return posA - posB\n })\n}\n\n/**\n * Sort sidebar groups by their position.\n * Groups with explicit position come first (sorted numerically),\n * followed by groups without position at the end (sorted by their original order).\n *\n * @param groups - Record of group key to group object with position\n * @returns Sorted array of [key, group] tuples\n */\nexport function sortSidebarGroups<T extends { position: number }>(\n groups: Record<string, T>\n): [string, T][] {\n return Object.entries(groups).sort(([, a], [, b]) => {\n const posA = a.position ?? 999\n const posB = b.position ?? 999\n return posA - posB\n })\n}\n\n/**\n * Build hierarchical sidebar structure from flat list of documents\n * This is the single source of truth for sidebar structure used by both\n * the sidebar component and navigation (prev/next) links.\n *\n * @param docs - Array of documents with metadata\n * @returns Object containing root groups and standalone items\n */\nexport function buildSidebarStructure<T extends {\n filePath: string\n slug: string\n categoryLabel?: string\n categoryPosition?: number\n categoryIcon?: string\n categoryCollapsible?: boolean\n categoryCollapsed?: boolean\n meta: any\n}>(docs: T[]): {\n rootGroups: Record<string, SidebarGroup>\n standalone: T[]\n} {\n const rootGroups: Record<string, SidebarGroup> = {}\n const standalone: T[] = []\n\n // First pass: collect category metadata from all docs to build complete folder structure\n const categoryMetadata = new Map<string, {\n label?: string\n position?: number\n icon?: string\n collapsible?: boolean\n collapsed?: boolean\n }>()\n\n docs.forEach((doc) => {\n const pathParts = doc.filePath.split(\"/\")\n const folderPath = pathParts.length > 1 ? pathParts.slice(0, -1).join(\"/\") : \"\"\n\n if (folderPath && doc.categoryLabel) {\n categoryMetadata.set(folderPath, {\n label: doc.categoryLabel,\n position: doc.categoryPosition,\n icon: doc.categoryIcon,\n collapsible: doc.categoryCollapsible,\n collapsed: doc.categoryCollapsed\n })\n }\n })\n\n docs.forEach((doc) => {\n const pathParts = doc.filePath.split(\"/\")\n const isIndexFile = doc.filePath.endsWith(\"/index\") ||\n doc.filePath === \"index\" ||\n (pathParts.length > 1 && doc.slug === pathParts.slice(0, -1).join(\"/\"))\n\n const customGroup = doc.meta.sidebar || doc.meta.group\n\n if (customGroup) {\n const groupName = customGroup.charAt(0).toUpperCase() + customGroup.slice(1)\n if (!rootGroups[groupName]) {\n rootGroups[groupName] = {\n label: groupName,\n path: customGroup,\n items: [],\n position: 999,\n collapsible: doc.categoryCollapsible ?? true,\n defaultCollapsed: doc.categoryCollapsed ?? false,\n children: {}\n }\n }\n if (isIndexFile) {\n // Use categoryPosition if available (from _category_.json), otherwise sidebar_position from frontmatter\n rootGroups[groupName].position = doc.categoryPosition ?? doc.meta.sidebar_position ?? 999\n rootGroups[groupName].icon = doc.categoryIcon\n } else {\n rootGroups[groupName].items.push(doc)\n }\n return\n }\n\n if (pathParts.length > 1) {\n const folderParts = pathParts.slice(0, -1)\n let currentLevel = rootGroups\n let currentPath = \"\"\n\n for (let i = 0; i < folderParts.length; i++) {\n const folder = folderParts[i]\n currentPath = currentPath ? `${currentPath}/${folder}` : folder\n const folderLabel = folder.split(\"-\").map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(\" \")\n\n // Get metadata for this specific folder path\n const metadata = categoryMetadata.get(currentPath)\n\n if (!currentLevel[folder]) {\n currentLevel[folder] = {\n label: metadata?.label ?? folderLabel,\n path: currentPath,\n icon: metadata?.icon,\n items: [],\n position: metadata?.position ?? 999,\n collapsible: metadata?.collapsible ?? true,\n defaultCollapsed: metadata?.collapsed ?? false,\n children: {}\n }\n }\n\n if (i === folderParts.length - 1) {\n if (isIndexFile) {\n // Update position, label, and icon if this is the index file for this folder\n currentLevel[folder].position = doc.categoryPosition ?? doc.meta.sidebar_position ?? currentLevel[folder].position\n if (doc.categoryLabel) {\n currentLevel[folder].label = doc.categoryLabel\n }\n if (doc.categoryIcon) {\n currentLevel[folder].icon = doc.categoryIcon\n }\n if (doc.categoryCollapsible !== undefined) {\n currentLevel[folder].collapsible = doc.categoryCollapsible\n }\n if (doc.categoryCollapsed !== undefined) {\n currentLevel[folder].defaultCollapsed = doc.categoryCollapsed\n }\n } else {\n currentLevel[folder].items.push(doc)\n }\n }\n\n currentLevel = currentLevel[folder].children\n }\n } else {\n if (!isIndexFile) {\n standalone.push(doc)\n }\n }\n })\n\n return { rootGroups, standalone }\n}\n","\n\nexport const COMPONENT_TEXT_PROPS: Record<string, string[]> = {\n // Accordion components\n Accordion: [\"title\"],\n AccordionItem: [\"title\"],\n\n // Alert/Callout components\n Alert: [\"title\", \"description\"],\n Banner: [\"title\"],\n Callout: [\"title\", \"content\"],\n Note: [\"title\"],\n Warning: [\"title\", \"text\"],\n\n // Navigation components\n BreadCrumb: [\"title\", \"slug\", \"version\"],\n\n // Card components\n Card: [\"title\", \"description\"],\n ImageCard: [\"title\", \"description\", \"alt\"],\n\n // Media components\n Image: [\"alt\", \"caption\"],\n Video: [\"caption\"],\n Frame: [\"title\"],\n Mermaid: [\"caption\"],\n\n // Interactive components\n Tooltip: [\"content\"],\n\n // Code components\n CodeBlock: [\"filename\"],\n\n // Step components\n Step: [\"title\"],\n}\n\nexport function extractComponentPropsText(mdx: string): string {\n return mdx.replace(\n /<([A-Z][\\w]*)\\b([^/>]*)\\/>/g,\n (_, component, props) => {\n const searchableProps = COMPONENT_TEXT_PROPS[component]\n if (!searchableProps) return \" \"\n\n let extracted = \"\"\n\n for (const prop of searchableProps) {\n const match = props.match(\n new RegExp(`${prop}=\"([^\"]+)\"`, \"i\")\n )\n if (match) {\n extracted += \" \" + match[1]\n }\n }\n\n return extracted || \" \"\n }\n )\n}\n\nexport function extractSearchText(mdx: string): string {\n return extractComponentPropsText(mdx)\n // 2. Remove fenced code blocks\n .replace(/```[\\s\\S]*?```/g, \" \")\n\n // 3. Remove JSX blocks with children\n .replace(/<([A-Z][\\w]*)\\b[^>]*>[\\s\\S]*?<\\/\\1>/g, \" \")\n\n // 4. Remove remaining JSX & HTML\n .replace(/<\\/?[A-Za-z][^>]*>/g, \" \")\n\n // 5. Remove inline code\n .replace(/`[^`]+`/g, \" \")\n\n // 6. Remove markdown links (keep text)\n .replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, \"$1\")\n\n // 7. Remove markdown noise\n .replace(/[#>*_~=-]+/g, \" \")\n\n // 8. Normalize whitespace\n .replace(/\\s+/g, \" \")\n .trim()\n .slice(0, 1000)\n}","\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { Code2, Wifi } from \"lucide-react\"\n\nexport function DevModeBadge() {\n const [isConnected, setIsConnected] = useState(true)\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Check WebSocket connection status\n const checkConnection = () => {\n setIsConnected(navigator.onLine)\n }\n\n window.addEventListener(\"online\", checkConnection)\n window.addEventListener(\"offline\", checkConnection)\n\n return () => {\n window.removeEventListener(\"online\", checkConnection)\n window.removeEventListener(\"offline\", checkConnection)\n }\n }, [])\n\n if (process.env.NODE_ENV !== \"development\") return null\n\n return (\n <div className=\"fixed top-20 left-4 z-40 flex items-center gap-2 px-3 py-1.5 bg-orange-500/10 text-orange-600 dark:text-orange-400 border border-orange-500/20 rounded-full text-xs font-medium\">\n <Code2 className=\"h-3 w-3\" />\n <span>Dev Mode</span>\n <div className={`h-2 w-2 rounded-full ${isConnected ? \"bg-green-500\" : \"bg-red-500\"} animate-pulse`} />\n </div>\n )\n}\n","import { ExternalLink, FileEdit } from \"lucide-react\"\nimport { MDXRemote, type MDXRemoteProps } from \"next-mdx-remote/rsc\"\nimport remarkGfm from \"remark-gfm\"\nimport rehypeSlug from \"rehype-slug\"\nimport { remarkCodeMeta } from \"@/lib/remark-code-meta\"\nimport { mdxComponents } from \"./mdx-components\"\nimport type { ComponentPropsWithoutRef } from \"react\"\nimport { DocNavigation } from \"./doc-navigation\"\nimport { Breadcrumb } from \"./breadcrumb\"\nimport { DocMetadata } from \"./doc-metadata\"\nimport { DraftBadge } from \"./draft-badge\"\nimport { DocTags } from \"./doc-tags\"\nimport { SearchHighlight } from \"./search-highlight\"\nimport type { DocMeta } from \"@/lib/mdx\"\nimport { getConfig, processContentWithEnv, type SpecraConfig } from \"@/lib/config\"\n\ninterface DocLayoutProps {\n meta: DocMeta\n content: string\n previousDoc?: {\n title: string\n slug: string\n }\n nextDoc?: {\n title: string\n slug: string\n }\n version: string\n slug: string\n config: SpecraConfig\n}\n\n\n\nexport async function DocLayout({ content, meta, previousDoc, nextDoc, version, slug, config }: DocLayoutProps) {\n const isDevelopment = process.env.NODE_ENV === \"development\"\n // const config = getConfig()\n\n // Process content with environment variables\n const processedContent = processContentWithEnv(content, config)\n\n // Build edit URL if configured\n const editUrl = config.features?.editUrl && typeof config.features.editUrl === 'string'\n ? `${config.features.editUrl}/${version}/${slug}.mdx`\n : null\n\n return (\n <article className=\"flex-1 min-w-0\">\n <SearchHighlight />\n\n {config.navigation?.showBreadcrumbs && (\n <Breadcrumb version={version} slug={slug} title={meta.title} />\n )}\n\n {isDevelopment && meta.draft && <DraftBadge />}\n\n <div className=\"mb-8\">\n <h1 className=\"text-4xl font-bold tracking-tight mb-3 text-foreground\">{meta.title}</h1>\n {meta.description && <p className=\"text-lg text-muted-foreground leading-relaxed\">{meta.description}</p>}\n </div>\n\n <DocMetadata meta={meta} config={config} />\n\n <div className=\"prose prose-slate dark:prose-invert max-w-none prose-headings:scroll-mt-24 prose-headings:font-semibold prose-h1:text-4xl prose-h2:text-3xl prose-h2:mt-12 prose-h2:mb-4 prose-h3:text-2xl prose-h3:mt-8 prose-h3:mb-3 prose-p:text-base prose-p:leading-7 prose-p:text-muted-foreground prose-p:mb-4 prose-a:font-normal prose-a:transition-all prose-code:text-primary prose-code:bg-muted/50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:text-[13px] prose-code:font-mono prose-code:border prose-code:border-border/50 prose-code:before:content-none prose-code:after:content-none prose-pre:bg-transparent prose-pre:p-0 prose-ul:list-disc prose-ul:list-inside prose-ul:space-y-2 prose-ul:mb-4 prose-ol:list-decimal prose-ol:list-inside prose-ol:space-y-2 prose-ol:mb-4 prose-li:leading-7 prose-li:text-muted-foreground prose-strong:text-foreground prose-strong:font-semibold\">\n <MDXRemote\n source={processedContent}\n options={{\n parseFrontmatter: false,\n mdxOptions: {\n remarkPlugins: [remarkGfm, remarkCodeMeta],\n rehypePlugins: [rehypeSlug],\n development: false,\n },\n }}\n components={mdxComponents as any}\n />\n </div>\n\n {config.features?.showTags && meta.tags && meta.tags.length > 0 && <DocTags tags={meta.tags} />}\n\n {(editUrl || config.social?.github) && (\n <div className=\"mt-12 pt-6 border-t border-border flex items-center justify-between\">\n {editUrl ? (\n <a\n href={editUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n <FileEdit className=\"h-4 w-4\" />\n Edit this page\n </a>\n ) : <div />}\n {config.social?.github && (\n <a\n href={`${config.social.github}/issues/new`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n <ExternalLink className=\"h-4 w-4\" />\n Report an issue\n </a>\n )}\n </div>\n )}\n\n <DocNavigation previousDoc={previousDoc} nextDoc={nextDoc} version={version} />\n </article>\n )\n}\n","import Link from \"next/link\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\n\ninterface DocNavigationProps {\n previousDoc?: {\n title: string\n slug: string\n }\n nextDoc?: {\n title: string\n slug: string\n }\n version: string\n}\n\nexport function DocNavigation({ previousDoc, nextDoc, version }: DocNavigationProps) {\n if (!previousDoc && !nextDoc) return null\n\n return (\n <div className=\"mt-12 pt-8 border-t border-border grid grid-cols-2 gap-4\">\n {previousDoc ? (\n <Link\n href={`/docs/${version}/${previousDoc.slug}`}\n className=\"group flex flex-col gap-2 p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all\"\n style={{\n textDecoration: \"none !important\"\n }}\n >\n <div className=\"flex items-center gap-2 text-sm text-muted-foreground\">\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </div>\n <div className=\"text-base font-medium text-foreground group-hover:text-primary transition-colors\">\n {previousDoc.title}\n </div>\n </Link>\n ) : (\n <div />\n )}\n\n {nextDoc ? (\n <Link\n href={`/docs/${version}/${nextDoc.slug}`}\n className=\"group flex flex-col gap-2 p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all text-right\"\n style={{\n textDecoration: \"none !important\"\n }}\n >\n <div className=\"flex items-center justify-end gap-2 text-sm text-muted-foreground\">\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </div>\n <div className=\"text-base font-medium text-foreground group-hover:text-primary transition-colors\">\n {nextDoc.title}\n </div>\n </Link>\n ) : (\n <div />\n )}\n </div>\n )\n}\n","import { Clock, Calendar, User } from \"lucide-react\"\nimport type { DocMeta } from \"@/lib/mdx\"\nimport { getConfig, SpecraConfig } from \"@/lib/config\"\n\ninterface DocMetadataProps {\n meta: DocMeta\n config: SpecraConfig\n}\n\nexport function DocMetadata({ meta, config }: DocMetadataProps) {\n // Server component - can use getConfig directly\n // const config = getConfig()\n \n const showReadingTime = config.features?.showReadingTime && meta.reading_time\n const showLastUpdated = config.features?.showLastUpdated && meta.last_updated\n const showAuthors = config.features?.showAuthors && meta.authors?.length\n \n const hasMetadata = showReadingTime || showLastUpdated || showAuthors\n\n if (!hasMetadata) {\n return null\n }\n\n return (\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-muted-foreground border-b border-border pb-4 mb-6\">\n {showReadingTime && (\n <div className=\"flex items-center gap-1.5\">\n <Clock className=\"h-4 w-4\" />\n <span>{meta.reading_time} min read</span>\n </div>\n )}\n \n {showLastUpdated && meta.last_updated && (\n <div className=\"flex items-center gap-1.5\">\n <Calendar className=\"h-4 w-4\" />\n <span>Updated {new Date(meta.last_updated).toLocaleDateString()}</span>\n </div>\n )}\n \n {showAuthors && (\n <div className=\"flex items-center gap-1.5\">\n <User className=\"h-4 w-4\" />\n <span>\n {meta.authors!.map((author, idx) => (\n <span key={author.id}>\n {author.name || author.id}\n {idx < meta.authors!.length - 1 && \", \"}\n </span>\n ))}\n </span>\n </div>\n )}\n </div>\n )\n}\n","import { FileWarning } from \"lucide-react\"\n\nexport function DraftBadge() {\n return (\n <div className=\"inline-flex items-center gap-2 px-3 py-1.5 rounded-md bg-yellow-500/10 border border-yellow-500/20 text-yellow-600 dark:text-yellow-400 text-sm font-medium mb-4\">\n <FileWarning className=\"h-4 w-4\" />\n <span>Draft - Not visible in production</span>\n </div>\n )\n}\n","import { Tag } from \"lucide-react\"\n\ninterface DocTagsProps {\n tags: string[]\n}\n\nexport function DocTags({ tags }: DocTagsProps) {\n if (!tags || tags.length === 0) {\n return null\n }\n\n return (\n <div className=\"flex flex-wrap items-center gap-2 mt-6 pt-6 border-t border-border\">\n <Tag className=\"h-4 w-4 text-muted-foreground\" />\n {tags.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-primary/10 text-primary border border-primary/20\"\n >\n {tag}\n </span>\n ))}\n </div>\n )\n}\n","\"use client\"\n\nimport { useEffect } from \"react\"\nimport { useSearchParams } from \"next/navigation\"\n\nexport function SearchHighlight() {\n const searchParams = useSearchParams()\n const query = searchParams.get(\"q\")\n\n useEffect(() => {\n if (!query) {\n // Remove any existing highlights\n document.querySelectorAll(\"mark.search-highlight\").forEach((mark) => {\n const parent = mark.parentNode\n if (parent) {\n parent.replaceChild(document.createTextNode(mark.textContent || \"\"), mark)\n parent.normalize()\n }\n })\n return\n }\n\n // Wait for content to load\n const timeout = setTimeout(() => {\n highlightSearchTerm(query)\n }, 100)\n\n return () => {\n clearTimeout(timeout)\n // Cleanup highlights on unmount\n document.querySelectorAll(\"mark.search-highlight\").forEach((mark) => {\n const parent = mark.parentNode\n if (parent) {\n parent.replaceChild(document.createTextNode(mark.textContent || \"\"), mark)\n parent.normalize()\n }\n })\n }\n }, [query])\n\n return null\n}\n\nfunction highlightSearchTerm(searchTerm: string) {\n // Remove existing highlights first\n document.querySelectorAll(\"mark.search-highlight\").forEach((mark) => {\n const parent = mark.parentNode\n if (parent) {\n parent.replaceChild(document.createTextNode(mark.textContent || \"\"), mark)\n parent.normalize()\n }\n })\n\n // Only highlight in the main content area\n const contentArea = document.querySelector(\"main\") || document.body\n \n const walker = document.createTreeWalker(\n contentArea,\n NodeFilter.SHOW_TEXT,\n {\n acceptNode: (node) => {\n // Skip if parent is already a mark, script, style, or code element\n const parent = node.parentElement\n if (!parent) return NodeFilter.FILTER_REJECT\n \n const tagName = parent.tagName.toLowerCase()\n if ([\"mark\", \"script\", \"style\", \"code\", \"pre\"].includes(tagName)) {\n return NodeFilter.FILTER_REJECT\n }\n \n // Check if text contains the search term\n if (node.textContent && node.textContent.toLowerCase().includes(searchTerm.toLowerCase())) {\n return NodeFilter.FILTER_ACCEPT\n }\n \n return NodeFilter.FILTER_REJECT\n }\n }\n )\n\n const nodesToHighlight: { node: Text; text: string }[] = []\n let currentNode: Node | null\n\n while ((currentNode = walker.nextNode())) {\n if (currentNode.textContent) {\n nodesToHighlight.push({\n node: currentNode as Text,\n text: currentNode.textContent\n })\n }\n }\n\n // Highlight all found nodes\n nodesToHighlight.forEach(({ node, text }) => {\n const regex = new RegExp(`(${escapeRegex(searchTerm)})`, \"gi\")\n const parts = text.split(regex)\n \n if (parts.length > 1) {\n const fragment = document.createDocumentFragment()\n \n parts.forEach((part) => {\n if (part.toLowerCase() === searchTerm.toLowerCase()) {\n const mark = document.createElement(\"mark\")\n mark.className = \"search-highlight bg-yellow-200 dark:bg-yellow-900/50 text-foreground px-1 rounded\"\n mark.textContent = part\n fragment.appendChild(mark)\n } else if (part) {\n fragment.appendChild(document.createTextNode(part))\n }\n })\n \n node.parentNode?.replaceChild(fragment, node)\n }\n })\n\n // Scroll to first highlight\n const firstHighlight = document.querySelector(\"mark.search-highlight\")\n if (firstHighlight) {\n setTimeout(() => {\n firstHighlight.scrollIntoView({ behavior: \"smooth\", block: \"center\" })\n }, 200)\n }\n}\n\nfunction escapeRegex(string: string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n","\"use client\"\n\nimport { ReactNode, useEffect, useRef } from \"react\"\nimport { MobileDocLayout } from \"./mobile-doc-layout\"\nimport { useTabContext } from \"./tab-context\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport type { Doc } from \"@/lib/mdx\"\n\ninterface DocLayoutWrapperProps {\n header: ReactNode\n docs: Doc[]\n version: string\n content: ReactNode\n toc: ReactNode\n config: SpecraConfig\n currentPageTabGroup?: string\n}\n\nexport function DocLayoutWrapper({ header, docs, version, content, toc, config, currentPageTabGroup }: DocLayoutWrapperProps) {\n // Use global tab context instead of local state\n const { activeTabGroup, setActiveTabGroup } = useTabContext()\n const lastPageTabGroupRef = useRef<string | undefined>(undefined)\n const isInitialMount = useRef(true)\n\n // Set tab based on page's tab group\n useEffect(() => {\n // On initial mount, always set to current page's tab group\n if (isInitialMount.current && currentPageTabGroup) {\n setActiveTabGroup(currentPageTabGroup)\n lastPageTabGroupRef.current = currentPageTabGroup\n isInitialMount.current = false\n return\n }\n\n // On subsequent renders, only update if navigating to a different page\n if (currentPageTabGroup && lastPageTabGroupRef.current !== currentPageTabGroup) {\n setActiveTabGroup(currentPageTabGroup)\n lastPageTabGroupRef.current = currentPageTabGroup\n }\n }, [currentPageTabGroup, setActiveTabGroup])\n\n return (\n <MobileDocLayout\n header={header}\n docs={docs}\n version={version}\n content={content}\n toc={toc}\n config={config}\n activeTabGroup={activeTabGroup}\n onTabChange={setActiveTabGroup}\n />\n )\n}\n","\"use client\"\n\nimport { useState, ReactNode, cloneElement, isValidElement } from \"react\"\nimport { Footer } from \"./footer\"\nimport { SiteBanner } from \"./site-banner\"\nimport { TabGroups } from \"./tab-groups\"\nimport { Sidebar } from \"./sidebar\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport type { Doc } from \"@/lib/mdx\"\n\ninterface MobileDocLayoutProps {\n header: ReactNode\n docs: Doc[]\n version: string\n content: ReactNode\n toc: ReactNode\n config: SpecraConfig\n activeTabGroup?: string\n onTabChange?: (tabId: string) => void\n}\n\nexport function MobileDocLayout({ header, docs, version, content, toc, config, activeTabGroup, onTabChange }: MobileDocLayoutProps) {\n const [sidebarOpen, setSidebarOpen] = useState(false)\n\n const handleTabChange = (tabId: string) => {\n onTabChange?.(tabId)\n }\n\n const closeSidebar = () => setSidebarOpen(false)\n const toggleSidebar = () => setSidebarOpen(!sidebarOpen)\n\n // Clone header and pass onMenuClick prop if it's a valid React element\n const headerWithProps = isValidElement(header)\n ? cloneElement(header as React.ReactElement<any>, {\n onMenuClick: toggleSidebar,\n })\n : header\n\n return (\n <div className=\"min-h-screen bg-background\">\n {/* Header */}\n {headerWithProps}\n\n {/* Site-wide Banner */}\n <SiteBanner config={config} />\n\n {/* Tab Groups - shown only if configured */}\n {config.navigation?.tabGroups && config.navigation.tabGroups.length > 0 && (\n <TabGroups\n tabGroups={config.navigation.tabGroups}\n activeTabId={activeTabGroup}\n onTabChange={handleTabChange}\n />\n )}\n\n {/* Mobile Sidebar Overlay */}\n {sidebarOpen && (\n <div\n className=\"lg:hidden fixed inset-0 bg-background/80 backdrop-blur-sm z-40\"\n onClick={() => setSidebarOpen(false)}\n />\n )}\n\n {/* Mobile Sidebar */}\n <div\n className={`lg:hidden fixed top-0 left-0 h-full w-64 bg-background border-r border-border z-40 transform transition-transform duration-300 ease-in-out overflow-y-auto ${sidebarOpen ? \"translate-x-0\" : \"-translate-x-full\"\n }`}\n >\n <div className=\"pt-20 px-4\">\n <Sidebar\n docs={docs}\n version={version}\n config={config}\n onLinkClick={closeSidebar}\n activeTabGroup={activeTabGroup}\n />\n </div>\n </div>\n\n {/* Main Content */}\n <main className=\"container mx-auto px-6 py-8\">\n <div className=\"flex\">\n {/* Desktop Sidebar */}\n <div className=\"hidden lg:block\">\n <Sidebar\n docs={docs}\n version={version}\n config={config}\n activeTabGroup={activeTabGroup}\n />\n </div>\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex flex-col gap-2 px-2 md:px-8\">\n {/* Content */}\n {content}\n\n {/* Footer */}\n <Footer config={config} />\n\n </div>\n </div>\n\n {/* ToC */}\n {toc}\n </div>\n\n\n </main>\n\n\n\n </div>\n )\n}\n","import Link from \"next/link\"\nimport { getConfig, SpecraConfig } from \"@/lib/config\"\n\nexport function Footer({ config }: { config: SpecraConfig }) {\n // Server component - can use getConfig directly\n // const config = getConfig()\n\n if (!config.footer) {\n return null\n }\n\n return (\n <footer className=\"bg-muted/30 dark:bg-muted/10 rounded-2xl mt-24\">\n <div className=\"px-6 py-12\">\n {config.footer.links && config.footer.links.length > 0 && (\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-8 mb-8\">\n {config.footer.links.map((column, idx) => (\n <div key={idx}>\n <h3 className=\"font-semibold text-foreground mb-4\">{column.title}</h3>\n <ul className=\"space-y-2\">\n {column.items.map((item, itemIdx) => (\n <li key={itemIdx}>\n <Link\n href={item.href}\n className=\"text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n {item.label}\n </Link>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n )}\n\n {config.footer.copyright && (\n <div className=\"pt-8\">\n <p className=\"text-sm text-muted-foreground text-center\">\n {config.footer.copyright}\n </p>\n </div>\n )}\n </div>\n </footer>\n )\n}\n","\"use client\"\n\nimport { X, AlertCircle, CheckCircle, Info, XCircle } from \"lucide-react\"\nimport { useState, useEffect } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\n\ninterface SiteBannerProps {\n config: SpecraConfig\n}\n\nexport function SiteBanner({ config }: SiteBannerProps) {\n const [dismissed, setDismissed] = useState(false)\n const [mounted, setMounted] = useState(false)\n \n const banner = config.banner\n const storageKey = \"site-banner-dismissed\"\n \n useEffect(() => {\n setMounted(true)\n // Check if banner was previously dismissed\n const isDismissed = localStorage.getItem(storageKey) === \"true\"\n setDismissed(isDismissed)\n }, [])\n \n const handleDismiss = () => {\n setDismissed(true)\n localStorage.setItem(storageKey, \"true\")\n }\n \n // Don't render on server or if no banner configured or if dismissed\n if (!mounted || !banner || !banner.enabled || dismissed) {\n return null\n }\n\n const typeConfig = {\n info: {\n icon: Info,\n bg: \"bg-blue-500/10 dark:bg-blue-400/5\",\n border: \"border-blue-500/30 dark:border-blue-500/20\",\n iconColor: \"text-blue-600 dark:text-blue-400\",\n textColor: \"text-blue-900 dark:text-blue-300\",\n },\n success: {\n icon: CheckCircle,\n bg: \"bg-green-500/10 dark:bg-green-400/5\",\n border: \"border-green-500/30 dark:border-green-500/20\",\n iconColor: \"text-green-600 dark:text-green-400\",\n textColor: \"text-green-900 dark:text-green-300\",\n },\n warning: {\n icon: AlertCircle,\n bg: \"bg-yellow-500/10 dark:bg-yellow-400/5\",\n border: \"border-yellow-500/30 dark:border-yellow-500/20\",\n iconColor: \"text-yellow-600 dark:text-yellow-400\",\n textColor: \"text-yellow-900 dark:text-yellow-300\",\n },\n error: {\n icon: XCircle,\n bg: \"bg-red-500/10 dark:bg-red-400/5\",\n border: \"border-red-500/30 dark:border-red-500/20\",\n iconColor: \"text-red-600 dark:text-red-400\",\n textColor: \"text-red-900 dark:text-red-300\",\n },\n }\n\n const type = banner.type || \"info\"\n const { icon: IconComponent, bg, border, iconColor, textColor } = typeConfig[type]\n\n return (\n <div className={`w-full border-b ${border} ${bg}`}>\n <div className=\"container mx-auto px-6 py-3\">\n <div className=\"flex items-center gap-3\">\n <IconComponent className={`h-5 w-5 shrink-0 ${iconColor}`} />\n <div className=\"flex-1 min-w-0\">\n <p className={`text-sm font-medium ${textColor}`}>\n {banner.message}\n </p>\n </div>\n {banner.dismissible && (\n <button\n onClick={handleDismiss}\n className={`shrink-0 p-1 rounded-md hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${iconColor}`}\n aria-label=\"Dismiss banner\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport { Icon } from \"./icon\"\nimport type { TabGroup } from \"@/lib/config.types\"\n\ninterface TabGroupsProps {\n tabGroups: TabGroup[]\n activeTabId?: string\n onTabChange?: (tabId: string) => void\n}\n\nexport function TabGroups({ tabGroups, activeTabId, onTabChange }: TabGroupsProps) {\n const activeTab = activeTabId || tabGroups[0]?.id || \"\"\n\n const handleTabChange = (tabId: string) => {\n onTabChange?.(tabId)\n }\n\n if (!tabGroups || tabGroups.length === 0) {\n return null\n }\n\n return (\n <div className=\"sticky top-16 z-30 border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60\">\n <div className=\"container mx-auto px-6\">\n <nav className=\"flex gap-1 overflow-x-auto no-scrollbar\" aria-label=\"Documentation tabs\">\n {tabGroups.map((tab) => {\n const isActive = tab.id === activeTab\n\n return (\n <button\n key={tab.id}\n onClick={() => handleTabChange(tab.id)}\n className={`flex items-center gap-2 px-4 py-3 text-sm font-medium whitespace-nowrap transition-all border-b-2 ${\n isActive\n ? \"border-primary text-primary\"\n : \"border-transparent text-muted-foreground hover:text-foreground hover:border-border\"\n }`}\n aria-current={isActive ? \"page\" : undefined}\n >\n {tab.icon && <Icon icon={tab.icon} size={16} className=\"shrink-0\" />}\n {tab.label}\n </button>\n )\n })}\n </nav>\n </div>\n </div>\n )\n}\n","\"use client\"\n\nimport Link from \"next/link\"\nimport { usePathname } from \"next/navigation\"\nimport { ChevronRight, ChevronDown, FolderOpen } from \"lucide-react\"\nimport { useState } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport { Icon } from \"./icon\"\nimport { sortSidebarItems, sortSidebarGroups } from \"@/lib/sidebar-utils\"\n\ninterface DocItem {\n title: string\n slug: string\n filePath: string\n section?: string\n group?: string\n sidebar?: string\n sidebar_position?: number\n categoryLabel?: string\n categoryPosition?: number\n categoryCollapsible?: boolean\n categoryCollapsed?: boolean\n categoryIcon?: string // Icon from _category_.json\n categoryTabGroup?: string // Tab group from _category_.json\n meta?: {\n icon?: string // Icon name from frontmatter\n tab_group?: string // Tab group from frontmatter\n [key: string]: any\n }\n}\n\ninterface SidebarProps {\n docs: DocItem[]\n version: string\n onLinkClick?: () => void\n config: SpecraConfig\n activeTabGroup?: string // Current active tab group filter\n}\n\ninterface SidebarGroup {\n label: string\n path: string // Path for navigation (e.g., \"components\" for /docs/v1.0.0/components)\n icon?: string // Icon from _category_.json\n items: DocItem[]\n position: number\n collapsible: boolean\n defaultCollapsed: boolean\n children: Record<string, SidebarGroup>\n}\n\nexport function Sidebar({ docs, version, onLinkClick, config, activeTabGroup }: SidebarProps) {\n const pathname = usePathname()\n const [collapsed, setCollapsed] = useState<Record<string, boolean>>(() => {\n const initial: Record<string, boolean> = {}\n return initial\n })\n\n if (!config.navigation?.showSidebar) {\n return null\n }\n\n // Filter docs by active tab group if tab groups are configured\n const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0\n const filteredDocs = hasTabGroups && activeTabGroup\n ? docs.filter((doc) => {\n // Get tab group from either frontmatter or category config\n const docTabGroup = doc.meta?.tab_group || doc.categoryTabGroup\n\n // If doc has no tab group, include it in the first tab group\n if (!docTabGroup) {\n return activeTabGroup === config.navigation?.tabGroups?.[0]?.id\n }\n\n return docTabGroup === activeTabGroup\n })\n : docs\n\n // Build a hierarchical tree structure\n const rootGroups: Record<string, SidebarGroup> = {}\n const standalone: DocItem[] = []\n\n filteredDocs.forEach((doc) => {\n const pathParts = doc.filePath.split(\"/\")\n const isIndexFile = doc.filePath.endsWith(\"/index\") ||\n doc.filePath === \"index\" ||\n (pathParts.length > 1 && doc.slug === pathParts.slice(0, -1).join(\"/\"))\n\n // Use the sidebar or group from frontmatter if provided\n const customGroup = doc.sidebar || doc.group\n\n if (customGroup) {\n const groupName = customGroup.charAt(0).toUpperCase() + customGroup.slice(1)\n if (!rootGroups[groupName]) {\n rootGroups[groupName] = {\n label: groupName,\n path: customGroup,\n items: [],\n position: 999,\n collapsible: doc.categoryCollapsible ?? true,\n defaultCollapsed: doc.categoryCollapsed ?? false,\n children: {}\n }\n }\n if (isIndexFile) {\n rootGroups[groupName].position = doc.sidebar_position ?? 999\n rootGroups[groupName].icon = doc.categoryIcon\n } else {\n rootGroups[groupName].items.push(doc)\n }\n return\n }\n\n // Build nested structure based on folder path\n if (pathParts.length > 1) {\n const folderParts = pathParts.slice(0, -1) // All folders except the file\n\n // Navigate/create the tree structure\n let currentLevel = rootGroups\n let currentPath = \"\"\n\n for (let i = 0; i < folderParts.length; i++) {\n const folder = folderParts[i]\n currentPath = currentPath ? `${currentPath}/${folder}` : folder\n const folderLabel = folder.split(\"-\").map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(\" \")\n\n if (!currentLevel[folder]) {\n currentLevel[folder] = {\n label: doc.categoryLabel && i === folderParts.length - 1 ? doc.categoryLabel : folderLabel,\n path: currentPath,\n icon: doc.categoryIcon,\n items: [],\n position: doc.categoryPosition ?? 999,\n collapsible: doc.categoryCollapsible ?? true,\n defaultCollapsed: doc.categoryCollapsed ?? false,\n children: {}\n }\n }\n\n // If this is the deepest folder (where the file lives), add the doc\n if (i === folderParts.length - 1) {\n if (isIndexFile) {\n currentLevel[folder].position = doc.categoryPosition ?? doc.sidebar_position ?? 999\n // Update label and icon from category config if available\n if (doc.categoryLabel) {\n currentLevel[folder].label = doc.categoryLabel\n }\n if (doc.categoryIcon) {\n currentLevel[folder].icon = doc.categoryIcon\n }\n } else {\n currentLevel[folder].items.push(doc)\n }\n }\n\n currentLevel = currentLevel[folder].children\n }\n } else {\n if (!isIndexFile) {\n standalone.push(doc)\n }\n }\n })\n\n const toggleSection = (section: string) => {\n setCollapsed((prev) => ({ ...prev, [section]: !prev[section] }))\n }\n\n // Recursive component to render nested groups\n const renderGroup = (groupKey: string, group: SidebarGroup, depth: number = 0) => {\n const sortedItems = sortSidebarItems(group.items)\n const sortedChildren = sortSidebarGroups(group.children)\n const hasChildren = sortedChildren.length > 0\n const hasItems = sortedItems.length > 0\n const hasContent = hasChildren || hasItems\n\n // Check if any item in this group (or nested children) is active\n const isActiveInGroup = (g: SidebarGroup): boolean => {\n const hasActiveItem = g.items.some((doc) => pathname === `/docs/${version}/${doc.slug}`)\n if (hasActiveItem) return true\n return Object.values(g.children).some(child => isActiveInGroup(child))\n }\n\n const hasActiveItem = isActiveInGroup(group)\n const isGroupActive = pathname === `/docs/${version}/${group.path}`\n const isCollapsed = hasActiveItem || isGroupActive ? false : (collapsed[groupKey] ?? group.defaultCollapsed)\n const marginLeft = depth > 0 ? \"ml-4\" : \"\"\n const groupHref = `/docs/${version}/${group.path}`\n\n return (\n <div key={`group-${groupKey}`} className={`space-y-1 ${marginLeft}`}>\n {/* Group header: Docusaurus-style with clickable label and chevron toggle */}\n <div className=\"flex items-center group\">\n {/* Icon + Label (clickable, navigates to index) */}\n <Link\n href={groupHref}\n onClick={onLinkClick}\n className={`flex items-center gap-2 flex-1 px-3 py-2 text-sm font-semibold rounded-l-xl transition-all ${isGroupActive\n ? \"bg-primary/10 text-primary\"\n : \"text-foreground hover:bg-accent/50\"\n }`}\n >\n {group.icon ? (\n <Icon icon={group.icon} size={16} className=\"shrink-0\" />\n ) : (\n <FolderOpen size={16} className=\"shrink-0\" />\n )}\n {group.label}\n </Link>\n\n {/* Chevron toggle (only if has content and is collapsible) */}\n {hasContent && group.collapsible && config.navigation?.collapsibleSidebar && (\n <button\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n toggleSection(groupKey)\n }}\n className={`p-2 rounded-r-xl transition-all ${isGroupActive ? \"hover:bg-primary/20\" : \"hover:bg-accent/50\"}`}\n aria-label={isCollapsed ? \"Expand section\" : \"Collapse section\"}\n >\n {isCollapsed ? (\n <ChevronRight className={`h-4 w-4 ${isGroupActive ? \"text-primary\" : \"text-muted-foreground\"}`} />\n ) : (\n <ChevronDown className={`h-4 w-4 ${isGroupActive ? \"text-primary\" : \"text-muted-foreground\"}`} />\n )}\n </button>\n )}\n </div>\n\n {/* Children (shown when not collapsed) */}\n {!isCollapsed && hasContent && (\n <div className=\"ml-4 space-y-1\">\n {/* Merge and sort both child groups and items by position */}\n {(() => {\n // Create a unified list with type indicators\n const merged: Array<{type: 'group', key: string, group: SidebarGroup, position: number} | {type: 'item', doc: DocItem, position: number}> = [\n ...sortedChildren.map(([childKey, childGroup]) => ({\n type: 'group' as const,\n key: childKey,\n group: childGroup,\n position: childGroup.position\n })),\n ...sortedItems.map((doc) => ({\n type: 'item' as const,\n doc,\n position: doc.sidebar_position ?? doc.meta?.sidebar_position ?? doc.meta?.order ?? 999\n }))\n ]\n\n // Sort by position\n merged.sort((a, b) => a.position - b.position)\n\n // Render in sorted order\n return merged.map((item) => {\n if (item.type === 'group') {\n return renderGroup(`${groupKey}/${item.key}`, item.group, depth + 1)\n } else {\n const href = `/docs/${version}/${item.doc.slug}`\n const isActive = pathname === href\n\n return (\n <Link\n key={`grouped-${item.doc.slug}`}\n href={href}\n onClick={onLinkClick}\n className={`flex items-center gap-2 px-3 py-2 text-sm rounded-xl transition-all ${isActive\n ? \"bg-primary/10 text-primary font-medium\"\n : \"text-foreground hover:text-foreground hover:bg-accent/50\"\n }`}\n >\n {item.doc.meta?.icon && <Icon icon={item.doc.meta.icon} size={16} className=\"shrink-0\" />}\n {item.doc.title}\n </Link>\n )\n }\n })\n })()}\n </div>\n )}\n </div>\n )\n }\n\n const sortedRootGroups = sortSidebarGroups(rootGroups)\n const sortedStandalone = sortSidebarItems(standalone)\n\n // Adjust top position based on whether tabs are present\n const stickyTop = hasTabGroups ? \"top-[7.5rem]\" : \"top-24\"\n const maxHeight = hasTabGroups ? \"max-h-[calc(100vh-10rem)]\" : \"max-h-[calc(100vh-7rem)]\"\n\n return (\n <aside className={`w-64 shrink-0 sticky ${stickyTop} self-start`}>\n <div className={`${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`}>\n <h2 className=\"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2\">Documentation</h2>\n <nav className=\"space-y-1\">\n {/* Standalone pages (not in folders) */}\n {sortedStandalone.length > 0 && sortedStandalone.map((doc) => {\n const href = `/docs/${version}/${doc.slug}`\n const isActive = pathname === href\n\n return (\n <Link\n key={`standalone-${doc.slug}`}\n href={href}\n onClick={onLinkClick}\n className={`flex items-center gap-2 px-3 py-2 text-sm rounded-xl transition-all ${isActive\n ? \"bg-primary/10 text-primary font-medium\"\n : \"text-foreground hover:text-foreground hover:bg-accent/50\"\n }`}\n >\n {doc.meta?.icon && <Icon icon={doc.meta.icon} size={16} className=\"shrink-0\" />}\n {doc.title}\n </Link>\n )\n })}\n\n {/* Grouped pages (in folders) - now hierarchical */}\n {sortedRootGroups.map(([groupKey, group]) => renderGroup(groupKey, group, 0))}\n </nav>\n </div>\n </aside>\n )\n}\n","\"use client\"\n\nimport { createContext, useContext, useState, ReactNode } from \"react\"\n\ninterface TabContextType {\n activeTabGroup: string\n setActiveTabGroup: (tabId: string) => void\n}\n\nconst TabContext = createContext<TabContextType | undefined>(undefined)\n\nexport function TabProvider({ children, defaultTab }: { children: ReactNode; defaultTab: string }) {\n const [activeTabGroup, setActiveTabGroup] = useState(defaultTab)\n\n return (\n <TabContext.Provider value={{ activeTabGroup, setActiveTabGroup }}>\n {children}\n </TabContext.Provider>\n )\n}\n\nexport function useTabContext() {\n const context = useContext(TabContext)\n if (!context) {\n throw new Error(\"useTabContext must be used within TabProvider\")\n }\n return context\n}\n","export function DocLoading() {\n return (\n <div className=\"max-w-4xl mx-auto px-6 py-8\">\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-gray-200 rounded w-3/4\" />\n <div className=\"h-4 bg-gray-200 rounded w-1/2\" />\n <div className=\"space-y-3 mt-8\">\n <div className=\"h-4 bg-gray-200 rounded\" />\n <div className=\"h-4 bg-gray-200 rounded w-5/6\" />\n <div className=\"h-4 bg-gray-200 rounded w-4/6\" />\n </div>\n </div>\n </div>\n )\n}","\"use client\"\n\nimport Link from \"next/link\"\nimport { Search, Menu, Github, Twitter, MessageCircle } from \"lucide-react\"\nimport { Button } from \"@/components/ui/button\"\nimport { VersionSwitcher } from \"./version-switcher\"\nimport { ThemeToggle } from \"./theme-toggle\"\nimport { SearchModal } from \"./search-modal\"\nimport { useState, useEffect } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport { useConfig } from \"@/lib/config.context\"\nimport { getAssetPath } from \"@/lib/utils\"\n\ninterface HeaderProps {\n currentVersion: string\n versions: string[]\n onMenuClick?: () => void\n config?: SpecraConfig // Made optional since we can get it from context\n}\n\nexport function Header({ currentVersion, versions, onMenuClick, config: configProp }: HeaderProps) {\n // Use config from context if not provided as prop\n const contextConfig = useConfig()\n const config = configProp || contextConfig\n const [searchOpen, setSearchOpen] = useState(false)\n\n // Keyboard shortcut for search (Cmd+K or Ctrl+K)\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.metaKey || e.ctrlKey) && e.key === \"k\") {\n e.preventDefault()\n setSearchOpen(true)\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [])\n\n return (\n <header className=\"sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60\">\n <div className=\"container flex h-16 items-center justify-between px-6 mx-auto\">\n <div className=\"flex items-center gap-2\">\n <button \n onClick={onMenuClick}\n className=\"lg:hidden hover:bg-muted p-2 rounded-md transition-colors\"\n aria-label=\"Toggle menu\"\n >\n <Menu className=\"h-5 w-5\" />\n </button>\n <Link href=\"/\" className=\"flex items-center gap-2\">\n {config.site.logo ? (\n <img src={getAssetPath(config.site.logo)} alt={config.site.title} className=\"h-8 w-auto\" />\n ) : (\n <div className=\"h-8 w-8 rounded-xl bg-primary flex items-center justify-center\">\n <span className=\"text-primary-foreground font-bold text-lg\">\n {config.site.title.charAt(0).toUpperCase()}\n </span>\n </div>\n )}\n <span className=\"font-semibold text-lg text-foreground\">{config.site.title ?? \"Specra\"}</span>\n </Link>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {config.search?.enabled && (\n <button\n onClick={() => setSearchOpen(true)}\n className=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground bg-muted rounded-md transition-colors\"\n >\n <Search className=\"h-4 w-4\" />\n <span className=\"hidden sm:inline\">{config.search.placeholder || \"Search\"}</span>\n <kbd className=\"hidden sm:inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-background px-1.5 font-mono text-xs font-medium\">\n ⌘K\n </kbd>\n </button>\n )}\n\n {config.features?.versioning && (\n <VersionSwitcher currentVersion={currentVersion} versions={versions} />\n )}\n\n {/* Social Links */}\n {config.social?.github && (\n <a\n href={config.social.github}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors\"\n aria-label=\"GitHub\"\n >\n <Github className=\"h-4 w-4\" />\n </a>\n )}\n {config.social?.twitter && (\n <a\n href={config.social.twitter}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors\"\n aria-label=\"Twitter\"\n >\n <Twitter className=\"h-4 w-4\" />\n </a>\n )}\n {config.social?.discord && (\n <a\n href={config.social.discord}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors\"\n aria-label=\"Discord\"\n >\n <MessageCircle className=\"h-4 w-4\" />\n </a>\n )}\n\n <ThemeToggle />\n </div>\n </div>\n\n {/* Search Modal */}\n <SearchModal isOpen={searchOpen} onClose={() => setSearchOpen(false)} config={config} />\n </header>\n )\n}\n","\"use client\"\n\nimport { useState } from \"react\"\nimport { Check, ChevronDown } from \"lucide-react\"\nimport { useRouter } from \"next/navigation\"\n\ninterface VersionSwitcherProps {\n currentVersion: string\n versions: string[]\n}\n\nexport function VersionSwitcher({ currentVersion, versions }: VersionSwitcherProps) {\n const [open, setOpen] = useState(false)\n const router = useRouter()\n\n const handleVersionChange = (version: string) => {\n router.push(`/docs/${version}`)\n setOpen(false)\n }\n\n return (\n <div className=\"relative\">\n <button\n onClick={() => setOpen(!open)}\n className=\"flex items-center gap-2 px-3 py-2 text-sm text-foreground bg-muted rounded-md hover:bg-muted/80 transition-colors\"\n >\n <span className=\"font-medium\">{currentVersion}</span>\n <ChevronDown className=\"h-4 w-4\" />\n </button>\n\n {open && (\n <>\n <div className=\"fixed inset-0 z-40\" onClick={() => setOpen(false)} />\n <div className=\"absolute right-0 mt-2 w-48 bg-background border border-border rounded-md shadow-lg z-50\">\n <div className=\"p-2\">\n {versions.map((version) => (\n <button\n key={version}\n onClick={() => handleVersionChange(version)}\n className=\"flex items-center justify-between w-full px-3 py-2 text-sm text-foreground hover:bg-muted rounded-md transition-colors\"\n >\n <span>{version}</span>\n {version === currentVersion && <Check className=\"h-4 w-4 text-primary\" />}\n </button>\n ))}\n </div>\n </div>\n </>\n )}\n </div>\n )\n}\n","\"use client\"\n\nimport { Moon, Sun } from \"lucide-react\"\nimport { useEffect, useState } from \"react\"\n\nexport function ThemeToggle() {\n const [theme, setTheme] = useState<\"light\" | \"dark\">(\"dark\")\n\n useEffect(() => {\n // Check for saved theme preference or default to dark\n const savedTheme = localStorage.getItem(\"theme\") as \"light\" | \"dark\" | null\n const prefersDark = window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n const initialTheme = savedTheme || (prefersDark ? \"dark\" : \"light\")\n \n setTheme(initialTheme)\n document.documentElement.classList.toggle(\"dark\", initialTheme === \"dark\")\n }, [])\n\n const toggleTheme = () => {\n const newTheme = theme === \"dark\" ? \"light\" : \"dark\"\n setTheme(newTheme)\n localStorage.setItem(\"theme\", newTheme)\n document.documentElement.classList.toggle(\"dark\", newTheme === \"dark\")\n }\n\n return (\n <button\n onClick={toggleTheme}\n className=\"flex items-center justify-center w-9 h-9 rounded-md border border-border bg-background hover:bg-accent transition-colors\"\n aria-label=\"Toggle theme\"\n >\n {theme === \"dark\" ? (\n <Sun className=\"h-4 w-4 text-foreground\" />\n ) : (\n <Moon className=\"h-4 w-4 text-foreground\" />\n )}\n </button>\n )\n}\n","\"use client\"\n\nimport { useState, useEffect, useCallback } from \"react\"\nimport { Search, FileText, Loader2 } from \"lucide-react\"\nimport { useRouter } from \"next/navigation\"\nimport type { SpecraConfig } from \"@/lib/config\"\nimport {\n Dialog,\n DialogContent,\n} from \"@/components/ui/dialog\"\n\ninterface SearchResult {\n id: string\n title: string\n content: string\n slug: string\n version: string\n category?: string\n}\n\ninterface SearchModalProps {\n isOpen: boolean\n onClose: () => void\n config: SpecraConfig\n}\n\nexport function SearchModal({ isOpen, onClose, config }: SearchModalProps) {\n const [query, setQuery] = useState(\"\")\n const [results, setResults] = useState<SearchResult[]>([])\n const [isLoading, setIsLoading] = useState(false)\n const [selectedIndex, setSelectedIndex] = useState(0)\n const router = useRouter()\n\n const searchConfig = config.search\n\n // Search function\n const performSearch = useCallback(async (searchQuery: string) => {\n if (!searchQuery.trim() || !searchConfig?.enabled) {\n setResults([])\n return\n }\n\n setIsLoading(true)\n try {\n const response = await fetch(\"/api/search\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n query: searchQuery,\n // filter: 'version = \"v1.0.0\"',\n distinct: \"version\",\n limit: 2\n }),\n })\n\n\n if (response.ok) {\n const data = await response.json()\n console.log(\"Search response:\", data)\n setResults(data.hits || [])\n } else {\n console.error(\"Search failed:\", response.status, await response.text())\n }\n } catch (error) {\n console.error(\"Search error:\", error)\n setResults([])\n } finally {\n setIsLoading(false)\n }\n }, [searchConfig])\n\n // Debounced search\n useEffect(() => {\n const timer = setTimeout(() => {\n performSearch(query)\n }, 300)\n\n return () => clearTimeout(timer)\n }, [query, performSearch])\n\n // Handle keyboard navigation\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!isOpen) return\n\n switch (e.key) {\n case \"Escape\":\n onClose()\n break\n case \"ArrowDown\":\n e.preventDefault()\n setSelectedIndex((prev) => Math.min(prev + 1, results.length - 1))\n break\n case \"ArrowUp\":\n e.preventDefault()\n setSelectedIndex((prev) => Math.max(prev - 1, 0))\n break\n case \"Enter\":\n e.preventDefault()\n if (results[selectedIndex]) {\n handleResultClick(results[selectedIndex])\n }\n break\n }\n }\n\n window.addEventListener(\"keydown\", handleKeyDown)\n return () => window.removeEventListener(\"keydown\", handleKeyDown)\n }, [isOpen, results, selectedIndex, onClose])\n\n // Reset on open/close\n useEffect(() => {\n if (isOpen) {\n setQuery(\"\")\n setResults([])\n setSelectedIndex(0)\n }\n }, [isOpen])\n\n const handleResultClick = (result: SearchResult) => {\n // Add search query as URL parameter for highlighting\n const url = `/docs/${result.version}/${result.slug}?q=${encodeURIComponent(query)}`\n router.push(url)\n onClose()\n }\n\n const highlightText = (text: string, query: string) => {\n if (!query.trim()) return text\n\n const parts = text.split(new RegExp(`(${query})`, \"gi\"))\n return parts.map((part, i) =>\n part.toLowerCase() === query.toLowerCase()\n ? <mark key={i} className=\"bg-yellow-200 dark:bg-yellow-900/50 text-foreground\">{part}</mark>\n : part\n )\n }\n\n return (\n <Dialog open={isOpen} onOpenChange={onClose} modal={true}>\n <DialogContent\n className=\"max-w-2xl p-0 gap-0 top-[10vh] translate-y-0\"\n showCloseButton={false}\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n {/* Search Input */}\n <div className=\"flex items-center gap-3 px-4 py-3 border-b border-border\">\n <Search className=\"h-5 w-5 text-muted-foreground shrink-0\" />\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={searchConfig?.placeholder || \"Search documentation...\"}\n className=\"flex-1 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground\"\n autoFocus\n />\n {isLoading && <Loader2 className=\"h-5 w-5 text-muted-foreground animate-spin\" />}\n </div>\n\n {/* Results */}\n <div className=\"max-h-[60vh] overflow-y-auto\">\n {query.trim() && results.length === 0 && !isLoading && (\n <div className=\"px-4 py-8 text-center text-muted-foreground\">\n No results found for \"{query}\"\n </div>\n )}\n\n {results.length > 0 && (\n <div className=\"py-2\">\n {results.map((result, index) => (\n <button\n key={result.id}\n onClick={() => handleResultClick(result)}\n className={`w-full px-4 py-3 text-left hover:bg-muted/50 transition-colors border-l-2 ${index === selectedIndex\n ? \"bg-muted/50 border-primary\"\n : \"border-transparent\"\n }`}\n onMouseEnter={() => setSelectedIndex(index)}\n >\n <div className=\"flex items-start gap-3\">\n <FileText className=\"h-5 w-5 text-muted-foreground shrink-0 mt-0.5\" />\n <div className=\"flex-1 min-w-0\">\n <div className=\"font-medium text-foreground mb-1\">\n {highlightText(result.title, query)}\n </div>\n {result.content && (\n <div className=\"text-sm text-muted-foreground line-clamp-2\">\n {highlightText(result.content, query)}\n </div>\n )}\n <div className=\"flex items-center gap-2 mt-1 text-xs text-muted-foreground\">\n <span>{result.version}</span>\n {result.category && (\n <>\n <span>•</span>\n <span>{result.category}</span>\n </>\n )}\n </div>\n </div>\n </div>\n </button>\n ))}\n </div>\n )}\n\n {!query.trim() && (\n <div className=\"px-4 py-8 text-center text-muted-foreground text-sm\">\n <p>Start typing to search documentation...</p>\n <div className=\"mt-4 flex items-center justify-center gap-4 text-xs\">\n <kbd className=\"px-2 py-1 bg-muted rounded border border-border\">↑↓</kbd>\n <span>Navigate</span>\n <kbd className=\"px-2 py-1 bg-muted rounded border border-border\">Enter</kbd>\n <span>Select</span>\n <kbd className=\"px-2 py-1 bg-muted rounded border border-border\">Esc</kbd>\n <span>Close</span>\n </div>\n </div>\n )}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 dark:bg-black/70 backdrop-blur-md\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","import * as React from \"react\"\nimport { SpecraConfig, defaultConfig } from \"./config.types\"\n\nconst ConfigContext = React.createContext<SpecraConfig>(defaultConfig)\n\nexport interface ConfigProviderProps {\n config: SpecraConfig\n children: React.ReactNode\n}\n\n/**\n * Provider component that makes Specra config available to all client components\n * Usage: Wrap your app with this provider in your root layout\n */\nexport function ConfigProvider({ config, children }: ConfigProviderProps) {\n return <ConfigContext.Provider value={config}>{children}</ConfigContext.Provider>\n}\n\n/**\n * Hook to access Specra configuration in any client component\n * @returns The current Specra configuration\n * @example\n * ```tsx\n * function MyComponent() {\n * const config = useConfig()\n * return <div>{config.site.title}</div>\n * }\n * ```\n */\nexport function useConfig(): SpecraConfig {\n const config = React.useContext(ConfigContext)\n if (!config) {\n throw new Error(\"useConfig must be used within a ConfigProvider\")\n }\n return config\n}\n\n/**\n * Hook to access a specific configuration value by path\n * @param path - Dot-separated path to the config value (e.g., \"site.title\")\n * @returns The configuration value at the specified path\n * @example\n * ```tsx\n * function MyComponent() {\n * const title = useConfigValue<string>(\"site.title\")\n * const showSidebar = useConfigValue<boolean>(\"navigation.showSidebar\")\n * return <div>{title}</div>\n * }\n * ```\n */\nexport function useConfigValue<T = any>(path: string): T | undefined {\n const config = useConfig()\n const keys = path.split(\".\")\n let value: any = config\n\n for (const key of keys) {\n if (value && typeof value === \"object\" && key in value) {\n value = value[key]\n } else {\n return undefined\n }\n }\n\n return value as T\n}\n","\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { usePathname } from \"next/navigation\"\nimport { RefreshCw } from \"lucide-react\"\n\nexport function HotReloadIndicator() {\n const [isReloading, setIsReloading] = useState(false)\n const [lastReload, setLastReload] = useState<Date | null>(null)\n const pathname = usePathname()\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Track when content updates\n setIsReloading(true)\n const timer = setTimeout(() => {\n setIsReloading(false)\n setLastReload(new Date())\n \n // Auto-hide after 3 seconds\n setTimeout(() => {\n setLastReload(null)\n }, 3000)\n }, 500)\n\n return () => clearTimeout(timer)\n }, [pathname])\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Listen for Next.js Fast Refresh\n const handleBeforeRefresh = () => {\n setIsReloading(true)\n }\n\n const handleAfterRefresh = () => {\n setIsReloading(false)\n setLastReload(new Date())\n setTimeout(() => setLastReload(null), 3000)\n }\n\n // @ts-ignore - Next.js internal API\n if (typeof window !== 'undefined' && window.__NEXT_DATA__) {\n window.addEventListener('beforeunload', handleBeforeRefresh)\n }\n\n return () => {\n window.removeEventListener('beforeunload', handleBeforeRefresh)\n }\n }, [])\n\n if (process.env.NODE_ENV !== \"development\") return null\n\n return (\n <>\n {/* Reloading indicator */}\n {isReloading && (\n <div className=\"fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-xl shadow-lg animate-in slide-in-from-bottom-2\">\n <RefreshCw className=\"h-4 w-4 animate-spin\" />\n <span className=\"text-sm font-medium\">Reloading...</span>\n </div>\n )}\n\n {/* Success indicator */}\n {lastReload && !isReloading && (\n <div className=\"fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-green-500 text-white rounded-xl shadow-lg animate-in slide-in-from-bottom-2\">\n <RefreshCw className=\"h-4 w-4\" />\n <span className=\"text-sm font-medium\">\n Updated at {lastReload.toLocaleTimeString()}\n </span>\n </div>\n )}\n </>\n )\n}\n","\"use client\"\n\nimport { useEffect } from \"react\"\nimport { useRouter } from \"next/navigation\"\n\nexport function MdxHotReload() {\n const router = useRouter()\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return\n\n // Use Server-Sent Events to watch for file changes\n const eventSource = new EventSource('/api/mdx-watch')\n\n eventSource.onmessage = (event) => {\n const data = JSON.parse(event.data)\n \n if (data.type === 'change') {\n console.log('[MDX Hot Reload] File changed:', data.file)\n router.refresh()\n } else if (data.type === 'connected') {\n console.log('[MDX Hot Reload] Watching for changes...')\n }\n }\n\n eventSource.onerror = (error) => {\n console.error('[MDX Hot Reload] Connection error:', error)\n eventSource.close()\n }\n\n return () => {\n eventSource.close()\n }\n }, [router])\n\n return null\n}\n","\"use client\"\n\nimport Link from \"next/link\"\nimport { AlertTriangle, Home, ArrowLeft } from \"lucide-react\"\n\ninterface NotFoundContentProps {\n version: string\n}\n\nexport function NotFoundContent({ version }: NotFoundContentProps) {\n return (\n <div className=\"flex min-h-[calc(100vh-12rem)] items-center justify-center px-4 py-12\">\n <div className=\"w-full max-w-2xl text-center\">\n <div className=\"mb-6 flex justify-center\">\n <div className=\"rounded-full bg-yellow-500/10 p-4\">\n <AlertTriangle className=\"h-16 w-16 text-yellow-500\" />\n </div>\n </div>\n\n <h1 className=\"mb-3 text-5xl font-bold tracking-tight\">404</h1>\n <h2 className=\"mb-4 text-2xl font-semibold\">Page Not Found</h2>\n\n <p className=\"mb-8 text-base text-muted-foreground\">\n The documentation page you're looking for doesn't exist or may have been moved.\n <br />\n Try using the sidebar to find what you're looking for, or return to the documentation home.\n </p>\n\n <div className=\"flex flex-col items-center justify-center gap-3 sm:flex-row\">\n <Link\n href={`/docs/${version}`}\n className=\"inline-flex items-center gap-2 rounded-lg bg-primary px-6 py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <ArrowLeft className=\"h-4 w-4\" />\n Back to Documentation\n </Link>\n\n <Link\n href=\"/\"\n className=\"inline-flex items-center gap-2 rounded-lg border border-border bg-background px-6 py-3 text-sm font-medium hover:bg-muted transition-colors\"\n >\n <Home className=\"h-4 w-4\" />\n Go to Homepage\n </Link>\n </div>\n\n <div className=\"mt-12 rounded-lg border border-border bg-muted/30 p-6\">\n <p className=\"text-sm text-muted-foreground\">\n <strong className=\"font-medium text-foreground\">Tip:</strong> Use the sidebar navigation on the left to browse all available documentation pages.\n </p>\n </div>\n </div>\n </div>\n )\n}\n","export function SidebarSkeleton() {\n return (\n <aside className=\"w-64 pr-8 py-6\">\n <div className=\"space-y-6\">\n {/* Documentation title */}\n <div className=\"px-2\">\n <div className=\"h-5 w-32 bg-muted/50 rounded animate-pulse\" />\n </div>\n\n {/* Skeleton items */}\n <div className=\"space-y-1\">\n {[...Array(8)].map((_, i) => (\n <div key={i} className=\"px-3 py-2\">\n <div\n className=\"h-4 bg-muted/50 rounded animate-pulse\"\n style={{ width: `${60 + Math.random() * 40}%` }}\n />\n </div>\n ))}\n </div>\n\n {/* Another section */}\n <div className=\"space-y-1\">\n <div className=\"px-2 mb-2\">\n <div className=\"h-4 w-24 bg-muted/50 rounded animate-pulse\" />\n </div>\n {[...Array(5)].map((_, i) => (\n <div key={i} className=\"px-3 py-2\">\n <div\n className=\"h-4 bg-muted/50 rounded animate-pulse\"\n style={{ width: `${50 + Math.random() * 50}%` }}\n />\n </div>\n ))}\n </div>\n </div>\n </aside>\n )\n}\n","\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport type { SpecraConfig } from \"@/lib/config\"\n\ninterface TOCItem {\n id: string\n title: string\n level: number\n}\n\ninterface TableOfContentsProps {\n items: TOCItem[]\n config: SpecraConfig\n}\n\nexport function TableOfContents({ items, config }: TableOfContentsProps) {\n const [activeId, setActiveId] = useState<string>(\"\")\n\n // Check if TOC should be shown\n if (!config.navigation?.showTableOfContents) {\n return null\n }\n\n // Filter items by max depth\n const maxDepth = config.navigation?.tocMaxDepth || 3\n const filteredItems = items.filter(item => item.level <= maxDepth)\n\n // Check if tab groups are configured\n const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setActiveId(entry.target.id)\n }\n })\n },\n { rootMargin: \"-80px 0px -80% 0px\" },\n )\n\n filteredItems.forEach((item) => {\n const element = document.getElementById(item.id)\n if (element) {\n observer.observe(element)\n }\n })\n\n return () => observer.disconnect()\n }, [filteredItems])\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>, id: string) => {\n e.preventDefault()\n const element = document.getElementById(id)\n if (element) {\n const offset = 100 // Offset for fixed header\n const elementPosition = element.getBoundingClientRect().top\n const offsetPosition = elementPosition + window.scrollY - offset\n\n window.scrollTo({\n top: offsetPosition,\n behavior: \"smooth\",\n })\n \n // Update URL without jumping\n window.history.replaceState(null, \"\", `#${id}`)\n \n // Manually set active ID after scroll\n setActiveId(id)\n }\n }\n\n // Adjust top position based on whether tabs are present\n const stickyTop = hasTabGroups ? \"top-[7.5rem]\" : \"top-24\"\n const maxHeight = hasTabGroups ? \"max-h-[calc(100vh-10rem)]\" : \"max-h-[calc(100vh-7rem)]\"\n\n return (\n <aside className={`w-64 hidden xl:block shrink-0 sticky ${stickyTop} self-start`}>\n {filteredItems.length > 0 && (\n <div className={`${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`}>\n <h3 className=\"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2\">On this page</h3>\n <nav className=\"space-y-1\">\n {filteredItems.map((item) => (\n <a\n key={item.id}\n href={`#${item.id}`}\n onClick={(e) => handleClick(e, item.id)}\n className={`block text-sm transition-all cursor-pointer rounded-xl px-3 py-2 ${item.level === 3 ? \"ml-3\" : \"\"} ${\n activeId === item.id\n ? \"text-primary font-medium\"\n : \"text-foreground hover:bg-accent/50\"\n }`}\n >\n {item.title}\n </a>\n ))}\n </nav>\n </div>\n )}\n </aside>\n )\n}\n","import { AlertTriangle } from \"lucide-react\";\nimport Link from \"next/link\";\n\nexport function VersionNotFound() {\n return (\n <>\n <div className=\"flex min-h-screen items-center justify-center px-4\">\n <div className=\"text-center\">\n <div className=\"mb-4 flex justify-center\">\n <AlertTriangle className=\"h-16 w-16 text-yellow-500\" />\n </div>\n <h1 className=\"mb-2 text-4xl font-bold\">Version Not Found</h1>\n <p className=\"mb-6 text-muted-foreground\">\n The documentation version you're looking for doesn't exist.\n </p>\n <Link\n href=\"/docs/v1.0.0\"\n className=\"inline-flex items-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90\"\n >\n Go to Latest Version\n </Link>\n </div>\n </div>\n </>\n )\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,0BAA4B;AAC5B,mBAAyB;AAcnB;AALC,SAAS,cAAc,EAAE,OAAO,UAAU,cAAc,MAAM,GAAuB;AAC1F,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS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,GAAG,KAAK,EAAE;AAAA,QACtC,WAAW,oEAAoE,KAAK,UAAU,IAAI,SAAS,EAAE,IAC3G,aAAa,KAAK,KACd,6BACA,oCACN;AAAA,QAEC,eAAK;AAAA;AAAA,MATD,KAAK;AAAA,IAUZ,CACD,GACH;AAAA,KACF,GAEJ;AAEJ;;;ACvGA,IAAAC,wBAA8B;AAC9B,IAAAC,gBAAiB;AAIb,IAAAC,uBAAA;AAFG,SAAS,kBAAkB;AAChC,SACE,+EACA,wDAAC,SAAI,WAAU,sDACb,yDAAC,SAAI,WAAU,eACb;AAAA,kDAAC,SAAI,WAAU,4BACb,wDAAC,uCAAc,WAAU,6BAA4B,GACvD;AAAA,IACA,8CAAC,QAAG,WAAU,2BAA0B,+BAAiB;AAAA,IACzD,8CAAC,OAAE,WAAU,8BAA6B,yEAE1C;AAAA,IACA;AAAA,MAAC,cAAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACX;AAAA;AAAA,IAED;AAAA,KACF,GACF,GACA;AAEJ;","names":["Badge","Math","import_jsx_runtime","import_lucide_react","import_jsx_runtime","Link","import_lucide_react","import_jsx_runtime","Icon","import_lucide_react","import_link","import_jsx_runtime","import_jsx_runtime","Link","import_link","import_lucide_react","import_react","import_lucide_react","import_jsx_runtime","code","import_react","import_jsx_runtime","import_react","import_lucide_react","import_jsx_runtime","NextImage","import_jsx_runtime","import_image","import_link","import_jsx_runtime","NextImage","Link","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","Math","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_lucide_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react_slot","import_class_variance_authority","import_jsx_runtime","Badge","import_lucide_react","import_jsx_runtime","Badge","import_react","import_lucide_react","import_jsx_runtime","import_jsx_runtime","Math","import_jsx_runtime","remarkGfm","rehypeSlug","Link","import_react","import_lucide_react","import_jsx_runtime","import_lucide_react","import_rsc","import_remark_gfm","import_rehype_slug","import_link","import_lucide_react","import_jsx_runtime","Link","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_react","import_jsx_runtime","remarkGfm","rehypeSlug","import_react","import_react","import_link","import_jsx_runtime","Link","import_lucide_react","import_react","import_jsx_runtime","import_jsx_runtime","import_link","import_navigation","import_lucide_react","import_react","import_jsx_runtime","hasActiveItem","Link","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_link","import_lucide_react","import_react","import_lucide_react","import_navigation","import_jsx_runtime","import_lucide_react","import_react","import_jsx_runtime","import_react","import_lucide_react","import_navigation","import_lucide_react","import_jsx_runtime","import_jsx_runtime","query","import_react","React","import_jsx_runtime","import_jsx_runtime","Link","import_react","import_navigation","import_lucide_react","import_jsx_runtime","import_react","import_navigation","import_link","import_lucide_react","import_jsx_runtime","Link","import_jsx_runtime","import_react","import_jsx_runtime","import_lucide_react","import_link","import_jsx_runtime","Link"]}
|